person: display user in the modal 'search person'

This commit is contained in:
nobohan 2021-11-03 15:58:16 +01:00
parent ec6828f128
commit c8b0d62d46
2 changed files with 54 additions and 0 deletions

View File

@ -20,18 +20,25 @@
v-bind:item="item"> v-bind:item="item">
</suggestion-third-party> </suggestion-third-party>
<suggestion-user
v-if="item.result.type === 'user'"
v-bind:item="item">
</suggestion-user>
</div> </div>
</template> </template>
<script> <script>
import SuggestionPerson from './TypePerson'; import SuggestionPerson from './TypePerson';
import SuggestionThirdParty from './TypeThirdParty'; import SuggestionThirdParty from './TypeThirdParty';
import SuggestionUser from './TypeUser';
export default { export default {
name: 'PersonSuggestion', name: 'PersonSuggestion',
components: { components: {
SuggestionPerson, SuggestionPerson,
SuggestionThirdParty, SuggestionThirdParty,
SuggestionUser,
}, },
props: [ props: [
'item', 'item',

View File

@ -0,0 +1,47 @@
<template>
<div class="container usercontainer">
<div class="user-identification">
<span class="name">
{{ item.result.text }}
</span>
</div>
</div>
<div class="right_actions">
<span class="badge rounded-pill bg-secondary">
{{ $t('user')}}
</span>
</div>
</template>
<script>
const i18n = {
messages: {
fr: {
user: 'T(M)S' // TODO how to define other translations?
}
}
};
export default {
name: 'SuggestionUser',
props: ['item'],
i18n,
computed: {
hasParent() {
return this.$props.item.result.parent !== null;
},
}
}
</script>
<style lang="scss" scoped>
.usercontainer {
.userparent {
.name {
font-weight: bold;
font-variant: all-small-caps;
}
}
}
</style>