Compare commits
No commits in common. "develop" and "main" have entirely different histories.
|
@ -101,7 +101,7 @@ import { PERMISSIONS } from '../../../permissions';
|
|||
import TransferInviteDialog from './TransferInviteDialog.vue';
|
||||
import ServiceUserChip from './ServiceUserChip.vue';
|
||||
import { UserAvatar } from '@flaschengeist/api/components';
|
||||
import { showName } from '@flaschengeist/users';
|
||||
import { DisplayNameMode } from '@flaschengeist/users';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'JobSlot',
|
||||
|
@ -132,9 +132,27 @@ export default defineComponent({
|
|||
/* Stuff used for general display */
|
||||
// Get displayname of user
|
||||
function userDisplay(id: string) {
|
||||
const user = userStore.findUser(id);
|
||||
|
||||
return user ? showName(user) : id;
|
||||
switch (userStore.userSettings.display_name) {
|
||||
case DisplayNameMode.FIRSTNAME:
|
||||
return userStore.findUser(id)?.firstname || id;
|
||||
case DisplayNameMode.LASTNAME:
|
||||
return userStore.findUser(id)?.lastname || id;
|
||||
case DisplayNameMode.DISPLAYNAME:
|
||||
return userStore.findUser(id)?.display_name || id;
|
||||
case DisplayNameMode.FIRSTNAME_LASTNAME:
|
||||
return (
|
||||
`${<string>userStore.findUser(id)?.firstname} ${<string>(
|
||||
userStore.findUser(id)?.lastname
|
||||
)}` || id
|
||||
);
|
||||
case DisplayNameMode.LASTNAME_FIRSTNAME:
|
||||
return (
|
||||
`${<string>userStore.findUser(id)?.lastname}, ${<string>(
|
||||
userStore.findUser(id)?.firstname
|
||||
)}` || id
|
||||
);
|
||||
}
|
||||
return userStore.findUser(id)?.display_name || id;
|
||||
}
|
||||
|
||||
// The name of the current job
|
||||
|
|
|
@ -21,7 +21,6 @@ import { useUserStore } from '@flaschengeist/api';
|
|||
import { PropType, computed, defineComponent, onBeforeMount, ref, watch } from 'vue';
|
||||
|
||||
import { UserAvatar } from '@flaschengeist/api/components';
|
||||
import { showName } from '@flaschengeist/users';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ServiceUserChip',
|
||||
|
@ -51,7 +50,7 @@ export default defineComponent({
|
|||
async () => (user.value = await userStore.getUser(props.modelValue.userid))
|
||||
);
|
||||
|
||||
const displayName = computed(() => (user.value ? showName(user.value) : '...'));
|
||||
const displayName = computed(() => user.value?.display_name || '...');
|
||||
const serviceValue = computed(() =>
|
||||
props.modelValue.value.toFixed(Number.isInteger(props.modelValue.value) ? 0 : 1)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue