From 33e20b874e9709fc8d9e45ffb8d0c2357bc79e8d Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 20 Sep 2016 13:02:08 -0300 Subject: PLT-4202 fix javascript error manage OAuth2 apps (#4039) * PLT-4202 fix javascript error manage OAuth2 apps * Fix unit tests --- .../integrations/components/installed_oauth_apps.jsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'webapp') 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 ( } - addText={ - - } - addLink={'/' + this.props.team.name + '/integrations/oauth2-apps/add'} emptyText={ {oauthApps} -- cgit v1.2.3-1-g7c22