diff --git a/src/components/overview/slots/JobSlot.vue b/src/components/overview/slots/JobSlot.vue index 8063ec0..5853a80 100644 --- a/src/components/overview/slots/JobSlot.vue +++ b/src/components/overview/slots/JobSlot.vue @@ -101,6 +101,7 @@ import { PERMISSIONS } from '../../../permissions'; import TransferInviteDialog from './TransferInviteDialog.vue'; import ServiceUserChip from './ServiceUserChip.vue'; import { UserAvatar } from '@flaschengeist/api/components'; +import { DisplayNameMode } from '@flaschengeist/users'; export default defineComponent({ name: 'JobSlot', @@ -123,11 +124,34 @@ export default defineComponent({ const quasar = useQuasar(); // Make sure users are loaded if we can assign them - onBeforeMount(() => void userStore.getUsers()); + onBeforeMount(() => { + void userStore.getUsers(); + void userStore.getDisplayNameModeSetting(true); + }); /* Stuff used for general display */ // Get displayname of user function userDisplay(id: string) { + 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 ( + `${userStore.findUser(id)?.firstname} ${( + userStore.findUser(id)?.lastname + )}` || id + ); + case DisplayNameMode.LASTNAME_FIRSTNAME: + return ( + `${userStore.findUser(id)?.lastname}, ${( + userStore.findUser(id)?.firstname + )}` || id + ); + } return userStore.findUser(id)?.display_name || id; } diff --git a/src/pages/EventRequests.vue b/src/pages/EventRequests.vue index 3ab5e2e..20cfa7d 100644 --- a/src/pages/EventRequests.vue +++ b/src/pages/EventRequests.vue @@ -159,7 +159,6 @@ export default defineComponent({ }; onBeforeMount(async () => { - if (route.query.sent === 'true') { showSent.value = true; } @@ -178,8 +177,6 @@ export default defineComponent({ await router.replace({ query: { sent: showSent.value ? 'true' : 'false' } }); }); - - function getType(row: RowData) { var idx = row.transferee === undefined ? 0 : 1; if (row.inviter.userid === mainStore.currentUser.userid) idx += 2;