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

add loading indicator

parent 40a6e02c
No related branches found
No related tags found
No related merge requests found
Pipeline #127899 waiting for manual action
...@@ -35,7 +35,7 @@ const { page } = useContent(); ...@@ -35,7 +35,7 @@ const { page } = useContent();
// get the structures // get the structures
const msIndexName = ref<string>("refseqsanitized") const msIndexName = ref<string>("refseqsanitized")
const client = useMeiliSearchRef() const client = useMeiliSearchRef()
const pending = ref<boolean>(false)
const genomeCountThreshold = ref<boolean>(true) const genomeCountThreshold = ref<boolean>(true)
const genomeCountDomain = ref<[number | null, number | null]>([null, null]) const genomeCountDomain = ref<[number | null, number | null]>([null, null])
...@@ -187,6 +187,7 @@ watchEffect(() => { ...@@ -187,6 +187,7 @@ watchEffect(() => {
// ================================================= // =================================================
async function fetchSystemHits() { async function fetchSystemHits() {
try { try {
pending.value = true
const data = await client.index(toValue(msIndexName)).search("", { const data = await client.index(toValue(msIndexName)).search("", {
facets: ["*"], facets: ["*"],
filter: [`type = '${toValue(systemName)}'`], filter: [`type = '${toValue(systemName)}'`],
...@@ -196,6 +197,13 @@ async function fetchSystemHits() { ...@@ -196,6 +197,13 @@ async function fetchSystemHits() {
} catch (error) { } catch (error) {
throw createError(`Cannot get hits on refseq for system: ${toValue(systemName)} `) throw createError(`Cannot get hits on refseq for system: ${toValue(systemName)} `)
} finally {
setTimeout(() => {
console.log("Delayed for 1 second.");
pending.value = false
}, "3000");
} }
} }
...@@ -223,10 +231,12 @@ async function fetchRefSeqTaxo() { ...@@ -223,10 +231,12 @@ async function fetchRefSeqTaxo() {
The system was detected in {{ d3.format(",")(systemStatistics.speciesWithSystem) }} different species. The system was detected in {{ d3.format(",")(systemStatistics.speciesWithSystem) }} different species.
</v-card-text> </v-card-text>
<v-card flat :loading="pending">
<v-row no-gutters> <v-row no-gutters>
<v-col> <v-col>
<v-select v-model="selectedTaxoRank" :items="taxoRanks" density="compact" label="Select taxonomic rank" <v-select v-model="selectedTaxoRank" :items="taxoRanks" density="compact"
hide-details="auto" class="mx-2"></v-select> label="Select taxonomic rank" hide-details="auto" class="mx-2"></v-select>
</v-col> </v-col>
<!-- <v-col cols="12" md="4"> <!-- <v-col cols="12" md="4">
<v-select v-model="plotY" :items="axisOptions" density="compact" label="Y axis based on" <v-select v-model="plotY" :items="axisOptions" density="compact" label="Y axis based on"
...@@ -237,7 +247,6 @@ async function fetchRefSeqTaxo() { ...@@ -237,7 +247,6 @@ async function fetchRefSeqTaxo() {
hide-details="auto" class="mx-2"></v-select> hide-details="auto" class="mx-2"></v-select>
</v-col> --> </v-col> -->
</v-row> </v-row>
<v-row class="d-flex" no-gutters> <v-row class="d-flex" no-gutters>
<v-col cols="12" md="5"> <v-col cols="12" md="5">
<v-card flat> <v-card flat>
...@@ -271,7 +280,8 @@ async function fetchRefSeqTaxo() { ...@@ -271,7 +280,8 @@ async function fetchRefSeqTaxo() {
</v-col> </v-col>
<v-col cols="3"> <v-col cols="3">
<v-switch v-model="genomeCountThreshold" color="primary" <v-switch v-model="genomeCountThreshold" color="primary"
:label="genomeCountThreshold ? 'activated' : 'disabled'" hide-details></v-switch> :label="genomeCountThreshold ? 'activated' : 'disabled'"
hide-details></v-switch>
</v-col> </v-col>
</v-row> </v-row>
</v-card-text> </v-card-text>
...@@ -279,6 +289,11 @@ async function fetchRefSeqTaxo() { ...@@ -279,6 +289,11 @@ async function fetchRefSeqTaxo() {
</v-col> </v-col>
</v-row> </v-row>
<PlotFigure ref="systemsDistributionPlot" :options="unref(distributionOptions)" defer></PlotFigure> <PlotFigure v-if="!pending" ref="systemsDistributionPlot" :options="unref(distributionOptions)" defer>
</PlotFigure>
<v-card v-else>
{{ pending }}...
</v-card>
</v-card>
</v-card> </v-card>
</template> </template>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment