Skip to content
Snippets Groups Projects
Commit d2f56147 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

add last and first name to dropdown for full name search

parent bf90c008
No related branches found
No related tags found
1 merge request!122REDMINE_ISSUE-10911
This commit is part of merge request !122. Comments created here will be created in the context of that merge request.
......@@ -35,7 +35,15 @@
{ 'active selected': option === selected },
]"
>
{{ option }}
<div v-if="twoParts">
<span v-if="option[0]">
{{ option[0] }} -
</span>
<span class="italic">{{ option[1] }}</span>
</div>
<div v-else>
{{ option }}
</div>
</div>
</div>
</div>
......@@ -52,11 +60,12 @@ export default {
"search",
"placeholder",
"clearable",
"twoParts",
],
computed: {
processedOptions: function () {
//* si un objet {name, value}
//* si un objet {name, value}, ne récupérer que le name
let options = this.options.map((el) =>
el.constructor === Object ? el.name : el
);
......@@ -138,4 +147,7 @@ export default {
.ui.selection.dropdown .menu > .item {
white-space: nowrap;
}
.italic {
font-style: italic;
}
</style>
\ No newline at end of file
......@@ -15,6 +15,7 @@
:selection.sync="newMember.user"
:search="true"
:clearable="true"
:twoParts="true"
/>
<ul id="errorlist" class="errorlist">
<li v-for="error in newMember.errors" :key="error">
......@@ -154,8 +155,12 @@ export default {
return this.projectUsers
.filter((el) => el.userLevel.value === "logged_user")
.map((el) => {
let name = el.user.first_name || "";
if (el.user.last_name) {
name = name + " " + el.user.last_name;
}
return {
name: el.user.username,
name: [name, el.user.username],
value: el.user.id,
};
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment