From b42156ce3a6c3148ceab4c52e00ac41c7b6400a0 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 22 Mar 2021 15:49:01 +0200 Subject: Logging out of account in profile settings will redirect to login screen (and not profile page) --- src/app/components/profile-settings/profile-settings.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/app/components/profile-settings/profile-settings.component.ts') diff --git a/src/app/components/profile-settings/profile-settings.component.ts b/src/app/components/profile-settings/profile-settings.component.ts index b314a9a..7863258 100644 --- a/src/app/components/profile-settings/profile-settings.component.ts +++ b/src/app/components/profile-settings/profile-settings.component.ts @@ -279,7 +279,7 @@ export class ProfileSettingsComponent implements OnInit { logout(): void { this._tokenService.logoutUserFromSessionStorage(); - this.goToProfile(); + this._router.navigate(['/login']); } toggleLanguages(): void { -- cgit v1.2.3 From e4099fbf0ec62ecf38c9be6eba784cac4e6a3479 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 22 Mar 2021 16:32:51 +0200 Subject: Fixed form errors in profile settings component --- .../profile-settings/profile-settings.component.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/app/components/profile-settings/profile-settings.component.ts') diff --git a/src/app/components/profile-settings/profile-settings.component.ts b/src/app/components/profile-settings/profile-settings.component.ts index 7863258..44ea8bb 100644 --- a/src/app/components/profile-settings/profile-settings.component.ts +++ b/src/app/components/profile-settings/profile-settings.component.ts @@ -50,6 +50,23 @@ export class ProfileSettingsComponent implements OnInit { this.availableTechnologies = []; this.newProfilePicture = new File([], ''); + // Initializing forms with blank (default) values + this.updateUserFormGroup = this._fb.group({ + firstName: new FormControl(''), + lastName: new FormControl(''), + username: new FormControl(''), + email: new FormControl(''), + password: new FormControl(''), + languageInput: new FormControl(''), + languages: new FormControl(''), + technologyInput: new FormControl(''), + technologies: new FormControl('') + }); + this.updateProfilePictureFormGroup = this._fb.group({ + fileUpload: new FormControl('') + }); + + this._userService.getUserByUsernameRequest(this._urlUsername).subscribe({ next: (res: object) => { Object.assign(this.user, res); -- cgit v1.2.3 From 3e34040b286bb41019d20794f19f18b1a94f77af Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 22 Mar 2021 16:53:08 +0200 Subject: Added a button for navigation to admin panel page --- src/app/components/profile-settings/profile-settings.component.html | 5 +++++ src/app/components/profile-settings/profile-settings.component.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/app/components/profile-settings/profile-settings.component.ts') diff --git a/src/app/components/profile-settings/profile-settings.component.html b/src/app/components/profile-settings/profile-settings.component.html index f5989ef..62513ef 100644 --- a/src/app/components/profile-settings/profile-settings.component.html +++ b/src/app/components/profile-settings/profile-settings.component.html @@ -3,6 +3,11 @@
+
+ +
diff --git a/src/app/components/profile-settings/profile-settings.component.ts b/src/app/components/profile-settings/profile-settings.component.ts index 44ea8bb..79519aa 100644 --- a/src/app/components/profile-settings/profile-settings.component.ts +++ b/src/app/components/profile-settings/profile-settings.component.ts @@ -290,7 +290,7 @@ export class ProfileSettingsComponent implements OnInit { this._router.navigate([this._router.url.substring(0, this._router.url.length - 9)]); } - navigateToAdminPanel(): void { + goToAdminPanel(): void { this._router.navigate(['/admin-panel']); } -- cgit v1.2.3