mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -5,7 +5,7 @@
|
||||
<mat-card class="adf-setting-card">
|
||||
<form id="host-form" [formGroup]="form" (submit)="onSubmit(form.value)" (keydown)="keyDownFunction($event)">
|
||||
|
||||
<mat-form-field floatLabel="{{'CORE.HOST_SETTINGS.PROVIDER' | translate }}" *ngIf="showSelectProviders">
|
||||
<mat-form-field *ngIf="showSelectProviders">
|
||||
<mat-select id="adf-provider-selector" placeholder="Provider" [formControl]="providersControl">
|
||||
<mat-option *ngFor="let provider of providers" [value]="provider">
|
||||
{{ provider }}
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<ng-container *ngIf="isALL() || isECM()">
|
||||
<mat-card-content>
|
||||
<mat-form-field class="adf-full-width" floatLabel="{{'CORE.HOST_SETTINGS.CS-HOST' | translate }}">
|
||||
<mat-form-field class="adf-full-width">
|
||||
<mat-label>{{'CORE.HOST_SETTINGS.CS-HOST' | translate }}</mat-label>
|
||||
<input matInput [formControl]="ecmHost" data-automation-id="ecmHost" type="text"
|
||||
id="ecmHost" placeholder="http(s)://host|ip:port(/path)">
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<ng-container *ngIf="isALL() || isBPM()">
|
||||
<mat-card-content>
|
||||
<mat-form-field class="adf-full-width" floatLabel="{{'CORE.HOST_SETTINGS.BP-HOST' | translate }}">
|
||||
<mat-form-field class="adf-full-width">
|
||||
<mat-label>{{'CORE.HOST_SETTINGS.BP-HOST' | translate }}</mat-label>
|
||||
<input matInput [formControl]="bpmHost" data-automation-id="bpmHost" type="text"
|
||||
id="bpmHost" placeholder="http(s)://host|ip:port(/path)">
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
<ng-container *ngIf="isOAUTH()">
|
||||
<mat-card-content>
|
||||
<mat-form-field class="adf-full-width" floatLabel="Identity Host">
|
||||
<mat-form-field class="adf-full-width">
|
||||
<mat-label>Identity Host</mat-label>
|
||||
<input matInput name="identityHost" id="identityHost" formControlName="identityHost"
|
||||
placeholder="http(s)://host|ip:port(/path)">
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
<ng-container *ngIf="isOAUTH()">
|
||||
<div formGroupName="oauthConfig">
|
||||
<mat-form-field class="adf-full-width" floatLabel="Auth Host">
|
||||
<mat-form-field class="adf-full-width">
|
||||
<mat-label>Auth Host</mat-label>
|
||||
<input matInput name="host" id="oauthHost" formControlName="host"
|
||||
placeholder="http(s)://host|ip:port(/path)">
|
||||
@@ -85,7 +85,7 @@
|
||||
{{ 'CORE.HOST_SETTINGS.REQUIRED'| translate }}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="adf-full-width" floatLabel="Client Id">
|
||||
<mat-form-field class="adf-full-width">
|
||||
<mat-label>{{ 'CORE.HOST_SETTINGS.CLIENT'| translate }}</mat-label>
|
||||
<input matInput name="clientId" id="clientId" formControlName="clientId"
|
||||
placeholder="Client Id">
|
||||
@@ -94,7 +94,7 @@
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="adf-full-width" floatLabel="Scope">
|
||||
<mat-form-field class="adf-full-width">
|
||||
<mat-label>{{ 'CORE.HOST_SETTINGS.SCOPE'| translate }}</mat-label>
|
||||
<input matInput name="{{ 'CORE.HOST_SETTINGS.SCOPE'| translate }}"
|
||||
formControlName="scope" placeholder="Scope Id">
|
||||
@@ -114,7 +114,7 @@
|
||||
</mat-slide-toggle>
|
||||
|
||||
|
||||
<mat-form-field class="adf-full-width" floatLabel="Redirect Uri">
|
||||
<mat-form-field class="adf-full-width">
|
||||
<mat-label>{{ 'CORE.HOST_SETTINGS.REDIRECT'| translate }}</mat-label>
|
||||
<input matInput placeholder="{{ 'CORE.HOST_SETTINGS.REDIRECT'| translate }}"
|
||||
name="redirectUri" formControlName="redirectUri">
|
||||
@@ -123,13 +123,13 @@
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="adf-full-width" floatLabel="Redirect Uri Logout">
|
||||
<mat-form-field class="adf-full-width">
|
||||
<mat-label>{{ 'CORE.HOST_SETTINGS.REDIRECT_LOGOUT'| translate }}</mat-label>
|
||||
<input id="logout-url" matInput placeholder="{{ 'CORE.HOST_SETTINGS.REDIRECT_LOGOUT'| translate }}"
|
||||
name="redirectUriLogout" formControlName="redirectUriLogout">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="adf-full-width" floatLabel="Public Urls">
|
||||
<mat-form-field class="adf-full-width">
|
||||
<mat-label>{{ 'CORE.HOST_SETTINGS.PUBLIC_URLS'| translate }}</mat-label>
|
||||
<input id="public-url" matInput placeholder="{{ 'CORE.HOST_SETTINGS.PUBLIC_URLS'| translate }}"
|
||||
name="publicUrls" formControlName="publicUrls">
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Output, ViewEncapsulation, OnInit, Input } from '@angular/core';
|
||||
import { Validators, FormGroup, FormBuilder, AbstractControl, FormControl } from '@angular/forms';
|
||||
import { Validators, FormGroup, FormBuilder, FormControl } from '@angular/forms';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
@@ -136,7 +136,7 @@ export class HostSettingsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private createOAuthFormGroup(): AbstractControl {
|
||||
private createOAuthFormGroup(): FormGroup {
|
||||
const oauth = <OauthConfigModel> this.appConfig.get(AppConfigValues.OAUTHCONFIG, {});
|
||||
|
||||
return this.formBuilder.group({
|
||||
@@ -152,15 +152,15 @@ export class HostSettingsComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
private createBPMFormControl(): AbstractControl {
|
||||
private createBPMFormControl(): FormControl {
|
||||
return new FormControl(this.appConfig.get<string>(AppConfigValues.BPMHOST), [Validators.required, Validators.pattern(this.HOST_REGEX)]);
|
||||
}
|
||||
|
||||
private createIdentityFormControl(): AbstractControl {
|
||||
private createIdentityFormControl(): FormControl {
|
||||
return new FormControl(this.appConfig.get<string>(AppConfigValues.IDENTITY_HOST), [Validators.required, Validators.pattern(this.HOST_REGEX)]);
|
||||
}
|
||||
|
||||
private createECMFormControl(): AbstractControl {
|
||||
private createECMFormControl(): FormControl {
|
||||
return new FormControl(this.appConfig.get<string>(AppConfigValues.ECMHOST), [Validators.required, Validators.pattern(this.HOST_REGEX)]);
|
||||
}
|
||||
|
||||
@@ -230,60 +230,60 @@ export class HostSettingsComponent implements OnInit {
|
||||
return this.form.get('authType').value === 'OAUTH';
|
||||
}
|
||||
|
||||
get providersControl(): AbstractControl {
|
||||
return this.form.get('providersControl');
|
||||
get providersControl(): FormControl {
|
||||
return this.form.get('providersControl') as FormControl;
|
||||
}
|
||||
|
||||
get bpmHost(): AbstractControl {
|
||||
return this.form.get('bpmHost');
|
||||
get bpmHost(): FormControl {
|
||||
return this.form.get('bpmHost') as FormControl;
|
||||
}
|
||||
|
||||
get ecmHost(): AbstractControl {
|
||||
return this.form.get('ecmHost');
|
||||
get ecmHost(): FormControl {
|
||||
return this.form.get('ecmHost') as FormControl;
|
||||
}
|
||||
|
||||
get host(): AbstractControl {
|
||||
return this.oauthConfig.get('host');
|
||||
get host(): FormControl {
|
||||
return this.oauthConfig.get('host') as FormControl;
|
||||
}
|
||||
|
||||
get identityHost(): AbstractControl {
|
||||
return this.form.get('identityHost');
|
||||
get identityHost(): FormControl {
|
||||
return this.form.get('identityHost') as FormControl;
|
||||
}
|
||||
|
||||
get clientId(): AbstractControl {
|
||||
return this.oauthConfig.get('clientId');
|
||||
get clientId(): FormControl {
|
||||
return this.oauthConfig.get('clientId') as FormControl;
|
||||
}
|
||||
|
||||
get scope(): AbstractControl {
|
||||
return this.oauthConfig.get('scope');
|
||||
get scope(): FormControl {
|
||||
return this.oauthConfig.get('scope') as FormControl;
|
||||
}
|
||||
|
||||
get secretId(): AbstractControl {
|
||||
return this.oauthConfig.get('secretId');
|
||||
get secretId(): FormControl {
|
||||
return this.oauthConfig.get('secretId') as FormControl;
|
||||
}
|
||||
|
||||
get implicitFlow(): AbstractControl {
|
||||
return this.oauthConfig.get('implicitFlow');
|
||||
get implicitFlow(): FormControl {
|
||||
return this.oauthConfig.get('implicitFlow') as FormControl;
|
||||
}
|
||||
|
||||
get silentLogin(): AbstractControl {
|
||||
return this.oauthConfig.get('silentLogin');
|
||||
get silentLogin(): FormControl {
|
||||
return this.oauthConfig.get('silentLogin') as FormControl;
|
||||
}
|
||||
|
||||
get redirectUri(): AbstractControl {
|
||||
return this.oauthConfig.get('redirectUri');
|
||||
get redirectUri(): FormControl {
|
||||
return this.oauthConfig.get('redirectUri') as FormControl;
|
||||
}
|
||||
|
||||
get publicUrls(): AbstractControl {
|
||||
return this.oauthConfig.get('publicUrls');
|
||||
get publicUrls(): FormControl {
|
||||
return this.oauthConfig.get('publicUrls') as FormControl;
|
||||
}
|
||||
|
||||
get redirectUriLogout(): AbstractControl {
|
||||
return this.oauthConfig.get('redirectUriLogout');
|
||||
get redirectUriLogout(): FormControl {
|
||||
return this.oauthConfig.get('redirectUriLogout') as FormControl;
|
||||
}
|
||||
|
||||
get oauthConfig(): AbstractControl {
|
||||
return this.form.get('oauthConfig');
|
||||
get oauthConfig(): FormControl {
|
||||
return this.form.get('oauthConfig') as FormControl;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user