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
3 changes: 3 additions & 0 deletions modules/ui/src/app/mocks/reports.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export const FORMATTED_HISTORY = [
finished: '2023-06-23T10:17:10.123Z',
deviceFirmware: '1.2.2',
deviceInfo: 'Delta 03-DIN-SRC',
testResult: 'Compliant',
duration: '06m 10s',
program: 'Device Qualification',
},
Expand All @@ -133,6 +134,7 @@ export const FORMATTED_HISTORY = [
finished: '2023-07-23T10:17:10.123Z',
deviceFirmware: '1.2.3',
deviceInfo: 'Delta 03-DIN-SRC',
testResult: 'Compliant',
duration: '06m 10s',
program: 'Device Qualification',
},
Expand All @@ -154,6 +156,7 @@ export const FORMATTED_HISTORY = [
finished: '2023-06-23T10:17:10.123Z',
deviceFirmware: '1.2.2',
deviceInfo: 'Delta 03-DIN-SRC',
testResult: 'Compliant',
duration: '06m 10s',
program: 'Device Qualification',
},
Expand Down
1 change: 1 addition & 0 deletions modules/ui/src/app/model/testrun-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface TestrunStatus {
export interface HistoryTestrun extends TestrunStatus {
deviceFirmware: string;
deviceInfo: string;
testResult: string;
program: string;
duration: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ import {
DateRange as LocalDateRange,
} from '../../../../model/filters';
import { EscapableDialogComponent } from '../../../../components/escapable-dialog/escapable-dialog.component';
import { StatusOfTestResult } from '../../../../model/testrun-status';
import {
ResultOfTestrun,
StatusOfTestrun,
} from '../../../../model/testrun-status';
import { DeviceValidators } from '../../../devices/components/device-form/device.validators';

interface DialogData {
Expand Down Expand Up @@ -97,8 +100,10 @@ export class FilterDialogComponent
implements OnInit
{
resultList = [
{ value: StatusOfTestResult.Compliant, enabled: false },
{ value: StatusOfTestResult.NonCompliant, enabled: false },
{ value: ResultOfTestrun.Compliant, enabled: false },
{ value: ResultOfTestrun.NonCompliant, enabled: false },
{ value: StatusOfTestrun.Proceed, enabled: false },
{ value: StatusOfTestrun.DoNotProceed, enabled: false },
];
filterForm!: FormGroup;
selectedRangeValue!: DateRange<Date> | undefined;
Expand Down
4 changes: 2 additions & 2 deletions modules/ui/src/app/pages/reports/reports.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ <h2 class="title" tabindex="-1">Reports</h2>
</th>
<td *matCellDef="let data" mat-cell>
<span
[ngClass]="getResultClass(data.status)"
[ngClass]="getResultClass(data.testResult)"
class="cell-result-text">
{{ data.status }}
{{ data.testResult }}
</span>
</td>
</ng-container>
Expand Down
15 changes: 14 additions & 1 deletion modules/ui/src/app/pages/reports/reports.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { selectReports, selectRiskProfiles } from '../../store/selectors';
import { Store } from '@ngrx/store';
import { AppState } from '../../store/state';
import { fetchReports, setReports } from '../../store/actions';
import { TestingType } from '../../model/device';

export interface ReportsComponentState {
displayedColumns: string[];
Expand Down Expand Up @@ -252,12 +253,24 @@ export class ReportsStore extends ComponentStore<ReportsComponentState> {
...item,
deviceFirmware: item.device.firmware,
deviceInfo: item.device.manufacturer + ' ' + item.device.model,
testResult: this.getTestResult(item),
duration: this.getDuration(item.started, item.finished),
program: item.device.test_pack ?? '',
};
});
}

private getTestResult(item: TestrunStatus): string {
let result = '';
if (item.device.test_pack === TestingType.Qualification) {
result = item.result ? item.result : item.status;
}
if (item.device.test_pack === TestingType.Pilot) {
result = item.status;
}
return result;
}

private getDuration(started: string | null, finished: string | null): string {
if (!started || !finished) {
return '';
Expand Down Expand Up @@ -290,7 +303,7 @@ export class ReportsStore extends ComponentStore<ReportsComponentState> {

const isIncludeStatus =
searchString.results?.length === 0 ||
searchString.results?.includes(data.status);
searchString.results?.includes(data.testResult);
const isIncludeStartedDate = this.filterStartedDateRange(
data.started,
searchString
Expand Down
2 changes: 2 additions & 0 deletions modules/ui/src/app/services/test-run.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ describe('TestRunService', () => {

const statusesForGreenRes = [
StatusOfTestResult.Compliant,
StatusOfTestrun.Proceed,
StatusOfTestResult.CompliantLimited,
StatusOfTestResult.CompliantHigh,
];
Expand All @@ -276,6 +277,7 @@ describe('TestRunService', () => {

const statusesForRedRes = [
StatusOfTestResult.NonCompliant,
StatusOfTestrun.DoNotProceed,
StatusOfTestResult.Error,
];

Expand Down
2 changes: 2 additions & 0 deletions modules/ui/src/app/services/test-run.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@ export class TestRunService {
return {
green:
result === StatusOfTestResult.Compliant ||
result === StatusOfTestrun.Proceed ||
result === StatusOfTestResult.CompliantLimited ||
result === StatusOfTestResult.CompliantHigh,
red:
result === StatusOfTestResult.NonCompliant ||
result === StatusOfTestrun.DoNotProceed ||
result === StatusOfTestResult.Error,
blue:
result === StatusOfTestResult.SmartReady ||
Expand Down
4 changes: 2 additions & 2 deletions resources/test_packs/pilot/config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Pilot Assessment",
"language": {
"compliant_description": "Your device has met the initial pilot assessment requirements. Please send your Testrun ZIP file to the qualification lab for verification. The lab will then contact you with further instructions.",
"non_compliant_description": "Your device didn't quite meet the initial pilot assessment requirements. The Testrun report will provide guidance on how to resolve any issues. If you require further support, please get in touch with the qualification lab."
"compliant_description": "This is a preliminary test result. Please attach the Risk Profile and download the test results. A full evaluation and recommendation will be provided by the lab team.",
"non_compliant_description": "This is a preliminary test result. Please attach the Risk Profile and download the test results. A full evaluation and recommendation will be provided by the lab team."
},
"tests": [
{
Expand Down
Loading