Skip to content
Snippets Groups Projects
Commit 755c3c7e authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

no more column in datatable slots

parent 52094d13
No related branches found
No related tags found
No related merge requests found
Pipeline #112584 passed with stages
in 6 minutes and 3 seconds
...@@ -22,8 +22,8 @@ const sections = ref([ ...@@ -22,8 +22,8 @@ const sections = ref([
href: runtimeConfig.public.defenseFinderWebservice, href: runtimeConfig.public.defenseFinderWebservice,
}, },
{ id: "wiki", label: "Wiki", to: '/', }, { id: "wiki", label: "Wiki", to: '/', },
{ id: "refseq", label: "REFSEQ", to: '/refseq' }, { id: "refseq", label: "REFSEQ", to: '/refseq/' },
{ id: "help", label: "Help", to: '/help' }, { id: "help", label: "Help", to: '/help/' },
]); ]);
......
...@@ -41,57 +41,29 @@ initPfam(); ...@@ -41,57 +41,29 @@ initPfam();
<v-toolbar color="primary"> <v-toolbar color="primary">
<v-toolbar-title>Defense Systems</v-toolbar-title> <v-toolbar-title>Defense Systems</v-toolbar-title>
<v-text-field <v-text-field v-model="search" density="compact" variant="underlined" prepend-inner-icon="mdi-magnify"
v-model="search" label="Search for defense systems" single-line hide-details class="mx-2" clearable></v-text-field>
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-toolbar>
<v-data-table-virtual <v-data-table-virtual :height="height" :items-per-page="itemsPerParge" v-model:sort-by="sortBy"
:height="height" :headers="props.headers" density="compact" :custom-filter="filterOnlyCapsText" :items="props.systems"
:items-per-page="itemsPerParge" :search="search" item-value="system.name">
v-model:sort-by="sortBy"
:headers="props.headers"
density="compact"
:custom-filter="filterOnlyCapsText"
:items="props.systems"
:search="search"
item-value="system"
>
<template #[`item.system`]="{ item }"> <template #[`item.system`]="{ item }">
<v-chip variant="text" link :to="`${item.columns.system.path}`">{{ <v-chip variant="text" link :to="item?.system?.path ? `${item?.system?.path}` : null">{{
item.columns.system.name item?.system?.name ?? 'None'
}}</v-chip> }}</v-chip>
</template> </template>
<template #[`item.article`]="{ item }"> <template #[`item.article`]="{ item }">
<ArticleDoi <ArticleDoi v-if="item?.article" :doi="item.article.doi" :title="item.article?.title"
v-if="item.columns?.article" :abstract="item.article?.abstract" :divider="false" :enumerate="false" />
:doi="item.columns.article.doi"
:title="item.columns.article?.title"
:abstract="item.columns.article?.abstract"
:divider="false"
:enumerate="false"
/>
</template> </template>
<template #[`item.PFAM`]="{ item }"> <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>
<template #expanded-row="{ columns, item }"> <template #expanded-row="{ columns, item }">
<tr> <tr>
<td <td :colspan="columns.length" class="v-data-table__td v-data-table-column--align-start">
:colspan="columns.length" <pfam-chips :pfam-string="item.columns.PFAM" :items-to-display="-1"></pfam-chips>
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> </td>
</tr> </tr>
</template> </template>
......
import { join } from "path";
import { withTrailingSlash, withLeadingSlash, joinURL } from "ufo"; import { withTrailingSlash, withLeadingSlash, joinURL } from "ufo";
......
...@@ -5,7 +5,7 @@ const { height } = useDisplay(); ...@@ -5,7 +5,7 @@ const { height } = useDisplay();
const { data, error, pending } = await useAsyncData( const { data, error, pending } = await useAsyncData(
"list-defense-systems", "list-defense-systems",
() => queryContent("/defense-systems").find() () => queryContent("/defense-systems").where({ _partial: false }).find()
); );
const defaultHeaders = ref([{ title: "System", key: "system" }]); const defaultHeaders = ref([{ title: "System", key: "system" }]);
const tableKey = "tableColumns"; const tableKey = "tableColumns";
...@@ -42,6 +42,7 @@ const headers = computed(() => { ...@@ -42,6 +42,7 @@ const headers = computed(() => {
}); });
const systems = computed(() => { const systems = computed(() => {
return sanitizedData.value.map((content) => { return sanitizedData.value.map((content) => {
console.log(content)
return { return {
system: { name: content.title, path: content._path }, system: { name: content.title, path: content._path },
...content[tableKey], ...content[tableKey],
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment