From 1c759ad413bc3028855d80d993e6677a52f72ea7 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Wed, 18 Dec 2019 10:46:27 +0100 Subject: [PATCH] Add option to disable email confirmation banner (#2469) GitOrigin-RevId: ef5e08a6359346cc53dff4ce7978affb71fdb556 --- services/web/app/src/infrastructure/ExpressLocals.js | 1 + services/web/config/settings.defaults.coffee | 2 ++ .../frontend/js/main/project-list/notifications-controller.js | 3 +++ 3 files changed, 6 insertions(+) diff --git a/services/web/app/src/infrastructure/ExpressLocals.js b/services/web/app/src/infrastructure/ExpressLocals.js index 63a4b59f1d..82362364aa 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.js +++ b/services/web/app/src/infrastructure/ExpressLocals.js @@ -361,6 +361,7 @@ module.exports = function(webRouter, privateApiRouter, publicApiRouter) { hasSamlFeature: Features.hasFeature('saml'), samlInitPath: _.get(Settings, ['saml', 'ukamf', 'initPath']), siteUrl: Settings.siteUrl, + emailConfirmationDisabled: Settings.emailConfirmationDisabled, recaptchaSiteKeyV3: Settings.recaptcha != null ? Settings.recaptcha.siteKeyV3 : undefined, recaptchaDisabled: diff --git a/services/web/config/settings.defaults.coffee b/services/web/config/settings.defaults.coffee index f757bc164d..fe10cdd234 100644 --- a/services/web/config/settings.defaults.coffee +++ b/services/web/config/settings.defaults.coffee @@ -567,6 +567,8 @@ module.exports = settings = validRootDocExtensions: ['tex', 'Rtex', 'ltx'] + emailConfirmationDisabled: (process.env['EMAIL_CONFIRMATION_DISABLED'] == "true") or false + # allowedImageNames: [ # {imageName: 'texlive-full:2017.1', imageDesc: 'TeXLive 2017'} # {imageName: 'wl_texlive:2018.1', imageDesc: 'Legacy OL TeXLive 2015'} diff --git a/services/web/frontend/js/main/project-list/notifications-controller.js b/services/web/frontend/js/main/project-list/notifications-controller.js index 4beb6fd6b5..011774b081 100644 --- a/services/web/frontend/js/main/project-list/notifications-controller.js +++ b/services/web/frontend/js/main/project-list/notifications-controller.js @@ -102,6 +102,9 @@ define(['base'], function(App) { ) { $scope.userEmails = [] $scope.showConfirmEmail = email => { + if (ExposedSettings.emailConfirmationDisabled) { + return false + } if (!email.confirmedAt && !email.hide) { if ( email.affiliation &&