Skip to content

Commit

Permalink
fix TRS link for Galaxy workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
svonworl authored Dec 7, 2023
1 parent 56236cb commit d58322b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/descriptor-languages/Jupyter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export const extendedJupyter: ExtendedDescriptorLanguageBean = {
toolDescriptorEnum: ToolDescriptor.TypeEnum.JUPYTER,
workflowDescriptorEnum: Workflow.DescriptorTypeEnum.Jupyter,
languageDocumentationURL: JUPYTER_DOCUMENTATION_URL,
plainTRS: null,
descriptorFileTypes: [],
plainTRS: 'PLAIN_JUPYTER',
descriptorFileTypes: [SourceFile.TypeEnum.DOCKSTOREJUPYTER],
toolTab: {
rowIdentifier: 'tool\xa0ID',
workflowStepHeader: 'Notebook',
Expand Down
10 changes: 10 additions & 0 deletions src/app/workflow/info-tab/info-tab.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,14 @@ describe('ValueService', () => {
expect(service.getTRSId(sampleWorkflow3, EntryType.Service)).toBe(`#service/${fullWorkflowPath}`);
expect(service.getTRSId(null, EntryType.BioWorkflow)).toBe('');
});

it(`getTRSPlainType should work for various descriptor types`, () => {
service = TestBed.inject(InfoTabService);
expect(service.getTRSPlainType('CWL')).toBe('PLAIN_CWL');
expect(service.getTRSPlainType('WDL')).toBe('PLAIN_WDL');
expect(service.getTRSPlainType('NFL')).toBe('PLAIN_NFL');
expect(service.getTRSPlainType('gxformat2')).toBe('PLAIN_GALAXY');
expect(service.getTRSPlainType('jupyter')).toBe('PLAIN_JUPYTER');
expect(service.getTRSPlainType('bogus')).toBe('PLAIN_BOGUS');
});
});
12 changes: 10 additions & 2 deletions src/app/workflow/info-tab/info-tab.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,21 @@ export class InfoTabService {
getTRSLink(path: string, versionName: string, descriptorType: string, descriptorPath: string, entryType: EntryType): string {
return (
`${Dockstore.API_URI}${ga4ghPath}/tools/${encodeURIComponent(this.getTRSIDFromPath(path, entryType))}` +
`/versions/${encodeURIComponent(versionName)}/PLAIN_` +
descriptorType.toUpperCase() +
`/versions/${encodeURIComponent(versionName)}/` +
this.getTRSPlainType(descriptorType) +
`/descriptor/` +
descriptorPath
);
}

getTRSPlainType(dockstoreDescriptorType: string): string {
const trsDescriptorType = this.descriptorTypeCompatService.stringToDescriptorType(dockstoreDescriptorType);
return (
this.descriptorTypeCompatService.toolDescriptorTypeEnumToPlainTRS(trsDescriptorType) ??
`PLAIN_${dockstoreDescriptorType.toUpperCase()}`
);
}

getTRSId(workflow: Workflow | undefined, entryType: EntryType): string {
if (!workflow) {
return '';
Expand Down

0 comments on commit d58322b

Please sign in to comment.