diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-05-05 09:32:12 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-05 09:32:12 -0400 |
commit | 2c92540471004c79e317e8a0daf3e612560beda7 (patch) | |
tree | 2abed81a2b4340cfaeaed47e70a6b14d0129bc47 /webapp/components/backstage/installed_integrations.jsx | |
parent | fcb5b70eb348368421464553066ef9c715c66ff0 (diff) | |
download | chat-2c92540471004c79e317e8a0daf3e612560beda7.tar.gz chat-2c92540471004c79e317e8a0daf3e612560beda7.tar.bz2 chat-2c92540471004c79e317e8a0daf3e612560beda7.zip |
PLT-2698 Integrations improvements (#2883)
* Fixed Integrations link to show up for non-admins (when enabled) and when only slash commands are enabled
* Updated BackstageSidebar to only show enabled integrations
* Added placeholder to integrations list when none exist
* Added loading spinner to integrations pages when they're loading
Diffstat (limited to 'webapp/components/backstage/installed_integrations.jsx')
-rw-r--r-- | webapp/components/backstage/installed_integrations.jsx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/webapp/components/backstage/installed_integrations.jsx b/webapp/components/backstage/installed_integrations.jsx index baf74447f..cff0611d7 100644 --- a/webapp/components/backstage/installed_integrations.jsx +++ b/webapp/components/backstage/installed_integrations.jsx @@ -6,6 +6,7 @@ import React from 'react'; import * as Utils from 'utils/utils.jsx'; import {Link} from 'react-router'; +import LoadingScreen from 'components/loading_screen.jsx'; export default class InstalledIntegrations extends React.Component { static get propTypes() { @@ -13,7 +14,9 @@ export default class InstalledIntegrations extends React.Component { children: React.PropTypes.node, header: React.PropTypes.node.isRequired, addLink: React.PropTypes.string.isRequired, - addText: React.PropTypes.node.isRequired + addText: React.PropTypes.node.isRequired, + emptyText: React.PropTypes.node.isRequired, + loading: React.PropTypes.bool.isRequired }; } @@ -36,9 +39,23 @@ export default class InstalledIntegrations extends React.Component { render() { const filter = this.state.filter.toLowerCase(); - const children = React.Children.map(this.props.children, (child) => { - return React.cloneElement(child, {filter}); - }); + let children; + + if (this.props.loading) { + children = <LoadingScreen/>; + } else { + children = React.Children.map(this.props.children, (child) => { + return React.cloneElement(child, {filter}); + }); + + if (children.length === 0) { + children = ( + <span className='backstage-list__item backstage-list_empty'> + {this.props.emptyText} + </span> + ); + } + } return ( <div className='backstage-content'> |