fixes: page disable menu

This commit is contained in:
arpitnath 2023-09-29 13:38:46 +05:30
parent 905d194eb5
commit 407ea635ae
8 changed files with 13 additions and 9 deletions

View file

@ -35,7 +35,7 @@ export const GlobalSettings = ({ darkMode, showHideViewerNavigationControls, sho
</label>
<hr style={{ margin: '0.75rem 0' }} />
<div className="menu-options mb-0">
<Toggle onChange={onChange} value={!showPageViwerPageNavitation} />
<Toggle onChange={onChange} value={showPageViwerPageNavitation} />
</div>
</div>
</Popover.Body>

View file

@ -86,7 +86,7 @@ class ViewerComponent extends React.Component {
if (byAppSlug) {
appDefData.globalSettings = data.globalSettings;
appDefData.homePageId = data.homePageId;
appDefData.showHideViewerNavigation = data.showHideViewerNavigation;
appDefData.showViewerNavigation = data.showViewerNavigation;
}
this.setState({
@ -567,7 +567,7 @@ class ViewerComponent extends React.Component {
if (appDefinition.globalSettings?.canvasMaxWidthType === 'px')
computedCanvasMaxWidth =
(+appDefinition.globalSettings?.canvasMaxWidth || 1292) - (appDefinition?.showHideViewerNavigation ? 200 : 0);
(+appDefinition.globalSettings?.canvasMaxWidth || 1292) - (appDefinition?.showViewerNavigation ? 200 : 0);
else if (appDefinition.globalSettings?.canvasMaxWidthType === '%')
computedCanvasMaxWidth = +appDefinition.globalSettings?.canvasMaxWidth + '%';
@ -683,7 +683,7 @@ class ViewerComponent extends React.Component {
}}
>
<div className="areas d-flex flex-rows">
{appDefinition?.showHideViewerNavigation && (
{appDefinition?.showViewerNavigation && (
<ViewerNavigation
isMobileDevice={this.props.currentLayout === 'mobile'}
canvasBackgroundColor={this.computeCanvasBackgroundColor()}

View file

@ -1715,7 +1715,7 @@ export const buildAppDefinition = (data) => {
const appJSON = {
globalSettings: editingVersion.globalSettings,
homePageId: editingVersion.homePageId,
showHideViewerNavigation: editingVersion.showHideViewerNavigation ?? true,
showViewerNavigation: editingVersion.showViewerNavigation ?? true,
pages: pages,
};

View file

@ -123,7 +123,7 @@ const updateFor = (appDiff, currentPageId, opts) => {
}),
},
{
updateTypes: ['globalSettings'],
updateTypes: ['globalSettings', 'generalAppDefinitionChanged'],
processingFunction: () => ({
updateDiff: appDiff,
type: 'global_settings',

View file

@ -17,7 +17,7 @@ export class UpdateAppVersionEntity1691006886222 implements MigrationInterface {
new TableColumn({
name: 'show_viewer_navigation',
type: 'boolean',
default: false,
default: true,
isNullable: false,
})
);

View file

@ -152,7 +152,7 @@ export class AppsController {
pages: pagesForVersion,
homePageId: versionToLoad.homePageId,
globalSettings: versionToLoad.globalSettings,
showHideViewerNavigation: versionToLoad.showViewerNavigation,
showViewerNavigation: versionToLoad.showViewerNavigation,
};
}

View file

@ -16,7 +16,7 @@ import { JwtAuthGuard } from '../../src/modules/auth/jwt-auth.guard';
import { AppsService } from '../services/apps.service';
import { camelizeKeys, decamelizeKeys } from 'humps';
import { AppsAbilityFactory } from 'src/modules/casl/abilities/apps-ability.factory';
// import { AppAuthGuard } from 'src/modules/auth/app-auth.guard';
import { App } from 'src/entities/app.entity';
import { User } from 'src/decorators/user.decorator';

View file

@ -919,6 +919,10 @@ export class AppsService {
};
}
if (typeof body?.showViewerNavigation === 'boolean') {
editableParams['showViewerNavigation'] = body.showViewerNavigation;
}
return await this.appVersionsRepository.update(version.id, editableParams);
}