From 89064f55a1a98084b0642c916b679f696fbf8574 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 25 Mar 2022 11:36:51 +0100 Subject: [PATCH 1/4] Accompanying course evaluation documents: disable the WOPI edit link if mimetype not supported --- .../components/FormEvaluation.vue | 82 ++++++++++++++++++- 1 file changed, 79 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index ca3d8b397..181592ba4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -113,9 +113,8 @@ :storedObject="d.storedObject" > - -
  • +
  • @@ -220,7 +219,79 @@ export default { maxFiles: 1, maxPostSize: 15000000, required: false, - } + }, + mime: [ + // TODO temporary hardcoded. to be replaced by twig extension or a collabora server query + 'application/clarisworks', + 'application/coreldraw', + 'application/macwriteii', + 'application/msword', + 'application/vnd.lotus-1-2-3', + 'application/vnd.ms-excel', + 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'application/vnd.ms-excel.template.macroEnabled.12', + 'application/vnd.ms-powerpoint', + 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'application/vnd.ms-powerpoint.template.macroEnabled.12', + 'application/vnd.ms-visio.drawing', + 'application/vnd.ms-word.document.macroEnabled.12', + 'application/vnd.ms-word.template.macroEnabled.12', + 'application/vnd.ms-works', + 'application/vnd.oasis.opendocument.chart', + 'application/vnd.oasis.opendocument.formula', + 'application/vnd.oasis.opendocument.graphics', + 'application/vnd.oasis.opendocument.graphics-flat-xml', + 'application/vnd.oasis.opendocument.graphics-template', + 'application/vnd.oasis.opendocument.presentation', + 'application/vnd.oasis.opendocument.presentation-flat-xml', + 'application/vnd.oasis.opendocument.presentation-template', + 'application/vnd.oasis.opendocument.spreadsheet', + 'application/vnd.oasis.opendocument.spreadsheet-flat-xml', + 'application/vnd.oasis.opendocument.spreadsheet-template', + 'application/vnd.oasis.opendocument.text', + 'application/vnd.oasis.opendocument.text-flat-xml', + 'application/vnd.oasis.opendocument.text-master', + 'application/vnd.oasis.opendocument.text-master-template', + 'application/vnd.oasis.opendocument.text-template', + 'application/vnd.oasis.opendocument.text-web', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'application/vnd.sun.xml.calc', + 'application/vnd.sun.xml.calc.template', + 'application/vnd.sun.xml.chart', + 'application/vnd.sun.xml.draw', + 'application/vnd.sun.xml.draw.template', + 'application/vnd.sun.xml.impress', + 'application/vnd.sun.xml.impress.template', + 'application/vnd.sun.xml.math', + 'application/vnd.sun.xml.writer', + 'application/vnd.sun.xml.writer.global', + 'application/vnd.sun.xml.writer.template', + 'application/vnd.visio', + 'application/vnd.visio2013', + 'application/vnd.wordperfect', + 'application/x-abiword', + 'application/x-aportisdoc', + 'application/x-dbase', + 'application/x-dif-document', + 'application/x-fictionbook+xml', + 'application/x-gnumeric', + 'application/x-hwp', + 'application/x-iwork-keynote-sffkey', + 'application/x-iwork-numbers-sffnumbers', + 'application/x-iwork-pages-sffpages', + 'application/x-mspublisher', + 'application/x-mswrite', + 'application/x-pagemaker', + 'application/x-sony-bbeb', + 'application/x-t602', + ] } }, computed: { @@ -268,6 +339,11 @@ export default { }, methods: { ISOToDatetime, + canEditDocument(document) { + console.log(document); + return 'storedObject' in document ? + this.mime.includes(document.storedObject.type) : false; + }, listAllStatus() { console.log('load all status'); let url = `/api/`; From cff126953ed128faf030328963781908a00e6f07 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 25 Mar 2022 11:45:13 +0100 Subject: [PATCH 2/4] Accompanying course evaluation documents: disable the WOPI edit link if no keyInfos --- .../AccompanyingCourseWorkEdit/components/FormEvaluation.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index 181592ba4..e368f51b7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -340,9 +340,8 @@ export default { methods: { ISOToDatetime, canEditDocument(document) { - console.log(document); return 'storedObject' in document ? - this.mime.includes(document.storedObject.type) : false; + this.mime.includes(document.storedObject.type) && document.storedObject.keyInfos.length !== 0 : false; }, listAllStatus() { console.log('load all status'); From f36fc0ba6099790e4c3af3aec267208a6b416252 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 25 Mar 2022 11:46:57 +0100 Subject: [PATCH 3/4] upd CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a3031354..a7bcfdf3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to ## Unreleased +* [person] Accompanying course evaluation documents: disable the WOPI edit link if mimetype not supported and if no keyInfos +(https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/585) + * [activity] display error messages above the form in creating a new location (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/481) * [activity] show required field in activity edit/new by an asterix in the vuejs fields (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/494) * [ACL] fix allow to see the course, event if the scope'course does not contains the scope's user From c1e972963f904e3339a4d2624b4407d0c27641ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 25 Mar 2022 14:03:43 +0100 Subject: [PATCH 4/4] invert condition with key infos --- .../AccompanyingCourseWorkEdit/components/FormEvaluation.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index e368f51b7..eff62bbbb 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -341,7 +341,7 @@ export default { ISOToDatetime, canEditDocument(document) { return 'storedObject' in document ? - this.mime.includes(document.storedObject.type) && document.storedObject.keyInfos.length !== 0 : false; + this.mime.includes(document.storedObject.type) && document.storedObject.keyInfos.length === 0 : false; }, listAllStatus() { console.log('load all status'); @@ -415,4 +415,4 @@ export default { font-weight: bold; font-size: 1rem; } - \ No newline at end of file +