Compare commits

...

2 Commits

Author SHA1 Message Date
Tim Gröger 6737bd5b45 update to version 1.1.0 2024-10-08 14:53:22 +02:00
Tim Gröger aa3c172160 [feat] show names by display mode setting 2024-10-08 14:46:44 +02:00
3 changed files with 26 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"license": "MIT", "license": "MIT",
"version": "1.0.0", "version": "1.1.0",
"name": "@flaschengeist/schedule", "name": "@flaschengeist/schedule",
"author": "Ferdinand Thiessen <rpm@fthiessen.de>", "author": "Ferdinand Thiessen <rpm@fthiessen.de>",
"homepage": "https://flaschengeist.dev/Flaschengeist", "homepage": "https://flaschengeist.dev/Flaschengeist",

View File

@ -101,6 +101,7 @@ import { PERMISSIONS } from '../../../permissions';
import TransferInviteDialog from './TransferInviteDialog.vue'; import TransferInviteDialog from './TransferInviteDialog.vue';
import ServiceUserChip from './ServiceUserChip.vue'; import ServiceUserChip from './ServiceUserChip.vue';
import { UserAvatar } from '@flaschengeist/api/components'; import { UserAvatar } from '@flaschengeist/api/components';
import { DisplayNameMode } from '@flaschengeist/users';
export default defineComponent({ export default defineComponent({
name: 'JobSlot', name: 'JobSlot',
@ -123,11 +124,34 @@ export default defineComponent({
const quasar = useQuasar(); const quasar = useQuasar();
// Make sure users are loaded if we can assign them // 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 */ /* Stuff used for general display */
// Get displayname of user // Get displayname of user
function userDisplay(id: string) { 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 (
`${<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; return userStore.findUser(id)?.display_name || id;
} }

View File

@ -159,7 +159,6 @@ export default defineComponent({
}; };
onBeforeMount(async () => { onBeforeMount(async () => {
if (route.query.sent === 'true') { if (route.query.sent === 'true') {
showSent.value = true; showSent.value = true;
} }
@ -178,8 +177,6 @@ export default defineComponent({
await router.replace({ query: { sent: showSent.value ? 'true' : 'false' } }); await router.replace({ query: { sent: showSent.value ? 'true' : 'false' } });
}); });
function getType(row: RowData) { function getType(row: RowData) {
var idx = row.transferee === undefined ? 0 : 1; var idx = row.transferee === undefined ? 0 : 1;
if (row.inviter.userid === mainStore.currentUser.userid) idx += 2; if (row.inviter.userid === mainStore.currentUser.userid) idx += 2;