Skip to content

Commit

Permalink
Related references progress indicator fix (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
mihailefter committed May 26, 2021
1 parent 2e5df1f commit 6420586
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 47 deletions.
95 changes: 50 additions & 45 deletions src/components/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<div>
<v-progress-linear
indeterminate
v-if="progress_datasets"
v-if="progress_datasets && progress_other"
></v-progress-linear>
<div v-if="!progress_datasets">
<div v-if="response && response.genes">

<div v-if="!(progress_datasets && progress_other)">
<div v-if="!response_datasets">
Related references from NCBI Datasets not retrieved.
</div>
<div v-if="response_datasets && response && response.genes">
<v-list>
<div v-if="updated_accession">
<v-subheader inset class="overline"
Expand Down Expand Up @@ -70,48 +74,44 @@
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</div>

<v-progress-linear
indeterminate
color="cyan"
v-if="progress_other"
></v-progress-linear>

<div v-if="!progress_datasets && !progress_other && other_references">
<v-list>
<v-subheader inset class="overline">Other</v-subheader>
<div
v-for="t in other_references"
:key="t.reference_id + t.selector_id"
>
<MapDescription
:description="description"
:reference_id="t.reference_id"
:selector_id="t.selector_id"
/>
</div>
</v-list>
<div v-if="!response_other">
Related references from NCBI Entrez not retrieved.
</div>

<v-expansion-panels
focusable
hover
flat
class="mb-3"
v-if="eutils && !progress_other"
>
<v-expansion-panel>
<v-expansion-panel-header
>View NCBI Eutils response as a tree</v-expansion-panel-header
<div v-if="other_references.length != 0">
<v-list>
<v-subheader inset class="overline">Other</v-subheader>
<div
v-for="t in other_references"
:key="t.reference_id + t.selector_id"
>
<v-expansion-panel-content>
<JsonPretty :summary="eutils" />
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</div>
<MapDescription
:description="description"
:reference_id="t.reference_id"
:selector_id="t.selector_id"
/>
</div>
</v-list>

<div v-if="!accession">Work in progress.</div>
<v-expansion-panels
focusable
hover
flat
class="mb-3"
v-if="eutils && !progress_other"
>
<v-expansion-panel>
<v-expansion-panel-header
>View NCBI Eutils response as a tree</v-expansion-panel-header
>
<v-expansion-panel-content>
<JsonPretty :summary="eutils" />
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</div>
</div>
</div>
</template>

Expand Down Expand Up @@ -144,7 +144,7 @@ export default {
chromosomes: [],
other_references: [],
progress_datasets: true,
progress_other: false,
progress_other: true,
};
},
mounted: function () {
Expand Down Expand Up @@ -200,17 +200,19 @@ export default {
) {
this.gene_id = response.genes[0].gene.gene_id;
let gene_name = response.genes[0].gene.symbol;
this.progress_other = true;
NcbiEutils.get_gene_summary(this.gene_id).then((response) => {
this.progress_other = false;
if (response.data) {
this.response_other = true;
this.eutils = response.data;
let references = this.get_eutils_hist(response.data, this.gene_id);
for (let reference of references) {
this.get_eutils_related(reference, gene_name);
}
} else {
this.response_other = false;
}
});
this.progress_other = false;
}
},
get_selector_id() {
Expand Down Expand Up @@ -244,9 +246,10 @@ export default {
descendats: true,
};
MutalyzerService.referenceModel(params).then((response) => {
this.progress_datasets = false;
if (response.data) {
this.response_datasets = true;
this.eutils = response.data;
this.progress_datasets = false;
if (response.data.id) {
if (
response.data.features &&
Expand All @@ -265,6 +268,8 @@ export default {
}
}
}
} else {
this.response_datasets = false;
}
});
},
Expand Down
1 change: 0 additions & 1 deletion src/components/ReferenceInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<div>
<v-progress-linear
indeterminate
color="cyan"
class="mt-5"
v-if="progress"
></v-progress-linear>
Expand Down
1 change: 0 additions & 1 deletion src/components/ViewVariants.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<div>
<v-progress-linear
indeterminate
color="cyan"
v-if="progress"
></v-progress-linear>

Expand Down

0 comments on commit 6420586

Please sign in to comment.