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) { } 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, { this.snackBar.openFromComponent(NotifierComponent, {
data: { data: {
message: displayMessage, message: displayMessage,
@ -19,7 +19,16 @@ export class NotifierService {
duration: 4000, duration: 4000,
verticalPosition: 'top', verticalPosition: 'top',
panelClass: [messageType] 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; background: whitesmoke;
color: black; 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" >
<div class="notifier-type"> <div class="notifier-type">
{{ data.type | titlecase }} {{ data.type | titlecase }}

View file

@ -79,17 +79,6 @@
style="align-items: center;"> style="align-items: center;">
<div class="container" style="margin-bottom: 20px;"> <div class="container" style="margin-bottom: 20px;">
<mat-dialog-content [formGroup]="settingsForm"> <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; <div style="height: 10px;
margin-top: 10px;"> margin-top: 10px;">
</div> </div>
@ -142,6 +131,18 @@
</td> </td>
</tbody> </tbody>
</table> </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> </div>
</mat-dialog-content> </mat-dialog-content>
</div> </div>

View file

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

BIN
src/assets/notifier.mp3 Normal file

Binary file not shown.