diff --git a/server/claim/claim.controller.ts b/server/claim/claim.controller.ts index 0014fa6cd..83630f6a9 100644 --- a/server/claim/claim.controller.ts +++ b/server/claim/claim.controller.ts @@ -456,11 +456,30 @@ export class ClaimController { namespace as NameSpaceEnum ); + const enableCollaborativeEditor = + this.featureFlagService.isEnableCollaborativeEditor(); + const enableCopilotChatBot = + this.featureFlagService.isEnableCopilotChatBot(); + const enableEditorAnnotations = + this.featureFlagService.isEnableEditorAnnotations(); + const enableAddEditorSourcesWithoutSelecting = + this.featureFlagService.isEnableAddEditorSourcesWithoutSelecting(); + const enableReviewersUpdateReport = + this.featureFlagService.isEnableReviewersUpdateReport(); + const enableViewReportPreview = + this.featureFlagService.isEnableViewReportPreview(); + const queryObject = Object.assign(parsedUrl.query, { claim, sitekey: this.configService.get("recaptcha_sitekey"), websocketUrl: this.configService.get("websocketUrl"), nameSpace: req.params.namespace, + enableCollaborativeEditor, + enableEditorAnnotations, + enableCopilotChatBot, + enableAddEditorSourcesWithoutSelecting, + enableReviewersUpdateReport, + enableViewReportPreview, }); await this.viewService.render(req, res, "/debate-page", queryObject); diff --git a/src/pages/debate-page.tsx b/src/pages/debate-page.tsx index 43f2edc11..f6c159a1a 100644 --- a/src/pages/debate-page.tsx +++ b/src/pages/debate-page.tsx @@ -15,11 +15,28 @@ const DebatePage: NextPage = ({ claim, sitekey, nameSpace, + enableCollaborativeEditor, + enableCopilotChatBot, + enableEditorAnnotations, + enableAddEditorSourcesWithoutSelecting, + enableReviewersUpdateReport, + enableViewReportPreview, }: InferGetServerSidePropsType): any => { const setCurrentNameSpace = useSetAtom(currentNameSpace); setCurrentNameSpace(nameSpace); const dispatch = useDispatch(); dispatch(actions.setSitekey(sitekey)); + dispatch( + actions.setEditorEnvironment( + enableCollaborativeEditor, + enableAddEditorSourcesWithoutSelecting, + enableEditorAnnotations, + enableCopilotChatBot, + false, + enableReviewersUpdateReport, + enableViewReportPreview + ) + ); return ( <> @@ -38,6 +55,13 @@ export async function getServerSideProps({ query, locale, locales, req }) { claim: JSON.parse(JSON.stringify(query?.claim)), sitekey: query.sitekey, nameSpace: query.nameSpace ? query.nameSpace : NameSpaceEnum.Main, + enableCollaborativeEditor: query?.enableCollaborativeEditor, + enableCopilotChatBot: query?.enableCopilotChatBot, + enableEditorAnnotations: query?.enableEditorAnnotations, + enableAddEditorSourcesWithoutSelecting: + query?.enableAddEditorSourcesWithoutSelecting, + enableViewReportPreview: query?.enableViewReportPreview, + enableReviewersUpdateReport: query?.enableReviewersUpdateReport, }, }; }