diff --git a/.changes/unreleased/Feature-20250224-150047.yaml b/.changes/unreleased/Feature-20250224-150047.yaml new file mode 100644 index 000000000..821e7ee5a --- /dev/null +++ b/.changes/unreleased/Feature-20250224-150047.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: Display social actions grouped per social issue within activity form +time: 2025-02-24T15:00:47.139983981+01:00 +custom: + Issue: "363" + 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 b25bd8731..a45d93b2a 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue @@ -68,14 +68,23 @@ socialActionsSelected.length) " > - - + {{ + group.issue + }} + + + diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue index 0d5a6bbf4..8172b2b6f 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue @@ -10,7 +10,9 @@ :value="action" /> @@ -43,5 +45,9 @@ span.badge { font-size: 95%; margin-bottom: 5px; margin-right: 1em; + max-width: 100%; /* Adjust as needed */ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js index c910d7318..f29e2e6d4 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js @@ -124,9 +124,19 @@ const store = createStore({ ); }, socialActionsListSorted(state) { - return [...state.socialActionsList].sort( - (a, b) => a.ordering - b.ordering, - ); + return [...state.socialActionsList] + .sort((a, b) => a.ordering - b.ordering) + .reduce((acc, action) => { + const issueText = action.issue?.text || "Uncategorized"; + // Find if the group for the issue already exists + let group = acc.find((item) => item.issue === issueText); + if (!group) { + group = { issue: issueText, actions: [] }; + acc.push(group); + } + group.actions.push(action); + return acc; + }, []); }, }, mutations: {