diff --git a/components/content/StructureDb.vue b/components/content/StructureDb.vue index 5cbd960233f326669e60178dc5728741b6d36a8e..711accda2a6ebdde83b6545beb50a1b957f8bc8e 100644 --- a/components/content/StructureDb.vue +++ b/components/content/StructureDb.vue @@ -43,9 +43,9 @@ const dataTableServerProps = computed(() => { function namesToCollapsibleChips(names: string[], file: string | null = null) { if (file === null) { - return names.filter((it) => it !== "").map(it => ({ title: it.split("__").pop() })) + return names.filter((it) => it !== "").map(it => ({ title: it.split("__")[1] })) } else { - return names.filter((it) => it !== "").map(it => ({ title: it.split("__").pop(), href: `/wiki/${toSystemName(file)}/${file}` })) + return names.filter((it) => it !== "").map(it => ({ title: it.split("__")[1], href: `/wiki/${toSystemName(it)}/${file}` })) } } @@ -55,14 +55,9 @@ function pdbNameToCif(pdbPath: string) { } function toSystemName(rawName: string) { - // split on -0 if exists else on _ - if (rawName.includes("-0")) { - - return rawName.split("-0")[0].toLocaleLowerCase() - } else { - return rawName.split("_")[0].toLocaleLowerCase() - } - + // Does it work if it's a list of system genes ? + // split on __ for systeme_vgenes + return rawName.split("__")[0].toLocaleLowerCase() } @@ -97,10 +92,10 @@ function remove(key) { </template> <template #[`item.system_genes`]="{ item }"> <CollapsibleChips :items="namesToCollapsibleChips(item.system_genes)"></CollapsibleChips> - </template> + </template>z <template #[`item.structure`]="{ item }"> <MolstarPdbePlugin v-if="item?.pdb && item.pdb !== 'na'" - :data-urls="[`/${toSystemName(item.system)}/${pdbNameToCif(item.pdb)}`]" uniq> + :data-urls="[`/${toSystemName(item.system_genes)}/${pdbNameToCif(item.pdb)}`]" uniq> </MolstarPdbePlugin> <span v-else class="d-flex flex-wrap align-center justify-center"> <v-icon color="warning" icon="md:dangerous"></v-icon>