Skip to content

Commit

Permalink
NXP-32187: warn when using legal hold on flexible record
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishant0928 committed Dec 21, 2023
1 parent 63ef5d5 commit 5a04a9f
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions nuxeo-retention-web/elements/nuxeo-hold-toggle-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,35 +145,39 @@ class RetentionHoldToggleButton extends mixinBehaviors([FiltersBehavior, FormatB
}

_hold() {
if (this.provider) {
this.$.opHold.op = 'Bulk.RunAction';
this.$.opHold.input = this.provider;
this.$.opHold.async = true;
this.$.opHold.params = {
action: 'holdDocumentsAction',
};
if (this.description) {
this.$.opHold.params.parameters = JSON.stringify({ description: this.description });
}
this.$.opHold.execute().then(() => {
this._toggleDialog();
});
} else {
this.$.opHold.op = 'Document.Hold';
this.$.opHold.input = this.document;
this.$.opHold.async = false;
if (this.description) {
this.$.opHold.params = { description: this.description };
const { isFlexibleRecord } = this.document;
const response = isFlexibleRecord ? window.confirm(this.i18n('retention.holdToggleButton.confirm.hold')) : true;
if (response) {
if (this.provider) {
this.$.opHold.op = 'Bulk.RunAction';
this.$.opHold.input = this.provider;
this.$.opHold.async = true;
this.$.opHold.params = {
action: 'holdDocumentsAction',
};
if (this.description) {
this.$.opHold.params.parameters = JSON.stringify({ description: this.description });
}
this.$.opHold.execute().then(() => {
this._toggleDialog();
});
} else {
this.$.opHold.op = 'Document.Hold';
this.$.opHold.input = this.document;
this.$.opHold.async = false;
if (this.description) {
this.$.opHold.params = { description: this.description };
}
this.$.opHold.execute().then(() => {
this._toggleDialog();
this.dispatchEvent(
new CustomEvent('document-updated', {
composed: true,
bubbles: true,
}),
);
});
}
this.$.opHold.execute().then(() => {
this._toggleDialog();
this.dispatchEvent(
new CustomEvent('document-updated', {
composed: true,
bubbles: true,
}),
);
});
}
}

Expand Down

0 comments on commit 5a04a9f

Please sign in to comment.