mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3388] E2e tests for notification component added (#3630)
* [ADF-3388] E2e tests for notification component added * [ADF-3388] Added missing function
This commit is contained in:
committed by
Eugenio Romano
parent
689c7711df
commit
357e09689b
@@ -16,7 +16,7 @@
|
||||
data-automation-id="notification-message">
|
||||
</mat-form-field>
|
||||
|
||||
<button mat-icon-button (click)="send()">
|
||||
<button mat-icon-button (click)="send()" data-automation-id="notification-default-button">
|
||||
<mat-icon>send</mat-icon>
|
||||
</button>
|
||||
|
||||
@@ -28,53 +28,43 @@
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
|
||||
<div data-automation-id="notification-action-output">
|
||||
<div data-automation-id="notification-action-output" *ngIf="actionOutput">
|
||||
{{ actionOutput }}
|
||||
</div>
|
||||
<mat-accordion>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<h3>Custom Configuration</h3>
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
|
||||
|
||||
<h2>Custom Configuration</h2>
|
||||
|
||||
<form [formGroup]="configForm">
|
||||
<mat-form-field>
|
||||
<input matInput class="form-control" formControlName="announcementMessage" placeholder="Announcement Message" >
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-select class="form-control" formControlName="direction" placeholder="Direction">
|
||||
<mat-select class="form-control" formControlName="direction" placeholder="Direction" data-automation-id="notification-direction">
|
||||
<mat-option *ngFor="let direction of directions" [value]="direction.value">
|
||||
{{ direction.title }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" class="form-control" formControlName="duration" placeholder="Duration" >
|
||||
<input matInput type="number" class="form-control" formControlName="duration" placeholder="Duration" data-automation-id="notification-duration">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-select class="form-control" formControlName="horizontalPosition" placeholder="Horizontal Position">
|
||||
<mat-select class="form-control" formControlName="horizontalPosition" placeholder="Horizontal Position" data-automation-id="notification-horizontal-position">
|
||||
<mat-option *ngFor="let horizontalPosition of horizontalPositions" [value]="horizontalPosition.value">
|
||||
{{ horizontalPosition.title }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-select class="form-control" formControlName="verticalPosition" placeholder="Vertical Position">
|
||||
<mat-select class="form-control" formControlName="verticalPosition" placeholder="Vertical Position" data-automation-id="notification-vertical-position">
|
||||
<mat-option *ngFor="let verticalPosition of verticalPositions" [value]="verticalPosition.value">{{ verticalPosition.title }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<button mat-icon-button (click)="sendCustomConfig()" data-automation-id="notification-custom-config-button">
|
||||
<mat-icon>send</mat-icon>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<button mat-icon-button (click)="sendCustomConfig()">
|
||||
<mat-icon>send</mat-icon>
|
||||
</button>
|
||||
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
|
||||
<div>
|
||||
<h3>SnackBar Config</h3>
|
||||
<p *ngIf="snackBarConfigObject" data-automation-id="notification-custom-object">
|
||||
{{snackBarConfigObject}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -29,6 +29,7 @@ export class NotificationsComponent implements OnInit {
|
||||
message = 'I ♥️ ADF';
|
||||
withAction = false;
|
||||
actionOutput = '';
|
||||
snackBarConfigObject = '';
|
||||
|
||||
configForm: FormGroup;
|
||||
|
||||
@@ -57,7 +58,6 @@ export class NotificationsComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.configForm = this.formBuilder.group({
|
||||
announcementMessage: new FormControl(''),
|
||||
direction: new FormControl(''),
|
||||
horizontalPosition: new FormControl(''),
|
||||
verticalPosition: new FormControl(''),
|
||||
@@ -72,10 +72,6 @@ export class NotificationsComponent implements OnInit {
|
||||
}
|
||||
|
||||
setSnackBarConfig(configFormValues: any) {
|
||||
|
||||
if (configFormValues.announcementMessage) {
|
||||
this.snackBarConfig.announcementMessage = configFormValues.announcementMessage;
|
||||
}
|
||||
if (configFormValues.direction) {
|
||||
this.snackBarConfig.direction = configFormValues.direction;
|
||||
|
||||
@@ -90,7 +86,6 @@ export class NotificationsComponent implements OnInit {
|
||||
if (configFormValues.verticalPosition) {
|
||||
this.snackBarConfig.verticalPosition = configFormValues.verticalPosition;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
send() {
|
||||
@@ -110,7 +105,10 @@ export class NotificationsComponent implements OnInit {
|
||||
|
||||
sendCustomConfig() {
|
||||
this.actionOutput = '';
|
||||
console.log(this.snackBarConfig);
|
||||
this.snackBarConfigObject = `{"direction": "${this.snackBarConfig.direction}",
|
||||
"duration": "${this.snackBarConfig.duration}",
|
||||
"horizontalPosition": "${ this.snackBarConfig.horizontalPosition}",
|
||||
"verticalPosition": "${ this.snackBarConfig.verticalPosition}"}`;
|
||||
|
||||
if (this.message) {
|
||||
if (this.withAction) {
|
||||
|
Reference in New Issue
Block a user