summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-09-20 13:02:08 -0300
committerChristopher Speller <crspeller@gmail.com>2016-09-20 12:02:08 -0400
commit33e20b874e9709fc8d9e45ffb8d0c2357bc79e8d (patch)
treee4a39214e462ca76a8a3a10a69feb99c29a1b010 /webapp
parent4e3d46521096a8f9a0b8b3461e0b1b44768c9e84 (diff)
downloadchat-33e20b874e9709fc8d9e45ffb8d0c2357bc79e8d.tar.gz
chat-33e20b874e9709fc8d9e45ffb8d0c2357bc79e8d.tar.bz2
chat-33e20b874e9709fc8d9e45ffb8d0c2357bc79e8d.zip
PLT-4202 fix javascript error manage OAuth2 apps (#4039)
* PLT-4202 fix javascript error manage OAuth2 apps * Fix unit tests
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/integrations/components/installed_oauth_apps.jsx19
1 files changed, 12 insertions, 7 deletions
diff --git a/webapp/components/integrations/components/installed_oauth_apps.jsx b/webapp/components/integrations/components/installed_oauth_apps.jsx
index 39ef347e2..322c95511 100644
--- a/webapp/components/integrations/components/installed_oauth_apps.jsx
+++ b/webapp/components/integrations/components/installed_oauth_apps.jsx
@@ -71,6 +71,17 @@ export default class InstalledOAuthApps extends React.Component {
);
});
+ const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
+ const config = global.mm_config;
+ const integrationsEnabled = (config.EnableOAuthServiceProvider === 'true' && (isSystemAdmin || config.EnableOnlyAdminIntegrations !== 'true'));
+ let props;
+ if (integrationsEnabled) {
+ props = {
+ addLink: '/' + this.props.team.name + '/integrations/oauth2-apps/add',
+ addText: localizeMessage('installed_oauth_apps.add', 'Add OAuth 2.0 Application')
+ };
+ }
+
return (
<BackstageList
header={
@@ -99,13 +110,6 @@ export default class InstalledOAuthApps extends React.Component {
}}
/>
}
- addText={
- <FormattedMessage
- id='installed_oauth_apps.add'
- defaultMessage='Add OAuth 2.0 Application'
- />
- }
- addLink={'/' + this.props.team.name + '/integrations/oauth2-apps/add'}
emptyText={
<FormattedMessage
id='installed_oauth_apps.empty'
@@ -114,6 +118,7 @@ export default class InstalledOAuthApps extends React.Component {
}
searchPlaceholder={localizeMessage('installed_oauth_apps.search', 'Search OAuth 2.0 Applications')}
loading={this.state.loading}
+ {...props}
>
{oauthApps}
</BackstageList>