mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix display elements order
selectAndSuggested method in store getter, is callable in all components, and make union of two arrays: suggested and selected * we need to have selected in last position (required for isChecked method to work well) * but we want to display selected in first position (for better ux) then, we use double inversion to obtain good behaviour
This commit is contained in:
parent
b4ad0128e4
commit
f3260f57a4
@ -29,8 +29,8 @@ let getDataPromise = getAccompanyingCourse(id)
|
||||
).values()
|
||||
];
|
||||
let union = [...new Set([
|
||||
...state.add_persons.selected,
|
||||
...state.add_persons.suggested,
|
||||
...state.add_persons.suggested.slice().reverse(),
|
||||
...state.add_persons.selected.slice().reverse(),
|
||||
])];
|
||||
return uniqBy(union, k => k.id);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<person-suggestion
|
||||
v-for="item in this.selectedAndSuggested"
|
||||
v-for="item in this.selectedAndSuggested.slice().reverse()"
|
||||
v-bind:item="item"
|
||||
v-bind:key="item.id">
|
||||
</person-suggestion>
|
||||
|
Loading…
x
Reference in New Issue
Block a user