[AAE-10774] move host settings to demo shell (#8051)

* move host settings to demo shell

* [ci:force] empty commit
This commit is contained in:
Denys Vuika
2022-12-16 08:46:23 +00:00
committed by GitHub
parent d27a3476f7
commit 280684c3ab
28 changed files with 85 additions and 555 deletions

View File

@@ -0,0 +1,158 @@
<div class="adf-setting-container">
<mat-card class="adf-setting-card">
<form id="host-form" [formGroup]="form" (submit)="onSubmit(form.value)" (keydown)="keyDownFunction($event)">
<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 }}
</mat-option>
</mat-select>
</mat-form-field>
<div class="adf-authentication-type">
<div> {{'APP.HOST_SETTINGS.TYPE-AUTH' | translate }} : </div>
<mat-radio-group formControlName="authType" >
<mat-radio-button value="BASIC">{{'APP.HOST_SETTINGS.BASIC' | translate }}
</mat-radio-button>
<mat-radio-button value="OAUTH">{{'APP.HOST_SETTINGS.SSO' | translate }}
</mat-radio-button>
</mat-radio-group>
</div>
<ng-container *ngIf="isALL() || isECM()">
<mat-card-content>
<mat-form-field class="adf-full-width">
<mat-label>{{'APP.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)">
<mat-error *ngIf="ecmHost.hasError('pattern')">
{{ 'APP.HOST_SETTINGS.NOT_VALID'| translate }}
</mat-error>
<mat-error *ngIf="ecmHost.hasError('required')">
{{ 'APP.HOST_SETTINGS.REQUIRED'| translate }}
</mat-error>
</mat-form-field>
<p>
</mat-card-content>
</ng-container>
<ng-container *ngIf="isALL() || isBPM()">
<mat-card-content>
<mat-form-field class="adf-full-width">
<mat-label>{{'APP.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)">
<mat-error *ngIf="bpmHost.hasError('pattern')">
{{ 'APP.HOST_SETTINGS.NOT_VALID'| translate }}
</mat-error>
<mat-error *ngIf="bpmHost.hasError('required')">
{{ 'APP.HOST_SETTINGS.REQUIRED'| translate }}
</mat-error>
</mat-form-field>
</mat-card-content>
</ng-container>
<ng-container *ngIf="isOAUTH()">
<mat-card-content>
<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)">
<mat-error *ngIf="identityHost.hasError('pattern')">
{{ 'APP.HOST_SETTINGS.NOT_VALID'| translate }}
</mat-error>
<mat-error *ngIf="identityHost.hasError('required')">
{{ 'APP.HOST_SETTINGS.REQUIRED'| translate }}
</mat-error>
</mat-form-field>
</mat-card-content>
</ng-container>
<ng-container *ngIf="isOAUTH()">
<div formGroupName="oauthConfig">
<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)">
<mat-error *ngIf="host.hasError('pattern')">
{{ 'APP.HOST_SETTINGS.NOT_VALID'| translate }}
</mat-error>
<mat-error *ngIf="host.hasError('required')">
{{ 'APP.HOST_SETTINGS.REQUIRED'| translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="adf-full-width">
<mat-label>{{ 'APP.HOST_SETTINGS.CLIENT'| translate }}</mat-label>
<input matInput name="clientId" id="clientId" formControlName="clientId"
placeholder="Client Id">
<mat-error *ngIf="clientId.hasError('required')">
{{ 'APP.HOST_SETTINGS.REQUIRED'| translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="adf-full-width">
<mat-label>{{ 'APP.HOST_SETTINGS.SCOPE'| translate }}</mat-label>
<input matInput name="{{ 'APP.HOST_SETTINGS.SCOPE'| translate }}"
formControlName="scope" placeholder="Scope Id">
<mat-error *ngIf="scope.hasError('required')">
{{ 'APP.HOST_SETTINGS.REQUIRED'| translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="adf-full-width">
<mat-label>{{ 'APP.HOST_SETTINGS.SECRET'| translate }}</mat-label>
<input matInput name="{{ 'APP.HOST_SETTINGS.SECRET'| translate }}"
formControlName="secret" placeholder="{{ 'APP.HOST_SETTINGS.SECRET'| translate }}">
<mat-error *ngIf="secret.hasError('required')">
{{ 'APP.HOST_SETTINGS.REQUIRED'| translate }}
</mat-error>
</mat-form-field>
<label for="silentLogin">{{ 'APP.HOST_SETTINGS.SILENT'| translate }}</label>
<mat-slide-toggle class="adf-full-width" name="silentLogin" [color]="'primary'"
formControlName="silentLogin">
</mat-slide-toggle>
<label for="implicitFlow">{{ 'APP.HOST_SETTINGS.IMPLICIT-FLOW'| translate }}</label>
<mat-slide-toggle class="adf-full-width" name="implicitFlow" [color]="'primary'"
formControlName="implicitFlow">
</mat-slide-toggle>
<mat-form-field class="adf-full-width">
<mat-label>{{ 'APP.HOST_SETTINGS.REDIRECT'| translate }}</mat-label>
<input matInput placeholder="{{ 'APP.HOST_SETTINGS.REDIRECT'| translate }}"
name="redirectUri" formControlName="redirectUri">
<mat-error *ngIf="redirectUri.hasError('required')">
{{ 'APP.HOST_SETTINGS.REQUIRED'| translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="adf-full-width">
<mat-label>{{ 'APP.HOST_SETTINGS.REDIRECT_LOGOUT'| translate }}</mat-label>
<input id="logout-url" matInput placeholder="{{ 'APP.HOST_SETTINGS.REDIRECT_LOGOUT'| translate }}"
name="redirectUriLogout" formControlName="redirectUriLogout">
</mat-form-field>
<mat-form-field class="adf-full-width">
<mat-label>{{ 'APP.HOST_SETTINGS.PUBLIC_URLS'| translate }}</mat-label>
<input id="public-url" matInput placeholder="{{ 'APP.HOST_SETTINGS.PUBLIC_URLS'| translate }}"
name="publicUrls" formControlName="publicUrls">
</mat-form-field>
</div>
</ng-container>
<mat-card-actions align="end">
<button mat-button (click)="onCancel()" color="primary">
{{'APP.HOST_SETTINGS.BACK' | translate }}
</button>
<button type="submit" id="host-button" class="adf-login-button" mat-raised-button
color="primary" data-automation-id="host-button"
[disabled]="!form.valid">
{{'APP.HOST_SETTINGS.APPLY' | translate }}
</button>
</mat-card-actions>
</form>
</mat-card>
</div>