Resolve all comments

This commit is contained in:
Julia Radzhabova 2021-04-06 10:53:53 +03:00
parent f33f7c28e9
commit 33acee7d61
5 changed files with 77 additions and 1 deletions

View file

@ -128,7 +128,8 @@ define([
'comment:addDummyComment': _.bind(this.onAddDummyComment, this) 'comment:addDummyComment': _.bind(this.onAddDummyComment, this)
}, },
'Common.Views.ReviewChanges': { 'Common.Views.ReviewChanges': {
'comment:removeComments': _.bind(this.onRemoveComments, this) 'comment:removeComments': _.bind(this.onRemoveComments, this),
'comment:resolveComments': _.bind(this.onResolveComments, this)
} }
}); });
@ -241,6 +242,13 @@ define([
this.api.asc_RemoveAllComments(type=='my' || !this.mode.canDeleteComments, type=='current');// 1 param = true if remove only my comments, 2 param - remove current comments this.api.asc_RemoveAllComments(type=='my' || !this.mode.canDeleteComments, type=='current');// 1 param = true if remove only my comments, 2 param - remove current comments
} }
}, },
onResolveComments: function (type) {
if (this.api) {
this.api.asc_ResolveAllComments(type=='my' || !this.mode.canEditComments, type=='current');// 1 param = true if resolve only my comments, 2 param - resolve current comments
}
},
onResolveComment: function (uid) { onResolveComment: function (uid) {
var t = this, var t = this,
reply = null, reply = null,

View file

@ -65,6 +65,7 @@ define([
'<div class="group">' + '<div class="group">' +
'<span class="btn-slot text x-huge slot-comment"></span>' + '<span class="btn-slot text x-huge slot-comment"></span>' +
'<span class="btn-slot text x-huge" id="slot-comment-remove"></span>' + '<span class="btn-slot text x-huge" id="slot-comment-remove"></span>' +
'<span class="btn-slot text x-huge" id="slot-comment-resolve"></span>' +
'</div>' + '</div>' +
'<div class="separator long comments"></div>' + '<div class="separator long comments"></div>' +
'<div class="group">' + '<div class="group">' +
@ -208,6 +209,15 @@ define([
me.fireEvent('comment:removeComments', [item.value]); me.fireEvent('comment:removeComments', [item.value]);
}); });
} }
if (this.btnCommentResolve) {
this.btnCommentResolve.on('click', function (e) {
me.fireEvent('comment:resolveComments', ['current']);
});
this.btnCommentResolve.menu.on('item:click', function (menu, item, e) {
me.fireEvent('comment:resolveComments', [item.value]);
});
}
} }
return { return {
@ -354,6 +364,12 @@ define([
split: true, split: true,
iconCls: 'toolbar__icon btn-rem-comment' iconCls: 'toolbar__icon btn-rem-comment'
}); });
this.btnCommentResolve = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
caption: this.txtCommentResolve,
split: true,
iconCls: 'toolbar__icon btn-resolve-comment'
});
} }
var filter = Common.localStorage.getKeysFilter(); var filter = Common.localStorage.getKeysFilter();
@ -532,6 +548,28 @@ define([
me.btnCommentRemove.updateHint([me.tipCommentRemCurrent, me.tipCommentRem]); me.btnCommentRemove.updateHint([me.tipCommentRemCurrent, me.tipCommentRem]);
} }
if (me.btnCommentResolve) {
var items = [
{
caption: config.canEditComments ? me.txtCommentResolveCurrent : me.txtCommentResolveMyCurrent,
value: 'current'
},
{
caption: me.txtCommentResolveMy,
value: 'my'
}
];
if (config.canEditComments)
items.push({
caption: me.txtCommentResolveAll,
value: 'all'
});
me.btnCommentResolve.setMenu(
new Common.UI.Menu({items: items})
);
me.btnCommentResolve.updateHint([me.tipCommentResolveCurrent, me.tipCommentResolve]);
}
var separator_sharing = !(me.btnSharing || me.btnCoAuthMode) ? me.$el.find('.separator.sharing') : '.separator.sharing', var separator_sharing = !(me.btnSharing || me.btnCoAuthMode) ? me.$el.find('.separator.sharing') : '.separator.sharing',
separator_comments = !(config.canComments && config.canCoAuthoring) ? me.$el.find('.separator.comments') : '.separator.comments', separator_comments = !(config.canComments && config.canCoAuthoring) ? me.$el.find('.separator.comments') : '.separator.comments',
separator_review = !(config.canReview || config.canViewReview) ? me.$el.find('.separator.review') : '.separator.review', separator_review = !(config.canReview || config.canViewReview) ? me.$el.find('.separator.review') : '.separator.review',
@ -591,6 +629,7 @@ define([
this.btnHistory && this.btnHistory.render(this.$el.find('#slot-btn-history')); this.btnHistory && this.btnHistory.render(this.$el.find('#slot-btn-history'));
this.btnChat && this.btnChat.render(this.$el.find('#slot-btn-chat')); this.btnChat && this.btnChat.render(this.$el.find('#slot-btn-chat'));
this.btnCommentRemove && this.btnCommentRemove.render(this.$el.find('#slot-comment-remove')); this.btnCommentRemove && this.btnCommentRemove.render(this.$el.find('#slot-comment-remove'));
this.btnCommentResolve && this.btnCommentResolve.render(this.$el.find('#slot-comment-resolve'));
return this.$el; return this.$el;
}, },
@ -742,6 +781,7 @@ define([
// this.btnChat && this.btnChat.setDisabled(state); // this.btnChat && this.btnChat.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment")); this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
this.btnCommentResolve && this.btnCommentResolve.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
}, },
onLostEditRights: function() { onLostEditRights: function() {
@ -804,6 +844,13 @@ define([
txtCommentRemMyCurrent: 'Remove My Current Comments', txtCommentRemMyCurrent: 'Remove My Current Comments',
txtCommentRemMy: 'Remove My Comments', txtCommentRemMy: 'Remove My Comments',
txtCommentRemAll: 'Remove All Comments', txtCommentRemAll: 'Remove All Comments',
txtCommentResolve: 'Resolve',
tipCommentResolveCurrent: 'Resolve current comments',
tipCommentResolve: 'Resolve comments',
txtCommentResolveCurrent: 'Resolve Current Comments',
txtCommentResolveMyCurrent: 'Resolve My Current Comments',
txtCommentResolveMy: 'Resolve My Comments',
txtCommentResolveAll: 'Resolve All Comments',
txtOnGlobal: 'ON for me and everyone', txtOnGlobal: 'ON for me and everyone',
txtOffGlobal: 'OFF for me and everyone', txtOffGlobal: 'OFF for me and everyone',
txtOn: 'ON for me', txtOn: 'ON for me',

View file

@ -387,6 +387,13 @@
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking", "Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
"Common.Views.ReviewChanges.txtTurnon": "Track Changes", "Common.Views.ReviewChanges.txtTurnon": "Track Changes",
"Common.Views.ReviewChanges.txtView": "Display Mode", "Common.Views.ReviewChanges.txtView": "Display Mode",
"Common.Views.ReviewChanges.txtCommentResolve": "Resolve",
"Common.Views.ReviewChanges.tipCommentResolveCurrent": "Resolve current comments",
"Common.Views.ReviewChanges.tipCommentResolve": "Resolve comments",
"Common.Views.ReviewChanges.txtCommentResolveCurrent": "Resolve Current Comments",
"Common.Views.ReviewChanges.txtCommentResolveMyCurrent": "Resolve My Current Comments",
"Common.Views.ReviewChanges.txtCommentResolveMy": "Resolve My Comments",
"Common.Views.ReviewChanges.txtCommentResolveAll": "Resolve All Comments",
"Common.Views.ReviewChangesDialog.textTitle": "Review Changes", "Common.Views.ReviewChangesDialog.textTitle": "Review Changes",
"Common.Views.ReviewChangesDialog.txtAccept": "Accept", "Common.Views.ReviewChangesDialog.txtAccept": "Accept",
"Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes", "Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes",

View file

@ -272,6 +272,13 @@
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking", "Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
"Common.Views.ReviewChanges.txtTurnon": "Track Changes", "Common.Views.ReviewChanges.txtTurnon": "Track Changes",
"Common.Views.ReviewChanges.txtView": "Display Mode", "Common.Views.ReviewChanges.txtView": "Display Mode",
"Common.Views.ReviewChanges.txtCommentResolve": "Resolve",
"Common.Views.ReviewChanges.tipCommentResolveCurrent": "Resolve current comments",
"Common.Views.ReviewChanges.tipCommentResolve": "Resolve comments",
"Common.Views.ReviewChanges.txtCommentResolveCurrent": "Resolve Current Comments",
"Common.Views.ReviewChanges.txtCommentResolveMyCurrent": "Resolve My Current Comments",
"Common.Views.ReviewChanges.txtCommentResolveMy": "Resolve My Comments",
"Common.Views.ReviewChanges.txtCommentResolveAll": "Resolve All Comments",
"Common.Views.ReviewPopover.textAdd": "Add", "Common.Views.ReviewPopover.textAdd": "Add",
"Common.Views.ReviewPopover.textAddReply": "Add Reply", "Common.Views.ReviewPopover.textAddReply": "Add Reply",
"Common.Views.ReviewPopover.textCancel": "Cancel", "Common.Views.ReviewPopover.textCancel": "Cancel",

View file

@ -324,6 +324,13 @@
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking", "Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
"Common.Views.ReviewChanges.txtTurnon": "Track Changes", "Common.Views.ReviewChanges.txtTurnon": "Track Changes",
"Common.Views.ReviewChanges.txtView": "Display Mode", "Common.Views.ReviewChanges.txtView": "Display Mode",
"Common.Views.ReviewChanges.txtCommentResolve": "Resolve",
"Common.Views.ReviewChanges.tipCommentResolveCurrent": "Resolve current comments",
"Common.Views.ReviewChanges.tipCommentResolve": "Resolve comments",
"Common.Views.ReviewChanges.txtCommentResolveCurrent": "Resolve Current Comments",
"Common.Views.ReviewChanges.txtCommentResolveMyCurrent": "Resolve My Current Comments",
"Common.Views.ReviewChanges.txtCommentResolveMy": "Resolve My Comments",
"Common.Views.ReviewChanges.txtCommentResolveAll": "Resolve All Comments",
"Common.Views.ReviewPopover.textAdd": "Add", "Common.Views.ReviewPopover.textAdd": "Add",
"Common.Views.ReviewPopover.textAddReply": "Add Reply", "Common.Views.ReviewPopover.textAddReply": "Add Reply",
"Common.Views.ReviewPopover.textCancel": "Cancel", "Common.Views.ReviewPopover.textCancel": "Cancel",