From 755c3c7e8b6859bed4d553fee6d1ea7e57862aec Mon Sep 17 00:00:00 2001 From: Remi PLANEL <rplanel@pasteur.fr> Date: Thu, 5 Oct 2023 22:14:52 +0200 Subject: [PATCH] no more column in datatable slots --- components/Nav/Navbar.vue | 4 +-- components/content/ListSystems.vue | 54 +++++++----------------------- composables/useRefinedUrl.ts | 1 - pages/defense-systems.vue | 3 +- 4 files changed, 17 insertions(+), 45 deletions(-) diff --git a/components/Nav/Navbar.vue b/components/Nav/Navbar.vue index 320f273f..b4271499 100644 --- a/components/Nav/Navbar.vue +++ b/components/Nav/Navbar.vue @@ -22,8 +22,8 @@ const sections = ref([ href: runtimeConfig.public.defenseFinderWebservice, }, { id: "wiki", label: "Wiki", to: '/', }, - { id: "refseq", label: "REFSEQ", to: '/refseq' }, - { id: "help", label: "Help", to: '/help' }, + { id: "refseq", label: "REFSEQ", to: '/refseq/' }, + { id: "help", label: "Help", to: '/help/' }, ]); diff --git a/components/content/ListSystems.vue b/components/content/ListSystems.vue index ad355346..7816bd5b 100644 --- a/components/content/ListSystems.vue +++ b/components/content/ListSystems.vue @@ -41,57 +41,29 @@ initPfam(); <v-toolbar color="primary"> <v-toolbar-title>Defense Systems</v-toolbar-title> - <v-text-field - v-model="search" - density="compact" - variant="underlined" - prepend-inner-icon="mdi-magnify" - label="Search for defense systems" - single-line - hide-details - class="mx-2" - clearable - ></v-text-field> + <v-text-field v-model="search" density="compact" variant="underlined" prepend-inner-icon="mdi-magnify" + label="Search for defense systems" single-line hide-details class="mx-2" clearable></v-text-field> </v-toolbar> - <v-data-table-virtual - :height="height" - :items-per-page="itemsPerParge" - v-model:sort-by="sortBy" - :headers="props.headers" - density="compact" - :custom-filter="filterOnlyCapsText" - :items="props.systems" - :search="search" - item-value="system" - > + <v-data-table-virtual :height="height" :items-per-page="itemsPerParge" v-model:sort-by="sortBy" + :headers="props.headers" density="compact" :custom-filter="filterOnlyCapsText" :items="props.systems" + :search="search" item-value="system.name"> <template #[`item.system`]="{ item }"> - <v-chip variant="text" link :to="`${item.columns.system.path}`">{{ - item.columns.system.name + <v-chip variant="text" link :to="item?.system?.path ? `${item?.system?.path}` : null">{{ + item?.system?.name ?? 'None' }}</v-chip> </template> <template #[`item.article`]="{ item }"> - <ArticleDoi - v-if="item.columns?.article" - :doi="item.columns.article.doi" - :title="item.columns.article?.title" - :abstract="item.columns.article?.abstract" - :divider="false" - :enumerate="false" - /> + <ArticleDoi v-if="item?.article" :doi="item.article.doi" :title="item.article?.title" + :abstract="item.article?.abstract" :divider="false" :enumerate="false" /> </template> <template #[`item.PFAM`]="{ item }"> - <pfam-chips :pfam-string="item.columns.PFAM"></pfam-chips> + + <pfam-chips v-if="item.columns?.PFAM" :pfam-string="item.columns.PFAM"></pfam-chips> </template> <template #expanded-row="{ columns, item }"> <tr> - <td - :colspan="columns.length" - class="v-data-table__td v-data-table-column--align-start" - > - <pfam-chips - :pfam-string="item.columns.PFAM" - :items-to-display="-1" - ></pfam-chips> + <td :colspan="columns.length" class="v-data-table__td v-data-table-column--align-start"> + <pfam-chips :pfam-string="item.columns.PFAM" :items-to-display="-1"></pfam-chips> </td> </tr> </template> diff --git a/composables/useRefinedUrl.ts b/composables/useRefinedUrl.ts index 3e81d7c3..5dae55fb 100644 --- a/composables/useRefinedUrl.ts +++ b/composables/useRefinedUrl.ts @@ -1,4 +1,3 @@ -import { join } from "path"; import { withTrailingSlash, withLeadingSlash, joinURL } from "ufo"; diff --git a/pages/defense-systems.vue b/pages/defense-systems.vue index c455cf83..e1b43918 100644 --- a/pages/defense-systems.vue +++ b/pages/defense-systems.vue @@ -5,7 +5,7 @@ const { height } = useDisplay(); const { data, error, pending } = await useAsyncData( "list-defense-systems", - () => queryContent("/defense-systems").find() + () => queryContent("/defense-systems").where({ _partial: false }).find() ); const defaultHeaders = ref([{ title: "System", key: "system" }]); const tableKey = "tableColumns"; @@ -42,6 +42,7 @@ const headers = computed(() => { }); const systems = computed(() => { return sanitizedData.value.map((content) => { + console.log(content) return { system: { name: content.title, path: content._path }, ...content[tableKey], -- GitLab