Skip to content
Merged
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
8 changes: 8 additions & 0 deletions modules/ui/src/app/mocks/reports.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const HISTORY = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
tags: [],
report: 'https://api.testrun.io/report.pdf',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
Expand All @@ -29,6 +30,7 @@ export const HISTORY = [
firmware: '1.2.3',
test_pack: TestingType.Qualification,
},
tags: [],
report: 'https://api.testrun.io/report.pdf',
started: '2023-07-23T10:11:00.123Z',
finished: '2023-07-23T10:17:10.123Z',
Expand All @@ -44,6 +46,7 @@ export const HISTORY = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
tags: [],
report: 'https://api.testrun.io/report.pdf',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
Expand All @@ -62,6 +65,7 @@ export const HISTORY_AFTER_REMOVE = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
tags: [],
report: 'https://api.testrun.io/report.pdf',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
Expand All @@ -77,6 +81,7 @@ export const HISTORY_AFTER_REMOVE = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
tags: [],
report: 'https://api.testrun.io/report.pdf',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
Expand All @@ -95,6 +100,7 @@ export const FORMATTED_HISTORY = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
tags: [],
report: 'https://api.testrun.io/report.pdf',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
Expand All @@ -114,6 +120,7 @@ export const FORMATTED_HISTORY = [
firmware: '1.2.3',
test_pack: TestingType.Qualification,
},
tags: [],
report: 'https://api.testrun.io/report.pdf',
started: '2023-07-23T10:11:00.123Z',
finished: '2023-07-23T10:17:10.123Z',
Expand All @@ -133,6 +140,7 @@ export const FORMATTED_HISTORY = [
firmware: '1.2.2',
test_pack: TestingType.Qualification,
},
tags: [],
report: 'https://api.testrun.io/report.pdf',
started: '2023-06-23T10:11:00.123Z',
finished: '2023-06-23T10:17:10.123Z',
Expand Down
1 change: 1 addition & 0 deletions modules/ui/src/app/mocks/testrun.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const PROGRESS_DATA_RESPONSE = (
finished,
tests,
report,
tags: ['VSA', 'Other tag', 'And one more'],
};
};

Expand Down
2 changes: 2 additions & 0 deletions modules/ui/src/app/model/testrun-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface TestrunStatus {
finished: string | null;
tests?: TestsResponse;
report: string;
tags: string[];
}

export interface HistoryTestrun extends TestrunStatus {
Expand Down Expand Up @@ -100,6 +101,7 @@ export const IDLE_STATUS = {
total: 0,
results: [],
},
tags: [],
} as TestrunStatus;

export type TestrunStatusKey = keyof typeof StatusOfTestrun;
Expand Down
14 changes: 14 additions & 0 deletions modules/ui/src/app/pages/testrun/testrun.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ <h2 class="title progress-title" tabindex="-1">
data.device.firmware
}}
</h2>
<span *ngIf="data.tags.length" class="toolbar-tag-container">
<span
tabindex="0"
class="toolbar-tag"
*ngFor="let tag of data.tags"
[attr.aria-label]="tag"
[matTooltip]="
tag === 'VSA'
? 'Device qualification requires Vendor Security Assessment'
: tag
"
>{{ tag }}</span
>
</span>
<button
*ngIf="isTestrunInProgress(data.status)"
(click)="openStopTestrunDialog(vm.systemStatus)"
Expand Down
26 changes: 26 additions & 0 deletions modules/ui/src/app/pages/testrun/testrun.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
@use 'node_modules/@angular/material/index' as mat;
@import 'src/theming/colors';
@import 'src/theming/variables';

:host {
display: flex;
Expand Down Expand Up @@ -88,6 +89,31 @@
text-overflow: ellipsis;
}

.toolbar-tag-container {
align-self: flex-start;
display: flex;
align-items: center;
gap: 6px;
margin-left: -10px;
}

.toolbar-tag {
background-color: mat.m2-get-color-from-palette($color-primary, 800);
color: $white;
font-family: $font-primary;
font-size: 8px;
font-weight: 500;
height: 16px;
line-height: 16px;
letter-spacing: 0.6px;
text-align: center;
padding: 0 4px 0 4px;
border-radius: 2px;
&:hover {
cursor: pointer;
}
}

.report-button,
.stop-button,
.start-button {
Expand Down
11 changes: 11 additions & 0 deletions modules/ui/src/app/pages/testrun/testrun.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import {
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NotificationService } from '../../services/notification.service';
import { Profile } from '../../model/profile';
import { MatTooltipModule } from '@angular/material/tooltip';

describe('TestrunComponent', () => {
let component: TestrunComponent;
Expand Down Expand Up @@ -141,6 +142,7 @@ describe('TestrunComponent', () => {
MatDialogModule,
SpinnerComponent,
BrowserAnimationsModule,
MatTooltipModule,
],
})
.overrideComponent(TestrunComponent, {
Expand Down Expand Up @@ -260,6 +262,7 @@ describe('TestrunComponent', () => {
MatDialogModule,
SpinnerComponent,
BrowserAnimationsModule,
MatTooltipModule,
],
})
.overrideComponent(TestrunComponent, {
Expand Down Expand Up @@ -429,6 +432,14 @@ describe('TestrunComponent', () => {

expect(downloadComp).toBeNull();
});

it('should have tags', () => {
const tags = fixture.nativeElement.querySelector(
'.toolbar-tag-container'
);

expect(tags).toBeTruthy();
});
});

describe('with available systemStatus$ data, as Completed', () => {
Expand Down
2 changes: 2 additions & 0 deletions modules/ui/src/app/pages/testrun/testrun.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { DownloadReportComponent } from '../../components/download-report/downlo
import { SpinnerComponent } from '../../components/spinner/spinner.component';
import { CalloutComponent } from '../../components/callout/callout.component';
import { DownloadOptionsComponent } from './components/download-options/download-options.component';
import { MatTooltipModule } from '@angular/material/tooltip';

@NgModule({
declarations: [
Expand All @@ -60,6 +61,7 @@ import { DownloadOptionsComponent } from './components/download-options/download
SpinnerComponent,
CalloutComponent,
DownloadOptionsComponent,
MatTooltipModule,
],
})
export class TestrunModule {}
4 changes: 4 additions & 0 deletions modules/ui/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,7 @@ body:has(app-risk-assessment .profiles-drawer) #main app-callout {
.certificate-notification .mat-mdc-snack-bar-label {
white-space: pre-line;
}

.mdc-tooltip--multiline .mat-mdc-tooltip-surface {
text-align: center !important;
}