From 84cf11933d684421093eaf36001e24731587726a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 5 Jun 2025 10:12:16 +0200 Subject: [PATCH 1/3] Fix loading of classlists in SocialIssuesAcc.vue --- .changes/unreleased/Fixed-20250605-101314.yaml | 6 ++++++ package.json | 1 + .../vuejs/Activity/components/SocialIssuesAcc.vue | 15 +++++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/Fixed-20250605-101314.yaml diff --git a/.changes/unreleased/Fixed-20250605-101314.yaml b/.changes/unreleased/Fixed-20250605-101314.yaml new file mode 100644 index 000000000..e01274cde --- /dev/null +++ b/.changes/unreleased/Fixed-20250605-101314.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Fix loading of classLists in SocialIssuesAcc.vue, ensure elements are present +time: 2025-06-05T10:13:14.351260769+02:00 +custom: + Issue: "" + SchemaChange: No schema change diff --git a/package.json b/package.json index a013df3da..1b4c7df13 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/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue index a45d93b2a..18e090fc8 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue @@ -136,8 +136,8 @@ export default { issueIsLoading: false, actionIsLoading: false, actionAreLoaded: false, - socialIssuesClassList: `col-form-label ${document.querySelector("input#chill_activitybundle_activity_socialIssues").getAttribute("required") ? "required" : ""}`, - socialActionsClassList: `col-form-label ${document.querySelector("input#chill_activitybundle_activity_socialActions").getAttribute("required") ? "required" : ""}`, + socialIssuesClassList: 'col-form-label', + socialActionsClassList: 'col-form-label', }; }, computed: { @@ -158,6 +158,17 @@ export default { }, }, mounted() { + /* Load classNames after element is present */ + const socialActionsEl = document.querySelector("input#chill_activitybundle_activity_socialActions"); + if (socialActionsEl && socialActionsEl.hasAttribute("required")) { + this.socialActionsClassList += ' required'; + } + + const socialIssuessEl = document.querySelector("input#chill_activitybundle_activity_socialIssues"); + if (socialIssuessEl && socialIssuessEl.hasAttribute("required")) { + this.socialIssuesClassList += ' required'; + } + /* Load other issues in multiselect */ this.issueIsLoading = true; this.actionAreLoaded = false; From a7e3b1c5d249232a86adf45f502d9f2c077076f5 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 8 Oct 2025 11:35:24 +0200 Subject: [PATCH 2/3] Use an object (instead of string) for dynamic classList in SocialIssuesAcc.vue component --- .../unreleased/Fixed-20251008-113621.yaml | 6 +++++ .../Activity/components/SocialIssuesAcc.vue | 24 +++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 .changes/unreleased/Fixed-20251008-113621.yaml diff --git a/.changes/unreleased/Fixed-20251008-113621.yaml b/.changes/unreleased/Fixed-20251008-113621.yaml new file mode 100644 index 000000000..75dcd9a4a --- /dev/null +++ b/.changes/unreleased/Fixed-20251008-113621.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Fix loading of social issues and social actions within vue component +time: 2025-10-08T11:36:21.158819835+02:00 +custom: + Issue: "" + SchemaChange: No schema change diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue index 18e090fc8..210f8092f 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue @@ -136,8 +136,14 @@ export default { issueIsLoading: false, actionIsLoading: false, actionAreLoaded: false, - socialIssuesClassList: 'col-form-label', - socialActionsClassList: 'col-form-label', + socialIssuesClassList: { + "col-form-label": true, + required: false, + }, + socialActionsClassList: { + "col-form-label": true, + required: false, + }, }; }, computed: { @@ -159,14 +165,18 @@ export default { }, mounted() { /* Load classNames after element is present */ - const socialActionsEl = document.querySelector("input#chill_activitybundle_activity_socialActions"); + const socialActionsEl = document.querySelector( + "input#chill_activitybundle_activity_socialActions", + ); if (socialActionsEl && socialActionsEl.hasAttribute("required")) { - this.socialActionsClassList += ' required'; + this.socialActionsClassList.required = true; } - const socialIssuessEl = document.querySelector("input#chill_activitybundle_activity_socialIssues"); - if (socialIssuessEl && socialIssuessEl.hasAttribute("required")) { - this.socialIssuesClassList += ' required'; + const socialIssuesEl = document.querySelector( + "input#chill_activitybundle_activity_socialIssues", + ); + if (socialIssuesEl && socialIssuesEl.hasAttribute("required")) { + this.socialIssuesClassList.required = true; } /* Load other issues in multiselect */ From 9089c8959bb2f6f850b3234e1d622a749452390c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 8 Oct 2025 11:35:47 +0000 Subject: [PATCH 3/3] remove ux/translator package in error --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 1b4c7df13..a013df3da 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "@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",