[SSE] Fix removing duplicates

This commit is contained in:
Julia Radzhabova 2020-04-08 11:51:55 +03:00
parent a08d896d0a
commit acd9eb20da
3 changed files with 9 additions and 5 deletions

View file

@ -1482,7 +1482,7 @@ define([
config.iconCls = 'info';
config.title = Common.UI.Window.prototype.textInformation;
config.buttons = ['ok'];
// config.msg = (errData.asc_getRemoved()>0) ? Common.Utils.String.format(this.errRemDuplicates, errData.asc_getRemoved(), errData.asc_getLeft()) : this.errNoDuplicates;
config.msg = (errData.asc_getDuplicateValues()!==null && errData.asc_getUniqueValues()!==null) ? Common.Utils.String.format(this.errRemDuplicates, errData.asc_getDuplicateValues(), errData.asc_getUniqueValues()) : this.errNoDuplicates;
config.maxwidth = 600;
break;

View file

@ -2273,7 +2273,7 @@ define([
}
need_disable = this._state.controlsdisabled.filters || (val===null);
toolbar.lockToolbar(SSE.enumLock.ruleFilter, need_disable,
{ array: toolbar.btnsSetAutofilter.concat(toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnCustomSort, toolbar.btnTableTemplate, toolbar.btnInsertTable) });
{ array: toolbar.btnsSetAutofilter.concat(toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnCustomSort, toolbar.btnTableTemplate, toolbar.btnInsertTable, toolbar.btnRemoveDuplicates) });
val = (formatTableInfo) ? formatTableInfo.asc_getTableStyleName() : null;
if (this._state.tablestylename !== val && this.toolbar.mnuTableTemplatePicker) {
@ -2303,11 +2303,12 @@ define([
toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink, toolbar.btnInsertTable]});
this._state.inpivot = !!info.asc_getPivotTableInfo();
toolbar.lockToolbar(SSE.enumLock.editPivot, this._state.inpivot, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnsClearAutofilter, toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnCustomSort, toolbar.btnMerge, toolbar.btnInsertHyperlink, toolbar.btnInsertTable)});
toolbar.lockToolbar(SSE.enumLock.editPivot, this._state.inpivot, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnsClearAutofilter, toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnCustomSort,
toolbar.btnMerge, toolbar.btnInsertHyperlink, toolbar.btnInsertTable, toolbar.btnRemoveDuplicates)});
need_disable = !this.appConfig.canModifyFilter;
toolbar.lockToolbar(SSE.enumLock.cantModifyFilter, need_disable, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnCustomSort, toolbar.btnTableTemplate, toolbar.btnClearStyle.menu.items[0], toolbar.btnClearStyle.menu.items[2],
toolbar.btnInsertTable)});
toolbar.lockToolbar(SSE.enumLock.cantModifyFilter, need_disable, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnCustomSort, toolbar.btnTableTemplate,
toolbar.btnClearStyle.menu.items[0], toolbar.btnClearStyle.menu.items[2], toolbar.btnInsertTable, toolbar.btnRemoveDuplicates)});
}
@ -3175,6 +3176,7 @@ define([
me.toolbar.btnsSetAutofilter = datatab.getButtons('set-filter');
me.toolbar.btnsClearAutofilter = datatab.getButtons('clear-filter');
me.toolbar.btnCustomSort = datatab.getButtons('sort-custom');
me.toolbar.btnRemoveDuplicates = datatab.getButtons('rem-duplicates');
var formulatab = me.getApplication().getController('FormulaDialog');
formulatab.setConfig({toolbar: me});

View file

@ -275,6 +275,8 @@ define([
return this.btnsSetAutofilter;
else if (type == 'clear-filter')
return this.btnsClearAutofilter;
else if (type == 'rem-duplicates')
return this.btnRemoveDuplicates;
else if (type===undefined)
return this.lockedControls;
return [];