Settings and Notifier services updated

This commit is contained in:
Rene V. Vergara A. 2022-09-06 16:03:38 -05:00
parent 8e04755cd4
commit 9c7140e3ff
7 changed files with 31 additions and 14 deletions

View File

@ -9,7 +9,7 @@ export class NotifierService {
constructor(private snackBar:MatSnackBar) { }
showNotification(displayMessage:string, buttonText: string, messageType: 'error' | 'success') {
showNotification(displayMessage:string, buttonText: string, messageType: 'error' | 'success' | 'warning') {
this.snackBar.openFromComponent(NotifierComponent, {
data: {
message: displayMessage,
@ -19,7 +19,16 @@ export class NotifierService {
duration: 4000,
verticalPosition: 'top',
panelClass: [messageType]
})
});
this.playSound();
}
playSound() {
console.log('Play sound called...');
let audio = new Audio();
audio.src = '../assets/notifier.mp3';
audio.load();
audio.play();
}
}

Binary file not shown.

View File

@ -29,3 +29,9 @@
background: whitesmoke;
color: black;
}
::ng-deep .mat-snack-bar-container.warning {
background: antiquewhite;
color: #fdebd0;
}

View File

@ -1,3 +1,4 @@
<div class="notifier" >
<div class="notifier-type">
{{ data.type | titlecase }}

View File

@ -79,17 +79,6 @@
style="align-items: center;">
<div class="container" style="margin-bottom: 20px;">
<mat-dialog-content [formGroup]="settingsForm">
<div style="height: 10px;
margin-top: 10px;">
</div>
<mat-form-field class="settings-field" [style.width.%]="100">
<mat-label>Account Code</mat-label>
<input matInput
width="100%"
placeholder="9999999999"
formControlName="xeroAccCod"
(change)="xeroAccCodChanged($event)">
</mat-form-field>
<div style="height: 10px;
margin-top: 10px;">
</div>
@ -142,6 +131,18 @@
</td>
</tbody>
</table>
<div style="height: 10px;
margin-top: 10px;">
</div>
<mat-form-field class="settings-field" [style.width.%]="100">
<mat-label>Account Code</mat-label>
<input matInput
width="100%"
placeholder="9999999999"
formControlName="xeroAccCod"
(change)="xeroAccCodChanged($event)">
</mat-form-field>
</div>
</mat-dialog-content>
</div>

View File

@ -112,7 +112,7 @@ export class SettingsComponent implements OnInit {
closeIntegration() {
if ( this.xeroAccCod == '' )
this.notifierService
.showNotification("Warning: Payment confirmation disabled","Close",'success');
.showNotification("Payment confirmation disabled!!","Close",'warning');
this.dialogRef.close();
}

BIN
src/assets/notifier.mp3 Normal file

Binary file not shown.