Skip to content

Commit

Permalink
feat: adapt field display on list page #172
Browse files Browse the repository at this point in the history
  • Loading branch information
wazolab committed Mar 5, 2024
1 parent fba4b01 commit f4e4a63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/Fields/Field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default defineNuxtComponent({
:key="`website_${item}`"
>
<ExternalLink :href="item">
{{ item }}
{{ context !== 'label_list' ? item : '' }}
</ExternalLink>
</div>

Expand All @@ -241,7 +241,7 @@ export default defineNuxtComponent({
:key="`email_${item}`"
>
<ExternalLink :href="`mailto:${item}`" icon="envelope">
{{ item }}
{{ context !== 'label_list' ? item : '' }}
</ExternalLink>
</div>

Expand Down
6 changes: 5 additions & 1 deletion components/PoisList/PoisTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ const headers = computed((): Array<DataTableHeader> => {
function customFilter(value: any, query: string): boolean {
return query !== null && value !== null && typeof value === 'string' && value.toLowerCase().includes(query.toLowerCase())
}
function getContext(key: string) {
return key === 'opening_hours' ? PropertyTranslationsContextEnum.Card : PropertyTranslationsContextEnum.List
}
</script>

<template>
Expand Down Expand Up @@ -150,7 +154,7 @@ function customFilter(value: any, query: string): boolean {
</IconButton>
<Field
v-else
:context="PropertyTranslationsContextEnum.List"
:context="getContext(col.key)"
:recursion-stack="[col.key]"
:field="{ field: col.key }"
:details="t('poisTable.details')"
Expand Down

0 comments on commit f4e4a63

Please sign in to comment.