Skip to content

Commit

Permalink
Use new description endpoint (#1812)
Browse files Browse the repository at this point in the history
* Use new description endpoint

SEAB-4592
  • Loading branch information
coverbeck authored Jul 13, 2023
1 parent 0c21d62 commit 8d648b1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"config": {
"webservice_version": "1.15.0",
"use_circle": true,
"circle_ci_source": "https://app.circleci.com/pipelines/github/dockstore/dockstore/10164/workflows/ea25cb1f-4d5f-4124-86d4-2305408a3784/jobs/35487/artifacts",
"circle_build_id": "35487"
"circle_ci_source": "https://app.circleci.com/pipelines/github/dockstore/dockstore/10185/workflows/bb72bacc-56ac-4b5e-b4a2-dfe7c9ab35f6/jobs/35552/artifacts",
"circle_build_id": "35552"
},
"scripts": {
"ng": "npx ng",
Expand Down
8 changes: 4 additions & 4 deletions src/app/container/info-tab/info-tab.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,15 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
<div *ngIf="selectedVersion?.description || !isPublic">
<div *ngIf="description || !isPublic">
<label matTooltip="Description of tool obtained from tool descriptor"> Description </label>:
<div *ngIf="selectedVersion?.description" class="well well-sm">
<div *ngIf="description" class="well well-sm">
<app-markdown-wrapper
[data]="selectedVersion?.description"
[data]="description"
[baseUrl]="tool?.providerUrl | baseUrl: selectedVersion?.reference"
></app-markdown-wrapper>
</div>
<div *ngIf="!selectedVersion?.description && !isPublic" class="well well-sm">
<div *ngIf="!description && !isPublic" class="well well-sm">
<mat-icon>warning</mat-icon>
<span ng-show="!containerObj.description">
No description associated with this tool. See
Expand Down
16 changes: 13 additions & 3 deletions src/app/container/info-tab/info-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Dockstore } from '../../shared/dockstore.model';
import { ExtendedToolsService } from '../../shared/extended-tools.service';
import { ExtendedDockstoreTool } from '../../shared/models/ExtendedDockstoreTool';
import { SessionQuery } from '../../shared/session/session.query';
import { ToolDescriptor, ToolVersion, WorkflowVersion } from '../../shared/openapi';
import { ContainertagsService, ToolDescriptor, ToolVersion, WorkflowVersion } from '../../shared/openapi';
import { DockstoreTool } from '../../shared/openapi/model/dockstoreTool';
import { Tag } from '../../shared/openapi/model/tag';
import { exampleDescriptorPatterns, validationDescriptorPatterns } from '../../shared/validationMessages.model';
Expand All @@ -42,10 +42,11 @@ export class InfoTabComponent extends Base implements OnInit, OnChanges {
@Input() selectedVersion: Tag;
@Input() privateOnlyRegistry: boolean;
@Input() extendedDockstoreTool: ExtendedDockstoreTool;
public description: string | null;
public validationPatterns = validationDescriptorPatterns;
public exampleDescriptorPatterns = exampleDescriptorPatterns;
public DockstoreToolType = DockstoreTool;
public tool: DockstoreTool;
public tool: ExtendedDockstoreTool;
public topicEditing: boolean;
public TopicSelectionEnum = DockstoreTool.TopicSelectionEnum;
public authors: Array<Author> = [];
Expand All @@ -61,12 +62,18 @@ export class InfoTabComponent extends Base implements OnInit, OnChanges {
downloadZipLink: string;
isValidVersion = false;
Dockstore = Dockstore;
constructor(private infoTabService: InfoTabService, private sessionQuery: SessionQuery, private containersService: ExtendedToolsService) {
constructor(
private infoTabService: InfoTabService,
private sessionQuery: SessionQuery,
private containersService: ExtendedToolsService,
private containerTagsService: ContainertagsService
) {
super();
}

ngOnChanges() {
this.tool = JSON.parse(JSON.stringify(this.extendedDockstoreTool));
this.description = null;
if (this.selectedVersion && this.tool) {
this.authors = this.selectedVersion.authors;
this.currentVersion = this.selectedVersion;
Expand All @@ -88,6 +95,9 @@ export class InfoTabComponent extends Base implements OnInit, OnChanges {
this.currentVersion.wdl_path
);
}
this.containerTagsService
.getTagDescription(this.tool.id, this.selectedVersion.id)
.subscribe((description) => (this.description = description));
} else {
this.isValidVersion = false;
this.trsLinkCWL = null;
Expand Down
8 changes: 4 additions & 4 deletions src/app/workflow/info-tab/info-tab.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,15 @@
{{ publicAccessibleTestParameterFile ? 'Yes' : 'No' }}
</div>
<div>
<div *ngIf="selectedVersion?.description || !isPublic">
<div *ngIf="description || !isPublic">
<label matTooltip="Description of workflow obtained from workflow descriptor"> Description </label>:
<div *ngIf="selectedVersion?.description" class="well well-sm">
<div *ngIf="description" class="well well-sm">
<app-markdown-wrapper
[data]="selectedVersion?.description"
[data]="description"
[baseUrl]="workflow?.providerUrl | baseUrl: selectedVersion?.name:selectedVersion?.readMePath"
></app-markdown-wrapper>
</div>
<div *ngIf="!selectedVersion?.description && !isPublic" class="well well-sm">
<div *ngIf="!description && !isPublic" class="well well-sm">
<mat-icon>warning</mat-icon>
<span ng-show="!containerObj.description">
No description associated with this {{ entryType$ | async }}.
Expand Down
6 changes: 6 additions & 0 deletions src/app/workflow/info-tab/info-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class InfoTabComponent extends EntryTab implements OnInit, OnChanges {
public WorkflowType = Workflow;
public TopicSelectionEnum = Workflow.TopicSelectionEnum;
public tooltip = Tooltip;
public description: string | null;
workflowPathEditing: boolean;
temporaryDescriptorType: Workflow.DescriptorTypeEnum;
descriptorLanguages$: Observable<Array<Workflow.DescriptorTypeEnum>>;
Expand Down Expand Up @@ -110,6 +111,7 @@ export class InfoTabComponent extends EntryTab implements OnInit, OnChanges {
}
this.workflow = this.deepCopy(this.extendedWorkflow);
this.temporaryDescriptorType = this.workflow.descriptorType;
this.description = null;
if (this.selectedVersion && this.workflow) {
this.currentVersion = this.selectedVersion;
this.publicAccessibleTestParameterFile = this.selectedVersion?.versionMetadata?.publicAccessibleTestParameterFile;
Expand All @@ -132,6 +134,9 @@ export class InfoTabComponent extends EntryTab implements OnInit, OnChanges {
this.workflowsService.getWorkflowVersionOrcidAuthors(this.workflow.id, this.selectedVersion.id).subscribe((orcidAuthors) => {
this.authors = [...this.selectedVersion.authors, ...orcidAuthors];
});
this.workflowsService
.getWorkflowVersionDescription(this.workflow.id, this.selectedVersion.id)
.subscribe((description) => (this.description = description));
} else {
this.currentVersion = null;
this.publicAccessibleTestParameterFile = null;
Expand All @@ -140,6 +145,7 @@ export class InfoTabComponent extends EntryTab implements OnInit, OnChanges {
this.isValidVersion = null;
this.downloadZipLink = null;
this.authors = null;
this.description = null;
}
}

Expand Down

0 comments on commit 8d648b1

Please sign in to comment.