Skip to content
Snippets Groups Projects
Commit 5debbf20 authored by Jean  CURY's avatar Jean CURY
Browse files

new tentative

parent 4119a9aa
No related branches found
No related tags found
2 merge requests!187fix cif path2,!166new tentative
Pipeline #119028 passed
...@@ -43,9 +43,9 @@ const dataTableServerProps = computed(() => { ...@@ -43,9 +43,9 @@ const dataTableServerProps = computed(() => {
function namesToCollapsibleChips(names: string[], file: string | null = null) { function namesToCollapsibleChips(names: string[], file: string | null = null) {
if (file === 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 { } 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) { ...@@ -55,14 +55,9 @@ function pdbNameToCif(pdbPath: string) {
} }
function toSystemName(rawName: string) { function toSystemName(rawName: string) {
// split on -0 if exists else on _ // Does it work if it's a list of system genes ?
if (rawName.includes("-0")) { // split on __ for systeme_vgenes
return rawName.split("__")[0].toLocaleLowerCase()
return rawName.split("-0")[0].toLocaleLowerCase()
} else {
return rawName.split("_")[0].toLocaleLowerCase()
}
} }
...@@ -97,10 +92,10 @@ function remove(key) { ...@@ -97,10 +92,10 @@ function remove(key) {
</template> </template>
<template #[`item.system_genes`]="{ item }"> <template #[`item.system_genes`]="{ item }">
<CollapsibleChips :items="namesToCollapsibleChips(item.system_genes)"></CollapsibleChips> <CollapsibleChips :items="namesToCollapsibleChips(item.system_genes)"></CollapsibleChips>
</template> </template>z
<template #[`item.structure`]="{ item }"> <template #[`item.structure`]="{ item }">
<MolstarPdbePlugin v-if="item?.pdb && item.pdb !== 'na'" <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> </MolstarPdbePlugin>
<span v-else class="d-flex flex-wrap align-center justify-center"> <span v-else class="d-flex flex-wrap align-center justify-center">
<v-icon color="warning" icon="md:dangerous"></v-icon> <v-icon color="warning" icon="md:dangerous"></v-icon>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment