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
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
<button
*ngIf="deviceView === DeviceView.Basic"
[tabIndex]="tabIndex"
[attr.role]="tabIndex === 0 ? 'button' : 'presentation'"
(click)="itemClick()"
[attr.aria-label]="label"
[ngClass]="{ 'non-interective': tabIndex !== 0 }"
class="device-item"
type="button">
<div class="item-manufacturer">
<div
class="item-manufacturer"
attr.aria-label="{{ device.test_pack }} {{ device.manufacturer }}">
<app-program-type-icon
*ngIf="device.test_pack === TestingType.Qualification"
[type]="ProgramType.Qualification"
Expand All @@ -32,9 +35,7 @@
[type]="ProgramType.Pilot"
matTooltip="This device will be tested for the Pilot program."
aria-label="This device will be tested for the Pilot program."></app-program-type-icon>
<span [attr.aria-label]="device.manufacturer">{{
device.manufacturer
}}</span>
<span>{{ device.manufacturer }}</span>
</div>
<div [attr.aria-label]="device.model" class="item-name">
{{ device.model }}
Expand All @@ -55,7 +56,7 @@
attr.aria-label="Edit device {{ label }}"
class="button-edit"
type="button">
<div [attr.aria-label]="device.manufacturer" class="item-manufacturer">
<div class="item-manufacturer">
<app-program-type-icon
*ngIf="device.test_pack === TestingType.Qualification"
[type]="ProgramType.Qualification"
Expand All @@ -73,16 +74,13 @@
edit_square</mat-icon
>
</div>
<div
*ngIf="device.status === DeviceStatus.INVALID"
[attr.aria-label]="device.status"
class="item-status">
Outdated
<div *ngIf="device.status === DeviceStatus.INVALID" class="item-status">
{{ INVALID_DEVICE }}
</div>
<div [attr.aria-label]="device.model" class="item-name">
<div class="item-name">
{{ device.model }}
</div>
<div [attr.aria-label]="device.mac_addr" class="item-mac-address">
<div class="item-mac-address">
{{ device.mac_addr }}
</div>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class DeviceItemComponent {
readonly DeviceStatus = DeviceStatus;
readonly TestingType = TestingType;
readonly ProgramType = ProgramType;
readonly INVALID_DEVICE = 'Outdated';
@Input() device!: Device;
@Input() tabIndex = 0;
@Input() deviceView!: string;
Expand All @@ -60,6 +61,8 @@ export class DeviceItemComponent {
}

get label() {
return `${this.device.manufacturer} ${this.device.model} ${this.device.mac_addr}`;
const deviceStatus =
this.device.status === DeviceStatus.INVALID ? this.INVALID_DEVICE : '';
return `${this.device.test_pack} ${this.device.manufacturer} ${this.device.model} ${deviceStatus} ${this.device.mac_addr}`;
}
}