Skip to content

Commit 31da6ee

Browse files
committed
fix: append reset server errors after update form values
1 parent b04453f commit 31da6ee

File tree

30 files changed

+232
-40
lines changed

30 files changed

+232
-40
lines changed

apps/client/src/app/app.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
1010
import { NzLayoutModule } from 'ng-zorro-antd/layout';
1111

1212
import { Title } from '@angular/platform-browser';
13-
import { FilesService } from '@nestjs-mod/files-afat';
1413
import {
1514
CheckUserRolesPipe,
1615
SsoActiveLangService,
@@ -20,6 +19,7 @@ import {
2019
TokensService,
2120
UserPipe,
2221
} from '@nestjs-mod-sso/sso-afat';
22+
import { FilesService } from '@nestjs-mod/files-afat';
2323
import { NzAvatarModule } from 'ng-zorro-antd/avatar';
2424
import { NzMenuModule } from 'ng-zorro-antd/menu';
2525
import { NzTypographyModule } from 'ng-zorro-antd/typography';
@@ -28,6 +28,7 @@ import { APP_TITLE } from './app.constants';
2828

2929
import { TIMEZONE_OFFSET } from '@nestjs-mod/misc';
3030
import { SsoRestSdkAngularService } from '@nestjs-mod/sso-rest-sdk-angular';
31+
3132
@UntilDestroy()
3233
@Component({
3334
imports: [
@@ -49,6 +50,7 @@ import { SsoRestSdkAngularService } from '@nestjs-mod/sso-rest-sdk-angular';
4950
selector: 'app-root',
5051
templateUrl: './app.component.html',
5152
changeDetection: ChangeDetectionStrategy.OnPush,
53+
standalone: true,
5254
})
5355
export class AppComponent implements OnInit {
5456
title!: string;
@@ -86,6 +88,9 @@ export class AppComponent implements OnInit {
8688
}
8789

8890
getFullFilePath(value: string) {
91+
if (typeof value !== 'string') {
92+
return undefined;
93+
}
8994
return (!value.toLowerCase().startsWith('http') ? this.filesService.getMinioURL() : '') + value;
9095
}
9196

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ErrorHandler, Injectable } from '@angular/core';
22
import { TranslocoService } from '@jsverse/transloco';
3-
import { WebhookErrorInterface } from '@nestjs-mod/sso-rest-sdk-angular';
43
import { NzNotificationService } from 'ng-zorro-antd/notification';
54

65
@Injectable()
@@ -10,11 +9,14 @@ export class AppErrorHandler implements ErrorHandler {
109
private translocoService: TranslocoService,
1110
) {}
1211

13-
handleError(err: { error: WebhookErrorInterface }) {
12+
handleError(err: { error: { message: string; code: string } } | Error) {
1413
if ('error' in err && 'code' in err['error']) {
1514
this.nzNotificationService.error(err.error.code, this.translocoService.translate(err.error.message));
1615
} else {
17-
console.log(err);
16+
if ('message' in err) {
17+
this.nzNotificationService.error(err.message, this.translocoService.translate(err.message));
18+
}
19+
console.error(err);
1820
}
1921
}
2022
}

apps/client/src/app/pages/complete-forgot-password/complete-forgot-password.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
1515
templateUrl: './complete-forgot-password.component.html',
1616
imports: [NzBreadCrumbModule, TranslocoDirective, SsoCompleteForgotPasswordFormComponent],
1717
changeDetection: ChangeDetectionStrategy.OnPush,
18+
standalone: true,
1819
})
1920
export class CompleteForgotPasswordComponent {
2021
code?: string | null;

apps/client/src/app/pages/complete-invite/complete-invite.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
1515
templateUrl: './complete-invite.component.html',
1616
imports: [NzBreadCrumbModule, TranslocoDirective, SsoCompleteForgotPasswordFormComponent, TranslocoPipe],
1717
changeDetection: ChangeDetectionStrategy.OnPush,
18+
standalone: true,
1819
})
1920
export class CompleteInviteComponent {
2021
code?: string | null;

apps/client/src/app/pages/complete-sign-up/complete-sign-up.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
77
templateUrl: './complete-sign-up.component.html',
88
imports: [NzBreadCrumbModule, TranslocoDirective],
99
changeDetection: ChangeDetectionStrategy.OnPush,
10+
standalone: true,
1011
})
1112
export class CompleteSignUpComponent {}

apps/client/src/app/pages/forgot-password/forgot-password.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
88
templateUrl: './forgot-password.component.html',
99
imports: [NzBreadCrumbModule, TranslocoDirective, SsoForgotPasswordFormComponent],
1010
changeDetection: ChangeDetectionStrategy.OnPush,
11+
standalone: true,
1112
})
1213
export class ForgotPasswordComponent {}

apps/client/src/app/pages/home/home.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ import { NzTypographyModule } from 'ng-zorro-antd/typography';
99
templateUrl: './home.component.html',
1010
imports: [NzBreadCrumbModule, NzTypographyModule, TranslocoDirective, NzCollapseModule, TranslocoPipe],
1111
changeDetection: ChangeDetectionStrategy.OnPush,
12+
standalone: true,
1213
})
1314
export class HomeComponent {}

apps/client/src/app/pages/profile/profile.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
1010
templateUrl: './profile.component.html',
1111
imports: [NzBreadCrumbModule, SsoProfileFormComponent, TranslocoDirective],
1212
changeDetection: ChangeDetectionStrategy.OnPush,
13+
standalone: true,
1314
})
1415
export class ProfileComponent {}

apps/client/src/app/pages/projects/projects.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ import { NzLayoutModule } from 'ng-zorro-antd/layout';
1010
templateUrl: './projects.component.html',
1111
imports: [NzBreadCrumbModule, SsoProjectGridComponent, NzGridModule, NzLayoutModule, TranslocoDirective],
1212
changeDetection: ChangeDetectionStrategy.OnPush,
13+
standalone: true,
1314
})
1415
export class ProjectsComponent {}

apps/client/src/app/pages/sign-in/sign-in.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
1111
templateUrl: './sign-in.component.html',
1212
imports: [NzBreadCrumbModule, TranslocoDirective, SsoSignInFormComponent],
1313
changeDetection: ChangeDetectionStrategy.OnPush,
14+
standalone: true,
1415
})
1516
export class SignInComponent {
1617
constructor(

0 commit comments

Comments
 (0)