[ADF-5432] component template and code fixes after testing Angular strict mode (#7118)

* process list fixes

* template error fixes

* template and code fixes

* bug fixes in templates and types

* bugs, bugs are everywhere

* fix test

* test fixes

* enable strict templates for extensions lib

* enable strict mode for insights lib

* enable strict mode for core lib

* enable strict mode for content lib

* strict mode for process lib

* strict mode for process cloud

* fix demo shell template issues

* fix process cloud types
This commit is contained in:
Denys Vuika
2021-06-22 16:36:06 +01:00
committed by GitHub
parent e2b8557f4b
commit 829805e201
129 changed files with 534 additions and 435 deletions

View File

@@ -7,13 +7,13 @@
<div>
<label>Choose header color</label>
<select (change)="changeColor($event.target.value)">
<select (change)="changeColor($any($event).target.value)">
<option value="primary">Primary</option>
<option value="accent">Accent</option>
<option value="warn">Warn</option>
</select>
OR
<input type="text" name="color" (keyup.enter)="changeColor($event.target.value)"
<input type="text" name="color" (keyup.enter)="changeColor($any($event).target.value)"
placeholder="hex color code">
<p>*Choose only one value at a time: either hex code or theme color.</p>
<p>*press enter for submitting new hex color</p>
@@ -21,27 +21,27 @@
<div>
<label>Change title</label>
<input type="text" name="title" (keyup.enter)="submitTitle($event.target.value)"
<input type="text" name="title" (keyup.enter)="submitTitle($any($event).target.value)"
placeholder="{{ 'APP_LAYOUT.APP_NAME' | translate}}">
<p>*press enter for submitting new title</p>
</div>
<div>
<label>Change logo</label>
<input type="text" placeholder="URL path" (keyup.enter)="submitLogo($event.target.value)">
<input type="text" placeholder="URL path" (keyup.enter)="submitLogo($any($event).target.value)">
<p>*press enter for submitting new logo</p>
</div>
<div>
<label>Change logo link</label>
<input type="url" placeholder="Redirect URL" (keyup.enter)="submitRedirectUrl($event.target.value)">
<input type="url" placeholder="Redirect URL" (keyup.enter)="submitRedirectUrl($any($event).target.value)">
<p>*Input JSON friendly array or explicit string. E.g. ["/test", 33, "user", 11] or "/test"</p>
<p>*press enter for submitting new link on logo</p>
</div>
<div>
<label>Change logo tooltip</label>
<input type="text" placeholder="Tooltip text" (keyup.enter)="submitTooltip($event.target.value)">
<input type="text" placeholder="Tooltip text" (keyup.enter)="submitTooltip($any($event).target.value)">
<p>*press enter for submitting new tooltip</p>
</div>

View File

@@ -16,6 +16,7 @@
*/
import { Component } from '@angular/core';
import { ThemePalette } from '@angular/material/core';
import { HeaderDataService } from './header-data.service';
@Component({
@@ -24,7 +25,7 @@ import { HeaderDataService } from './header-data.service';
})
export class HeaderDataComponent {
checkbox = true;
position = 'start';
position: 'start' | 'end' = 'start';
hideSidenavToggle = false;
constructor(private headerService: HeaderDataService) {
@@ -34,7 +35,7 @@ export class HeaderDataComponent {
this.headerService.hideMenuButton();
}
changeColor(color: string) {
changeColor(color: ThemePalette) {
this.headerService.changeColor(color);
}

View File

@@ -16,6 +16,7 @@
*/
import { Injectable, Output, EventEmitter } from '@angular/core';
import { ThemePalette } from '@angular/material/core';
@Injectable({
providedIn: 'root'
@@ -26,12 +27,12 @@ export class HeaderDataService {
show = true;
@Output() hideMenu = new EventEmitter<boolean>();
@Output() color = new EventEmitter<string>();
@Output() color = new EventEmitter<ThemePalette>();
@Output() title = new EventEmitter<string>();
@Output() logo = new EventEmitter<string>();
@Output() redirectUrl = new EventEmitter<string | any[]>();
@Output() tooltip = new EventEmitter<string>();
@Output() position = new EventEmitter<string>();
@Output() position = new EventEmitter<'start' | 'end'>();
@Output() hideSidenav = new EventEmitter<boolean>();
hideMenuButton() {
@@ -39,7 +40,7 @@ export class HeaderDataService {
this.hideMenu.emit(this.show);
}
changeColor(color: string) {
changeColor(color: ThemePalette) {
this.color.emit(color);
}
@@ -60,7 +61,7 @@ export class HeaderDataService {
this.tooltip.emit(tooltip);
}
changePosition(position: string) {
changePosition(position: 'start' | 'end') {
this.position.emit(position);
}