fixes: enable and disable pages

This commit is contained in:
arpitnath 2023-09-25 00:22:08 +05:30
parent f3452bbbbb
commit 1b53f7284b
3 changed files with 25 additions and 0 deletions

View file

@ -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}

View file

@ -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',

View file

@ -16,6 +16,9 @@ export class Page {
@Column()
index: number;
@Column()
disabled: boolean;
@Column({ name: 'app_version_id' })
appVersionId: string;