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

Should fix compilation website

parent f8a40a36
No related branches found
No related tags found
1 merge request!134Resolve "Table with all PDB files, to make them available to download"
Pipeline #118260 passed
Showing
with 100 additions and 150 deletions
......@@ -10,21 +10,19 @@ const props = withDefaults(defineProps<Props>(), {
// import { useCustomTheme } from '~/composables/useCustomTheme'
import { useDisplay, useTheme } from "vuetify";
const { navigation } = useContent();
const { navigation, page } = useContent();
// const drawer = ref(true);
// const computedNavigation = computed(() => {
// console.log(page.value.title)
// // console.log(navigation.value)
// if (page.value.title === "stru") {
// console.log(navigation.value)
// }
// return navigation.value
// // .filter((item) => {
// // return item?.layout !== "db"
// // })
// .filter((item: { layout: string }) => {
// if (item?.layout === "db") {
// console.log(item)
// return false
// }
// return true
// // return item?.layout !== "db"
// })
// });
</script>
......
......@@ -9,7 +9,6 @@ export interface Props {
}
const runtimeConfig = useRuntimeConfig();
const { navigation } = useContent();
const { mobile } = useDisplay();
const theme = useTheme();
......@@ -36,17 +35,10 @@ const sections = ref([
},
{ id: "wiki", label: "Wiki", to: '/', },
{ id: "refseq", label: "RefSeq DB", to: '/refseq/' },
{ id: "structure", label: "Structures DB", to: '/predicted-structure/' },
{ id: "structure", label: "Structures DB", to: '/structure/' },
{ id: "help", label: "Help", to: '/help/' },
]);
const computedNavigation = computed(() => {
return navigation.value
.filter(({ _path }) => {
return _path !== "/refseq";
})
});
function toggleDrawer() {
emit('update:drawer', !props.drawer)
......
......@@ -16,7 +16,7 @@ const props = defineProps<{
<Navigation :navigation="navItem.children" />
</v-list-group>
<template v-else>
<v-list-item :title="navItem.title" :value="navItem.title" :to="navItem._path"
<v-list-item :title="navItem?.title ?? 'no title'" :value="navItem.title" :to="navItem._path"
:prepend-icon="navItem?.icon ? navItem.icon : null" color="primary" exact nav>
</v-list-item>
</template>
......
......@@ -2,11 +2,11 @@
// import type { FacetDistribution } from "meilisearch";
import { useSlots } from 'vue'
import { useDisplay } from "vuetify";
import { useFacetsStore, type Facets } from '~~/stores/facets'
import { useFacetsStore } from '~~/stores/facets'
import { useMeiliSearch } from "#imports"
interface SortItem {
export interface SortItem {
key: string,
order: boolean | 'asc' | 'desc'
}
......@@ -15,8 +15,8 @@ export interface Props {
title?: string
db?: string
sortBy?: SortItem[]
facets: string[]
dataTableServerProps: { [key: string]: any; }
facets: MaybeRef<string[]>
dataTableServerProps: Record<string, any>
}
export interface FilterItem {
......@@ -25,12 +25,7 @@ export interface FilterItem {
title: string
count?: number
deletable: boolean
props: {
[key: string]: any
// title: string
// value: any
}
// raw?: any
props: Record<string, any>
}
const props = withDefaults(defineProps<Props>(), {
......@@ -38,17 +33,20 @@ const props = withDefaults(defineProps<Props>(), {
db: 'refseq',
sortBy: () => [{ key: "type", order: "asc" }],
});
console.log(props.dataTableServerProps)
const slots = useSlots()
console.log(slots)
const sortByRef = ref(toValue(props.sortBy))
const facetsRef = toRef(() => props.facets)
const sortByRef = toRef(props.sortBy)
const facetsRef = toRef(props.facets)
const { search: msSearch, result: msResult } = useMeiliSearch(props.db)
const facetStore = useFacetsStore()
const search: Ref<string> = ref("");
const filterOrSearch: Ref<FilterItem[] | null> = ref(null)
const hitsPerPage: Ref<number> = ref(25)
const limit = ref(1000)
const filterError: Ref<string | null> = ref(null)
const msFilter: Ref<string | undefined> = ref(undefined)
const page = ref(1)
......@@ -61,7 +59,7 @@ const computedTableHeight = computed(() => {
return computedHeight > minTableHeight.value ? computedHeight : minTableHeight.value
})
const { pending: pendingDownloadData, downloadCsv } = useCsvDownload(props.db, `df-${props.db}`)
// const { pending: pendingDownloadData, downloadCsv } = useCsvDownload(props.db, `df-${props.db}`)
const filterInputValues = computed(() => {
// console.log("recompouted FILTER value")
......@@ -72,25 +70,23 @@ const filterInputValues = computed(() => {
}
})
const queryInputValue = computed(() => {
// console.log("recompouted TEXT value")
if (filterOrSearch.value !== null) {
const phrase = filterOrSearch.value
.filter((f) => {
return f.props.type === 'text'
})
.map((f) => {
return f.value
})
if (phrase.length > 1) {
return `${phrase.join(" ")}`
}
else { return phrase[0] }
} else {
return null
}
})
// const queryInputValue = computed(() => {
// if (filterOrSearch.value !== null) {
// const phrase = filterOrSearch.value
// .filter((f) => {
// return f.props.type === 'text'
// })
// .map((f) => {
// return f.value
// })
// if (phrase.length > 1) {
// return `${phrase.join(" ")}`
// }
// else { return phrase[0] }
// } else {
// return null
// }
// })
const isFilter = computed(() => {
return Array.isArray(filterOrSearch.value)
......@@ -172,8 +168,6 @@ watch(msFilter, async (fos) => {
})
watch(msResult, (newRes) => {
// console.log(msResult)
// console.log(newRes)
facetStore.setFacets({ facetDistribution: newRes.facetDistribution, facetStat: newRes.facetStat })
}, { deep: true })
......@@ -223,7 +217,7 @@ const autocompleteItems = computed(() => {
const index = filterOrSearch.value?.length ?? 0
// console.log(index)
if (filterStep.value === null || filterStep.value === 0) {
return props.facets.map(value => {
return toValue(facetsRef).map(value => {
return {
type: "facet",
value: `${value}-${index}`,
......@@ -258,80 +252,52 @@ const autocompleteItems = computed(() => {
}
})
const canAddTextSearch = computed(() => {
if (filterOrSearch.value !== null && filterOrSearch.value.length > 0) {
const lastItem = filterOrSearch.value.slice(-1)[0]
return lastItem?.props.type === 'value' || lastItem?.props.type === "text"
}
return true
})
// const canAddTextSearch = computed(() => {
// if (filterOrSearch.value !== null && filterOrSearch.value.length > 0) {
// const lastItem = filterOrSearch.value.slice(-1)[0]
// return lastItem?.props.type === 'value' || lastItem?.props.type === "text"
// }
// return true
// })
function selectItem(item) {
filterOrSearch.value = Array.isArray(filterOrSearch.value) ? [...filterOrSearch.value, item] : [item]
}
function deleteOneFilter(index: number) {
// console.log("deleteOnefilter")
// console.log(index)
// console.log(isFilter.value)
// console.log(filterOrSearch)
if (isFilter.value) {
filterOrSearch.value?.splice(index - 2, 2)
// console.log(filterOrSearch.value)
}
}
function deleteTextFilter(index: number) {
// console.log("delete text filter")
// console.log(index)
// console.log(isFilter.value)
// console.log(filterOrSearch)
// console.log(filterOrSearch.value?.length)
if (isFilter.value) {
if (index === 0) {
filterOrSearch.value?.shift()
} else {
filterOrSearch.value?.splice(index, 1)
}
// console.log(filterOrSearch.value?.length)
// console.log(filterOrSearch.value)
}
}
function clearSearch() {
search.value = ""
}
function runTextSearch() {
if (canAddTextSearch) {
const item: FilterItem = reactive({
type: 'text', title: search.value, value: search.value, deletable: true, props: { type: "text", deletable: true, }
})
if (Array.isArray(filterOrSearch.value)) {
filterOrSearch.value = [
...filterOrSearch.value, item
// function runTextSearch() {
// if (canAddTextSearch) {
// const item: FilterItem = reactive({
// type: 'text', title: search.value, value: search.value, deletable: true, props: { type: "text", deletable: true, }
// })
// if (Array.isArray(filterOrSearch.value)) {
// filterOrSearch.value = [
// ...filterOrSearch.value, item
]
} else {
filterOrSearch.value = [item]
}
search.value = ""
searchOrFilter()
}
}
// ]
// } else {
// filterOrSearch.value = [item]
// }
// search.value = ""
// searchOrFilter()
// }
// }
function downloadData() {
downloadCsv(search, msFilter, msSortBy, notPaginatedParams)
}
// function downloadData() {
// downloadCsv(search, msFilter, msSortBy, notPaginatedParams)
// }
</script>
<template>
......@@ -349,13 +315,8 @@ function downloadData() {
@click:appendInner="searchOrFilter" @click:clear="clearFilterOrSearch"
@update:modelValue="() => clearSearch()">
<template #chip="{ props, item, index }">
<v-chip v-bind="props" :text="item.raw.title" :closable="item.props.deletable"
@click:close="item.props.type === 'text' ? deleteTextFilter(index) : deleteOneFilter(index)"></v-chip>
<!-- <v-chip v-if="(index + 1) % 3 === 0" v-bind="props" :text="item.raw.title" closable
@click:close="deleteOneFilter(index)"></v-chip>
<v-chip v-else v-bind="props" :text="item.raw.title"></v-chip> -->
@click:close="item.props.type === deleteOneFilter(index)"></v-chip>
</template>
<template #item="{ props, item }">
<v-list-item v-bind="{ ...props, active: false, onClick: () => selectItem(item) }"
......@@ -363,10 +324,6 @@ function downloadData() {
</v-list-item>
</template>
<!-- <template #no-data></template>
<template #prepend-item>
<v-list-item v-if="canAddTextSearch" :title="`Text search: ${search}`" @click="runTextSearch"> </v-list-item>
</template> -->
</v-autocomplete>
</v-col>
</v-row>
......@@ -381,10 +338,10 @@ function downloadData() {
</v-toolbar-title><v-spacer></v-spacer>
<v-btn :loading="pendingDownloadData" :disabled="totalHits > 10000" @click="downloadData" icon
<!-- <v-btn :loading="pendingDownloadData" :disabled="totalHits > 10000" @click="downloadData" icon
variant="text" class="text-none mr-15">
<v-badge :content="totalHits" color="info" floating>
<v-icon>md:download</v-icon></v-badge></v-btn>
<v-icon>md:download</v-icon></v-badge></v-btn> -->
</v-toolbar>
</template>
<template v-for="(slot, index) of Object.keys(slots)" :key="index" v-slot:[slot]="data">
......
......@@ -3,11 +3,12 @@ import { useFacetsStore } from '~~/stores/facets'
import * as Plot from "@observablehq/plot";
import PlotFigure from "~/components/PlotFigure";
import { useDisplay } from "vuetify";
import type { SortItem } from "@/components/ServerDbTable.vue"
import { ServerDbTable } from "#components"
const facetStore = useFacetsStore()
const sortBy: Ref<{ key: string, order: string }[]> = ref([{ key: 'type', order: "asc" }])
const sortBy: Ref<SortItem[]> = ref([{ key: 'type', order: "asc" }])
const itemValue = ref("id");
const { width } = useDisplay();
const distriTool: Ref<string[]> = ref([])
......@@ -157,7 +158,8 @@ const computedDistriTaxoOptions = computed(() => {
],
};
});
function capitalize([first, ...rest]) {
function capitalize(name: string) {
const [first, ...rest] = name
return first.toUpperCase() + rest.join('').toLowerCase();
}
......@@ -209,7 +211,6 @@ function namesToAccessionChips(names: string[]) {
</v-col>
</v-row>
</v-card>
<ServerDbTable title="RefSeq" db="refseq" :sortBy="sortBy" :facets="facets"
:data-table-server-props="dataTableServerProps">
<template #[`item.accession_in_sys`]="{ item }">
......
<script setup lang="ts">
const sortBy: Ref<{ key: string, order: string }[]> = ref([{ key: 'system', order: "asc" }])
import type { SortItem } from "@/components/ServerDbTable.vue"
import { ServerDbTable } from "#components"
const sortBy: Ref<SortItem[]> = ref([{ key: 'system', order: "asc" }])
const itemValue = ref("id");
const facets: Ref<string[]> = ref(["system", "completed",
"plddts",])
......@@ -26,9 +28,9 @@ const defaultDataTableServerProps = ref({
const dataTableServerProps = computed(() => {
return {
...defaultDataTableServerProps.value,
headers: headers.value,
itemValue: itemValue.value
...toValue(defaultDataTableServerProps),
headers: toValue(headers),
itemValue: toValue(itemValue)
}
})
......
---
title: General Concepts
toc: true
layout: article
---
......
---
title: Abortive Infection
layout: article
toc: true
---
......
---
title: Defense Islands
layout: article
---
......
......@@ -2,6 +2,7 @@
title: Defense system triggers
contributors:
- Avigail Stokar-Avihail
layout: article
---
# How anti-phage systems sense invading phages
......
---
title: RefSeq DB
layout: db
navigation: false
navigation: true
---
......
---
title: Structures DB
layout: db
navigation: false
navigation: true
---
::structure-db
::
\ No newline at end of file
......@@ -19,7 +19,6 @@ export default defineNuxtConfig({
'sh',
]
},
layoutFallbacks: ['article'],
},
vuetify: {
vuetifyOptions: {
......@@ -53,6 +52,7 @@ export default defineNuxtConfig({
meiliApiKey: 'api_key'
}
},
vue: {
compilerOptions: {
isCustomElement: (tag) => ['pdbe-molstar'].includes(tag),
......
......@@ -27,10 +27,10 @@ class TableArticle(BaseModel):
class TableColumns(BaseModel):
article: TableArticle
Sensor: str
Activator: str
Effector: str
PFAM: str
Sensor: Optional[str] = None
Activator: Optional[str] = None
Effector: Optional[str] = None
PFAM: Optional[str] = None
class RelevantAbstract(BaseModel):
......@@ -64,10 +64,6 @@ def lint(
try:
FrontMatter.model_validate(metadata)
except ValidationError as exc:
# print(repr(exc.errors()[0]["type"]))
# print(repr(exc))
# print(exc.errors())
# pprint(exc.errors(), expand_all=True)
for err in exc.errors():
console.print(
f"[red]{err['msg']} : {err['type']} {' -> '.join([str(l) for l in err['loc']])}"
......
<template>
<ContentDoc></ContentDoc>
</template>
\ No newline at end of file
<template>
<ContentDoc></ContentDoc>
</template>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment