Skip to content

Commit

Permalink
Merge branch 'release/2.13.0-beta.1' into release/2.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-yuen committed Oct 31, 2024
2 parents 7083d84 + bccb3bd commit c7df560
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/app/home-page/home-logged-out/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ <h3><span class="title-strong">Use</span> in many analysis environments.</h3>
<span class="code primary-3">## or grab one that the workflow author has provided (if applicable)</span>
<span class="code"><span style="color: #3f51b5">wget --header=</span><span style="color: #0277bd">'Accept: text/plain' </span><span class="warn-1">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</span></span>
<span class="code primary-3">## Run locally with the Dockstore CLI</span>
<span class="code"><span style="color: #3f51b5">dockstore</span><span style="color: #0277bd">' workflow launch --entry </span><span class="warn-1">github.com/dockstore/bcc2020-training/HelloWorld:master --json Dockstore.json</span></span>
<span class="code"><span style="color: #3f51b5">dockstore</span> <span style="color: #0277bd">workflow launch --entry </span><span class="warn-1">github.com/dockstore/bcc2020-training/HelloWorld:master --json Dockstore.json</span></span>
</pre>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/app/test/service-stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
56 changes: 22 additions & 34 deletions src/app/workflow/launch-third-party/launch-third-party.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 */
/**
Expand Down Expand Up @@ -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,
Expand All @@ -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<SourceFile>) => {
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);
Expand All @@ -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<SourceFile>) => {
this.descriptorsService.updateSecondaryDescriptors(sourceFiles);
});
this.devcontainers = undefined;
if (this.workflow.descriptorType === Workflow.DescriptorTypeEnum.Jupyter) {
const workflowId = this.workflow.id;
Expand Down
2 changes: 1 addition & 1 deletion src/app/workflow/launch/launch.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c7df560

Please sign in to comment.