feat: improve user assignments via quick add magic #3348

Merged
konrad merged 18 commits from feature/better-user-search-assignees into main 2023-06-05 15:03:16 +00:00
3 changed files with 5 additions and 7 deletions
Showing only changes of commit 57c64bbf71 - Show all commits

View File

@ -20,7 +20,8 @@
:user="n.notification.doer"
:show-username="false"
:avatar-size="16"
v-if="n.notification.doer"/>
v-if="n.notification.doer"
/>
<div class="detail">
<div>
<span class="has-text-weight-bold mr-1" v-if="n.notification.doer">

View File

@ -12,14 +12,14 @@
>
<template #tag="{item: user}">
<span class="assignee">
<user :avatar-size="32" :show-username="false" :user="user"/>
<user :avatar-size="32" :show-username="false" :user="user" class="m-2"/>
<BaseButton @click="removeAssignee(user)" class="remove-assignee" v-if="!disabled">
<icon icon="times"/>
</BaseButton>
</span>
</template>
<template #searchResult="{option: user}">
<user :avatar-size="24" :show-username="true" :user="user" class="user-search-result"/>
<user :avatar-size="24" :show-username="true" :user="user"/>
dpschen marked this conversation as resolved Outdated

Use a prop here and change user so that it doesn't add a margin.

Reason: If we want to remove the margin in general from the user component later (which we should and I think I have done that already in some branch) then it will be much easier if we don't have classes that have dependencies that we are not aware of.

Sum up:

  • setting margin from outside of components is fine
  • unsetting margin from outside if there is already one from inside (which shouldn't be there in the first place) is not fine.
Use a prop here and change user so that it doesn't add a margin. Reason: If we want to remove the margin in general from the user component later (which we should and I think I have done that already in some branch) then it will be much easier if we don't have classes that have dependencies that we are not aware of. Sum up: - setting margin from outside of components is fine - unsetting margin from outside if there is already one from inside (which shouldn't be there in the first place) is not fine.

My first gut-reaction was, "but the user component is used a lot! That's quite a bit of effort to change it everywhere!". Then I started looking into and as it turns out, there are only 3 places where the margin from the component is not overridden from the outer component. That made it easier and kind of proved your point :)

My first gut-reaction was, "but the user component is used a lot! That's quite a bit of effort to change it everywhere!". Then I started looking into and as it turns out, there are only 3 places where the margin from the component _is not_ overridden from the outer component. That made it easier and kind of proved your point :)
</template>
</Multiselect>
</template>
@ -149,8 +149,4 @@ async function findUser(query: string) {
height: 18px;
z-index: 100;
}
.user-search-result {
margin: 0;
}
</style>

View File

@ -56,6 +56,7 @@
:key="task.id + 'assignee' + a.id + i"
:show-username="false"
:user="a"
class="m-2"
/>
<!-- FIXME: use popup -->