From b0959f8cc5af02c9c197a5807794b9123a4003f3 Mon Sep 17 00:00:00 2001 From: LenaertsJ Date: Fri, 16 May 2025 08:33:56 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Resolve=20"Code=20mort:=20module=20wopi-lin?= =?UTF-8?q?k=20semble=20inutilis=C3=A9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changes/unreleased/DX-20250430-144550.yaml | 6 + package.json | 1 + .../public/module/wopi-link/index.js | 45 ---- .../public/vuejs/_components/OpenWopiLink.vue | 214 ------------------ .../Resources/views/Workflow/index.html.twig | 2 - .../ChillMainBundle/chill.webpack.config.js | 4 - 6 files changed, 7 insertions(+), 265 deletions(-) create mode 100644 .changes/unreleased/DX-20250430-144550.yaml delete mode 100644 src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js delete mode 100644 src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OpenWopiLink.vue diff --git a/.changes/unreleased/DX-20250430-144550.yaml b/.changes/unreleased/DX-20250430-144550.yaml new file mode 100644 index 000000000..7d9f0c32b --- /dev/null +++ b/.changes/unreleased/DX-20250430-144550.yaml @@ -0,0 +1,6 @@ +kind: DX +body: Remove dead code for wopi-link module +time: 2025-04-30T14:45:50.406111606+02:00 +custom: + Issue: "352" + SchemaChange: No schema change diff --git a/package.json b/package.json index 9493bd5dc..15697def7 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@hotwired/stimulus": "^3.0.0", "@luminateone/eslint-baseline": "^1.0.9", "@symfony/stimulus-bridge": "^3.2.0", + "@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets", "@symfony/webpack-encore": "^4.1.0", "@tsconfig/node20": "^20.1.4", "@types/dompurify": "^3.0.5", diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js b/src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js deleted file mode 100644 index 856c12ef4..000000000 --- a/src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js +++ /dev/null @@ -1,45 +0,0 @@ -import { createApp } from "vue"; -import OpenWopiLink from "ChillMainAssets/vuejs/_components/OpenWopiLink"; -import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n"; - -const i18n = _createI18n({}); - -//TODO move to chillDocStore or ChillWopi - -/* - -tags to load module: - - - -*/ - -window.addEventListener("DOMContentLoaded", function (e) { - document - .querySelectorAll('span[data-module="wopi-link"]') - .forEach(function (el) { - createApp({ - template: - '', - components: { - OpenWopiLink, - }, - data() { - return { - wopiUrl: el.dataset.wopiUrl, - type: el.dataset.docType, - options: - el.dataset.options !== "null" - ? JSON.parse(el.dataset.options) - : {}, - }; - }, - }) - .use(i18n) - .mount(el); - }); -}); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OpenWopiLink.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OpenWopiLink.vue deleted file mode 100644 index f323107fa..000000000 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OpenWopiLink.vue +++ /dev/null @@ -1,214 +0,0 @@ - - - - - diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/index.html.twig index 989f2fa72..27af88296 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/index.html.twig @@ -9,7 +9,6 @@ {{ encore_entry_script_tags('mod_pickentity_type') }} {{ encore_entry_script_tags('mod_entity_workflow_subscribe') }} {{ encore_entry_script_tags('page_workflow_show') }} - {{ encore_entry_script_tags('mod_wopi_link') }} {{ encore_entry_script_tags('mod_document_action_buttons_group') }} {{ encore_entry_script_tags('mod_workflow_attachment') }} {% endblock %} @@ -19,7 +18,6 @@ {{ encore_entry_link_tags('mod_pickentity_type') }} {{ encore_entry_link_tags('mod_entity_workflow_subscribe') }} {{ encore_entry_link_tags('page_workflow_show') }} - {{ encore_entry_link_tags('mod_wopi_link') }} {{ encore_entry_link_tags('mod_document_action_buttons_group') }} {{ encore_entry_link_tags('mod_workflow_attachment') }} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/chill.webpack.config.js b/src/Bundle/ChillMainBundle/chill.webpack.config.js index 88b537932..6cc890797 100644 --- a/src/Bundle/ChillMainBundle/chill.webpack.config.js +++ b/src/Bundle/ChillMainBundle/chill.webpack.config.js @@ -86,10 +86,6 @@ module.exports = function (encore, entries) { "mod_entity_workflow_pick", __dirname + "/Resources/public/module/entity-workflow-pick/index.js", ); - encore.addEntry( - "mod_wopi_link", - __dirname + "/Resources/public/module/wopi-link/index.js", - ); encore.addEntry( "mod_pick_postal_code", __dirname + "/Resources/public/module/pick-postal-code/index.js", From 2faf194b15196b452b6bd88bccf9c0c6806cd6aa Mon Sep 17 00:00:00 2001 From: juminet Date: Fri, 16 May 2025 14:40:19 +0000 Subject: [PATCH 2/2] #365 correct works counter in acc course summary --- .../Controller/AccompanyingCourseController.php | 3 +-- .../ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index 0cb3c1473..79b0b8046 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -207,7 +207,6 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle $works = $this->workRepository->findByAccompanyingPeriod( $accompanyingCourse, ['startDate' => 'DESC', 'endDate' => 'DESC'], - 3 ); $counters = [ @@ -220,7 +219,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle 'accompanyingCourse' => $accompanyingCourse, 'withoutHousehold' => $withoutHousehold, 'participationsByHousehold' => $accompanyingCourse->actualParticipationsByHousehold(), - 'works' => $works, + 'works' => \array_slice($works, 0, 3), 'activities' => \array_slice($activities, 0, 3), 'counters' => $counters, ]); diff --git a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php index 8c93f461d..7eb4b63bc 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -87,7 +87,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface ], ]) ->setExtras([ 'order' => 40, - 'counter' => count($period->getOpenWorks()) > 0 ? count($period->getOpenWorks()) : null, + 'counter' => count($period->getWorks()) > 0 ? count($period->getWorks()) : null, ]); }