Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEAB-6341: Add Metrics type icons in versions tab #2048

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cypress/e2e/group3/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ describe('Dockstore Metrics', () => {
}).as('getMetrics');
});
cy.visit('/workflows/github.com/A/l:master');
goToTab('Versions');
cy.get('[data-cy=execution-metrics-icon]').should('be.visible');
cy.get('[data-cy=validation-metrics-icon]').should('be.visible');

cy.wait('@getMetrics');
goToTab('Metrics');

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.13.0",
"license": "Apache License 2.0",
"config": {
"webservice_version_prefix": "1.17.0",
"webservice_version_prefix": "1.17.0-feature-seab-6341",
"webservice_version": "1.17.0",
"use_snapshot": true
},
Expand Down
11 changes: 10 additions & 1 deletion src/app/workflow/versions/versions-datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,19 @@ export class VersionsDataSource implements DataSource<WorkflowVersion> {
pageIndex,
sortCol,
sortDirection,
'metrics',
'response'
);
} else {
workflowVersions = this.workflowsService.getWorkflowVersions(workflowId, pageSize, pageIndex, sortCol, sortDirection, 'response');
workflowVersions = this.workflowsService.getWorkflowVersions(
workflowId,
pageSize,
pageIndex,
sortCol,
sortDirection,
'metrics',
'response'
);
}

workflowVersions.pipe(finalize(() => this.loadingSubject$.next(false))).subscribe((versions) => {
Expand Down
13 changes: 12 additions & 1 deletion src/app/workflow/versions/versions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,18 @@
>
</th>
<td mat-cell *matCellDef="let version">
<mat-icon data-cy="metrics" *ngIf="version.metricsByPlatform && (version.metricsByPlatform | json) !== '{}'">check</mat-icon>
<img
*ngIf="showExecutionMetricsIcon(version)"
src="../assets/svg/execution-icon.svg"
alt="Execution Metrics Icon"
matTooltip="This version contains execution metrics."
/>
<img
*ngIf="showValidationMetricsIcon(version)"
src="../assets/svg/validation-icon.svg"
alt="Validation Metrics Icon"
matTooltip="This version contains validation metrics."
/>
</td>
</ng-container>

Expand Down
20 changes: 19 additions & 1 deletion src/app/workflow/versions/versions.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { AlertService } from '../../shared/alert/state/alert.service';
import { DateService } from '../../shared/date.service';
import { Dockstore } from '../../shared/dockstore.model';
import { DockstoreService } from '../../shared/dockstore.service';
import { Doi, EntryType, VersionVerifiedPlatform, WorkflowsService } from '../../shared/openapi';
import { CloudInstance, Doi, EntryType, VersionVerifiedPlatform, WorkflowsService } from '../../shared/openapi';
import { ExtendedWorkflow } from '../../shared/models/ExtendedWorkflow';
import { SessionQuery } from '../../shared/session/session.query';
import { ExtendedWorkflowQuery } from '../../shared/state/extended-workflow.query';
Expand All @@ -45,6 +45,7 @@ import { PaginatorService } from '../../shared/state/paginator.service';
import { merge, Observable } from 'rxjs';
import { MatLegacyPaginator as MatPaginator, MatLegacyPaginatorModule } from '@angular/material/legacy-paginator';
import { VersionsDataSource } from './versions-datasource';
import PartnerEnum = CloudInstance.PartnerEnum;

@Component({
selector: 'app-versions-workflow',
Expand Down Expand Up @@ -82,6 +83,7 @@ export class VersionsWorkflowComponent extends Versions implements OnInit, OnCha
@Input() workflowId: number;
@Input() verifiedVersionPlatforms: Array<VersionVerifiedPlatform>;
@Input() publicPage: boolean;

_selectedVersion: WorkflowVersion;
Dockstore = Dockstore;
@Input() set selectedVersion(value: WorkflowVersion) {
Expand Down Expand Up @@ -245,4 +247,20 @@ export class VersionsWorkflowComponent extends Versions implements OnInit, OnCha
trackBy(index: number, item: WorkflowVersion) {
return item.id;
}

showExecutionMetricsIcon(version: WorkflowVersion) {
if (version.metricsByPlatform !== null) {
const metrics = version.metricsByPlatform[PartnerEnum.ALL];
return metrics?.executionStatusCount != null;
}
return false;
}

showValidationMetricsIcon(version: WorkflowVersion) {
if (version.metricsByPlatform !== null) {
const metrics = version.metricsByPlatform[PartnerEnum.ALL];
return metrics?.validationStatus != null;
}
return false;
}
}
Loading