Merge branch 'issue571_ordering_socialactions' into 'master'

Ordering social actions

See merge request Chill-Projet/chill-bundles!412
This commit is contained in:
Julien Fastré 2022-04-25 20:14:59 +00:00
commit 329fb05db0
3 changed files with 16 additions and 13 deletions

View File

@ -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;

View File

@ -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) {

View File

@ -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':