From 95aa79e95dcf171d653213e29226004eed5d7719 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 26 Aug 2024 15:00:49 +0200 Subject: [PATCH] Merge pull request #20089 from overleaf/tm-link-sharing-enforcement-in-frontend Make ol-linkSharingEnforcement available to the frontend GitOrigin-RevId: b64ce29f528c5b02c0cee400c73dc364d8e6da47 --- services/web/app/src/Features/Project/ProjectController.js | 4 +++- services/web/app/views/project/editor/meta.pug | 1 + services/web/frontend/js/utils/meta.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index be1b95eb66..12ef10732f 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -589,6 +589,7 @@ const _ProjectController = { projectId: project._id, // temporary link sharing segmentation: linkSharingWarning: linkSharingChanges?.variant, + linkSharingEnforcement: linkSharingEnforcement?.variant, namedEditors, pendingEditors, tokenEditors: project.tokenAccessReadAndWrite_refs?.length || 0, @@ -743,7 +744,8 @@ const _ProjectController = { useOpenTelemetry: Settings.useOpenTelemetryClient, hasTrackChangesFeature: Features.hasFeature('track-changes'), projectTags, - linkSharingWarning: linkSharingChanges.variant === 'active', + linkSharingWarning: linkSharingChanges?.variant === 'active', + linkSharingEnforcement: linkSharingEnforcement?.variant === 'active', usedLatex: // only use the usedLatex value if the split test is enabled splitTestAssignments['default-visual-for-beginners']?.variant === diff --git a/services/web/app/views/project/editor/meta.pug b/services/web/app/views/project/editor/meta.pug index f32800531f..bbb8d1de4a 100644 --- a/services/web/app/views/project/editor/meta.pug +++ b/services/web/app/views/project/editor/meta.pug @@ -35,6 +35,7 @@ meta(name="ol-hasTrackChangesFeature", data-type="boolean" content=hasTrackChang meta(name="ol-inactiveTutorials", data-type="json" content=user.inactiveTutorials) meta(name="ol-projectTags" data-type="json" content=projectTags) meta(name="ol-linkSharingWarning" data-type="boolean" content=linkSharingWarning) +meta(name="ol-linkSharingEnforcement" data-type="boolean" content=linkSharingEnforcement) meta(name="ol-usedLatex" data-type="string" content=usedLatex) meta(name="ol-ro-mirror-on-client-no-local-storage" data-type="boolean" content=roMirrorOnClientNoLocalStorage) meta(name="ol-isSaas" data-type="boolean" content=isSaas) diff --git a/services/web/frontend/js/utils/meta.ts b/services/web/frontend/js/utils/meta.ts index 9322d21fd2..7c3e6a0d25 100644 --- a/services/web/frontend/js/utils/meta.ts +++ b/services/web/frontend/js/utils/meta.ts @@ -123,6 +123,7 @@ export interface Meta { 'ol-languages': SpellCheckLanguage[] 'ol-learnedWords': string[] 'ol-legacyEditorThemes': string[] + 'ol-linkSharingEnforcement': boolean 'ol-linkSharingWarning': boolean 'ol-loadingText': string 'ol-managedGroupSubscriptions': ManagedGroupSubscription[]