Просмотр исходного кода

Merge pull request #2216 from overleaf/jel-saml-beta-account-settings

Allow SAML beta testing on Account Settings

GitOrigin-RevId: 6a2c60a3cbab3d9d0cdcc72e23f5d75f7702f89c
Jessica Lawshe 7 лет назад
Родитель
Сommit
625b4c9339

+ 1 - 0
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,

+ 1 - 1
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"

+ 2 - 1
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) ||