Skip to content

Commit eaa310b

Browse files
authored
feat: add the ability to define if fillable documents should be opened in fill or edit mode - EXO-81254 (#1804)
This change adds the ability to define if fillable documents should be opened in fill or edit mode from the attachments list drawer.
1 parent ea0491a commit eaa310b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

documents-webapp/src/main/webapp/vue-app/attachment/components/Attachment.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
ref="attachmentsListDrawer"
2424
:supported-documents="supportedDocuments"
2525
:attachments="attachments"
26-
:open-attachments-in-editor="openAttachmentsInEditor" />
26+
:open-attachments-in-editor="openAttachmentsInEditor"
27+
:can-fill-attachments="canFillAttachments" />
2728
</div>
2829
</v-app>
2930
</template>
@@ -152,6 +153,7 @@ export default {
152153
this.entityType = config.entityType;
153154
this.entityId = config.entityId;
154155
this.openAttachmentsInEditor = config.openAttachmentsInEditor || true;
156+
this.canFillAttachments = config.canFillAttachments;
155157
this.displayUploadedFiles = config.displayUploadedFiles;
156158
this.createEntityTypeFolder = config.createEntityTypeFolder;
157159
this.showCustomDrawerOverlay = config.showCustomDrawerOverlay;

documents-webapp/src/main/webapp/vue-app/attachment/components/AttachmentsListDrawer.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ export default {
7878
type: Boolean,
7979
default: () => true
8080
},
81+
canFillAttachments: {
82+
type: Boolean,
83+
default: () => true
84+
},
8185
allowToDetach: {
8286
type: Boolean,
8387
default: true
@@ -98,7 +102,7 @@ export default {
98102
},
99103
isFileFillable(attachment) {
100104
const type = attachment && attachment.mimetype || '';
101-
return type === 'application/pdf';
105+
return this.canFillAttachments && type === 'application/pdf';
102106
},
103107
isFileReadable(attachment) {
104108
const type = attachment && attachment.mimetype || '';
@@ -111,6 +115,7 @@ export default {
111115
this.$refs.attachmentsListDrawer.endLoading();
112116
},
113117
openAttachmentsListDrawer() {
118+
console.log('openFile called');
114119
this.$refs.attachmentsListDrawer.open();
115120
},
116121
closeAttachmentsListDrawer() {

0 commit comments

Comments
 (0)