From 625b4c93395dfb669aee9f89e742d80816a68bf3 Mon Sep 17 00:00:00 2001 From: Jessica Lawshe Date: Wed, 9 Oct 2019 07:58:27 -0500 Subject: [PATCH] Merge pull request #2216 from overleaf/jel-saml-beta-account-settings Allow SAML beta testing on Account Settings GitOrigin-RevId: 6a2c60a3cbab3d9d0cdcc72e23f5d75f7702f89c --- services/web/app/src/infrastructure/ExpressLocals.js | 1 + services/web/app/views/user/settings/user-affiliations.pug | 2 +- .../affiliations/controllers/UserAffiliationsController.js | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/web/app/src/infrastructure/ExpressLocals.js b/services/web/app/src/infrastructure/ExpressLocals.js index e91d1b6e35..bbaefeed69 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.js +++ b/services/web/app/src/infrastructure/ExpressLocals.js @@ -530,6 +530,7 @@ module.exports = function(app, webRouter, privateApiRouter, publicApiRouter) { res.locals.ExposedSettings = { isOverleaf: Settings.overleaf != null, appName: Settings.appName, + hasSamlBeta: req.session.samlBeta, hasSamlFeature: Features.hasFeature('saml'), samlInitPath: lodash.get(Settings, ['saml', 'ukamf', 'initPath']), siteUrl: Settings.siteUrl, diff --git a/services/web/app/views/user/settings/user-affiliations.pug b/services/web/app/views/user/settings/user-affiliations.pug index 3211ac6855..d01695e51c 100644 --- a/services/web/app/views/user/settings/user-affiliations.pug +++ b/services/web/app/views/user/settings/user-affiliations.pug @@ -137,7 +137,7 @@ form.row( input-type="email" input-required="true" ) - if hasFeature('saml') + if hasFeature('saml') || samlBeta td( colspan="2" ng-if="newAffiliation && newAffiliation.university && newAffiliation.university.ssoEnabled" diff --git a/services/web/public/src/main/affiliations/controllers/UserAffiliationsController.js b/services/web/public/src/main/affiliations/controllers/UserAffiliationsController.js index c7ef0e82b6..f122ad33ed 100644 --- a/services/web/public/src/main/affiliations/controllers/UserAffiliationsController.js +++ b/services/web/public/src/main/affiliations/controllers/UserAffiliationsController.js @@ -28,11 +28,12 @@ define(['base'], App => $scope.closeInstitutionNotification = type => { $scope.hideInstitutionNotifications[type] = true } + $scope.hasSamlBeta = ExposedSettings.hasSamlBeta $scope.hasSamlFeature = ExposedSettings.hasSamlFeature $scope.samlInitPath = ExposedSettings.samlInitPath $scope.shouldShowRolesAndAddEmailButton = () => { const newAffiliation = $scope.newAffiliation - const hasSamlFeature = $scope.hasSamlFeature + const hasSamlFeature = $scope.hasSamlFeature || $scope.hasSamlBeta return ( !newAffiliation || (newAffiliation && !newAffiliation.university) ||