From b660d907958cd44e86dffcb1edb2aa0ec63ee871 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 20 Feb 2024 22:09:17 +0300 Subject: [PATCH 01/10] [SSE] Change protected ranges window --- .../main/app/view/ProtectedRangesEditDlg.js | 147 ++++++++++++++++-- .../resources/less/advanced-settings.less | 45 ++++-- 2 files changed, 166 insertions(+), 26 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js index 782eb62978..61838af1ff 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js @@ -39,10 +39,28 @@ */ define([ - 'common/main/lib/component/Window' + 'common/main/lib/component/Window', + 'common/main/lib/component/ListView' ], function () { 'use strict'; + var _CustomItem = Common.UI.DataViewItem.extend({ + initialize : function(options) { + Common.UI.BaseView.prototype.initialize.call(this, options); + + var me = this; + + me.template = me.options.template || me.template; + + me.listenTo(me.model, 'change:selected', function() { + var el = me.$el || $(me.el); + el.toggleClass('selected', me.model.get('selected') && me.model.get('allowSelected')); + me.onSelectChange(me.model, me.model.get('selected') && me.model.get('allowSelected')); + }); + me.listenTo(me.model, 'remove', me.remove); + } + }); + SSE.Views.ProtectedRangesEditDlg = Common.UI.Window.extend(_.extend({ initialize : function (options) { @@ -79,7 +97,7 @@ define([ '', '', '
', - '
', + '
', '<% } else { %>', '
', '', @@ -159,18 +177,37 @@ define([ store: new Common.UI.DataViewStore(), itemTemplate: _.template([ '
', - '
<%= Common.Utils.String.htmlEncode(displayName) %>
', - '
<%= Common.Utils.String.htmlEncode(email) %>
', - '<% if (typeof isCurrent === "undefined" || !isCurrent) { %>', - '
', - '<% } %>', + '
', + 'style="background-image: url(<%=avatar%>); <% if (usercolor!==null) { %> border-color:<%=usercolor%>; border-style:solid;<% }%>"', + '<% } else { %>', + 'style="background-color: <% if (usercolor!==null) { %> <%=usercolor%> <% } else { %> #cfcfcf <% }%>;"', + '<% } %>', + '><% if (!avatar) { %><%-initials%><% } %>
', + '
', + '<% if (!!email) { %>', + '
<%= Common.Utils.String.htmlEncode(displayName) %>
', + '
<%= Common.Utils.String.htmlEncode(email) %>
', + '<% } else { %>', + '
<%= Common.Utils.String.htmlEncode(displayName) %>
', + '<% } %>', + '
', + '
', '
' ].join('')), emptyText: '', tabindex: 1 }); + this.listUser.createNewItem = function(record) { + return new _CustomItem({ + template: this.itemTemplate, + model: record + }); + }; this.listUser.on('item:keydown', _.bind(this.onKeyDown, this)) this.listUser.on('item:click', _.bind(this.onListUserClick, this)) + this.listUser.on('item:add', _.bind(this.addControls, this)); + this.listUser.on('item:change', _.bind(this.addControls, this)); this.afterRender(); }, @@ -230,14 +267,33 @@ define([ if (props) { this.inputRangeName.setValue(props.asc_getName()); this.txtDataRange.setValue(props.asc_getRef()); - this.listUser.store.add({value: this.currentUser.id, name: this.currentUser.name, displayName: this.currentUser.name + ' (' + this.textYou + ')', email: '', isCurrent: true}); + this.listUser.store.add({ + value: this.currentUser.id, + name: this.currentUser.name, + displayName: this.currentUser.name + ' (' + this.textYou + ')', + initials: Common.Utils.getUserInitials(this.currentUser.name), + avatar: '', + usercolor: null, + email: '', + type: Asc.c_oSerUserProtectedRangeType.edit, + isCurrent: true}); var me = this, rangeUsers = this.props.asc_getUsers(); if (rangeUsers && rangeUsers.length>0) { var store = me.listUser.store, count = 1; rangeUsers.forEach(function(item) { - (item.asc_getId()!==me.currentUser.id) && store.add({value: item.asc_getId(), name: item.asc_getName() || me.textAnonymous, displayName: item.asc_getName() || me.textAnonymous + ' ' + count++, email: ''}); + var name = item.asc_getName() || me.textAnonymous; + (item.asc_getId()!==me.currentUser.id) && store.add({ + value: item.asc_getId(), + name: name, + displayName: name + ' ' + count++, + initials: Common.Utils.getUserInitials(name), + avatar: '', + usercolor: null, + email: '', + type: item.asc_getType() + }); }); } this.onUserMenu(true); @@ -253,6 +309,7 @@ define([ var user = new Asc.CUserProtectedRangeUserInfo(); user.asc_setId(item.get('value')); user.asc_setName(item.get('name')); + user.asc_setType(item.get('type')); arr.push(user); }); @@ -298,7 +355,16 @@ define([ if (value!==undefined && value!=='') { var rec = store.findWhere({value: value}); if (!rec) { - store.add({value: value, name: record.displayValue, displayName: record.displayValue, email: record.value}); + store.add({ + value: value, + name: record.displayValue, + displayName: record.displayValue, + initials: Common.Utils.getUserInitials(record.displayValue), + avatar: '', + usercolor: null, + email: record.value || 'a@asdlfkja;sldfkj', + type: Asc.c_oSerUserProtectedRangeType.edit + }); } } this.cmbUser.setRawValue(this._userStr); @@ -407,6 +473,62 @@ define([ } }, + addControls: function(listView, itemView, item) { + if (!item) return; + + var me = this, + type = item.get('type'); + var btn = new Common.UI.Button({ + parentEl: $('.listitem-icon', $(itemView.el)), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon ' + (type===Asc.c_oSerUserProtectedRangeType.edit ? 'btn-edit' : type===Asc.c_oSerUserProtectedRangeType.view ? 'btn-sheet-view' : 'btn-hide-password'), + disabled: !!item.get('isCurrent'), + menu: item.get('isCurrent') ? false : new Common.UI.Menu({ + style: 'min-width: auto;', + cls: 'menu-absolute', + items: [ + { + caption: this.textCanEdit, + value: 'edit', + iconCls: 'menu__icon btn-edit', + }, + { + caption: this.textCanView, + value: 'view', + iconCls: 'menu__icon btn-sheet-view', + }, + { + caption: this.textRemove, + value: 'remove', + iconCls: 'menu__icon btn-cc-remove' + }, + ] + }) + }); + if (btn.menu) { + btn.menu.on('item:click', function(menu, mni) { + if (mni.value==='remove') { + me.onHideMenu(); + me.onDeleteUser(item); + } else { + item.set('type', mni.value==='edit' ? Asc.c_oSerUserProtectedRangeType.edit : mni.value==='view' ? Asc.c_oSerUserProtectedRangeType.view : Asc.c_oSerUserProtectedRangeType.notView); + item.get('btnEdit').setIconCls('toolbar__icon ' + (mni.value==='edit' ? 'btn-edit' : mni.value==='view' ? 'btn-sheet-view' : 'btn-hide-password')); + } + }); + btn.menu.on('show:after', _.bind(this.onShowMenu, this)); + btn.menu.on('hide:after', _.bind(this.onHideMenu, this)); + } + item.set('btnEdit', btn, {silent: true}); + }, + + onShowMenu: function() { + this.listUser.enableKeyEvents = false; + }, + + onHideMenu: function() { + this.listUser.enableKeyEvents = true; + }, + txtProtect: 'Protect', txtRangeName: 'Title', txtRange: 'Range', @@ -420,7 +542,10 @@ define([ textYou: 'you', userPlaceholder: 'Start type name or email', txtYouCanEdit: 'Only you can edit this range', - textAnonymous: 'Anonymous' + textAnonymous: 'Anonymous', + textCanEdit: 'Can edit', + textCanView: 'Can view', + textRemove: 'Remove' }, SSE.Views.ProtectedRangesEditDlg || {})); }); diff --git a/apps/spreadsheeteditor/main/resources/less/advanced-settings.less b/apps/spreadsheeteditor/main/resources/less/advanced-settings.less index 258216404e..baad8d6e81 100644 --- a/apps/spreadsheeteditor/main/resources/less/advanced-settings.less +++ b/apps/spreadsheeteditor/main/resources/less/advanced-settings.less @@ -526,27 +526,42 @@ } .listitem-icon { position: absolute; - display: none; width: 20px; height: 20px; - right: -5px; - top: -3px; + right: 12px; + top: 4px; .rtl & { right: auto; - left: -5px; - } - } - &:hover { - .listitem-icon { - display: block; - } - } - &.selected { - .listitem-icon { - background-position-x: -20px; - background-position-x: @button-small-active-icon-offset-x; + left: 12px; } } + //&:hover { + // .listitem-icon { + // display: block; + // } + //} + .color { + display: inline-block; + width: 26px; + height: 26px; + border-radius: 20px; + border-width: var(--scaled-two-pixel, 2px); + .margin-right-8(); + vertical-align: middle; + background-color: #ffffff; + background-size: cover; + background-position: center; + text-align: center; + line-height: 26px; + color: #ffffff; + font-weight: 700; + } + //&.selected { + // .listitem-icon { + // background-position-x: -20px; + // background-position-x: @button-small-active-icon-offset-x; + // } + //} } } From 814e20a7aa27b9fe5084b4644b161b89eda79741 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 21 Feb 2024 12:27:18 +0300 Subject: [PATCH 02/10] [SSE] Fix styles for protected ranges --- .../main/app/view/ProtectedRangesEditDlg.js | 16 ++++--- .../resources/less/advanced-settings.less | 43 +++++++++++++------ 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js index 61838af1ff..5627ddc3ae 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js @@ -461,16 +461,14 @@ define([ if (rec && !rec.get('isCurrent')) { this.listUser.store.remove(rec); } + var me = this; + setTimeout(function() { + me.listUser.focus(); + }, 1); }, onListUserClick: function(list, item, record, e) { - if (e) { - var btn = $(e.target); - if (btn && btn.hasClass('listitem-icon')) { - this.onDeleteUser(record); - return; - } - } + }, addControls: function(listView, itemView, item) { @@ -527,6 +525,10 @@ define([ onHideMenu: function() { this.listUser.enableKeyEvents = true; + var me = this; + setTimeout(function() { + me.listUser.focus(); + }, 1); }, txtProtect: 'Protect', diff --git a/apps/spreadsheeteditor/main/resources/less/advanced-settings.less b/apps/spreadsheeteditor/main/resources/less/advanced-settings.less index baad8d6e81..fd05c76d10 100644 --- a/apps/spreadsheeteditor/main/resources/less/advanced-settings.less +++ b/apps/spreadsheeteditor/main/resources/less/advanced-settings.less @@ -528,18 +528,13 @@ position: absolute; width: 20px; height: 20px; - right: 12px; + right: 16px; top: 4px; .rtl & { right: auto; - left: 12px; + left: 16px; } } - //&:hover { - // .listitem-icon { - // display: block; - // } - //} .color { display: inline-block; width: 26px; @@ -556,12 +551,34 @@ color: #ffffff; font-weight: 700; } - //&.selected { - // .listitem-icon { - // background-position-x: -20px; - // background-position-x: @button-small-active-icon-offset-x; - // } - //} + .listitem-icon .btn-toolbar { + background-color: transparent !important; + box-shadow: none; + } + &.selected { + .listitem-icon { + .btn-toolbar .icon{ + background-position-x: -20px; + background-position-x: @button-small-active-icon-offset-x !important; + } + .caret { + border-color: @icon-normal-pressed-ie; + border-color: @icon-normal-pressed; + } + } + } + &:not(.selected) { + .listitem-icon { + .btn-toolbar .icon{ + background-position-x: 0; + background-position-x: @button-small-normal-icon-offset-x !important; + } + .caret { + border-color: @icon-normal-ie; + border-color: @icon-normal; + } + } + } } } From eed7a29ac974665cc77f950bc04094aadf4bbdb3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 21 Feb 2024 18:35:43 +0300 Subject: [PATCH 03/10] [SSE] Allow hide range for anyone --- .../main/app/view/ProtectedRangesEditDlg.js | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js index 5627ddc3ae..e79c10ec37 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js @@ -97,7 +97,7 @@ define([ '', '
', '
', - '
', + '
', '<% } else { %>', '
', '', @@ -205,7 +205,6 @@ define([ }); }; this.listUser.on('item:keydown', _.bind(this.onKeyDown, this)) - this.listUser.on('item:click', _.bind(this.onListUserClick, this)) this.listUser.on('item:add', _.bind(this.addControls, this)); this.listUser.on('item:change', _.bind(this.addControls, this)); @@ -277,6 +276,16 @@ define([ email: '', type: Asc.c_oSerUserProtectedRangeType.edit, isCurrent: true}); + this.listUser.store.add({ + value: null, + name: this.textAnyone, + displayName: this.textAnyone, + initials: Common.Utils.getUserInitials(this.textAnyone), + avatar: '', + usercolor: null, + email: '', + type: props.asc_getType() || Asc.c_oSerUserProtectedRangeType.notView, + isAnyone: true}); var me = this, rangeUsers = this.props.asc_getUsers(); if (rangeUsers && rangeUsers.length>0) { @@ -306,11 +315,15 @@ define([ props.asc_setRef(this.txtDataRange.getValue()); var arr = []; this.listUser.store.each(function(item){ - var user = new Asc.CUserProtectedRangeUserInfo(); - user.asc_setId(item.get('value')); - user.asc_setName(item.get('name')); - user.asc_setType(item.get('type')); - arr.push(user); + if (item.get('isAnyone')) { + props.asc_setType(item.get('type')); + } else { + var user = new Asc.CUserProtectedRangeUserInfo(); + user.asc_setId(item.get('value')); + user.asc_setName(item.get('name')); + user.asc_setType(item.get('type')); + arr.push(user); + } }); props.asc_setUsers(arr); @@ -458,7 +471,7 @@ define([ onDeleteUser: function(rec) { !rec && (rec = this.listUser.getSelectedRec()); - if (rec && !rec.get('isCurrent')) { + if (rec && !rec.get('isCurrent') && !rec.get('isAnyone')) { this.listUser.store.remove(rec); } var me = this; @@ -467,10 +480,6 @@ define([ }, 1); }, - onListUserClick: function(list, item, record, e) { - - }, - addControls: function(listView, itemView, item) { if (!item) return; @@ -484,7 +493,18 @@ define([ menu: item.get('isCurrent') ? false : new Common.UI.Menu({ style: 'min-width: auto;', cls: 'menu-absolute', - items: [ + items: item.get('isAnyone') ? [ + { + caption: this.textCanView, + value: 'view', + iconCls: 'menu__icon btn-sheet-view', + }, + { + caption: this.textCantView, + value: 'notview', + iconCls: 'menu__icon btn-hide-password' + } + ] : [ { caption: this.textCanEdit, value: 'edit', @@ -547,7 +567,9 @@ define([ textAnonymous: 'Anonymous', textCanEdit: 'Can edit', textCanView: 'Can view', - textRemove: 'Remove' + textRemove: 'Remove', + textCantView: 'Can\'t view', + textAnyone: 'Anyone' }, SSE.Views.ProtectedRangesEditDlg || {})); }); From 3e12a22ff408eef921c082a1ec472cc0ab41c079 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 21 Feb 2024 19:56:01 +0300 Subject: [PATCH 04/10] [SSE] Refactoring protected ranges (use space key) --- .../main/app/view/ProtectedRangesEditDlg.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js index e79c10ec37..0b764e4068 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js @@ -465,8 +465,13 @@ define([ }, onKeyDown: function (lisvView, record, e) { - if (e.keyCode==Common.UI.Keys.DELETE) + if (e.keyCode===Common.UI.Keys.DELETE) this.onDeleteUser(); + else if (e.keyCode===Common.UI.Keys.SPACE) { + var rec = this.listUser.getSelectedRec(), + btn = rec && !rec.get('isCurrent') ? rec.get('btnEdit') : null; + btn && $('button', btn.cmpEl).click(); + } }, onDeleteUser: function(rec) { From e2a2a22fe473ea66d9e37e81247c910dc915bbd4 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 26 Feb 2024 12:10:09 +0300 Subject: [PATCH 05/10] Fix bug --- apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js index 0b764e4068..c255dd3ed0 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js @@ -375,7 +375,7 @@ define([ initials: Common.Utils.getUserInitials(record.displayValue), avatar: '', usercolor: null, - email: record.value || 'a@asdlfkja;sldfkj', + email: record.value, type: Asc.c_oSerUserProtectedRangeType.edit }); } From 83b1335c16f14e31fffe0867a217c6e8c9b18fe0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 26 Feb 2024 12:26:16 +0300 Subject: [PATCH 06/10] Show user colors for protected ranges --- .../main/app/view/ProtectedRangesEditDlg.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js index c255dd3ed0..c5b8b8633c 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js @@ -272,7 +272,7 @@ define([ displayName: this.currentUser.name + ' (' + this.textYou + ')', initials: Common.Utils.getUserInitials(this.currentUser.name), avatar: '', - usercolor: null, + usercolor: Common.UI.ExternalUsers.getColor(this.currentUser.id), email: '', type: Asc.c_oSerUserProtectedRangeType.edit, isCurrent: true}); @@ -299,7 +299,7 @@ define([ displayName: name + ' ' + count++, initials: Common.Utils.getUserInitials(name), avatar: '', - usercolor: null, + usercolor: Common.UI.ExternalUsers.getColor(item.asc_getId()), email: '', type: item.asc_getType() }); @@ -374,7 +374,7 @@ define([ displayName: record.displayValue, initials: Common.Utils.getUserInitials(record.displayValue), avatar: '', - usercolor: null, + usercolor: Common.UI.ExternalUsers.getColor(value), email: record.value, type: Asc.c_oSerUserProtectedRangeType.edit }); From 79932fd1ad0c94a01b12077f3f9d254c476a3282 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 26 Feb 2024 12:58:43 +0300 Subject: [PATCH 07/10] Show avatars in protected ranges window --- .../main/app/view/ProtectedRangesEditDlg.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js index c5b8b8633c..99862e8d8f 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js @@ -271,7 +271,7 @@ define([ name: this.currentUser.name, displayName: this.currentUser.name + ' (' + this.textYou + ')', initials: Common.Utils.getUserInitials(this.currentUser.name), - avatar: '', + avatar: Common.UI.ExternalUsers.getImage(this.currentUser.id), usercolor: Common.UI.ExternalUsers.getColor(this.currentUser.id), email: '', type: Asc.c_oSerUserProtectedRangeType.edit, @@ -298,7 +298,7 @@ define([ name: name, displayName: name + ' ' + count++, initials: Common.Utils.getUserInitials(name), - avatar: '', + avatar: Common.UI.ExternalUsers.getImage(item.asc_getId()), usercolor: Common.UI.ExternalUsers.getColor(item.asc_getId()), email: '', type: item.asc_getType() @@ -373,7 +373,7 @@ define([ name: record.displayValue, displayName: record.displayValue, initials: Common.Utils.getUserInitials(record.displayValue), - avatar: '', + avatar: Common.UI.ExternalUsers.getImage(value), usercolor: Common.UI.ExternalUsers.getColor(value), email: record.value, type: Asc.c_oSerUserProtectedRangeType.edit From b6eb9f0734fdf59a30d29cd779ab64aa2dd65fd4 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 26 Feb 2024 15:17:24 +0300 Subject: [PATCH 08/10] [SSE] Show access rights for ranges --- .../main/app/view/ProtectedRangesEditDlg.js | 11 +++-------- .../main/app/view/ProtectedRangesManagerDlg.js | 16 +++++++++++----- apps/spreadsheeteditor/main/locale/en.json | 7 +++++++ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js index 99862e8d8f..c7aa7b1d7c 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js @@ -92,17 +92,11 @@ define([ '', '
', '
', - '<% if (canRequestUsers) { %>', '
', - '', + '', '
', '
', '
', - '<% } else { %>', - '
', - '', - '
', - '<% } %>', '' ].join(''); @@ -574,7 +568,8 @@ define([ textCanView: 'Can view', textRemove: 'Remove', textCantView: 'Can\'t view', - textAnyone: 'Anyone' + textAnyone: 'Anyone', + txtAccess: 'Access to range' }, SSE.Views.ProtectedRangesEditDlg || {})); }); diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js index fdb8b4f182..f09150ef12 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js @@ -103,13 +103,13 @@ define([ 'text!spreadsheeteditor/main/app/template/ProtectedRangesManagerDlg.te headers: [ {name: this.textTitle, width: 184}, {name: this.textRange, width: 191}, - {name: this.textYouCan, width: 70}, + {name: this.txtAccess, width: 70}, ], itemTemplate: _.template([ '
', '
<%= Common.Utils.String.htmlEncode(name) %>
', '
<%= Common.Utils.String.htmlEncode(range) %>
', - '
<% if (canEdit) { %>', me.txtEdit, '<% } else { %>', me.txtView, '<% } %>
', + '
<% if (type===Asc.c_oSerUserProtectedRangeType.edit) { %>', me.txtEdit, '<% } else if (type===Asc.c_oSerUserProtectedRangeType.view) { %>', me.txtView, '<% } else { %>', me.txtDenied, '<% } %>
', '<% if (lock) { %>', '
<%=Common.Utils.String.htmlEncode(lockuser)%>
', '<% } %>', @@ -174,14 +174,18 @@ define([ 'text!spreadsheeteditor/main/app/template/ProtectedRangesManagerDlg.te currentId = this.currentUser.id; for (var i=0; iAnyone who has edit access to the spreadsheet will be able to edit content in the range.", "SSE.Views.ProtectedRangesManagerDlg.warnDeleteRanges": "Are you sure you want to delete the protected ranges?
Anyone who has edit access to the spreadsheet will be able to edit content in those ranges.", + "SSE.Views.ProtectedRangesManagerDlg.txtAccess": "Access", "SSE.Views.ProtectRangesDlg.guestText": "Guest", "SSE.Views.ProtectRangesDlg.lockText": "Locked", "SSE.Views.ProtectRangesDlg.textDelete": "Delete", From 42503a71a482d960dd416cfe5f1cf9e9dc2b13fc Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 26 Feb 2024 18:23:02 +0300 Subject: [PATCH 09/10] Update translation --- .../main/app/view/ProtectedRangesEditDlg.js | 10 ++++------ .../main/app/view/ProtectedRangesManagerDlg.js | 1 - apps/spreadsheeteditor/main/locale/en.json | 15 ++++++++------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js index c7aa7b1d7c..70f590ed4e 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesEditDlg.js @@ -514,6 +514,7 @@ define([ value: 'view', iconCls: 'menu__icon btn-sheet-view', }, + { caption: '--'}, { caption: this.textRemove, value: 'remove', @@ -553,21 +554,18 @@ define([ txtProtect: 'Protect', txtRangeName: 'Title', txtRange: 'Range', - txtWhoCanEdit: 'Who can edit', txtEmpty: 'This field is required', textSelectData: 'Select Data', textInvalidRange: 'ERROR! Invalid cells range', textInvalidName: 'The range title must begin with a letter and may only contain letters, numbers, and spaces.', - textTipAdd: 'Add user', - textTipDelete: 'Delete user', textYou: 'you', userPlaceholder: 'Start type name or email', txtYouCanEdit: 'Only you can edit this range', textAnonymous: 'Anonymous', - textCanEdit: 'Can edit', - textCanView: 'Can view', + textCanEdit: 'Edit', + textCanView: 'View', textRemove: 'Remove', - textCantView: 'Can\'t view', + textCantView: 'Denied', textAnyone: 'Anyone', txtAccess: 'Access to range' diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js index f09150ef12..02651d59aa 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js @@ -451,7 +451,6 @@ define([ 'text!spreadsheeteditor/main/app/template/ProtectedRangesManagerDlg.te lockText: 'Locked', textFilter: 'Filter', textFilterAll: 'All', - textYouCan: 'You can', txtDenied: 'Denied', txtAccess: 'Access' diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 5dd73142f3..d273e4c810 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -3460,20 +3460,20 @@ "SSE.Views.ProtectedRangesEditDlg.textInvalidName": "The range title must begin with a letter and may only contain letters, numbers, and spaces.", "SSE.Views.ProtectedRangesEditDlg.textInvalidRange": "ERROR! Invalid cells range", "SSE.Views.ProtectedRangesEditDlg.textSelectData": "Select data", - "SSE.Views.ProtectedRangesEditDlg.textTipAdd": "Add user", - "SSE.Views.ProtectedRangesEditDlg.textTipDelete": "Delete user", + "del_SSE.Views.ProtectedRangesEditDlg.textTipAdd": "Add user", + "del_SSE.Views.ProtectedRangesEditDlg.textTipDelete": "Delete user", "SSE.Views.ProtectedRangesEditDlg.textYou": "you", "SSE.Views.ProtectedRangesEditDlg.txtEmpty": "This field is required", "SSE.Views.ProtectedRangesEditDlg.txtProtect": "Protect", "SSE.Views.ProtectedRangesEditDlg.txtRange": "Range", "SSE.Views.ProtectedRangesEditDlg.txtRangeName": "Title", - "SSE.Views.ProtectedRangesEditDlg.txtWhoCanEdit": "Who can edit", + "del_SSE.Views.ProtectedRangesEditDlg.txtWhoCanEdit": "Who can edit", "SSE.Views.ProtectedRangesEditDlg.txtYouCanEdit": "Only you can edit this range", "SSE.Views.ProtectedRangesEditDlg.userPlaceholder": "Start typing name or email", - "SSE.Views.ProtectedRangesEditDlg.textCanEdit": "Can edit", - "SSE.Views.ProtectedRangesEditDlg.textCanView": "Can view", + "SSE.Views.ProtectedRangesEditDlg.textCanEdit": "Edit", + "SSE.Views.ProtectedRangesEditDlg.textCanView": "View", "SSE.Views.ProtectedRangesEditDlg.textRemove": "Remove", - "SSE.Views.ProtectedRangesEditDlg.textCantView": "Can't view", + "SSE.Views.ProtectedRangesEditDlg.textCantView": "Denied", "SSE.Views.ProtectedRangesEditDlg.textAnyone": "Anyone", "SSE.Views.ProtectedRangesEditDlg.txtAccess": "Access to range", "SSE.Views.ProtectedRangesManagerDlg.guestText": "Guest", @@ -3488,7 +3488,7 @@ "SSE.Views.ProtectedRangesManagerDlg.textRange": "Range", "SSE.Views.ProtectedRangesManagerDlg.textRangesDesc": "You can restrict editing ranges to selected people.", "SSE.Views.ProtectedRangesManagerDlg.textTitle": "Title", - "SSE.Views.ProtectedRangesManagerDlg.textYouCan": "You can", + "del_SSE.Views.ProtectedRangesManagerDlg.textYouCan": "You can", "SSE.Views.ProtectedRangesManagerDlg.tipIsLocked": "This element is being edited by another user.", "SSE.Views.ProtectedRangesManagerDlg.txtEdit": "Edit", "SSE.Views.ProtectedRangesManagerDlg.txtEditRange": "Edit range", @@ -3498,6 +3498,7 @@ "SSE.Views.ProtectedRangesManagerDlg.warnDelete": "Are you sure you want to delete the protected range {0}?
Anyone who has edit access to the spreadsheet will be able to edit content in the range.", "SSE.Views.ProtectedRangesManagerDlg.warnDeleteRanges": "Are you sure you want to delete the protected ranges?
Anyone who has edit access to the spreadsheet will be able to edit content in those ranges.", "SSE.Views.ProtectedRangesManagerDlg.txtAccess": "Access", + "SSE.Views.ProtectedRangesManagerDlg.txtDenied": "Denied", "SSE.Views.ProtectRangesDlg.guestText": "Guest", "SSE.Views.ProtectRangesDlg.lockText": "Locked", "SSE.Views.ProtectRangesDlg.textDelete": "Delete", From bf5729ce1e68e52a5456c1c8a7e87aa28b9205e3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 27 Feb 2024 16:42:19 +0300 Subject: [PATCH 10/10] Update translation --- .../main/app/view/ProtectedRangesManagerDlg.js | 2 +- apps/spreadsheeteditor/main/locale/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js index 02651d59aa..71e5bebb9f 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectedRangesManagerDlg.js @@ -432,7 +432,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ProtectedRangesManagerDlg.te }, txtTitle: 'Protected Ranges', - textRangesDesc: 'You can restrict editing ranges to selected people.', + textRangesDesc: 'You can restrict editing or viewing ranges to selected people.', textTitle: 'Title', textRange: 'Range', textNew: 'New', diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index d273e4c810..c5f7637a1d 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -3486,7 +3486,7 @@ "SSE.Views.ProtectedRangesManagerDlg.textNew": "New", "SSE.Views.ProtectedRangesManagerDlg.textProtect": "Protect sheet", "SSE.Views.ProtectedRangesManagerDlg.textRange": "Range", - "SSE.Views.ProtectedRangesManagerDlg.textRangesDesc": "You can restrict editing ranges to selected people.", + "SSE.Views.ProtectedRangesManagerDlg.textRangesDesc": "You can restrict editing or viewing ranges to selected people.", "SSE.Views.ProtectedRangesManagerDlg.textTitle": "Title", "del_SSE.Views.ProtectedRangesManagerDlg.textYouCan": "You can", "SSE.Views.ProtectedRangesManagerDlg.tipIsLocked": "This element is being edited by another user.",