From dde15276a43ce7db783995241fc35374f7d14f4d Mon Sep 17 00:00:00 2001 From: mderamos Date: Tue, 20 Sep 2022 17:51:19 +0800 Subject: [PATCH] Check if user selected a variant set before exporting flapjack IBP-5656 --- .../genotyping/genotyping-pane.component.ts | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/main/jhipster/src/main/webapp/app/germplasm-details/genotyping/genotyping-pane.component.ts b/src/main/jhipster/src/main/webapp/app/germplasm-details/genotyping/genotyping-pane.component.ts index fd49ed9ef3..5b0678b4ae 100644 --- a/src/main/jhipster/src/main/webapp/app/germplasm-details/genotyping/genotyping-pane.component.ts +++ b/src/main/jhipster/src/main/webapp/app/germplasm-details/genotyping/genotyping-pane.component.ts @@ -172,28 +172,30 @@ export class GenotypingPaneComponent implements OnInit { } selectVariantsetOnChange() { - this.isExportingFlapjack = true; - const exportFlapjackRequest = new ExportFlapjackRequest([], [], 'FLAPJACK', [this.genotypingGermplasm.germplasmName], true, - 100, this.selectedVariantSet.referenceSetDbId); - this.genotypingBrapiService.exportFlapjack(exportFlapjackRequest).subscribe((response) => { - this.isExportingFlapjack = false; - let file = response.replace('.fjzip', ''); - file = this.extractHostName(this.cropGenotypingParameter.baseUrl) + file; - - const flapjackDiv = '#flapjack-div'; - const renderer = flapjack.default(); - renderer.renderGenotypesUrl({ - domParent: flapjackDiv, - width: document.querySelector(flapjackDiv).getBoundingClientRect().width, - height: 250, - mapFileURL: file + '.map', - genotypeFileURL: file + '.genotype', - phenotypeFileURL: file + '.phenotype', - overviewWidth: document.querySelector(flapjackDiv).getBoundingClientRect().width, - overviewHeight: 25, - dataSetId: this.cropGenotypingParameter.programId, + if (this.selectedVariantSet) { + this.isExportingFlapjack = true; + const exportFlapjackRequest = new ExportFlapjackRequest([], [], 'FLAPJACK', [this.genotypingGermplasm.germplasmName], true, + 100, this.selectedVariantSet.referenceSetDbId); + this.genotypingBrapiService.exportFlapjack(exportFlapjackRequest).subscribe((response) => { + this.isExportingFlapjack = false; + let file = response.replace('.fjzip', ''); + file = this.extractHostName(this.cropGenotypingParameter.baseUrl) + file; + + const flapjackDiv = '#flapjack-div'; + const renderer = flapjack.default(); + renderer.renderGenotypesUrl({ + domParent: flapjackDiv, + width: document.querySelector(flapjackDiv).getBoundingClientRect().width, + height: 250, + mapFileURL: file + '.map', + genotypeFileURL: file + '.genotype', + phenotypeFileURL: file + '.phenotype', + overviewWidth: document.querySelector(flapjackDiv).getBoundingClientRect().width, + overviewHeight: 25, + dataSetId: this.cropGenotypingParameter.programId, + }); }); - }); + } } extractHostName(baseUrl) {