bug 59288

This commit is contained in:
OVSharova 2022-10-25 15:50:27 +03:00
parent a49071c6e3
commit 97d106c3fa
3 changed files with 20 additions and 4 deletions

View file

@ -216,6 +216,7 @@ define([
view.pmiFilterCells.menu.on('item:click', _.bind(me.onFilterCells, me)); view.pmiFilterCells.menu.on('item:click', _.bind(me.onFilterCells, me));
view.pmiReapply.on('click', _.bind(me.onReapply, me)); view.pmiReapply.on('click', _.bind(me.onReapply, me));
view.pmiCondFormat.on('click', _.bind(me.onCondFormat, me)); view.pmiCondFormat.on('click', _.bind(me.onCondFormat, me));
view.mnuRefreshPivot.on('click', _.bind(me.onRefreshPivot, me));
view.mnuGroupPivot.on('click', _.bind(me.onGroupPivot, me)); view.mnuGroupPivot.on('click', _.bind(me.onGroupPivot, me));
view.mnuUnGroupPivot.on('click', _.bind(me.onGroupPivot, me)); view.mnuUnGroupPivot.on('click', _.bind(me.onGroupPivot, me));
view.pmiClear.menu.on('item:click', _.bind(me.onClear, me)); view.pmiClear.menu.on('item:click', _.bind(me.onClear, me));
@ -576,6 +577,12 @@ define([
})).show(); })).show();
}, },
onRefreshPivot: function(){
if (this.api) {
this.propsPivot.asc_refresh(this.api);
}
},
onGroupPivot: function(item) { onGroupPivot: function(item) {
item.value=='grouping' ? this.api.asc_groupPivot() : this.api.asc_ungroupPivot(); item.value=='grouping' ? this.api.asc_groupPivot() : this.api.asc_ungroupPivot();
}, },
@ -2267,13 +2274,13 @@ define([
seltype !== Asc.c_oAscSelectionType.RangeChart && seltype !== Asc.c_oAscSelectionType.RangeChartText && seltype !== Asc.c_oAscSelectionType.RangeChart && seltype !== Asc.c_oAscSelectionType.RangeChartText &&
seltype !== Asc.c_oAscSelectionType.RangeShapeText && seltype !== Asc.c_oAscSelectionType.RangeSlicer)) { seltype !== Asc.c_oAscSelectionType.RangeShapeText && seltype !== Asc.c_oAscSelectionType.RangeSlicer)) {
if (!documentHolder.ssMenu || !showMenu && !documentHolder.ssMenu.isVisible()) return; if (!documentHolder.ssMenu || !showMenu && !documentHolder.ssMenu.isVisible()) return;
this.propsPivot = cellinfo.asc_getPivotTableInfo();
var iscelledit = this.api.isCellEdited, var iscelledit = this.api.isCellEdited,
formatTableInfo = cellinfo.asc_getFormatTableInfo(), formatTableInfo = cellinfo.asc_getFormatTableInfo(),
isinsparkline = (cellinfo.asc_getSparklineInfo()!==null), isinsparkline = (cellinfo.asc_getSparklineInfo()!==null),
isintable = (formatTableInfo !== null), isintable = (formatTableInfo !== null),
ismultiselect = cellinfo.asc_getMultiselect(), ismultiselect = cellinfo.asc_getMultiselect(),
inPivot = !!cellinfo.asc_getPivotTableInfo(); inPivot = !!this.propsPivot;
documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null; documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null;
documentHolder.ssMenu.cellColor = xfs.asc_getFillColor(); documentHolder.ssMenu.cellColor = xfs.asc_getFillColor();
documentHolder.ssMenu.fontColor = xfs.asc_getFontColor(); documentHolder.ssMenu.fontColor = xfs.asc_getFontColor();
@ -2294,6 +2301,7 @@ define([
documentHolder.pmiFilterCells.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && !inPivot); documentHolder.pmiFilterCells.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && !inPivot);
documentHolder.pmiReapply.setVisible((iscellmenu||isallmenu) && !iscelledit && !diagramOrMergeEditor && !inPivot); documentHolder.pmiReapply.setVisible((iscellmenu||isallmenu) && !iscelledit && !diagramOrMergeEditor && !inPivot);
documentHolder.pmiCondFormat.setVisible(!iscelledit && !diagramOrMergeEditor); documentHolder.pmiCondFormat.setVisible(!iscelledit && !diagramOrMergeEditor);
documentHolder.mnuRefreshPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot);
documentHolder.mnuGroupPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot); documentHolder.mnuGroupPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot);
documentHolder.mnuUnGroupPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot); documentHolder.mnuUnGroupPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot);
documentHolder.ssMenu.items[12].setVisible((iscellmenu||isallmenu||isinsparkline) && !iscelledit); documentHolder.ssMenu.items[12].setVisible((iscellmenu||isallmenu||isinsparkline) && !iscelledit);
@ -2325,7 +2333,7 @@ define([
/** coauthoring begin **/ /** coauthoring begin **/
var celcomments = cellinfo.asc_getComments(); // celcomments===null - has comment, but no permissions to view it var celcomments = cellinfo.asc_getComments(); // celcomments===null - has comment, but no permissions to view it
documentHolder.ssMenu.items[19].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && celcomments && (celcomments.length < 1)); documentHolder.ssMenu.items[20].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && celcomments && (celcomments.length < 1));
documentHolder.pmiAddComment.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && celcomments && (celcomments.length < 1)); documentHolder.pmiAddComment.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && celcomments && (celcomments.length < 1));
/** coauthoring end **/ /** coauthoring end **/
documentHolder.pmiCellMenuSeparator.setVisible(iscellmenu && !iscelledit || isrowmenu || iscolmenu || isallmenu); documentHolder.pmiCellMenuSeparator.setVisible(iscellmenu && !iscelledit || isrowmenu || iscolmenu || isallmenu);
@ -2394,6 +2402,7 @@ define([
var canGroup = this.api.asc_canGroupPivot(); var canGroup = this.api.asc_canGroupPivot();
documentHolder.mnuGroupPivot.setDisabled(isPivotLocked || !canGroup || this._state.wsLock); documentHolder.mnuGroupPivot.setDisabled(isPivotLocked || !canGroup || this._state.wsLock);
documentHolder.mnuUnGroupPivot.setDisabled(isPivotLocked || !canGroup || this._state.wsLock); documentHolder.mnuUnGroupPivot.setDisabled(isPivotLocked || !canGroup || this._state.wsLock);
documentHolder.mnuRefreshPivot.setDisabled(isPivotLocked || this._state.wsLock);
} }
if (showMenu) this.showPopupMenu(documentHolder.ssMenu, {}, event); if (showMenu) this.showPopupMenu(documentHolder.ssMenu, {}, event);

View file

@ -335,6 +335,10 @@ define([
caption : me.txtReapply caption : me.txtReapply
}); });
me.mnuRefreshPivot = new Common.UI.MenuItem({
caption : me.txtRefresh
});
me.mnuGroupPivot = new Common.UI.MenuItem({ me.mnuGroupPivot = new Common.UI.MenuItem({
caption : this.txtGroup, caption : this.txtGroup,
value : 'grouping' value : 'grouping'
@ -584,6 +588,7 @@ define([
me.pmiSortCells, me.pmiSortCells,
me.pmiFilterCells, me.pmiFilterCells,
me.pmiReapply, me.pmiReapply,
me.mnuRefreshPivot,
me.mnuGroupPivot, me.mnuGroupPivot,
me.mnuUnGroupPivot, me.mnuUnGroupPivot,
{caption: '--'}, {caption: '--'},
@ -1319,7 +1324,8 @@ define([
tipMarkersDash: 'Dash bullets', tipMarkersDash: 'Dash bullets',
chartDataText: 'Select Chart Data', chartDataText: 'Select Chart Data',
chartTypeText: 'Change Chart Type', chartTypeText: 'Change Chart Type',
txtGetLink: 'Get link to this range' txtGetLink: 'Get link to this range',
txtRefresh: 'Refresh'
}, SSE.Views.DocumentHolder || {})); }, SSE.Views.DocumentHolder || {}));
}); });

View file

@ -2242,6 +2242,7 @@
"SSE.Views.DocumentHolder.txtPaste": "Paste", "SSE.Views.DocumentHolder.txtPaste": "Paste",
"SSE.Views.DocumentHolder.txtPercentage": "Percentage", "SSE.Views.DocumentHolder.txtPercentage": "Percentage",
"SSE.Views.DocumentHolder.txtReapply": "Reapply", "SSE.Views.DocumentHolder.txtReapply": "Reapply",
"SSE.Views.DocumentHolder.txtRefresh": "Refresh",
"SSE.Views.DocumentHolder.txtRow": "Entire row", "SSE.Views.DocumentHolder.txtRow": "Entire row",
"SSE.Views.DocumentHolder.txtRowHeight": "Set Row Height", "SSE.Views.DocumentHolder.txtRowHeight": "Set Row Height",
"SSE.Views.DocumentHolder.txtScientific": "Scientific", "SSE.Views.DocumentHolder.txtScientific": "Scientific",