From eab7b2108d91af1c905f795febf811d5cc404863 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 25 Feb 2021 14:38:12 +0200 Subject: Removed unnecessary variables from request subscriptions --- .../admin-panel-page/admin-panel-page.component.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/app/components/admin-panel-page/admin-panel-page.component.ts') diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.ts b/src/app/components/admin-panel-page/admin-panel-page.component.ts index 99c0721..95d69d3 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.ts +++ b/src/app/components/admin-panel-page/admin-panel-page.component.ts @@ -53,7 +53,7 @@ export class AdminPanelPageComponent implements OnInit { this._router.navigate(['/login']); } }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/login']); } ); @@ -129,7 +129,7 @@ export class AdminPanelPageComponent implements OnInit { if (languageCreate !== '' && languageCreate !== null) { this._languageService.createLanguageWithSessionStorageRequest(languageCreate.trim()).subscribe( - (result: object) => { + () => { this.languageModifiedSuccess('Successfully updated languages!'); }, (err: HttpErrorResponse) => { @@ -147,7 +147,7 @@ export class AdminPanelPageComponent implements OnInit { const langId = this.availableLanguages.filter(x => x.name === updateLanguageOldName.trim())[0].id; this._languageService.putLanguageWithSessionStorageRequest(langId, updateLanguageNewName.trim()).subscribe( - (result: object) => { + () => { this.languageModifiedSuccess('Successfully updated languages!'); }, (err: HttpErrorResponse) => { @@ -164,7 +164,7 @@ export class AdminPanelPageComponent implements OnInit { const langId = this.availableLanguages.filter(x => x.name === deleteLanguageName.trim())[0].id; this._languageService.deleteLanguageWithSessionStorageRequest(langId).subscribe( - (result: object) => { + () => { this.languageModifiedSuccess('Successfully deleted language!'); }, (err: HttpErrorResponse) => { @@ -205,7 +205,7 @@ export class AdminPanelPageComponent implements OnInit { if (technologyCreate !== '' && technologyCreate !== null) { this._technologyService.createTechnologyWithSessionStorageRequest(technologyCreate.trim()).subscribe( - (result: object) => { + () => { this.technologyModifiedSuccess('Successfully updated technologies!'); }, (err: HttpErrorResponse) => { @@ -223,7 +223,7 @@ export class AdminPanelPageComponent implements OnInit { const techId = this.availableTechnologies.filter(x => x.name === updateTechnologyOldName.trim())[0].id; this._technologyService.putTechnologyWithSessionStorageRequest(techId, updateTechnologyNewName.trim()).subscribe( - (result: object) => { + () => { this.technologyModifiedSuccess('Successfully updated technologies!'); }, (err: HttpErrorResponse) => { @@ -240,7 +240,7 @@ export class AdminPanelPageComponent implements OnInit { const techId = this.availableTechnologies.filter(x => x.name === deleteTechnologyName.trim())[0].id; this._technologyService.deleteTechnologyWithSessionStorageRequest(techId).subscribe( - (result: object) => { + () => { this.technologyModifiedSuccess('Successfully deleted technology!'); }, (err: HttpErrorResponse) => { @@ -283,7 +283,7 @@ export class AdminPanelPageComponent implements OnInit { const userId: Guid = Guid.parse(deleteUser); this._userService.deleteUserRequest(userId, this._tokenService.getTokenFromSessionStorage()).subscribe( - (result: object) => { + () => { this.deletionSuccess('Successfully deleted user!'); }, (err: HttpErrorResponse) => { @@ -300,7 +300,7 @@ export class AdminPanelPageComponent implements OnInit { const postId: Guid = Guid.parse(deletePost); this._postService.deletePostRequest(postId, this._tokenService.getTokenFromSessionStorage()).subscribe( - (result: object) => { + () => { this.deletionSuccess('Successfully deleted user!'); }, (err: HttpErrorResponse) => { @@ -317,7 +317,7 @@ export class AdminPanelPageComponent implements OnInit { const commentId: Guid = Guid.parse(deleteComment); this._commentService.deleteCommentWithSessionStorage(commentId).subscribe( - (result: object) => { + () => { this.deletionSuccess('Successfully deleted comment!'); }, (err: HttpErrorResponse) => { -- cgit v1.2.3 From 94d421d08f24b117b58bc87799861016fbff8ec0 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 14 Mar 2021 08:31:19 +0200 Subject: Updated admin-panel-page's subscriptions to use an observer object --- .../admin-panel-page/admin-panel-page.component.ts | 116 +++++++++++---------- 1 file changed, 61 insertions(+), 55 deletions(-) (limited to 'src/app/components/admin-panel-page/admin-panel-page.component.ts') diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.ts b/src/app/components/admin-panel-page/admin-panel-page.component.ts index 95d69d3..d5ecc71 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.ts +++ b/src/app/components/admin-panel-page/admin-panel-page.component.ts @@ -46,17 +46,17 @@ export class AdminPanelPageComponent implements OnInit { return; } - this._userService.getUserFromSessionStorageRequest().subscribe( - (result: object) => { + this._userService.getUserFromSessionStorageRequest().subscribe({ + next: (result: object) => { const user = result as User; if (!user.roles.map(x => x.name).includes(AppConstants.ADMIN_ROLE_NAME)) { this._router.navigate(['/login']); } }, - () => { + error: () => { this._router.navigate(['/login']); } - ); + }); this.languageForm = this._fb.group({ languageCreate: new FormControl(''), @@ -65,9 +65,11 @@ export class AdminPanelPageComponent implements OnInit { deleteLanguageName: new FormControl('') }); - this.languageForm.valueChanges.subscribe(() => { - this._successBar?.hideMsg(); - this._errorBar?.hideError(); + this.languageForm.valueChanges.subscribe({ + next: () => { + this._successBar?.hideMsg(); + this._errorBar?.hideError(); + } }); this.technologyForm = this._fb.group({ @@ -77,9 +79,11 @@ export class AdminPanelPageComponent implements OnInit { deleteTechnologyName: new FormControl('') }); - this.technologyForm.valueChanges.subscribe(() => { - this._successBar?.hideMsg(); - this._errorBar?.hideError(); + this.technologyForm.valueChanges.subscribe({ + next: () => { + this._successBar?.hideMsg(); + this._errorBar?.hideError(); + } }); this.deleteForm = this._fb.group({ @@ -88,9 +92,11 @@ export class AdminPanelPageComponent implements OnInit { deleteComment: new FormControl('') }); - this.deleteForm.valueChanges.subscribe(() => { - this._successBar?.hideMsg(); - this._errorBar?.hideError(); + this.deleteForm.valueChanges.subscribe({ + next: () => { + this._successBar?.hideMsg(); + this._errorBar?.hideError(); + } }); this.loadAvailableLanguages(); @@ -128,14 +134,14 @@ export class AdminPanelPageComponent implements OnInit { const languageCreate: string = this.languageForm.get('languageCreate')?.value; if (languageCreate !== '' && languageCreate !== null) { - this._languageService.createLanguageWithSessionStorageRequest(languageCreate.trim()).subscribe( - () => { + this._languageService.createLanguageWithSessionStorageRequest(languageCreate.trim()).subscribe({ + next: () => { this.languageModifiedSuccess('Successfully updated languages!'); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } } @@ -146,14 +152,14 @@ export class AdminPanelPageComponent implements OnInit { if (updateLanguageOldName !== '' && updateLanguageOldName !== null && updateLanguageNewName !== '' && updateLanguageNewName !== null) { const langId = this.availableLanguages.filter(x => x.name === updateLanguageOldName.trim())[0].id; - this._languageService.putLanguageWithSessionStorageRequest(langId, updateLanguageNewName.trim()).subscribe( - () => { + this._languageService.putLanguageWithSessionStorageRequest(langId, updateLanguageNewName.trim()).subscribe({ + next: () => { this.languageModifiedSuccess('Successfully updated languages!'); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } } @@ -163,14 +169,14 @@ export class AdminPanelPageComponent implements OnInit { if (deleteLanguageName !== '' && deleteLanguageName !== null) { const langId = this.availableLanguages.filter(x => x.name === deleteLanguageName.trim())[0].id; - this._languageService.deleteLanguageWithSessionStorageRequest(langId).subscribe( - () => { + this._languageService.deleteLanguageWithSessionStorageRequest(langId).subscribe({ + next: () => { this.languageModifiedSuccess('Successfully deleted language!'); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } } @@ -181,11 +187,11 @@ export class AdminPanelPageComponent implements OnInit { } private loadAvailableLanguages(): void { - this._languageService.getAllLanguagesWithSessionStorageRequest().subscribe( - (result: object) => { + this._languageService.getAllLanguagesWithSessionStorageRequest().subscribe({ + next: (result: object) => { this.availableLanguages = result as Language[]; } - ); + }); } // Technology modifying @@ -204,14 +210,14 @@ export class AdminPanelPageComponent implements OnInit { const technologyCreate: string = this.technologyForm.get('technologyCreate')?.value; if (technologyCreate !== '' && technologyCreate !== null) { - this._technologyService.createTechnologyWithSessionStorageRequest(technologyCreate.trim()).subscribe( - () => { + this._technologyService.createTechnologyWithSessionStorageRequest(technologyCreate.trim()).subscribe({ + next: () => { this.technologyModifiedSuccess('Successfully updated technologies!'); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } } @@ -222,14 +228,14 @@ export class AdminPanelPageComponent implements OnInit { if (updateTechnologyOldName !== '' && updateTechnologyOldName !== null && updateTechnologyNewName !== '' && updateTechnologyNewName !== null) { const techId = this.availableTechnologies.filter(x => x.name === updateTechnologyOldName.trim())[0].id; - this._technologyService.putTechnologyWithSessionStorageRequest(techId, updateTechnologyNewName.trim()).subscribe( - () => { + this._technologyService.putTechnologyWithSessionStorageRequest(techId, updateTechnologyNewName.trim()).subscribe({ + next: () => { this.technologyModifiedSuccess('Successfully updated technologies!'); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } } @@ -239,14 +245,14 @@ export class AdminPanelPageComponent implements OnInit { if (deleteTechnologyName !== '' && deleteTechnologyName !== null) { const techId = this.availableTechnologies.filter(x => x.name === deleteTechnologyName.trim())[0].id; - this._technologyService.deleteTechnologyWithSessionStorageRequest(techId).subscribe( - () => { + this._technologyService.deleteTechnologyWithSessionStorageRequest(techId).subscribe({ + next: () => { this.technologyModifiedSuccess('Successfully deleted technology!'); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } } @@ -257,11 +263,11 @@ export class AdminPanelPageComponent implements OnInit { } private loadAvailableTechnologies(): void { - this._technologyService.getAllTechnologiesWithSessionStorageRequest().subscribe( - (result: object) => { + this._technologyService.getAllTechnologiesWithSessionStorageRequest().subscribe({ + next: (result: object) => { this.availableTechnologies = result as Technology[]; } - ); + }); } // Deletions @@ -282,14 +288,14 @@ export class AdminPanelPageComponent implements OnInit { if (deleteUser !== '' && deleteUser !== null) { const userId: Guid = Guid.parse(deleteUser); - this._userService.deleteUserRequest(userId, this._tokenService.getTokenFromSessionStorage()).subscribe( - () => { + this._userService.deleteUserRequest(userId, this._tokenService.getTokenFromSessionStorage()).subscribe({ + next: () => { this.deletionSuccess('Successfully deleted user!'); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } } @@ -299,14 +305,14 @@ export class AdminPanelPageComponent implements OnInit { if (deletePost !== '' && deletePost !== null) { const postId: Guid = Guid.parse(deletePost); - this._postService.deletePostRequest(postId, this._tokenService.getTokenFromSessionStorage()).subscribe( - () => { + this._postService.deletePostRequest(postId, this._tokenService.getTokenFromSessionStorage()).subscribe({ + next: () => { this.deletionSuccess('Successfully deleted user!'); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } } @@ -316,14 +322,14 @@ export class AdminPanelPageComponent implements OnInit { if (deleteComment !== '' && deleteComment !== null) { const commentId: Guid = Guid.parse(deleteComment); - this._commentService.deleteCommentWithSessionStorage(commentId).subscribe( - () => { + this._commentService.deleteCommentWithSessionStorage(commentId).subscribe({ + next: () => { this.deletionSuccess('Successfully deleted comment!'); }, - (err: HttpErrorResponse) => { + error: (err: HttpErrorResponse) => { this._errorBar.showError(err); } - ); + }); } } -- cgit v1.2.3 From 8434044dcf8cec14765aa5d96072feaa2560a823 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 14 Mar 2021 09:06:08 +0200 Subject: Fixed includes (for models) of all components --- src/app/components/admin-panel-page/admin-panel-page.component.ts | 6 +++--- src/app/components/comment-page/comment-page.component.ts | 2 +- src/app/components/comment/comment.component.ts | 4 ++-- src/app/components/feed/feed.component.ts | 4 ++-- src/app/components/post-page/post-page.component.ts | 2 +- src/app/components/post/post.component.ts | 4 ++-- src/app/components/profile-settings/profile-settings.component.ts | 6 +++--- src/app/components/profile/profile.component.ts | 6 +++--- src/app/components/register/register.component.ts | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/app/components/admin-panel-page/admin-panel-page.component.ts') diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.ts b/src/app/components/admin-panel-page/admin-panel-page.component.ts index d5ecc71..9beb8bc 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.ts +++ b/src/app/components/admin-panel-page/admin-panel-page.component.ts @@ -11,9 +11,9 @@ import { PostService } from 'src/app/services/post.service'; import { TechnologyService } from 'src/app/services/technology.service'; import { TokenService } from 'src/app/services/token.service'; import { UserService } from 'src/app/services/user.service'; -import { User } from 'src/models/identity/user'; -import { Language } from 'src/models/language'; -import { Technology } from 'src/models/technology'; +import { User } from 'src/models/identity/user.model'; +import { Language } from 'src/models/language.model'; +import { Technology } from 'src/models/technology.model'; import { ErrorBarComponent } from '../error-bar/error-bar.component'; import { SuccessBarComponent } from '../success-bar/success-bar.component'; diff --git a/src/app/components/comment-page/comment-page.component.ts b/src/app/components/comment-page/comment-page.component.ts index 9bbdc59..5d256bf 100644 --- a/src/app/components/comment-page/comment-page.component.ts +++ b/src/app/components/comment-page/comment-page.component.ts @@ -5,7 +5,7 @@ import { Router } from '@angular/router'; import { Guid } from 'guid-typescript'; import { CommentService } from 'src/app/services/comment.service'; import { TokenService } from 'src/app/services/token.service'; -import { Comment } from 'src/models/comment'; +import { Comment } from 'src/models/comment.model'; @Component({ selector: 'app-comment-page', diff --git a/src/app/components/comment/comment.component.ts b/src/app/components/comment/comment.component.ts index d4dd9f4..7da896d 100644 --- a/src/app/components/comment/comment.component.ts +++ b/src/app/components/comment/comment.component.ts @@ -3,8 +3,8 @@ import { Router } from '@angular/router'; import { Guid } from 'guid-typescript'; import { CommentService } from 'src/app/services/comment.service'; import { UserService } from 'src/app/services/user.service'; -import { Comment } from 'src/models/comment'; -import { User } from 'src/models/identity/user'; +import { Comment } from 'src/models/comment.model'; +import { User } from 'src/models/identity/user.model'; @Component({ selector: 'app-comment', diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index a9a042c..895bf76 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -1,11 +1,11 @@ import { Component, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { Router } from '@angular/router'; -import { User } from 'src/models/identity/user'; +import { User } from 'src/models/identity/user.model'; import { UserService } from '../../services/user.service'; import { AppConstants } from 'src/app/app-constants.module'; import { FeedService } from 'src/app/services/feed.service'; -import { Post } from 'src/models/post'; +import { Post } from 'src/models/post.model'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { PostService } from 'src/app/services/post.service'; import { TokenService } from 'src/app/services/token.service'; diff --git a/src/app/components/post-page/post-page.component.ts b/src/app/components/post-page/post-page.component.ts index 7c32ce0..a60f4da 100644 --- a/src/app/components/post-page/post-page.component.ts +++ b/src/app/components/post-page/post-page.component.ts @@ -6,7 +6,7 @@ import { Guid } from 'guid-typescript'; import { CommentService } from 'src/app/services/comment.service'; import { PostService } from 'src/app/services/post.service'; import { TokenService } from 'src/app/services/token.service'; -import { Post } from 'src/models/post'; +import { Post } from 'src/models/post.model'; import { CloudinaryService } from 'src/app/services/cloudinary.service'; @Component({ diff --git a/src/app/components/post/post.component.ts b/src/app/components/post/post.component.ts index a46811d..fa5ac2f 100644 --- a/src/app/components/post/post.component.ts +++ b/src/app/components/post/post.component.ts @@ -3,8 +3,8 @@ import { Router } from '@angular/router'; import { Guid } from 'guid-typescript'; import { PostService } from 'src/app/services/post.service'; import { UserService } from 'src/app/services/user.service'; -import { User } from 'src/models/identity/user'; -import { Post } from 'src/models/post'; +import { User } from 'src/models/identity/user.model'; +import { Post } from 'src/models/post.model'; @Component({ selector: 'app-post', diff --git a/src/app/components/profile-settings/profile-settings.component.ts b/src/app/components/profile-settings/profile-settings.component.ts index ba1fbb6..b856bef 100644 --- a/src/app/components/profile-settings/profile-settings.component.ts +++ b/src/app/components/profile-settings/profile-settings.component.ts @@ -6,11 +6,11 @@ import { Router } from '@angular/router'; import { LanguageService } from 'src/app/services/language.service'; import { UserService } from 'src/app/services/user.service'; import { TechnologyService } from 'src/app/services/technology.service'; -import { User } from 'src/models/identity/user'; +import { User } from 'src/models/identity/user.model'; import { ErrorBarComponent } from '../error-bar/error-bar.component'; import { SuccessBarComponent } from '../success-bar/success-bar.component'; -import { Language } from 'src/models/language'; -import { Technology } from 'src/models/technology'; +import { Language } from 'src/models/language.model'; +import { Technology } from 'src/models/technology.model'; import { TokenService } from 'src/app/services/token.service'; import { Title } from '@angular/platform-browser'; import { AppConstants } from 'src/app/app-constants.module'; diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index 73e1e96..ed17f33 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -1,16 +1,16 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { UserService } from 'src/app/services/user.service'; -import { User } from 'src/models/identity/user'; +import { User } from 'src/models/identity/user.model'; import { AppConstants } from 'src/app/app-constants.module'; import { Location } from '@angular/common'; import { LanguageService } from 'src/app/services/language.service'; import { TechnologyService } from 'src/app/services/technology.service'; -import { Post } from 'src/models/post'; +import { Post } from 'src/models/post.model'; import { FeedService } from 'src/app/services/feed.service'; import { TokenService } from 'src/app/services/token.service'; import { Title } from '@angular/platform-browser'; -import { Friend } from 'src/models/identity/friend'; +import { Friend } from 'src/models/identity/friend.model'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; @Component({ diff --git a/src/app/components/register/register.component.ts b/src/app/components/register/register.component.ts index b5800ad..07b8976 100644 --- a/src/app/components/register/register.component.ts +++ b/src/app/components/register/register.component.ts @@ -1,6 +1,6 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; -import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { Title } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { TokenService } from 'src/app/services/token.service'; -- cgit v1.2.3 From 72bc161e3b33a65783647615736cff6f8581f8be Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 22 Mar 2021 17:17:59 +0200 Subject: Major redesign of admin panel page component styling --- .../admin-panel-page.component.css | 45 +---- .../admin-panel-page.component.html | 185 ++++++++++++--------- .../admin-panel-page/admin-panel-page.component.ts | 33 ++-- 3 files changed, 130 insertions(+), 133 deletions(-) (limited to 'src/app/components/admin-panel-page/admin-panel-page.component.ts') diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.css b/src/app/components/admin-panel-page/admin-panel-page.component.css index 1f98e20..ec7aa5d 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.css +++ b/src/app/components/admin-panel-page/admin-panel-page.component.css @@ -1,42 +1,5 @@ -#content { - max-width: 22em; - justify-content: start; -} - -hr { - width: calc(100% - 1em); - color: black; - border: 1px solid black; -} - -#navigation { - width: 100%; - display: flex; -} - -#navigation > * { - flex: 1; - margin-left: .4em; -} - -.submit-btn:first-of-type { - margin-left: 0 !important; -} - -#all-languages, #all-technologies { - display: flex; - flex-wrap: wrap; -} - -.flexbox { - display: flex; -} - -.flexbox > * { - flex: 1; - margin-left: 1em; -} - -.flexbox > *:first-child { - margin-left: 0; +.sec-info { + width: fit-content; + background-color: #424242; + margin: 0 0.3em 0.3em 0; } diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.html b/src/app/components/admin-panel-page/admin-panel-page.component.html index 96ab545..65f9691 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.html +++ b/src/app/components/admin-panel-page/admin-panel-page.component.html @@ -1,87 +1,118 @@ - + -
- -
-
- - +
+ + - -
-
- - -
- -
- - -
- -
- -
- -
- Available languages: -
-
- {{ lang.name }} +
+
+ + + + + + +
+ +
-
-
- - -
-
- - -
- -
- - -
- -
- -
- -
- Available technologies: -
-
- {{ tech.name }} + + + + +
+
+ No languages in database! +
+
+ Available languages: +
+
+
+ {{ lang.name }} +
+
+
+ + +
+ +
+ + + + +
+ +
-
-
- - -
-
- - -
+ + + + +
+
+ No technologies in database! +
+
+ Available technologies: +
+
+
+ {{ tech.name }} +
+
+
+
+ +
+ +
+ + + + + + + + -
- - -
-
- - -
- -
-
-
+ + + +
diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.ts b/src/app/components/admin-panel-page/admin-panel-page.component.ts index 9beb8bc..d1070b5 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.ts +++ b/src/app/components/admin-panel-page/admin-panel-page.component.ts @@ -103,6 +103,24 @@ export class AdminPanelPageComponent implements OnInit { this.loadAvailableTechnologies(); } + private loadAvailableLanguages(): void { + this._languageService.getAllLanguagesWithSessionStorageRequest().subscribe({ + next: (result: object) => { + this.availableLanguages = result as Language[]; + this.dataArrived = true; + } + }); + } + + private loadAvailableTechnologies(): void { + this._technologyService.getAllTechnologiesWithSessionStorageRequest().subscribe({ + next: (result: object) => { + this.availableTechnologies = result as Technology[]; + this.dataArrived = true; + } + }); + } + // Navigation backToProfile(): void { @@ -186,13 +204,6 @@ export class AdminPanelPageComponent implements OnInit { this.loadAvailableLanguages(); } - private loadAvailableLanguages(): void { - this._languageService.getAllLanguagesWithSessionStorageRequest().subscribe({ - next: (result: object) => { - this.availableLanguages = result as Language[]; - } - }); - } // Technology modifying @@ -262,14 +273,6 @@ export class AdminPanelPageComponent implements OnInit { this.loadAvailableTechnologies(); } - private loadAvailableTechnologies(): void { - this._technologyService.getAllTechnologiesWithSessionStorageRequest().subscribe({ - next: (result: object) => { - this.availableTechnologies = result as Technology[]; - } - }); - } - // Deletions toggleDeletions(): void { -- cgit v1.2.3