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
95 changes: 49 additions & 46 deletions modules/ui/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,52 @@
<mat-drawer-container hasBackdrop="false" class="app-container" autosize>
<mat-drawer mode="side" role="navigation" opened cdkFocusInitial>
<div class="app-sidebar" #navigation>
<ng-container
*ngTemplateOutlet="
navButtonRoute;
context: {
route: Routes.Testing,
svgIcon: 'testrun_logo_small',
label: 'Testing',
name: 'testrun',
}
">
</ng-container>
<ng-container
*ngTemplateOutlet="
navButtonRoute;
context: {
route: Routes.Devices,
svgIcon: 'devices',
label: 'Devices',
name: 'devices',
}
">
</ng-container>
<ng-container
*ngTemplateOutlet="
navButtonRoute;
context: {
route: Routes.Reports,
svgIcon: 'reports',
label: 'Reports',
name: 'reports',
}
">
</ng-container>
<ng-container
*ngTemplateOutlet="
navButtonRoute;
context: {
route: Routes.RiskAssessment,
svgIcon: 'risk_assessment',
label: 'Risk Assessment',
name: 'risk-assessment',
}
">
</ng-container>
<div class="nav-items-container">
<ng-container
*ngTemplateOutlet="
navButtonRoute;
context: {
route: Routes.Testing,
svgIcon: 'testrun_logo_small',
label: 'Testing',
name: 'testrun',
}
">
</ng-container>
<ng-container
*ngTemplateOutlet="
navButtonRoute;
context: {
route: Routes.Devices,
icon: 'home_iot_device',
label: 'Devices',
name: 'devices',
}
">
</ng-container>
<ng-container
*ngTemplateOutlet="
navButtonRoute;
context: {
route: Routes.Reports,
icon: 'problem',
label: 'Reports',
name: 'reports',
}
">
</ng-container>
<ng-container
*ngTemplateOutlet="
navButtonRoute;
context: {
route: Routes.RiskAssessment,
icon: 'rule',
label: 'Risk Assessment',
name: 'risk-assessment',
}
">
</ng-container>
</div>
<app-version
[consentShown]="vm.consentShown"
(consentShownEvent)="consentShown()"></app-version>
Expand Down Expand Up @@ -307,10 +309,11 @@ <h1 class="main-heading">Testrun</h1>
mat-button
routerLink="{{ route }}"
routerLinkActive="app-sidebar-button-active"
[matTooltip]="label"
(keydown.enter)="onNavigationClick()">
<mat-icon *ngIf="svgIcon" svgIcon="{{ svgIcon }}"></mat-icon>
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
<mat-icon *ngIf="icon" class="material-symbols-outlined">{{
icon
}}</mat-icon>
<span class="sidebar-button-label">{{ label }}</span>
</button>
</ng-template>
Expand Down
84 changes: 54 additions & 30 deletions modules/ui/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
$toolbar-height: 64px;
$content-padding-top: 18px;
$content-padding-bottom: 16px;
$nav-close-width: 96px;
$nav-open-width: 236px;
$nav-close-btn-width: 48px;
$nav-open-btn-width: 210px;
$nav-width: 96px;

.app-container {
height: 100%;
Expand All @@ -38,39 +35,54 @@ $nav-open-btn-width: 210px;
.app-sidebar {
display: flex;
flex-direction: column;
background-color: $white;
background-color: $surface-container-low;
height: 100%;
gap: 8px;
width: $nav-close-width;
width: $nav-width;
align-items: center;
}

.nav-items-container {
height: calc(100% - $nav-button-height);
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
}

.app-sidebar-button {
border-radius: 20px;
display: flex;
flex-direction: column;
border-radius: $corner-large;
border: 1px solid transparent;
min-width: 48px;
padding: 0;
box-sizing: border-box;
height: 34px;
margin: 11px 0;
padding: 10px;
line-height: 50% !important;
justify-content: center;
gap: 4px;
align-self: stretch;
height: unset;
width: 86px;
margin: 0 auto;
}

.app-sidebar-button {
--mat-text-button-with-icon-horizontal-padding: 8px;

width: $nav-close-btn-width;
display: flex;
justify-content: flex-start;
padding-inline: 8px;
}

.app-sidebar-button:first-child {
margin-top: 19px;
}

.app-toolbar-button-menu {
margin: 11px 17px 11px 16px;
.sidebar-button-label {
color: $on-surface-variant;
text-align: center;
font-family: $font-text;
font-size: 12px;
font-weight: 500;
line-height: 16px;
letter-spacing: 0.1px;
}

.app-sidebar-button:disabled {
Expand All @@ -82,23 +94,35 @@ $nav-open-btn-width: 210px;
margin-right: 0;
width: 24px;
font-size: 24px;
color: $dark-grey;
color: $on-surface-variant;
height: 24px;
}

.app-sidebar-button > .mat-icon {
margin: 0 3px;
margin: 4px;
min-width: 24px;
line-height: 18px !important;
}

.app-sidebar-button-active {
border: 1px solid mat.get-theme-color($light-theme, primary, 40);
background-color: mat.get-theme-color($light-theme, primary, 40);
}
.material-symbols-outlined {
font-variation-settings:
'FILL' 1,
'wght' 400,
'GRAD' 0,
'opsz' 24;
}

.app-sidebar-button-active > .mat-icon {
color: $white;
& > .mat-icon {
color: $on-secondary-fixed-variant;
}
.sidebar-button-label {
color: $secondary;
}

.mat-mdc-button-persistent-ripple::before {
opacity: 1;
background: $secondary-fixed;
}
}

.logo-link {
Expand Down Expand Up @@ -135,13 +159,13 @@ $nav-open-btn-width: 210px;
.app-toolbar {
position: absolute;
top: 0;
left: $nav-close-width;
left: $nav-width;
z-index: 3;
height: $toolbar-height;
padding: 0 16px;
background-color: $surface-container-low;
color: $grey-800;
width: calc(100% - $nav-close-width);
width: calc(100% - $nav-width);
}

.app-bar-buttons {
Expand Down Expand Up @@ -181,7 +205,7 @@ app-version {
margin-top: auto;
margin-bottom: 16px;
max-width: 100%;
width: $nav-close-width;
width: $nav-width;
display: flex;
justify-content: center;
}
15 changes: 0 additions & 15 deletions modules/ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ import { LiveAnnouncer } from '@angular/cdk/a11y';
import { filter, take } from 'rxjs/operators';
import { skip, timer } from 'rxjs';

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 @@ -89,22 +86,10 @@ export class AppComponent implements AfterViewInit {
this.appStore.getReports();
this.appStore.getTestModules();
this.appStore.getNetworkAdapters();
this.matIconRegistry.addSvgIcon(
'devices',
this.domSanitizer.bypassSecurityTrustResourceUrl(DEVICES_LOGO_URL)
);
this.matIconRegistry.addSvgIcon(
'device_run',
this.domSanitizer.bypassSecurityTrustResourceUrl(DEVICES_RUN_URL)
);
this.matIconRegistry.addSvgIcon(
'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
7 changes: 4 additions & 3 deletions modules/ui/src/app/components/version/version.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/
@import 'colors';
@import 'variables';

:host {
position: relative;
Expand All @@ -22,11 +23,11 @@
.version-content,
.version-content-update {
min-width: 48px;
height: 34px;
height: $nav-button-height;
max-width: 100%;
background: $color-background-grey;
border-radius: 20px;
cursor: pointer;
color: $on-surface-variant;
& ::ng-deep .mdc-button__label {
text-overflow: ellipsis;
overflow: hidden;
Expand All @@ -39,7 +40,7 @@
width: 8px;
height: 8px;
border-radius: 100%;
background: $red-800;
background: $red-700;
top: 3px;
right: 3px;
}
Expand Down
5 changes: 0 additions & 5 deletions modules/ui/src/assets/icons/devices.svg

This file was deleted.

5 changes: 0 additions & 5 deletions modules/ui/src/assets/icons/reports.svg

This file was deleted.

10 changes: 0 additions & 10 deletions modules/ui/src/assets/icons/risk-assessment.svg

This file was deleted.

2 changes: 1 addition & 1 deletion modules/ui/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined"
rel="stylesheet" />
<link
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
rel="stylesheet" />
</head>
<body class="mat-typography">
Expand Down
Loading