Merge pull request #796 from ONLYOFFICE/feature/resolve-comments
Feature/resolve comments
This commit is contained in:
commit
3b146397ee
|
@ -128,7 +128,8 @@ define([
|
|||
'comment:addDummyComment': _.bind(this.onAddDummyComment, this)
|
||||
},
|
||||
'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
|
||||
}
|
||||
},
|
||||
|
||||
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) {
|
||||
var t = this,
|
||||
reply = null,
|
||||
|
|
|
@ -818,8 +818,9 @@ define([
|
|||
me.view.turnChat(state);
|
||||
});
|
||||
}
|
||||
if (me.view && me.view.btnCommentRemove) {
|
||||
me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
|
||||
if (me.view) {
|
||||
me.view.btnCommentRemove && me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
|
||||
me.view.btnCommentResolve && me.view.btnCommentResolve.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -952,6 +953,7 @@ define([
|
|||
if (!this.view) return;
|
||||
var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment");
|
||||
(value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value);
|
||||
(value!==undefined) && this.view.btnCommentResolve && this.view.btnCommentResolve.setDisabled(mode != 'show' && !value);
|
||||
},
|
||||
|
||||
textInserted: '<b>Inserted:</b>',
|
||||
|
|
|
@ -65,6 +65,7 @@ define([
|
|||
'<div class="group">' +
|
||||
'<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-resolve"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long comments"></div>' +
|
||||
'<div class="group">' +
|
||||
|
@ -208,6 +209,15 @@ define([
|
|||
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 {
|
||||
|
@ -354,6 +364,12 @@ define([
|
|||
split: true,
|
||||
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-all'
|
||||
});
|
||||
}
|
||||
|
||||
var filter = Common.localStorage.getKeysFilter();
|
||||
|
@ -532,6 +548,28 @@ define([
|
|||
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',
|
||||
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',
|
||||
|
@ -591,6 +629,7 @@ define([
|
|||
this.btnHistory && this.btnHistory.render(this.$el.find('#slot-btn-history'));
|
||||
this.btnChat && this.btnChat.render(this.$el.find('#slot-btn-chat'));
|
||||
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;
|
||||
},
|
||||
|
@ -742,6 +781,7 @@ define([
|
|||
// this.btnChat && this.btnChat.setDisabled(state);
|
||||
|
||||
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() {
|
||||
|
@ -804,6 +844,13 @@ define([
|
|||
txtCommentRemMyCurrent: 'Remove My Current Comments',
|
||||
txtCommentRemMy: 'Remove My 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',
|
||||
txtOffGlobal: 'OFF for me and everyone',
|
||||
txtOn: 'ON for me',
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 433 B |
Binary file not shown.
After Width: | Height: | Size: 514 B |
Binary file not shown.
After Width: | Height: | Size: 561 B |
Binary file not shown.
After Width: | Height: | Size: 367 B |
Binary file not shown.
After Width: | Height: | Size: 717 B |
|
@ -387,6 +387,13 @@
|
|||
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
|
||||
"Common.Views.ReviewChanges.txtTurnon": "Track Changes",
|
||||
"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.txtAccept": "Accept",
|
||||
"Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes",
|
||||
|
|
|
@ -272,6 +272,13 @@
|
|||
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
|
||||
"Common.Views.ReviewChanges.txtTurnon": "Track Changes",
|
||||
"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.textAddReply": "Add Reply",
|
||||
"Common.Views.ReviewPopover.textCancel": "Cancel",
|
||||
|
|
|
@ -324,6 +324,13 @@
|
|||
"Common.Views.ReviewChanges.txtSpelling": "Spell Checking",
|
||||
"Common.Views.ReviewChanges.txtTurnon": "Track Changes",
|
||||
"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.textAddReply": "Add Reply",
|
||||
"Common.Views.ReviewPopover.textCancel": "Cancel",
|
||||
|
|
Loading…
Reference in a new issue