diff --git a/frontend/src/Editor/EditorFunc.jsx b/frontend/src/Editor/EditorFunc.jsx index 33775c9d15..4a98137f36 100644 --- a/frontend/src/Editor/EditorFunc.jsx +++ b/frontend/src/Editor/EditorFunc.jsx @@ -1230,6 +1230,22 @@ const EditorComponent = (props) => { switchPage(newCurrentPageId); }; + const disableEnablePage = ({ pageId, isDisabled }) => { + updateEditorState({ + isUpdatingEditorStateInProcess: true, + }); + + const copyOfAppDefinition = JSON.parse(JSON.stringify(appDefinition)); + + const newAppDefinition = _.cloneDeep(copyOfAppDefinition); + + newAppDefinition.pages[pageId].disabled = isDisabled ?? false; + + appDefinitionChanged(newAppDefinition, { + pageDefinitionChanged: true, + }); + }; + const hidePage = (pageId) => { updateEditorState({ isUpdatingEditorStateInProcess: true, @@ -1478,6 +1494,7 @@ const EditorComponent = (props) => { clonePage={clonePage} hidePage={hidePage} unHidePage={unHidePage} + disableEnablePage={disableEnablePage} updateHomePage={updateHomePage} updatePageHandle={updatePageHandle} showHideViewerNavigationControls={showHideViewerNavigation} diff --git a/server/migrations/1691004576333-CreatePageTable.ts b/server/migrations/1691004576333-CreatePageTable.ts index 729cc11349..dd2648e88e 100644 --- a/server/migrations/1691004576333-CreatePageTable.ts +++ b/server/migrations/1691004576333-CreatePageTable.ts @@ -27,6 +27,11 @@ export class CreatePageTable1691004576333 implements MigrationInterface { type: 'varchar', isNullable: false, }, + { + name: 'disabled', + type: 'boolean', + isNullable: true, + }, { name: 'app_version_id', type: 'uuid', diff --git a/server/src/entities/page.entity.ts b/server/src/entities/page.entity.ts index ee029c6049..38a1fa332e 100644 --- a/server/src/entities/page.entity.ts +++ b/server/src/entities/page.entity.ts @@ -16,6 +16,9 @@ export class Page { @Column() index: number; + @Column() + disabled: boolean; + @Column({ name: 'app_version_id' }) appVersionId: string;