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 51957b010..4691a860a 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue @@ -54,19 +54,19 @@ {{ $t('activity.select_first_a_social_issue') }} - + - {{ $t('activity.social_action_list_empty') }} + {{ $t('activity.social_action_list_empty') }} @@ -111,7 +111,7 @@ export default { return this.$store.state.socialIssuesOther; }, socialActionsList() { - return this.$store.state.socialActionsList; + return this.$store.getters.socialActionsListSorted; }, socialActionsSelected() { return this.$store.state.activity.socialActions; diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js index f94381fc2..ca56a5dae 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js @@ -101,6 +101,9 @@ const store = createStore({ state.activity.activityType.thirdPartiesVisible !== 0) ); }, + socialActionsListSorted(state) { + return [ ...state.socialActionsList].sort((a, b) => a.ordering - b.ordering); + }, }, mutations: { // SocialIssueAcc @@ -131,7 +134,6 @@ const store = createStore({ state.socialActionsList = []; }, addActionInList(state, action) { - //console.log('add action list', action.id); state.socialActionsList.push(action); }, updateActionsSelected(state, actions) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php index e210e1c4f..52ba07a93 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php @@ -40,6 +40,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte 'desactivationDate' => $this->normalizer->normalize($socialAction->getDesactivationDate(), $format, $context), 'title' => $socialAction->getTitle(), 'issue' => $this->normalizer->normalize($socialAction->getIssue(), $format, $context), + 'ordering' => $socialAction->getOrdering(), ]; case 'docgen':