File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
app/admin/users/user-edit Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 55 < li *ngFor ="let error of errorMessages ">
66 {{error}}
77 </ li >
8+ < li *ngIf ="errorMessage ">
9+ {{errorMessage | translate}}
10+ </ li >
811 </ ul >
912 </ div >
1013
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ export class UserEditComponent implements OnInit {
6060 this . user . active = response . active ;
6161 this . user . globalAdmin = response . globalAdmin ;
6262 // We cannot set the password.
63- this . user . password = '' ;
6463 } ) ;
6564 }
6665
@@ -98,7 +97,13 @@ export class UserEditComponent implements OnInit {
9897 private showError ( error : HttpErrorResponse ) {
9998 this . errorFields = [ ] ;
10099 this . errorMessages = [ ] ;
101- if ( error . error ?. message ?. length > 0 ) {
100+
101+ if ( typeof error . error ?. message === 'string' ) {
102+ this . errorMessage = error . error . message ;
103+ if ( error . error . message === 'MESSAGE.PASSWORD-DOES-NOT-MEET-REQUIREMENTS' ) {
104+ this . errorFields . push ( 'password' ) ;
105+ }
106+ } else if ( error . error ?. message ?. length > 0 ) {
102107 error . error . message . forEach ( ( err ) => {
103108 this . errorFields . push ( err . property ) ;
104109 this . errorMessages = this . errorMessages . concat (
Original file line number Diff line number Diff line change 316316 },
317317 "MESSAGE" : {
318318 "NAME-INVALID-OR-ALREADY-IN-USE" : " En applikation med det navn findes allerede" ,
319- "ORGANIZATION-ALREADY-EXISTS" : " Navnet er forkert eller en organisation med det navn eksistere allerede"
319+ "ORGANIZATION-ALREADY-EXISTS" : " Navnet er forkert eller en organisation med det navn eksistere allerede" ,
320+ "PASSWORD-DOES-NOT-MEET-REQUIREMENTS" : " Password lever ikke op til kravene. Password skal minimum være 6 tegn"
320321 },
321322 "PROFILES" : {
322323 "NAME" : " LoRaWan Profiler" ,
434435 "WELCOME" : " Velkommen til OS2 Internet of things" ,
435436 "WELCOME-MESSAGE" : " Her kan du bla bla"
436437 },
437- "HTTP_PUSH" : " HTTP Push"
438+ "HTTP_PUSH" : " HTTP Push" ,
439+ "Forbidden" : " Du har ikke rettigheder til at foretage denne handling"
438440}
You can’t perform that action at this time.
0 commit comments