diff --git a/apps/picsa-apps/dashboard/src/app/modules/climate/components/api-status/api-status.html b/apps/picsa-apps/dashboard/src/app/modules/climate/components/api-status/api-status.html index 5d6c2cf0..835256fe 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/climate/components/api-status/api-status.html +++ b/apps/picsa-apps/dashboard/src/app/modules/climate/components/api-status/api-status.html @@ -1,7 +1,7 @@ -
+
@if(options().showStatusCode){ - {{code() || ''}} + {{code() || ''}} } @if(options().labels?.ready; as readyLabel){
{{readyLabel}}
} @if(options().events?.refresh; as refreshEvent){ diff --git a/apps/picsa-apps/dashboard/src/app/modules/profile/components/sign-in-dialog/sign-in-dialog.component.html b/apps/picsa-apps/dashboard/src/app/modules/profile/components/sign-in-dialog/sign-in-dialog.component.html index 0a09a061..8d85a1e5 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/profile/components/sign-in-dialog/sign-in-dialog.component.html +++ b/apps/picsa-apps/dashboard/src/app/modules/profile/components/sign-in-dialog/sign-in-dialog.component.html @@ -3,21 +3,30 @@

{{ title }}

Email - + @if (form.controls.email.errors) { Please enter a valid email address } @if (template !== 'reset') { Password - - } - @if(template==='register'){ + } @if(template==='register'){ Repeat Password - + @if (form.controls.passwordConfirm?.errors) { Password must match } @@ -25,32 +34,38 @@

{{ title }}

} - + @if(template==='signIn'){
- - +
- + } @if(template==='register'){
- -
- } - @if(template==='reset'){ + } @if(template==='reset'){
- -
} -
\ No newline at end of file +
diff --git a/apps/picsa-apps/dashboard/src/app/modules/profile/components/sign-in-dialog/sign-in-dialog.component.ts b/apps/picsa-apps/dashboard/src/app/modules/profile/components/sign-in-dialog/sign-in-dialog.component.ts index 9aa2911e..abe0fc0c 100644 --- a/apps/picsa-apps/dashboard/src/app/modules/profile/components/sign-in-dialog/sign-in-dialog.component.ts +++ b/apps/picsa-apps/dashboard/src/app/modules/profile/components/sign-in-dialog/sign-in-dialog.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { FormControl, FormGroup, @@ -50,8 +50,9 @@ export class SupabaseSignInDialogComponent { password: new FormControl('', Validators.required), }); + private readonly dialogRef = inject(MatDialogRef); + constructor( - private dialogRef: MatDialogRef, private notificationService: PicsaNotificationService, private supabaseAuthService: SupabaseAuthService ) {} @@ -83,8 +84,8 @@ export class SupabaseSignInDialogComponent { const { data, error } = await this.supabaseAuthService.signInUser(email, password); console.log({ data, error }); if (error) { - throw new Error(error.message); this.form.enable(); + throw new Error(error.message); } else { this.dialogRef.close(); } @@ -94,20 +95,21 @@ export class SupabaseSignInDialogComponent { const { email, password } = this.form.value; const { error } = await this.supabaseAuthService.signUpUser(email, password); if (error) { - throw new Error(error.message); this.form.enable(); + throw new Error(error.message); } else { this.dialogRef.close(); } } public async handleReset() { - this.form.disable(); + this.form.disable(); const { email } = this.form.value; const { error } = await this.supabaseAuthService.resetEmailPassword(email); if (error) { - throw new Error(error.message); this.form.enable(); + throw new Error(error.message); } else { + this.notificationService.showSuccessNotification(`Reset email sent, please check your inbox`,{duration:5000}); this.dialogRef.close(); } }