From 48fa6dbf8f470dbbf6672f647702be42e2133350 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 13 Apr 2020 12:45:11 +0300 Subject: [PATCH] [SSE] Remove duplicates in table from the right panel --- apps/spreadsheeteditor/main/app/controller/DataTab.js | 1 + .../main/app/template/TableSettings.template | 5 +++++ apps/spreadsheeteditor/main/app/view/TableSettings.js | 11 ++++++++++- apps/spreadsheeteditor/main/locale/en.json | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DataTab.js b/apps/spreadsheeteditor/main/app/controller/DataTab.js index 5fe81fb6b..e310cf1dc 100644 --- a/apps/spreadsheeteditor/main/app/controller/DataTab.js +++ b/apps/spreadsheeteditor/main/app/controller/DataTab.js @@ -96,6 +96,7 @@ define([ 'sheet:changed': this.onApiSheetChanged } }); + Common.NotificationCenter.on('data:remduplicates', _.bind(this.onRemoveDuplicates, this)); }, SetDisabled: function(state) { diff --git a/apps/spreadsheeteditor/main/app/template/TableSettings.template b/apps/spreadsheeteditor/main/app/template/TableSettings.template index 2ed6e5d01..8f369fddc 100644 --- a/apps/spreadsheeteditor/main/app/template/TableSettings.template +++ b/apps/spreadsheeteditor/main/app/template/TableSettings.template @@ -78,6 +78,11 @@ + + + + +
diff --git a/apps/spreadsheeteditor/main/app/view/TableSettings.js b/apps/spreadsheeteditor/main/app/view/TableSettings.js index eecf3c5cf..542ba3565 100644 --- a/apps/spreadsheeteditor/main/app/view/TableSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TableSettings.js @@ -297,6 +297,14 @@ define([ }, this)); this.lockedControls.push(this.btnConvertRange); + this.btnRemDuplicates = new Common.UI.Button({ + el: $('#table-btn-rem-duplicates') + }); + this.btnRemDuplicates.on('click', _.bind(function(btn){ + Common.NotificationCenter.trigger('data:remduplicates', this); + }, this)); + this.lockedControls.push(this.btnRemDuplicates); + $(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this)); this._initSettings = false; @@ -576,7 +584,8 @@ define([ textAdvanced: 'Show advanced settings', textConvertRange: 'Convert to range', textLongOperation: 'Long operation', - warnLongOperation: 'The operation you are about to perform might take rather much time to complete.
Are you sure you want to continue?' + warnLongOperation: 'The operation you are about to perform might take rather much time to complete.
Are you sure you want to continue?', + textRemDuplicates: 'Remove duplicates' }, SSE.Views.TableSettings || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 1f3fd1559..b1f6637b7 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -2377,6 +2377,7 @@ "SSE.Views.TableSettings.textTemplate": "Select From Template", "SSE.Views.TableSettings.textTotal": "Total", "SSE.Views.TableSettings.warnLongOperation": "The operation you are about to perform might take rather much time to complete.
Are you sure you want to continue?", + "SSE.Views.TableSettings.textRemDuplicates": "Remove duplicates", "SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text", "SSE.Views.TableSettingsAdvanced.textAltDescription": "Description", "SSE.Views.TableSettingsAdvanced.textAltTip": "The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.",