Skip to content

Commit

Permalink
fixed broken cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Ruf committed Aug 7, 2024
1 parent d69ce78 commit 2c0be0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const participants = computed(() => getParticipants());
const filteredParticipants = computed(() => {
if (getFilter() === '') {
return participants.value.map((participant) => getDisplayName(participant));
return participants.value.map((participant) => getDisplayName(participant, t));
}
return participants.value
.filter((participant) => participant.toLowerCase().includes(getFilter().toLowerCase()))
.map((participant) => getDisplayName(participant));
.map((participant) => getDisplayName(participant, t));
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>
<div class="flex w-full flex-row">
<span>
{{ getDisplayName(participantName) }}
{{ getDisplayName(participantName, t) }}
</span>
<svg
v-if="isOfferingMeal"
Expand Down Expand Up @@ -42,6 +42,9 @@ import type { IBookedData, IMealWithVariations } from '@/api/getShowParticipatio
import ParticipantsTableData from './ParticipantsTableData.vue';
import { computed } from 'vue';
import getDisplayName from '@/services/useConvertDisplayName';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const props = defineProps<{
participantName: string;
Expand Down
6 changes: 1 addition & 5 deletions src/Resources/src/services/useConvertDisplayName.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { useI18n } from 'vue-i18n';

export default function getDisplayName(fullname: string) {
const { t } = useI18n();

export default function getDisplayName(fullname: string, t: (str: string) => string ) {
if (fullname.includes('(Guest)')) {
return `${fullname.split(' (Guest)')[0]} (${t('menu.guest')})`;
}
Expand Down

0 comments on commit 2c0be0a

Please sign in to comment.