diff --git a/components/Fields/Field.vue b/components/Fields/Field.vue index 1d32afe04..349b51dbe 100644 --- a/components/Fields/Field.vue +++ b/components/Fields/Field.vue @@ -230,8 +230,8 @@ export default defineNuxtComponent({ v-else-if="isWebsite" :key="`website_${item}`" > - - {{ item }} + + {{ context !== 'label_list' ? item : '' }} @@ -240,8 +240,8 @@ export default defineNuxtComponent({ v-else-if="field.field === 'email'" :key="`email_${item}`" > - - {{ item }} + + {{ context !== 'label_list' ? item : '' }} diff --git a/components/Layout/Header.vue b/components/Layout/Header.vue index 40ec50333..97729d7e5 100644 --- a/components/Layout/Header.vue +++ b/components/Layout/Header.vue @@ -43,6 +43,8 @@ export default defineNuxtComponent({ :logo-url="theme && theme.logo_url" /> + +
diff --git a/components/PoisList/Actions.vue b/components/PoisList/Actions.vue index a1ba8b3a3..c9e674fa0 100644 --- a/components/PoisList/Actions.vue +++ b/components/PoisList/Actions.vue @@ -2,10 +2,11 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' import type { PropType } from 'vue' -import { defineNuxtComponent, useRequestHeaders } from '#app' +import { defineNuxtComponent } from '#app' import IconButton from '~/components/UI/IconButton.vue' import IconsBar from '~/components/UI/IconsBar.vue' import { getPoiByCategoryIdUrl } from '~/lib/apiPois' +import { siteStore as useSiteStore } from '~/stores/site' export default defineNuxtComponent({ components: { @@ -13,7 +14,6 @@ export default defineNuxtComponent({ IconsBar, IconButton, }, - props: { categoryId: { type: Number, @@ -42,7 +42,7 @@ export default defineNuxtComponent({ methods: { url(format: 'geojson' | 'csv'): string { return getPoiByCategoryIdUrl( - this.$vidoConfig(useRequestHeaders()), + useSiteStore().config!, this.categoryId, { geometry_as: 'point', diff --git a/components/PoisList/PoisList.vue b/components/PoisList/PoisList.vue deleted file mode 100644 index a43f1e20f..000000000 --- a/components/PoisList/PoisList.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - - - diff --git a/components/PoisList/PoisTable.vue b/components/PoisList/PoisTable.vue index eb2715f83..d4ac6647d 100644 --- a/components/PoisList/PoisTable.vue +++ b/components/PoisList/PoisTable.vue @@ -1,98 +1,180 @@ - + + diff --git a/components/UI/CookiesConsent.vue b/components/UI/CookiesConsent.vue index c3c09dd40..96048b02e 100644 --- a/components/UI/CookiesConsent.vue +++ b/components/UI/CookiesConsent.vue @@ -5,6 +5,7 @@ import type { VidoConfig } from '~/utils/types-config' import { defineNuxtComponent, useRequestHeaders } from '#app' import 'vue-cookie-accept-decline/dist/vue-cookie-accept-decline.css' import ExternalLink from '~/components/UI/ExternalLink.vue' +import { siteStore as useSiteStore } from '~/stores/site' export default defineNuxtComponent({ components: { @@ -14,7 +15,7 @@ export default defineNuxtComponent({ computed: { vidoConfig(): VidoConfig { - return this.$vidoConfig(useRequestHeaders()) + return useSiteStore().config || this.$vidoConfig(useRequestHeaders()) }, doNotTrack(): boolean { diff --git a/cypress/e2e/category/pois-list.cy.ts b/cypress/e2e/category/pois-list.cy.ts index e67a3f9a4..de52396dd 100644 --- a/cypress/e2e/category/pois-list.cy.ts +++ b/cypress/e2e/category/pois-list.cy.ts @@ -10,6 +10,15 @@ const hostnames = { 'http://127.0.0.1:3000': '/fixtures/teritorio/references/', } +const htmlValidateRules = { + rules: { + 'no-dup-class': 0, + 'wcag/h63': 0, + 'input-missing-label': 0, + 'element-permitted-content': 0, + }, +} + describe('pois table', () => { beforeEach(() => { mockSSRAPI(hostnames, teritorioReferenceAPIFixture, { @@ -30,7 +39,7 @@ describe('pois table', () => { cy.get('td') .contains(teritorioReferenceAPIFixture.pois.features[0].properties.name as string) - cy.htmlvalidate() + cy.htmlvalidate(htmlValidateRules) }) it('should be interative', () => { @@ -50,6 +59,6 @@ describe('pois table', () => { // Unselect the selector before validate cy.get('body').click() - cy.htmlvalidate() + cy.htmlvalidate(htmlValidateRules) }) }) diff --git a/eslint.config.js b/eslint.config.js index 666cddc0c..ceed83de6 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -9,6 +9,7 @@ export default antfu( files: ['**/*.vue'], rules: { 'vue/no-unused-refs': 0, + 'vue/valid-v-slot': 0, }, }, { diff --git a/lib/apiMenu.ts b/lib/apiMenu.ts index b7f21350e..ac11ef687 100644 --- a/lib/apiMenu.ts +++ b/lib/apiMenu.ts @@ -114,8 +114,8 @@ export interface MenuGroup extends ApiMenuGroup { export type MenuItem = MenuGroup | ApiMenuLink | ApiMenuCategory -export function getMenu(vidoConfig: VidoConfig): Promise { - return fetch( +export async function getMenu(vidoConfig: VidoConfig): Promise { + return await fetch( `${vidoConfig.API_ENDPOINT}/${vidoConfig.API_PROJECT}/${vidoConfig.API_THEME}/menu.json`, ).then((data) => { if (data.ok) { diff --git a/lib/apiPois.ts b/lib/apiPois.ts index 385ee4dfd..fa6c63fd7 100644 --- a/lib/apiPois.ts +++ b/lib/apiPois.ts @@ -166,13 +166,13 @@ export function getPoiByCategoryIdUrl( ) } -export function getPoiByCategoryId( +export async function getPoiByCategoryId( vidoConfig: VidoConfig, categoryId: number | string, options: ApiPoisOptions = {}, ): Promise { options = Object.assign(defaultOptions, { geometry_as: 'point' }, options) - return fetch(getPoiByCategoryIdUrl(vidoConfig, categoryId, options)).then( + return await fetch(getPoiByCategoryIdUrl(vidoConfig, categoryId, options)).then( (data) => { if (data.ok) { return data.json() as unknown as ApiPois diff --git a/lib/apiSettings.ts b/lib/apiSettings.ts index 23334be8c..8778a1328 100644 --- a/lib/apiSettings.ts +++ b/lib/apiSettings.ts @@ -50,8 +50,8 @@ export interface Settings { themes: SiteInfosTheme[] } -export function getSettings(vidoConfig: VidoConfig): Promise { - return fetch( +export async function getSettings(vidoConfig: VidoConfig): Promise { + return await fetch( `${vidoConfig.API_ENDPOINT}/${vidoConfig.API_PROJECT}/${vidoConfig.API_THEME}/settings.json`, ) .then((data) => { diff --git a/locales/en-GB.ts b/locales/en-GB.ts index c99fc5b88..875ff7b33 100644 --- a/locales/en-GB.ts +++ b/locales/en-GB.ts @@ -138,6 +138,7 @@ export default defineI18nLocale(() => { details: 'Details', downloadCsv: 'Download in CSV', downloadGeojson: 'Download in GeoJSON', + search: 'Search into the list', showOnMap: 'Show on Map', }, categorySelector: { diff --git a/locales/es-ES.ts b/locales/es-ES.ts index 5bee28d1e..d465a04f2 100644 --- a/locales/es-ES.ts +++ b/locales/es-ES.ts @@ -138,6 +138,7 @@ export default defineI18nLocale(() => { details: 'Detalles', downloadCsv: 'Descargar como CSV', downloadGeojson: 'Descargar como GeoJSON', + search: 'Buscar en la lista', showOnMap: 'Mostrar en el mapa', }, categorySelector: { diff --git a/locales/fr-FR.ts b/locales/fr-FR.ts index 2f01b1d70..34215eee9 100644 --- a/locales/fr-FR.ts +++ b/locales/fr-FR.ts @@ -139,6 +139,7 @@ export default defineI18nLocale(() => { details: 'Détails', downloadCsv: 'Télécharger en CSV', downloadGeojson: 'Télécharger en GeoJSON', + search: 'Recherchez dans la liste', showOnMap: 'Afficher sur la carte', }, categorySelector: { diff --git a/pages/category/[id].vue b/pages/category/[id].vue index b4d9894d5..c8428c901 100644 --- a/pages/category/[id].vue +++ b/pages/category/[id].vue @@ -1,171 +1,136 @@ -