Commit 3250418d authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

handle error for gene list

parent b474d6dc
Pipeline #32863 passed with stages
in 3 minutes and 19 seconds
......@@ -6,7 +6,7 @@
</v-toolbar>
<v-alert
v-if="notFound"
:value="true"
:value="notFound"
type="warning"
>
<v-layout align-center>
......@@ -14,7 +14,7 @@
<v-spacer/>
<router-link to="/">redirect to home page</router-link>
<v-icon small class="ml-1">fa-home</v-icon>
</v-layout>
</v-layout>
</v-alert>
<v-card v-else class="blue-grey lighten-5">
......
......@@ -2,7 +2,7 @@
<template v-for="(item, index) in downloadAlerts">
<v-alert
:value="item.value"
type="info"
:type="item.type"
icon="fas fa-download"
transition="slide-y-transition"
>
......@@ -12,6 +12,7 @@
<v-spacer/>
<v-flex md8>
<v-progress-linear
v-if="item.progressBar"
indeterminate
height="2"
color="primary"
......@@ -210,8 +211,17 @@
</v-card>
</v-expansion-panel-content>
</v-expansion-panel>
<!-- Table : Alert for backend error -->
<v-alert
v-if="listGenesError"
:value="listGenesError"
type="warning"
>
<v-layout align-center>
Could not retrieve gene list from the server.
</v-layout>
</v-alert>
<!-- Table -->
<v-card flat id="tablegenes" v-if="!loadTable">
<v-speed-dial
v-model="fab"
......
......@@ -34,6 +34,10 @@ export default {
downloadFastaReady: true,
downloadCSVReady: true,
fab: false,
// Error handlers
listGenesError: false,
fastaError: false,
csvError: false,
};
},
computed: {
......@@ -167,11 +171,25 @@ export default {
return [
{
value: this.loadingFastaDownload,
text: "Downloading sequences (.fasta)..."
text: "Downloading sequences (.fasta)...",
type: "info",
progressBar: true,
},
{
value: this.loadingCSVDownload,
text: "Downloading metadata (.csv)..."
text: "Downloading metadata (.csv)...",
type: "info",
progressBar: true,
},
{
value: this.fastaError,
text: "Could not download sequences (.fasta).",
type: "error",
},
{
value: this.csvError,
text: "Could not download metadata (.csv).",
type: "error"
},
]
}
......@@ -190,8 +208,12 @@ export default {
})
return taxLevelsFormatted;
},
getGenes() {
resetGeneListFlags() {
this.requestDone = false;
this.listGenesError = false;
},
getGenes() {
this.resetGeneListFlags();
axios.get('/api/catalog/v1/genes', {
params: this.qParams,
headers: {
......@@ -232,6 +254,7 @@ export default {
})
.catch((error) => {
console.error(error);
this.listGenesError = true;
this.requestDone = true;
});
},
......@@ -243,8 +266,12 @@ export default {
document.body.appendChild(link)
link.click()
},
downloadFasta() {
resetFastaFlags() {
this.downloadFastaReady = false;
this.fastaError = false;
},
downloadFasta() {
this.resetFastaFlags();
var qParams = {};
Object.assign(qParams, this.qParams);
qParams.fasta = "true";
......@@ -262,11 +289,16 @@ export default {
})
.catch((error) => {
console.error(error);
this.downloadReady = true;
this.fastaError = true;
this.downloadFastaReady = true;
});
},
downloadMetadataCSV() {
resetCsvFlags() {
this.downloadCSVReady = false;
this.csvError = false;
},
downloadMetadataCSV() {
this.resetCsvFlags();
var qParams = {};
Object.assign(qParams, this.qParams);
qParams.csv = "true";
......@@ -284,7 +316,8 @@ export default {
})
.catch((error) => {
console.error(error);
this.downloadReady = true;
this.csvError = true;
this.downloadCSVReady = true;
});
},
emptyGeneInformationFilter() {
......
Markdown is supported
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