mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Export: in filter "Filter accompanying period work (social action) by type, goal and result", order the items alphabetically or with the defined order
This commit is contained in:
parent
ff344dbb0c
commit
89e19502d3
6
.changes/unreleased/Feature-20231116-115315.yaml
Normal file
6
.changes/unreleased/Feature-20231116-115315.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
kind: Feature
|
||||
body: 'Export: in filter "Filter accompanying period work (social action) by type,
|
||||
goal and result", order the items alphabetically or with the defined order'
|
||||
time: 2023-11-16T11:53:15.32989153+01:00
|
||||
custom:
|
||||
Issue: "161"
|
@ -14,7 +14,7 @@
|
||||
:multiple="true"
|
||||
:close-on-select="false"
|
||||
:placeholder="$t('action.placeholder')"
|
||||
label="text"
|
||||
:custom-label="formatSocialAction"
|
||||
track-by="id"
|
||||
:searchable="true"
|
||||
></VueMultiselect>
|
||||
@ -161,7 +161,29 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async getSocialActionsList() {
|
||||
this.actions.options = await getSocialActions();
|
||||
let actions = await getSocialActions();
|
||||
this.actions.options = actions.toSorted(function (a, b) {
|
||||
console.log(a, b);
|
||||
if (a.issue.ordering === b.issue.ordering) {
|
||||
if (a.ordering === b.ordering) {
|
||||
return 0;
|
||||
}
|
||||
if (a.ordering < b.ordering) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (a.issue.ordering < b.issue.ordering) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
})
|
||||
},
|
||||
|
||||
formatSocialAction({text, issue}) {
|
||||
return text + ' (' + issue.text + ')';
|
||||
},
|
||||
|
||||
/**
|
||||
@ -263,6 +285,7 @@ export default {
|
||||
if (dump.length > 0) {
|
||||
//console.log('push ' + dump.length + ' elems in', target, dump);
|
||||
}
|
||||
data.sort();
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -35,6 +35,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz
|
||||
'children_ids' => $socialIssue->getChildren()->map(static fn (SocialIssue $si) => $si->getId()),
|
||||
'title' => $socialIssue->getTitle(),
|
||||
'text' => $this->render->renderString($socialIssue, []),
|
||||
'ordering' => $socialIssue->getOrdering(),
|
||||
];
|
||||
|
||||
case 'docgen':
|
||||
|
Loading…
x
Reference in New Issue
Block a user