From 43ff8d378819f5e77baf66b33afc85bfe22d8700 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 20 Mar 2020 17:58:03 +0300 Subject: [PATCH] [SSE] Check pivot feature --- apps/spreadsheeteditor/main/app/controller/Main.js | 3 ++- apps/spreadsheeteditor/main/app/controller/RightMenu.js | 2 +- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 2 +- apps/spreadsheeteditor/main/app/view/RightMenu.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 59c9c475d..9f86cb1a1 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -352,6 +352,7 @@ define([ this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings; this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false)); this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink; + this.appOptions.canFeaturePivot = !!this.api.asc_isSupportFeature("pivot"); this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header'); this.headerView.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '') @@ -1116,7 +1117,7 @@ define([ statusbarController.getView('Statusbar').changeViewMode(true); } - if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && !me.appOptions.isDesktopApp && !me.appOptions.isOffline) + if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && me.appOptions.canFeaturePivot) application.getController('PivotTable').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api); var viewport = this.getApplication().getController('Viewport').getView('Viewport'); diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 41378b537..c9f186f55 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -200,7 +200,7 @@ define([ this._settings[settingsType].btn.updateHint(this.rightmenu.txtSparklineSettings); } - if (pivotInfo && !this.rightmenu.mode.isDesktopApp) { + if (pivotInfo && this.rightmenu.mode.canFeaturePivot) { settingsType = Common.Utils.documentSettingsType.Pivot; this._settings[settingsType].props = pivotInfo; this._settings[settingsType].locked = isPivotLocked; // disable pivot settings diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 7ddf2f229..9a08232d6 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -3183,7 +3183,7 @@ define([ me.toolbar.itemsNamedRange = (namedRange && namedRange.menu && namedRange.menu.items) ? [namedRange.menu.items[0], namedRange.menu.items[1]] : []; Array.prototype.push.apply(me.toolbar.lockControls, formulatab.getButtons()); - if ( !config.isDesktopApp && !config.isOffline ) { + if ( config.canFeaturePivot ) { tab = {action: 'pivot', caption: me.textPivot}; var pivottab = me.getApplication().getController('PivotTable'); $panel = pivottab.createToolbarPanel(); diff --git a/apps/spreadsheeteditor/main/app/view/RightMenu.js b/apps/spreadsheeteditor/main/app/view/RightMenu.js index 2f979a2df..a7595f7fe 100644 --- a/apps/spreadsheeteditor/main/app/view/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/view/RightMenu.js @@ -213,7 +213,7 @@ define([ this.signatureSettings = new SSE.Views.SignatureSettings(); } - if (mode && !mode.isDesktopApp) + if (mode && mode.canFeaturePivot) this.btnPivot.setVisible(true); if (_.isUndefined(this.scroller)) {