From f74fccee76fe67bac5ba4ec77b24c2b34832004c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 9 Sep 2021 17:02:07 +0300 Subject: [PATCH 1/2] [SSE] Show table content helper --- .../main/app/controller/DocumentHolder.js | 66 ++++++++++++++++--- apps/spreadsheeteditor/main/locale/en.json | 10 +++ 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index ff1223e9e..019f5b5e3 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -2415,8 +2415,14 @@ define([ i--; } funcarr.sort(function (a,b) { - var aname = a.asc_getName(true).toLocaleUpperCase(), + var atype = a.asc_getType(), + btype = b.asc_getType(), + aname = a.asc_getName(true).toLocaleUpperCase(), bname = b.asc_getName(true).toLocaleUpperCase(); + if (atype === Asc.c_oAscPopUpSelectorType.TableThisRow) return -1; + if (btype === Asc.c_oAscPopUpSelectorType.TableThisRow) return 1; + if ((atype === Asc.c_oAscPopUpSelectorType.TableColumnName || btype === Asc.c_oAscPopUpSelectorType.TableColumnName) && atype !== btype) + return atype === Asc.c_oAscPopUpSelectorType.TableColumnName ? -1 : 1; if (aname < bname) return -1; if (aname > bname) return 1; return 0; @@ -2425,24 +2431,54 @@ define([ var type = menuItem.asc_getType(), name = menuItem.asc_getName(true), origname = me.api.asc_getFormulaNameByLocale(name), - iconCls = 'btn-named-range'; + iconCls = '', + caption = name, + hint = ''; switch (type) { case Asc.c_oAscPopUpSelectorType.Func: - iconCls = 'btn-function'; + iconCls = 'menu__icon btn-function'; + hint = (funcdesc && funcdesc[origname]) ? funcdesc[origname].d : ''; break; case Asc.c_oAscPopUpSelectorType.Table: - iconCls = 'btn-menu-table'; + iconCls = 'menu__icon btn-menu-table'; break; case Asc.c_oAscPopUpSelectorType.Slicer: - iconCls = 'btn-slicer'; + iconCls = 'menu__icon btn-slicer'; + break; + case Asc.c_oAscPopUpSelectorType.Range: + iconCls = 'menu__icon btn-named-range'; + break; + case Asc.c_oAscPopUpSelectorType.TableColumnName: + caption = '(...) ' + name; + break; + case Asc.c_oAscPopUpSelectorType.TableThisRow: + caption = name + ' - ' + me.txtThisRow; + hint = me.txtThisRowHint; + break; + case Asc.c_oAscPopUpSelectorType.TableAll: + name = caption = me.txtAllTable; + hint = me.txtAllTableHint; + break; + case Asc.c_oAscPopUpSelectorType.TableData: + name = caption = me.txtDataTable; + hint = me.txtDataTableHint; + break; + case Asc.c_oAscPopUpSelectorType.TableHeaders: + name = caption = me.txtHeadersTable; + hint = me.txtHeadersTableHint; + break; + case Asc.c_oAscPopUpSelectorType.TableTotals: + name = caption = me.txtTotalsTable; + hint = me.txtTotalsTableHint; break; } var mnu = new Common.UI.MenuItem({ - iconCls: 'menu__icon ' + iconCls , - caption: name, - hint : (funcdesc && funcdesc[origname]) ? funcdesc[origname].d : '' + iconCls: iconCls, + caption: caption, + name: name, + hint: hint }).on('click', function(item, e) { - setTimeout(function(){ me.api.asc_insertInCell(item.caption, type, false ); }, 10); + setTimeout(function(){ me.api.asc_insertInCell(item.options.name, type, false ); }, 10); }); menu.addItem(mnu); }); @@ -3964,7 +4000,17 @@ define([ textAutoCorrectSettings: 'AutoCorrect options', txtLockSort: 'Data is found next to your selection, but you do not have sufficient permissions to change those cells.
Do you wish to continue with the current selection?', txtRemoveWarning: 'Do you want to remove this signature?
It can\'t be undone.', - txtWarnUrl: 'Clicking this link can be harmful to your device and data.
Are you sure you want to continue?' + txtWarnUrl: 'Clicking this link can be harmful to your device and data.
Are you sure you want to continue?', + txtThisRow: 'This Row', + txtThisRowHint: 'Choose only this row of the specified column', + txtAllTable: '#All', + txtDataTable: '#Data', + txtHeadersTable: '#Headers', + txtTotalsTable: '#Totals', + txtAllTableHint: 'Returns the entire contents of the table or specified table columns including column headers, data and total rows', + txtDataTableHint: 'Returns the data cells of the table or specified table columns', + txtHeadersTableHint: 'Returns the column headers for the table or specified table columns', + txtTotalsTableHint: 'Returns the total rows for the table or specified table columns' }, SSE.Controllers.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 75aabddfc..0ad143013 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -590,6 +590,16 @@ "SSE.Controllers.DocumentHolder.txtUseTextImport": "Use text import wizard", "SSE.Controllers.DocumentHolder.txtWidth": "Width", "SSE.Controllers.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.
Are you sure you want to continue?", + "SSE.Controllers.DocumentHolder.txtThisRow": "This Row", + "SSE.Controllers.DocumentHolder.txtThisRowHint": "Choose only this row of the specified column", + "SSE.Controllers.DocumentHolder.txtAllTable": "#All", + "SSE.Controllers.DocumentHolder.txtDataTable": "#Data", + "SSE.Controllers.DocumentHolder.txtHeadersTable": "#Headers", + "SSE.Controllers.DocumentHolder.txtTotalsTable": "#Totals", + "SSE.Controllers.DocumentHolder.txtAllTableHint": "Returns the entire contents of the table or specified table columns including column headers, data and total rows", + "SSE.Controllers.DocumentHolder.txtDataTableHint": "Returns the data cells of the table or specified table columns", + "SSE.Controllers.DocumentHolder.txtHeadersTableHint": "Returns the column headers for the table or specified table columns", + "SSE.Controllers.DocumentHolder.txtTotalsTableHint": "Returns the total rows for the table or specified table columns", "SSE.Controllers.FormulaDialog.sCategoryAll": "All", "SSE.Controllers.FormulaDialog.sCategoryCube": "Cube", "SSE.Controllers.FormulaDialog.sCategoryDatabase": "Database", From 88435fd465c18f3d769e717108507d1709fb9d9e Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 9 Sep 2021 17:56:24 +0300 Subject: [PATCH 2/2] [SSE] Fix translation for table helper --- .../main/app/controller/DocumentHolder.js | 8 -------- apps/spreadsheeteditor/main/app/controller/Main.js | 12 ++++++++++-- apps/spreadsheeteditor/main/locale/en.json | 8 ++++---- apps/spreadsheeteditor/main/locale/ru.json | 4 ++++ 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 019f5b5e3..e82002c8f 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -2456,19 +2456,15 @@ define([ hint = me.txtThisRowHint; break; case Asc.c_oAscPopUpSelectorType.TableAll: - name = caption = me.txtAllTable; hint = me.txtAllTableHint; break; case Asc.c_oAscPopUpSelectorType.TableData: - name = caption = me.txtDataTable; hint = me.txtDataTableHint; break; case Asc.c_oAscPopUpSelectorType.TableHeaders: - name = caption = me.txtHeadersTable; hint = me.txtHeadersTableHint; break; case Asc.c_oAscPopUpSelectorType.TableTotals: - name = caption = me.txtTotalsTable; hint = me.txtTotalsTableHint; break; } @@ -4003,10 +3999,6 @@ define([ txtWarnUrl: 'Clicking this link can be harmful to your device and data.
Are you sure you want to continue?', txtThisRow: 'This Row', txtThisRowHint: 'Choose only this row of the specified column', - txtAllTable: '#All', - txtDataTable: '#Data', - txtHeadersTable: '#Headers', - txtTotalsTable: '#Totals', txtAllTableHint: 'Returns the entire contents of the table or specified table columns including column headers, data and total rows', txtDataTableHint: 'Returns the data cells of the table or specified table columns', txtHeadersTableHint: 'Returns the column headers for the table or specified table columns', diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 7aa4dc9d0..2ced4c879 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -146,7 +146,11 @@ define([ 'Quarters': this.txtQuarters, 'Years': this.txtYears, '%1 or %2': this.txtOr, - 'Qtr': this.txtQuarter + 'Qtr': this.txtQuarter, + 'All': this.txtAllTable, + 'Data': this.txtDataTable, + 'Headers': this.txtHeadersTable, + 'Totals': this.txtTotalsTable }; styleNames.forEach(function(item){ @@ -3400,7 +3404,11 @@ define([ uploadDocFileCountMessage: 'No documents uploaded.', errorLoadingFont: 'Fonts are not loaded.
Please contact your Document Server administrator.', textNeedSynchronize: 'You have an updates', - textChangesSaved: 'All changes saved' + textChangesSaved: 'All changes saved', + txtAllTable: 'All', + txtDataTable: 'Data', + txtHeadersTable: 'Headers', + txtTotalsTable: 'Totals' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 0ad143013..b4e6e3e22 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -592,10 +592,6 @@ "SSE.Controllers.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.
Are you sure you want to continue?", "SSE.Controllers.DocumentHolder.txtThisRow": "This Row", "SSE.Controllers.DocumentHolder.txtThisRowHint": "Choose only this row of the specified column", - "SSE.Controllers.DocumentHolder.txtAllTable": "#All", - "SSE.Controllers.DocumentHolder.txtDataTable": "#Data", - "SSE.Controllers.DocumentHolder.txtHeadersTable": "#Headers", - "SSE.Controllers.DocumentHolder.txtTotalsTable": "#Totals", "SSE.Controllers.DocumentHolder.txtAllTableHint": "Returns the entire contents of the table or specified table columns including column headers, data and total rows", "SSE.Controllers.DocumentHolder.txtDataTableHint": "Returns the data cells of the table or specified table columns", "SSE.Controllers.DocumentHolder.txtHeadersTableHint": "Returns the column headers for the table or specified table columns", @@ -1054,6 +1050,10 @@ "SSE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
Contact %1 sales team for personal upgrade terms.", "SSE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", "SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", + "SSE.Controllers.Main.txtAllTable": "All", + "SSE.Controllers.Main.txtDataTable": "Data", + "SSE.Controllers.Main.txtHeadersTable": "Headers", + "SSE.Controllers.Main.txtTotalsTable": "Totals", "SSE.Controllers.Print.strAllSheets": "All Sheets", "SSE.Controllers.Print.textFirstCol": "First column", "SSE.Controllers.Print.textFirstRow": "First row", diff --git a/apps/spreadsheeteditor/main/locale/ru.json b/apps/spreadsheeteditor/main/locale/ru.json index 9cdeb5213..ca7354cf4 100644 --- a/apps/spreadsheeteditor/main/locale/ru.json +++ b/apps/spreadsheeteditor/main/locale/ru.json @@ -1041,6 +1041,10 @@ "SSE.Controllers.Main.warnNoLicense": "Вы достигли лимита на одновременные подключения к редакторам %1. Этот документ будет открыт на просмотр.
Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия лицензирования.", "SSE.Controllers.Main.warnNoLicenseUsers": "Вы достигли лимита на одновременные подключения к редакторам %1.
Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия лицензирования.", "SSE.Controllers.Main.warnProcessRightsChange": "Вам было отказано в праве на редактирование этого файла.", + "SSE.Controllers.Main.txtAllTable": "Все", + "SSE.Controllers.Main.txtDataTable": "Данные", + "SSE.Controllers.Main.txtHeadersTable": "Заголовки", + "SSE.Controllers.Main.txtTotalsTable": "Итоги", "SSE.Controllers.Print.strAllSheets": "Все листы", "SSE.Controllers.Print.textFirstCol": "Первый столбец", "SSE.Controllers.Print.textFirstRow": "Первая строка",