From 96d9ca2d37bc19cdf8914859ff4cf5cb097e537a Mon Sep 17 00:00:00 2001 From: ilkin-overleaf <100852799+ilkin-overleaf@users.noreply.github.com> Date: Tue, 9 Sep 2025 16:09:31 +0300 Subject: [PATCH] Merge pull request #28126 from overleaf/ii-domain-capture-join-success-message [web] Notification message for joining group via domain capture GitOrigin-RevId: 67ef924b2d80afb5e1de75fb6aab147263c0f33c --- .../Project/ProjectListController.mjs | 6 ++++ services/web/app/views/project/list-react.pug | 2 ++ .../web/frontend/extracted-translations.json | 1 + .../groups/group-sso-setup-success.tsx | 30 ++++++++++++++++--- services/web/frontend/js/utils/meta.ts | 2 ++ services/web/locales/en.json | 1 + .../components/notifications.test.tsx | 12 ++++++++ .../Project/ProjectListController.test.mjs | 15 ++++++++++ 8 files changed, 65 insertions(+), 4 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectListController.mjs b/services/web/app/src/Features/Project/ProjectListController.mjs index 6ae8f094c0..c42ca24036 100644 --- a/services/web/app/src/Features/Project/ProjectListController.mjs +++ b/services/web/app/src/Features/Project/ProjectListController.mjs @@ -285,6 +285,8 @@ async function projectListPage(req, res, next) { const notificationsInstitution = [] // Institution and group SSO Notifications let groupSsoSetupSuccess + let viaDomainCapture + let joinedGroupName = '' let reconfirmedViaSAML if (Features.hasFeature('saml')) { reconfirmedViaSAML = _.get(req.session, ['saml', 'reconfirmed']) @@ -324,6 +326,8 @@ async function projectListPage(req, res, next) { // Notification group SSO: After SSO Linked if (samlSession.linkedGroup) { groupSsoSetupSuccess = true + viaDomainCapture = samlSession.domainCaptureJoin + joinedGroupName = samlSession.universityName } // Notification institution SSO: After SSO Linked or Logging in @@ -517,6 +521,8 @@ async function projectListPage(req, res, next) { showBrlGeoBanner, projectDashboardReact: true, // used in navbar groupSsoSetupSuccess, + joinedGroupName, + viaDomainCapture, groupSubscriptionsPendingEnrollment: groupSubscriptionsPendingEnrollment.map(subscription => ({ groupId: subscription._id, diff --git a/services/web/app/views/project/list-react.pug b/services/web/app/views/project/list-react.pug index 74eb8ebc72..af239f3df4 100644 --- a/services/web/app/views/project/list-react.pug +++ b/services/web/app/views/project/list-react.pug @@ -81,6 +81,8 @@ block append meta data-type='boolean' content=groupSsoSetupSuccess ) + meta(name='ol-joinedGroupName' data-type='string' content=joinedGroupName) + meta(name='ol-viaDomainCapture' data-type='boolean' content=viaDomainCapture) meta(name='ol-showUSGovBanner' data-type='boolean' content=showUSGovBanner) meta( name='ol-usGovBannerVariant' diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index a742db0e6b..9ba6c48010 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1722,6 +1722,7 @@ "subscription_will_remain_active_until_end_of_billing_period_x": "", "subscription_will_remain_active_until_end_of_trial_period_x": "", "success_sso_set_up": "", + "success_youve_successfully_join_group": "", "suggest_a_different_fix": "", "suggest_fix": "", "suggested": "", diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups/group-sso-setup-success.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups/group-sso-setup-success.tsx index b9cb718f33..a114795a7e 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups/group-sso-setup-success.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups/group-sso-setup-success.tsx @@ -1,24 +1,46 @@ -import { useTranslation } from 'react-i18next' +import { useTranslation, Trans } from 'react-i18next' import Notification from '../../../../../shared/components/notification' import getMeta from '../../../../../utils/meta' function GroupSsoSetupSuccess() { const { t } = useTranslation() const wasSuccess = getMeta('ol-groupSsoSetupSuccess') + const joinedGroupName = getMeta('ol-joinedGroupName') + const viaDomainCapture = getMeta('ol-viaDomainCapture') if (!wasSuccess) { return null } - return ( + if (!viaDomainCapture) { + return ( +