[DE][DE mobile] Support review changes for selection

This commit is contained in:
Julia Radzhabova 2022-01-21 00:11:12 +03:00
parent 302c220ccf
commit 0d1549e56f
5 changed files with 83 additions and 11 deletions

View file

@ -179,10 +179,10 @@ define([
});
},
isSelectedChangesLocked: function(changes, fromSelection) {
isSelectedChangesLocked: function(changes, isShow) {
if (!changes || changes.length<1) return true;
if (!fromSelection)
if (isShow)
return changes[0].get('lock') || !changes[0].get('editable');
for (var i=0; i<changes.length; i++) {
@ -193,13 +193,13 @@ define([
return false;
},
onApiShowChange: function (sdkchange, fromSelection) {
onApiShowChange: function (sdkchange, isShow) {
var btnlock = true,
changes;
if (this.appConfig.canReview && !this.appConfig.isReviewOnly) {
if (sdkchange && sdkchange.length>0) {
changes = this.readSDKChange(sdkchange);
btnlock = this.isSelectedChangesLocked(changes, fromSelection);
btnlock = this.isSelectedChangesLocked(changes, isShow);
}
if (this._state.lock !== btnlock) {
this.view.btnAccept.setDisabled(btnlock);
@ -214,7 +214,7 @@ define([
}
if (this.getPopover()) {
if (!this.appConfig.reviewHoverMode && sdkchange && sdkchange.length>0 && !fromSelection) { // show changes balloon only for current position, not selection
if (!this.appConfig.reviewHoverMode && sdkchange && sdkchange.length>0 && isShow) { // show changes balloon only for current position, not selection
var i = 0,
posX = sdkchange[0].get_X(),
posY = sdkchange[0].get_Y(),

View file

@ -52,7 +52,7 @@ class InitReview extends Component {
});
}
onChangeReview (data) {
onChangeReview (data, isShow) {
const storeReview = this.props.storeReview;
storeReview.changeArrReview(data);
}

View file

@ -1895,6 +1895,16 @@ define([
me.fireEvent('editcomplete', me);
},
onAcceptRejectChange: function(item, e) {
if (this.api) {
if (item.value == 'accept')
this.api.asc_AcceptChanges();
else if (item.value == 'reject')
this.api.asc_RejectChanges();
}
this.fireEvent('editcomplete', this);
},
onPrintSelection: function(item){
if (this.api){
var printopt = new Asc.asc_CAdjustPrint();
@ -2516,6 +2526,20 @@ define([
value : 'cut'
}).on('click', _.bind(me.onCutCopyPaste, me));
var menuImgAccept = new Common.UI.MenuItem({
caption : me.textAccept,
value : 'accept'
}).on('click', _.bind(me.onAcceptRejectChange, me));
var menuImgReject = new Common.UI.MenuItem({
caption : me.textReject,
value : 'reject'
}).on('click', _.bind(me.onAcceptRejectChange, me));
var menuImgReviewSeparator = new Common.UI.MenuItem({
caption : '--'
});
var menuImgPrint = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-print',
caption : me.txtPrintSelection
@ -2745,6 +2769,11 @@ define([
menuImgPrint.setVisible(me.mode.canPrint);
menuImgPrint.setDisabled(!cancopy);
var lockreview = Common.Utils.InternalSettings.get("de-accept-reject-lock");
menuImgAccept.setVisible(!lockreview);
menuImgReject.setVisible(!lockreview);
menuImgReviewSeparator.setVisible(!lockreview);
var signGuid = (value.imgProps && value.imgProps.value && me.mode.isSignatureSupport) ? value.imgProps.value.asc_getSignatureId() : undefined,
isInSign = !!signGuid;
menuSignatureEditSign.setVisible(isInSign);
@ -2767,6 +2796,9 @@ define([
menuImgPaste,
menuImgPrint,
{ caption: '--' },
menuImgAccept,
menuImgReject,
menuImgReviewSeparator,
menuSignatureEditSign,
menuSignatureEditSetup,
menuEditSignSeparator,
@ -3081,6 +3113,20 @@ define([
value : 'cut'
}).on('click', _.bind(me.onCutCopyPaste, me));
var menuTableAccept = new Common.UI.MenuItem({
caption : me.textAccept,
value : 'accept'
}).on('click', _.bind(me.onAcceptRejectChange, me));
var menuTableReject = new Common.UI.MenuItem({
caption : me.textReject,
value : 'reject'
}).on('click', _.bind(me.onAcceptRejectChange, me));
var menuTableReviewSeparator = new Common.UI.MenuItem({
caption : '--'
});
var menuTablePrint = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-print',
caption : me.txtPrintSelection
@ -3787,6 +3833,20 @@ define([
value : 'cut'
}).on('click', _.bind(me.onCutCopyPaste, me));
var menuParaAccept = new Common.UI.MenuItem({
caption : me.textAccept,
value : 'accept'
}).on('click', _.bind(me.onAcceptRejectChange, me));
var menuParaReject = new Common.UI.MenuItem({
caption : me.textReject,
value : 'reject'
}).on('click', _.bind(me.onAcceptRejectChange, me));
var menuParaReviewSeparator = new Common.UI.MenuItem({
caption : '--'
});
var menuParaPrint = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-print',
caption : me.txtPrintSelection
@ -3985,6 +4045,11 @@ define([
menuParaPrint.setVisible(me.mode.canPrint);
menuParaPrint.setDisabled(!cancopy);
var lockreview = Common.Utils.InternalSettings.get("de-accept-reject-lock");
menuParaAccept.setVisible(!lockreview);
menuParaReject.setVisible(!lockreview);
menuParaReviewSeparator.setVisible(!lockreview);
// spellCheck
var spell = (value.spellProps!==undefined && value.spellProps.value.get_Checked()===false);
me.menuSpellPara.setVisible(spell);
@ -4011,9 +4076,9 @@ define([
//equation menu
var eqlen = 0;
if (isEquation) {
eqlen = me.addEquationMenu(true, 15);
eqlen = me.addEquationMenu(true, 18);
} else
me.clearEquationMenu(true, 15);
me.clearEquationMenu(true, 18);
menuEquationSeparator.setVisible(isEquation && eqlen>0);
menuEquationInsertCaption.setVisible(isEquation);
menuEquationInsertCaptionSeparator.setVisible(isEquation);
@ -4098,6 +4163,9 @@ define([
menuParaCopy,
menuParaPaste,
menuParaPrint,
menuParaReviewSeparator,
menuParaAccept,
menuParaReject,
menuEquationInsertCaptionSeparator,
menuEquationInsertCaption,
{ caption: '--' },
@ -4743,7 +4811,9 @@ define([
txtRemoveWarning: 'Do you want to remove this signature?<br>It can\'t be undone.',
notcriticalErrorTitle: 'Warning',
txtWarnUrl: 'Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?',
textEditPoints: 'Edit Points'
textEditPoints: 'Edit Points',
textAccept: 'Accept Change',
textReject: 'Reject Change'
}, DE.Views.DocumentHolder || {}));
});

View file

@ -1629,6 +1629,8 @@
"DE.Views.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?",
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
"DE.Views.DocumentHolder.textAccept": "Accept Change",
"DE.Views.DocumentHolder.textReject": "Reject Change",
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
"DE.Views.DropcapSettingsAdvanced.strDropcap": "Drop Cap",
"DE.Views.DropcapSettingsAdvanced.strMargins": "Margins",

View file

@ -63,8 +63,8 @@ class ContextMenu extends ContextMenuController {
this.isComments = false;
}
onApiShowChange(sdkchange) {
this.inRevisionChange = sdkchange && sdkchange.length>0;
onApiShowChange(sdkchange, isShow) {
this.inRevisionChange = isShow && sdkchange && sdkchange.length>0;
}
// onMenuClosed() {