>('GET', `/api/participations/day/${date}`);
useParticipationsError.value = error.value;
if (loaded.value === false) {
await request();
loaded.value = true;
- listDataState.value = listData.value as string[];
+ listDataState.value = Object.values(listData.value ?? {});
}
}
+
return {
useParticipationsError,
listData: readonly(listDataState),
diff --git a/src/Resources/src/components/dashboard/MealData.vue b/src/Resources/src/components/dashboard/MealData.vue
index e4c111793..2f49f3ed2 100644
--- a/src/Resources/src/components/dashboard/MealData.vue
+++ b/src/Resources/src/components/dashboard/MealData.vue
@@ -11,6 +11,7 @@
{{ title }}
diff --git a/src/Resources/src/components/dashboard/VariationsData.vue b/src/Resources/src/components/dashboard/VariationsData.vue
index 2463f90ef..66cc12f3a 100644
--- a/src/Resources/src/components/dashboard/VariationsData.vue
+++ b/src/Resources/src/components/dashboard/VariationsData.vue
@@ -18,6 +18,7 @@
{{ locale.substring(0, 2) === 'en' ? variation.title.en : variation.title.de }}
diff --git a/src/Resources/src/components/dishes/DishTableRow.vue b/src/Resources/src/components/dishes/DishTableRow.vue
index cae0d1493..e3c908c9d 100644
--- a/src/Resources/src/components/dishes/DishTableRow.vue
+++ b/src/Resources/src/components/dishes/DishTableRow.vue
@@ -12,7 +12,7 @@
|
{
if (showParticipations.value === true) {
isLoading.value = true;
- participations.value = (await getParticipantsForEvent(props.date)) as string[];
+ participations.value = ((await getParticipantsForEvent(props.date)) as string[]).sort();
isLoading.value = false;
}
});
diff --git a/src/Resources/src/components/guest/GuestMeal.vue b/src/Resources/src/components/guest/GuestMeal.vue
index f705bc201..5006d92d7 100644
--- a/src/Resources/src/components/guest/GuestMeal.vue
+++ b/src/Resources/src/components/guest/GuestMeal.vue
@@ -8,6 +8,7 @@
{{ title }}
diff --git a/src/Resources/src/components/guest/GuestVariation.vue b/src/Resources/src/components/guest/GuestVariation.vue
index b10acd144..78e550a4e 100644
--- a/src/Resources/src/components/guest/GuestVariation.vue
+++ b/src/Resources/src/components/guest/GuestVariation.vue
@@ -18,6 +18,7 @@
{{ locale.substring(0, 2) === 'en' ? variation.title.en : variation.title.de }}
diff --git a/src/Resources/src/components/menuParticipants/AddParticipantsSearchBar.vue b/src/Resources/src/components/menuParticipants/AddParticipantsSearchBar.vue
index 86283b818..9760a8d70 100644
--- a/src/Resources/src/components/menuParticipants/AddParticipantsSearchBar.vue
+++ b/src/Resources/src/components/menuParticipants/AddParticipantsSearchBar.vue
@@ -92,7 +92,7 @@ const props = defineProps<{
weekId: number;
}>();
-const { ProfilesState, fetchAbsentingProfiles } = useProfiles(props.weekId);
+const { ProfilesState, fetchAbsentingProfiles, getDisplayName } = useProfiles(props.weekId);
const { t } = useI18n();
const slot = useSlots();
@@ -130,13 +130,6 @@ const filteredProfiles = computed(() => {
});
});
-function getDisplayName(profile: IProfile) {
- if (profile.roles.includes('ROLE_GUEST')) {
- return `(${t('menu.guest')}) ${profile.fullName}`;
- }
- return profile.fullName;
-}
-
function handleClick() {
openProp.value = true;
useDetectClickOutside(combobox, () => (openProp.value = false));
diff --git a/src/Resources/src/components/menuParticipants/MenuTable.vue b/src/Resources/src/components/menuParticipants/MenuTable.vue
index 6b3d913e1..9222a41c9 100644
--- a/src/Resources/src/components/menuParticipants/MenuTable.vue
+++ b/src/Resources/src/components/menuParticipants/MenuTable.vue
@@ -20,7 +20,6 @@ import MenuTableBody from '@/components/menuParticipants/MenuTableBody.vue';
import MenuTableHead from './MenuTableHead.vue';
import { useProgress } from '@marcoschulte/vue3-progress';
import LoadingSpinner from '../misc/LoadingSpinner.vue';
-import process from 'node:process';
const props = defineProps<{
weekId: number;
@@ -49,7 +48,7 @@ onMounted(async () => {
});
// expose functions for testing
-if (process?.env?.NODE_ENV === 'TEST') {
+if (import.meta.env.VITE_ENV === 'TEST') {
defineExpose({ loaded });
}
diff --git a/src/Resources/src/components/menuParticipants/MenuTableBody.vue b/src/Resources/src/components/menuParticipants/MenuTableBody.vue
index 346589bcb..117d7f81b 100644
--- a/src/Resources/src/components/menuParticipants/MenuTableBody.vue
+++ b/src/Resources/src/components/menuParticipants/MenuTableBody.vue
@@ -32,6 +32,7 @@ import { useI18n } from 'vue-i18n';
import MenuTableRow from './MenuTableRow.vue';
import MenuTableDataRows from '@/components/menuParticipants/MenuTableDataRows.vue';
import { computed } from 'vue';
+import getDisplayName from '@/services/useConvertDisplayName';
const props = defineProps<{
weekId: number;
@@ -43,7 +44,12 @@ const { t } = useI18n();
const participants = computed(() => getParticipants());
const filteredParticipants = computed(() => {
- if (getFilter() === '') return participants.value;
- return participants.value.filter((participant) => participant.toLowerCase().includes(getFilter().toLowerCase()));
+ if (getFilter() === '') {
+ return participants.value.map((participant) => getDisplayName(participant, t));
+ }
+
+ return participants.value
+ .filter((participant) => participant.toLowerCase().includes(getFilter().toLowerCase()))
+ .map((participant) => getDisplayName(participant, t));
});
diff --git a/src/Resources/src/components/misc/VeggiIcon.vue b/src/Resources/src/components/misc/VeggiIcon.vue
index fb3c9931a..3a82425ca 100644
--- a/src/Resources/src/components/misc/VeggiIcon.vue
+++ b/src/Resources/src/components/misc/VeggiIcon.vue
@@ -1,5 +1,5 @@
-
+
-
-
- {{ t('flashMessage.success.participations.no') }}
-
-
- {{ participant }}
+
+
+ {{ getDisplayName(participant) }}
|
|
+
+ {{ t('flashMessage.success.participations.no') }}
+
diff --git a/src/Resources/src/components/participations/ParticipantsTableRow.vue b/src/Resources/src/components/participations/ParticipantsTableRow.vue
index 577a8952e..1e99bd0d0 100644
--- a/src/Resources/src/components/participations/ParticipantsTableRow.vue
+++ b/src/Resources/src/components/participations/ParticipantsTableRow.vue
@@ -6,7 +6,7 @@
>
- {{ participantName }}
+ {{ getDisplayName(participantName, t) }}
|