From bcb8476df7366cfb835e269f8488d4b3eade88cc Mon Sep 17 00:00:00 2001 From: David Steinberg Date: Wed, 30 Oct 2024 13:03:37 -0700 Subject: [PATCH 1/2] Typo in landing page (#2039) --- src/app/home-page/home-logged-out/home.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/home-page/home-logged-out/home.component.html b/src/app/home-page/home-logged-out/home.component.html index 5a4fd4fd6e..bccac10107 100644 --- a/src/app/home-page/home-logged-out/home.component.html +++ b/src/app/home-page/home-logged-out/home.component.html @@ -174,7 +174,7 @@

Use in many analysis environments.

## or grab one that the workflow author has provided (if applicable) wget --header='Accept: text/plain' https://dockstore.org/api/api/ga4gh/v2/tools/%23workflow%2Fgithub.com%2Fdockstore%2Fbcc2020-training%2FHelloWorld/versions/master/PLAIN_WDL/descriptor/..%2F..%2Ftest.json -O Dockstore.json ## Run locally with the Dockstore CLI - dockstore' workflow launch --entry github.com/dockstore/bcc2020-training/HelloWorld:master --json Dockstore.json + dockstore workflow launch --entry github.com/dockstore/bcc2020-training/HelloWorld:master --json Dockstore.json From bccb3bdbe8663c28d50ea0945edf61a220dc5b2c Mon Sep 17 00:00:00 2001 From: Steve Von Worley Date: Wed, 30 Oct 2024 14:04:50 -0700 Subject: [PATCH 2/2] fix launch-with button "has no content" bug https://ucsc-cgl.atlassian.net/browse/SEAB-6767 --- src/app/test/service-stubs.ts | 6 ++ .../launch-third-party.component.ts | 56 ++++++++----------- src/app/workflow/launch/launch.component.ts | 2 +- 3 files changed, 29 insertions(+), 35 deletions(-) diff --git a/src/app/test/service-stubs.ts b/src/app/test/service-stubs.ts index c2e4e26f66..b13914a67d 100644 --- a/src/app/test/service-stubs.ts +++ b/src/app/test/service-stubs.ts @@ -889,6 +889,12 @@ export class WorkflowsStubService { updateWorkflowDefaultVersion(workflowId: number, tag: string) { return observableOf([]); } + primaryDescriptor1(workflowId, descriptorType, versionName) { + return observableOf({}); + } + secondaryDescriptors1(workflowId, descriptorType, versionName) { + return observableOf([]); + } } export class ContainersStubService { diff --git a/src/app/workflow/launch-third-party/launch-third-party.component.ts b/src/app/workflow/launch-third-party/launch-third-party.component.ts index 2e89325962..8ecbdf9301 100644 --- a/src/app/workflow/launch-third-party/launch-third-party.component.ts +++ b/src/app/workflow/launch-third-party/launch-third-party.component.ts @@ -2,13 +2,11 @@ import { HttpUrlEncodingCodec } from '@angular/common/http'; import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; import { MatLegacyDialog as MatDialog, MatLegacyDialogModule } from '@angular/material/legacy-dialog'; import { DescriptorLanguageService } from 'app/shared/entry/descriptor-language.service'; -import { combineLatest, Observable } from 'rxjs'; +import { combineLatest, Observable, Subscription } from 'rxjs'; import { map, shareReplay, takeUntil } from 'rxjs/operators'; import { Base } from '../../shared/base'; -import { DescriptorTypeCompatService } from '../../shared/descriptor-type-compat.service'; import { Dockstore } from '../../shared/dockstore.model'; -import { GA4GHFilesQuery } from '../../shared/ga4gh-files/ga4gh-files.query'; -import { CloudInstance, CloudInstancesService, User, ToolFile, Workflow, WorkflowVersion } from '../../shared/openapi'; +import { CloudInstance, CloudInstancesService, User, Workflow, WorkflowVersion } from '../../shared/openapi'; import { WorkflowsService } from '../../shared/openapi/api/workflows.service'; import { SourceFile } from '../../shared/openapi/model/sourceFile'; import { UserQuery } from '../../shared/user/user.query'; @@ -24,7 +22,6 @@ import { FlexModule } from '@ngbracket/ngx-layout/flex'; import { MatDividerModule } from '@angular/material/divider'; import { MatLegacyCardModule } from '@angular/material/legacy-card'; import { NgIf, AsyncPipe } from '@angular/common'; -import FileTypeEnum = ToolFile.FileTypeEnum; /* eslint-disable max-len */ /** @@ -254,10 +251,11 @@ export class LaunchThirdPartyComponent extends Base implements OnChanges, OnInit map(([hasContent]) => (hasContent ? 'Run this notebook at mybinder.org' : 'The notebook has no content.')) ); + private primaryDescriptorSubscription: Subscription | null = null; + private secondaryDescriptorsSubscription: Subscription | null = null; + constructor( private workflowsService: WorkflowsService, - private descriptorTypeCompatService: DescriptorTypeCompatService, - private gA4GHFilesQuery: GA4GHFilesQuery, private descriptorsQuery: DescriptorsQuery, private descriptorsService: DescriptorsService, private cloudInstanceService: CloudInstancesService, @@ -279,37 +277,12 @@ export class LaunchThirdPartyComponent extends Base implements OnChanges, OnInit // this.usersCloudInstances = cloudInstances; // }); // } - - this.gA4GHFilesQuery - .getToolFiles(this.descriptorTypeCompatService.stringToDescriptorType(this.workflow.descriptorType), [ - FileTypeEnum.PRIMARYDESCRIPTOR, - FileTypeEnum.SECONDARYDESCRIPTOR, - ]) - .pipe(takeUntil(this.ngUnsubscribe)) - .subscribe((fileDescriptors) => { - if (fileDescriptors && fileDescriptors.length) { - // No idea if this.workflow.descriptorType is the one that's required or if it's some other enum - const descriptorType = this.workflow.descriptorType; - const descriptorLanguageEnum = - this.descriptorLanguageService.workflowDescriptorTypeEnumToExtendedDescriptorLanguageBean( - descriptorType - ).descriptorLanguageEnum; - this.workflowsService.primaryDescriptor1(this.workflow.id, descriptorType, this.selectedVersion.name).subscribe((sourceFile) => { - this.descriptorsService.updatePrimaryDescriptor(sourceFile); - if (fileDescriptors.some((file) => file.file_type === FileTypeEnum.SECONDARYDESCRIPTOR)) { - this.workflowsService - .secondaryDescriptors1(this.workflow.id, descriptorLanguageEnum, this.selectedVersion.name) - .subscribe((sourceFiles: Array) => { - this.descriptorsService.updateSecondaryDescriptors(sourceFiles); - }); - } - }); - } - }); } ngOnChanges(changes: SimpleChanges): void { this.descriptorsQuery.clear(); + this.primaryDescriptorSubscription?.unsubscribe(); + this.secondaryDescriptorsSubscription?.unsubscribe(); this.trsUrl = this.trsUrlAsQueryValue = this.workflowPathAsQueryValue = null; if (this.workflow && this.selectedVersion) { this.trsUrl = this.descriptorsService.trsUrl(this.workflow.full_workflow_path, this.selectedVersion.name); @@ -319,6 +292,21 @@ export class LaunchThirdPartyComponent extends Base implements OnChanges, OnInit this.workflowRepositoryAsQueryValue = this.encode(this.workflow.repository); this.selectedVersionNameAsQueryValue = this.encode(this.selectedVersion.name); this.selectedVersionWorkflowPathAsQueryValue = this.encode(this.prependIfNotPrefix('/', this.selectedVersion.workflow_path)); + const descriptorType = this.workflow.descriptorType; + const descriptorLanguageEnum = + this.descriptorLanguageService.workflowDescriptorTypeEnumToExtendedDescriptorLanguageBean(descriptorType).descriptorLanguageEnum; + this.primaryDescriptorSubscription = this.workflowsService + .primaryDescriptor1(this.workflow.id, descriptorType, this.selectedVersion.name) + .pipe(takeUntil(this.ngUnsubscribe)) + .subscribe((sourceFile) => { + this.descriptorsService.updatePrimaryDescriptor(sourceFile); + }); + this.secondaryDescriptorsSubscription = this.workflowsService + .secondaryDescriptors1(this.workflow.id, descriptorLanguageEnum, this.selectedVersion.name) + .pipe(takeUntil(this.ngUnsubscribe)) + .subscribe((sourceFiles: Array) => { + this.descriptorsService.updateSecondaryDescriptors(sourceFiles); + }); this.devcontainers = undefined; if (this.workflow.descriptorType === Workflow.DescriptorTypeEnum.Jupyter) { const workflowId = this.workflow.id; diff --git a/src/app/workflow/launch/launch.component.ts b/src/app/workflow/launch/launch.component.ts index c31f743f54..8c25bb7737 100644 --- a/src/app/workflow/launch/launch.component.ts +++ b/src/app/workflow/launch/launch.component.ts @@ -164,7 +164,7 @@ export class LaunchWorkflowComponent extends EntryTab implements OnInit, OnChang ]).subscribe( ([toolFiles, descriptorFiles]) => { // test parameter file is optional ... - if (toolFiles !== undefined) { + if (toolFiles) { if (toolFiles.length > 0) { this.testParameterPath = toolFiles[0].path; } else {