Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEBUI-992: prevent replacing and removing an attachment under retention when using nuxeo-dropzone #1906

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions elements/nuxeo-dropzone/nuxeo-dropzone.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Polymer({
</template>
</div>

<div id="dropzone" hidden$="[[!_isDropzoneVisible(hasFiles, multiple, updateDocument, blobList)]]">
<div id="dropzone" hidden$="[[!_isDropzoneVisible(document, hasFiles, multiple, updateDocument, blobList)]]">
<div id="container">
<button class="link" on-click="open">
[[_computeMessage(draggingFiles, message, dragContentMessage, i18n)]]
Expand Down Expand Up @@ -581,7 +581,13 @@ Polymer({
return this.i18n && this.draggingFiles ? this.i18n(this.dragContentMessage) : this.i18n(this.message);
},

_isDropzoneVisible() {
_isDropzoneVisible(document) {
if (document && document.isUnderRetentionOrLegalHold && document.retainedProperties.length > 0) {
if (document.retainedProperties.indexOf(this.xpath) !== -1) {
return false;
}
}

// Area to drop files should stay visible when the element is attached to a blob list property
// and, e.g, when using the element on a form: creation or edition of documents.
// This will allow the user to manage the list of files.
Expand Down
Loading