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/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ const routes: Routes = [
import('./pages/reports/history.module').then(m => m.HistoryModule),
title: 'Testrun - Reports',
},
{
path: 'risk-assessment',
loadChildren: () =>
import('./pages/risk-assessment/risk-assessment.module').then(
m => m.RiskAssessmentModule
),
title: 'Testrun - Risk Assessment',
},
{
path: '',
redirectTo: 'devices',
Expand Down
11 changes: 11 additions & 0 deletions modules/ui/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@
}
">
</ng-container>
<ng-container
*ngTemplateOutlet="
navButtonRoute;
context: {
route: Routes.RiskAssessment,
svgIcon: 'risk_assessment',
label: 'Risk Assessment',
name: 'risk-assessment'
}
">
</ng-container>
<app-version
[consentShown]="vm.consentShown"
(consentShownEvent)="consentShown()"></app-version>
Expand Down
5 changes: 5 additions & 0 deletions modules/ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { TestRunService } from './services/test-run.service';
const DEVICES_LOGO_URL = '/assets/icons/devices.svg';
const DEVICES_RUN_URL = '/assets/icons/device_run.svg';
const REPORTS_LOGO_URL = '/assets/icons/reports.svg';
const RISK_ASSESSMENT_LOGO_URL = '/assets/icons/risk-assessment.svg';
const TESTRUN_LOGO_URL = '/assets/icons/testrun_logo_small.svg';
const TESTRUN_LOGO_COLOR_URL = '/assets/icons/testrun_logo_color.svg';
const CLOSE_URL = '/assets/icons/close.svg';
Expand Down Expand Up @@ -86,6 +87,10 @@ export class AppComponent {
'reports',
this.domSanitizer.bypassSecurityTrustResourceUrl(REPORTS_LOGO_URL)
);
this.matIconRegistry.addSvgIcon(
'risk_assessment',
this.domSanitizer.bypassSecurityTrustResourceUrl(RISK_ASSESSMENT_LOGO_URL)
);
this.matIconRegistry.addSvgIcon(
'testrun_logo_small',
this.domSanitizer.bypassSecurityTrustResourceUrl(TESTRUN_LOGO_URL)
Expand Down
1 change: 1 addition & 0 deletions modules/ui/src/app/model/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ export enum Routes {
Devices = '/devices',
Testing = '/testing',
Reports = '/reports',
RiskAssessment = '/risk-assessment',
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
}

.device-repository-toolbar {
padding-left: 32px;
gap: 16px;
background: $white;
height: 72px;
height: 74px;
padding: 24px 0 8px 32px;
}

.device-repository-content {
Expand Down
6 changes: 3 additions & 3 deletions modules/ui/src/app/pages/reports/history.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
}

.history-toolbar {
padding-left: 32px;
gap: 10px;
background: $white;
height: 72px;
height: 74px;
padding: 24px 0 8px 32px;
}

.history-content {
margin: 0 32px 39px 32px;
margin: 10px 32px 39px 32px;
overflow-y: auto;
border-radius: 4px;
border: 1px solid $lighter-grey;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { RiskAssessmentComponent } from './risk-assessment.component';

const routes: Routes = [{ path: '', component: RiskAssessmentComponent }];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class RiskAssessmentRoutingModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
Copyright 2023 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<mat-toolbar class="risk-assessment-toolbar">
<h2 class="title">Risk assessment</h2>
</mat-toolbar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@import 'src/theming/colors';

.risk-assessment-toolbar {
height: 74px;
padding: 24px 0 8px 32px;
background: $white;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { RiskAssessmentComponent } from './risk-assessment.component';
import { MatToolbarModule } from '@angular/material/toolbar';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

describe('RiskAssessmentComponent', () => {
let component: RiskAssessmentComponent;
let fixture: ComponentFixture<RiskAssessmentComponent>;
let compiled: HTMLElement;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [RiskAssessmentComponent],
imports: [MatToolbarModule, BrowserAnimationsModule],
}).compileComponents();

fixture = TestBed.createComponent(RiskAssessmentComponent);
component = fixture.componentInstance;
compiled = fixture.nativeElement as HTMLElement;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});

it('should have toolbar with title', () => {
const toolbarEl = compiled.querySelector('.risk-assessment-toolbar');
const title = compiled.querySelector('h2.title');
const titleContent = title?.innerHTML.trim();

expect(toolbarEl).not.toBeNull();
expect(title).toBeTruthy();
expect(titleContent).toContain('Risk assessment');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'app-risk-assessment',
templateUrl: './risk-assessment.component.html',
styleUrl: './risk-assessment.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class RiskAssessmentComponent {}
27 changes: 27 additions & 0 deletions modules/ui/src/app/pages/risk-assessment/risk-assessment.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { RiskAssessmentRoutingModule } from './risk-assessment-routing.module';
import { MatToolbarModule } from '@angular/material/toolbar';
import { RiskAssessmentComponent } from './risk-assessment.component';

@NgModule({
declarations: [RiskAssessmentComponent],
imports: [CommonModule, RiskAssessmentRoutingModule, MatToolbarModule],
})
export class RiskAssessmentModule {}
10 changes: 10 additions & 0 deletions modules/ui/src/assets/icons/risk-assessment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion modules/ui/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ mat-hint {
}
}

h2.title {
.mat-toolbar h2.title {
margin: 0;
font-size: 32px;
font-style: normal;
Expand Down