From f6ee4d91c648ba1be3a48200832ec16e6dd5f1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bult=C3=A9?= Date: Tue, 19 Nov 2024 10:56:47 +0100 Subject: [PATCH 1/2] fix: datasets pagination --- src/components.d.ts | 17 ----------------- src/store/SearchStore.js | 4 ++-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/components.d.ts b/src/components.d.ts index b266844de..2c61250f4 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -23,38 +23,21 @@ declare module 'vue' { DatasetPropertiesFields: typeof import('./components/forms/dataset/DatasetPropertiesFields.vue')['default'] DatasetPropertiesTextFields: typeof import('./components/forms/dataset/DatasetPropertiesTextFields.vue')['default'] DiscussionsList: typeof import('./components/DiscussionsList.vue')['default'] - DsfrAccordion: typeof import('@gouvminint/vue-dsfr')['DsfrAccordion'] - DsfrAccordionsGroup: typeof import('@gouvminint/vue-dsfr')['DsfrAccordionsGroup'] - DsfrAlert: typeof import('@gouvminint/vue-dsfr')['DsfrAlert'] - DsfrBadge: typeof import('@gouvminint/vue-dsfr')['DsfrBadge'] DsfrBreadcrumb: typeof import('@gouvminint/vue-dsfr')['DsfrBreadcrumb'] - DsfrButton: typeof import('@gouvminint/vue-dsfr')['DsfrButton'] - DsfrButtonGroup: typeof import('@gouvminint/vue-dsfr')['DsfrButtonGroup'] - DsfrCard: typeof import('@gouvminint/vue-dsfr')['DsfrCard'] - DsfrCheckbox: typeof import('@gouvminint/vue-dsfr')['DsfrCheckbox'] DsfrFooter: typeof import('@gouvminint/vue-dsfr')['DsfrFooter'] DsfrHeaderMenuLink: typeof import('./components/header/DsfrHeaderMenuLink.vue')['default'] DsfrHeaderMenuLinks: typeof import('@gouvminint/vue-dsfr')['DsfrHeaderMenuLinks'] - DsfrInput: typeof import('@gouvminint/vue-dsfr')['DsfrInput'] DsfrLogo: typeof import('@gouvminint/vue-dsfr')['DsfrLogo'] - DsfrModal: typeof import('@gouvminint/vue-dsfr')['DsfrModal'] DsfrNavigation: typeof import('@gouvminint/vue-dsfr')['DsfrNavigation'] DsfrNavigationItem: typeof import('@gouvminint/vue-dsfr')['DsfrNavigationItem'] DsfrNavigationMenuLink: typeof import('@gouvminint/vue-dsfr')['DsfrNavigationMenuLink'] DsfrNotice: typeof import('@gouvminint/vue-dsfr')['DsfrNotice'] DsfrPagination: typeof import('@gouvminint/vue-dsfr')['DsfrPagination'] - DsfrRadioButton: typeof import('@gouvminint/vue-dsfr')['DsfrRadioButton'] - DsfrRadioButtonSet: typeof import('@gouvminint/vue-dsfr')['DsfrRadioButtonSet'] DsfrSearchBar: typeof import('@gouvminint/vue-dsfr')['DsfrSearchBar'] DsfrSelect: typeof import('@gouvminint/vue-dsfr')['DsfrSelect'] - DsfrTabContent: typeof import('@gouvminint/vue-dsfr')['DsfrTabContent'] - DsfrTabItem: typeof import('@gouvminint/vue-dsfr')['DsfrTabItem'] - DsfrTabs: typeof import('@gouvminint/vue-dsfr')['DsfrTabs'] - DsfrTag: typeof import('@gouvminint/vue-dsfr')['DsfrTag'] ExtendedInformationPanel: typeof import('./components/datasets/ExtendedInformationPanel.vue')['default'] GenericContainer: typeof import('./components/GenericContainer.vue')['default'] HeaderComponent: typeof import('./components/header/HeaderComponent.vue')['default'] - HeaderSearch: typeof import('./components/header/HeaderSearch.vue')['default'] HomeThemes: typeof import('./components/HomeThemes.vue')['default'] LiveRegion: typeof import('./components/LiveRegion.vue')['default'] Navigation: typeof import('./components/Navigation.vue')['default'] diff --git a/src/store/SearchStore.js b/src/store/SearchStore.js index e762c41dd..37fa631d8 100644 --- a/src/store/SearchStore.js +++ b/src/store/SearchStore.js @@ -4,7 +4,7 @@ import config from '@/config' import SearchAPI from '@/services/api/SearchAPI' const searchAPI = new SearchAPI() -const pageSize = 21 +const pageSize = 20 export const useSearchStore = defineStore('search', { state: () => ({ @@ -21,7 +21,7 @@ export const useSearchStore = defineStore('search', { if (!state.data) return [] if (!state.data.total && !state.data.page_size) return [] return [ - ...Array(Math.round(state.data.total / state.data.page_size)).keys() + ...Array(Math.ceil(state.data.total / state.data.page_size)).keys() ].map((page) => { page += 1 return { From aa4342701fb1838b50041f35295fdf7a3e9b270c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bult=C3=A9?= Date: Tue, 19 Nov 2024 11:07:29 +0100 Subject: [PATCH 2/2] revert components.d.ts --- src/components.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/components.d.ts b/src/components.d.ts index 2c61250f4..b266844de 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -23,21 +23,38 @@ declare module 'vue' { DatasetPropertiesFields: typeof import('./components/forms/dataset/DatasetPropertiesFields.vue')['default'] DatasetPropertiesTextFields: typeof import('./components/forms/dataset/DatasetPropertiesTextFields.vue')['default'] DiscussionsList: typeof import('./components/DiscussionsList.vue')['default'] + DsfrAccordion: typeof import('@gouvminint/vue-dsfr')['DsfrAccordion'] + DsfrAccordionsGroup: typeof import('@gouvminint/vue-dsfr')['DsfrAccordionsGroup'] + DsfrAlert: typeof import('@gouvminint/vue-dsfr')['DsfrAlert'] + DsfrBadge: typeof import('@gouvminint/vue-dsfr')['DsfrBadge'] DsfrBreadcrumb: typeof import('@gouvminint/vue-dsfr')['DsfrBreadcrumb'] + DsfrButton: typeof import('@gouvminint/vue-dsfr')['DsfrButton'] + DsfrButtonGroup: typeof import('@gouvminint/vue-dsfr')['DsfrButtonGroup'] + DsfrCard: typeof import('@gouvminint/vue-dsfr')['DsfrCard'] + DsfrCheckbox: typeof import('@gouvminint/vue-dsfr')['DsfrCheckbox'] DsfrFooter: typeof import('@gouvminint/vue-dsfr')['DsfrFooter'] DsfrHeaderMenuLink: typeof import('./components/header/DsfrHeaderMenuLink.vue')['default'] DsfrHeaderMenuLinks: typeof import('@gouvminint/vue-dsfr')['DsfrHeaderMenuLinks'] + DsfrInput: typeof import('@gouvminint/vue-dsfr')['DsfrInput'] DsfrLogo: typeof import('@gouvminint/vue-dsfr')['DsfrLogo'] + DsfrModal: typeof import('@gouvminint/vue-dsfr')['DsfrModal'] DsfrNavigation: typeof import('@gouvminint/vue-dsfr')['DsfrNavigation'] DsfrNavigationItem: typeof import('@gouvminint/vue-dsfr')['DsfrNavigationItem'] DsfrNavigationMenuLink: typeof import('@gouvminint/vue-dsfr')['DsfrNavigationMenuLink'] DsfrNotice: typeof import('@gouvminint/vue-dsfr')['DsfrNotice'] DsfrPagination: typeof import('@gouvminint/vue-dsfr')['DsfrPagination'] + DsfrRadioButton: typeof import('@gouvminint/vue-dsfr')['DsfrRadioButton'] + DsfrRadioButtonSet: typeof import('@gouvminint/vue-dsfr')['DsfrRadioButtonSet'] DsfrSearchBar: typeof import('@gouvminint/vue-dsfr')['DsfrSearchBar'] DsfrSelect: typeof import('@gouvminint/vue-dsfr')['DsfrSelect'] + DsfrTabContent: typeof import('@gouvminint/vue-dsfr')['DsfrTabContent'] + DsfrTabItem: typeof import('@gouvminint/vue-dsfr')['DsfrTabItem'] + DsfrTabs: typeof import('@gouvminint/vue-dsfr')['DsfrTabs'] + DsfrTag: typeof import('@gouvminint/vue-dsfr')['DsfrTag'] ExtendedInformationPanel: typeof import('./components/datasets/ExtendedInformationPanel.vue')['default'] GenericContainer: typeof import('./components/GenericContainer.vue')['default'] HeaderComponent: typeof import('./components/header/HeaderComponent.vue')['default'] + HeaderSearch: typeof import('./components/header/HeaderSearch.vue')['default'] HomeThemes: typeof import('./components/HomeThemes.vue')['default'] LiveRegion: typeof import('./components/LiveRegion.vue')['default'] Navigation: typeof import('./components/Navigation.vue')['default']