Skip to content

Commit

Permalink
Fix Launch With Disabling for Checker Workflows (#341)
Browse files Browse the repository at this point in the history
* Fix Launch With Disabling for Checker Workflows

dockstore/dockstore#1548

Fix case when disabling of launch with FireCloud/DNAstack buttons did
not happen when it should have, when you select the checker workflow
by clicking View Checker when on the parent.

Events seem to fire in a different order when selecting a checker
workflow that way. Add a call to checkWdlForImportsAndSetFirecloudUrl in
setupPublicEntry().

To avoid too many calls to fetch secondary files, store the last time
workflow and version that was queried, and make sure we don't query
twice for the same workflow/version. Less than perfect, but will
will redo in dockstore/dockstore#1575.
  • Loading branch information
coverbeck authored Jul 10, 2018
1 parent 8e6a951 commit adb9d75
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions src/app/workflow/workflow.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export class WorkflowComponent extends Entry {
public wdlHasHttpImports: boolean;
public wdlHasFileImports: boolean;
public enableLaunchWithFireCloud = Dockstore.FEATURES.enableLaunchWithFireCloud;
private lastWorkflow: ExtendedWorkflow;
private lastVersion: WorkflowVersion;
public workflow;
public missingWarning: boolean;
public title: string;
Expand Down Expand Up @@ -144,18 +146,22 @@ export class WorkflowComponent extends Entry {
if (this.isWdl(workflowRef)) {
const version: WorkflowVersion = this.selectedVersion;
if (version) {
this.workflowsService.secondaryWdl(workflowRef.id, version.name).subscribe((sourceFiles: Array<SourceFile>) => {
if (!sourceFiles || sourceFiles.length === 0) {
this.workflowsService.wdl(workflowRef.id, version.name).subscribe((sourceFile) => {
this.wdlHasHttpImports = importHttpRegEx.test(sourceFile.content);
});
if (this.enableLaunchWithFireCloud) {
this.fireCloudURL = `${Dockstore.FIRECLOUD_IMPORT_URL}/${workflowRef.full_workflow_path}:${version.name}`;
if (version !== this.lastVersion || this.lastWorkflow !== workflowRef) {
this.lastVersion = version;
this.lastWorkflow = workflowRef;
this.workflowsService.secondaryWdl(workflowRef.id, version.name).subscribe((sourceFiles: Array<SourceFile>) => {
if (!sourceFiles || sourceFiles.length === 0) {
this.workflowsService.wdl(workflowRef.id, version.name).subscribe((sourceFile) => {
this.wdlHasHttpImports = importHttpRegEx.test(sourceFile.content);
});
if (this.enableLaunchWithFireCloud) {
this.fireCloudURL = `${Dockstore.FIRECLOUD_IMPORT_URL}/${workflowRef.full_workflow_path}:${version.name}`;
}
} else {
this.wdlHasFileImports = true;
}
} else {
this.wdlHasFileImports = true;
}
});
});
}
}
}
}
Expand Down Expand Up @@ -206,6 +212,7 @@ export class WorkflowComponent extends Entry {
this.workflowService.setWorkflow(workflow);
this.selectedVersion = this.selectVersion(this.workflow.workflowVersions, this.urlVersion,
this.workflow.defaultVersion);
this.checkWdlForImportsAndSetFirecloudUrl(workflow);

this.selectTab(this.validTabs.indexOf(this.currentTab));
if (this.workflow != null) {
Expand Down

0 comments on commit adb9d75

Please sign in to comment.