From cc271cd7236823a1bf6fe26efa911ebcc5f51e15 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 12 Jul 2021 00:30:52 +0300 Subject: [PATCH] Bug 42150: add sort direction --- apps/common/main/lib/controller/Comments.js | 17 +++++++---- apps/common/main/lib/view/Comments.js | 32 +++++++++++++++------ apps/documenteditor/main/locale/en.json | 6 ++-- apps/presentationeditor/main/locale/en.json | 6 ++-- apps/spreadsheeteditor/main/locale/en.json | 6 ++-- 5 files changed, 47 insertions(+), 20 deletions(-) diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js index 89cba715a6..a93ccca3c7 100644 --- a/apps/common/main/lib/controller/Comments.js +++ b/apps/common/main/lib/controller/Comments.js @@ -210,19 +210,24 @@ define([ if (this.collection) { var sort = (type !== undefined); if (type === undefined) { - type = Common.localStorage.getItem(this.appPrefix + "comments-sort") || 'date'; + type = Common.localStorage.getItem(this.appPrefix + "comments-sort") || 'date-desc'; } Common.localStorage.setItem(this.appPrefix + "comments-sort", type); Common.Utils.InternalSettings.set(this.appPrefix + "comments-sort", type); if (type=='position') { - } else if (type=='author') { - this.collection.comparator = function (collection) { - return collection.get('parsedName').toLowerCase(); + } else if (type=='author-asc' || type=='author-desc') { + var direction = (type=='author-asc') ? 1 : -1; + this.collection.comparator = function(item1, item2) { + var n1 = item1.get('parsedName').toLowerCase(), + n2 = item2.get('parsedName').toLowerCase(); + if (n1==n2) return 0; + return (n1
To copy or paste to or from applications outside the editor tab use the following keyboard combinations:", diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 4129c9812d..29eb081a2f 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -141,8 +141,10 @@ "Common.Views.Comments.textResolved": "Resolved", "Common.Views.Comments.textSort": "Sort comments", "Common.Views.Comments.mniPosition": "Sort by Position", - "Common.Views.Comments.mniAuthor": "Sort by Authors", - "Common.Views.Comments.mniDate": "Sort by Date", + "Common.Views.Comments.mniAuthorAsc": "Sort by Author A to Z", + "Common.Views.Comments.mniAuthorDesc": "Sort by Author Z to A", + "Common.Views.Comments.mniDateDesc": "Sort by Newest", + "Common.Views.Comments.mniDateAsc": "Sort by Oldest", "Common.Views.Comments.textClosePanel": "Close comments", "Common.Views.CopyWarningDialog.textDontShow": "Don't show this message again", "Common.Views.CopyWarningDialog.textMsg": "Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.

To copy or paste to or from applications outside the editor tab use the following keyboard combinations:", diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index e0bcb82403..6a72a95fc3 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -189,8 +189,10 @@ "Common.Views.Comments.textResolved": "Resolved", "Common.Views.Comments.textSort": "Sort comments", "Common.Views.Comments.mniPosition": "Sort by Position", - "Common.Views.Comments.mniAuthor": "Sort by Authors", - "Common.Views.Comments.mniDate": "Sort by Date", + "Common.Views.Comments.mniAuthorAsc": "Sort by Author A to Z", + "Common.Views.Comments.mniAuthorDesc": "Sort by Author Z to A", + "Common.Views.Comments.mniDateDesc": "Sort by Newest", + "Common.Views.Comments.mniDateAsc": "Sort by Oldest", "Common.Views.Comments.textClosePanel": "Close comments", "Common.Views.CopyWarningDialog.textDontShow": "Don't show this message again", "Common.Views.CopyWarningDialog.textMsg": "Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.

To copy or paste to or from applications outside the editor tab use the following keyboard combinations:",