diff --git a/src/app/shell/admin-tools/platform/platform-info/info-card/info-card.component.html b/src/app/shell/admin-tools/platform/platform-info/info-card/info-card.component.html index b5727c7920..2a9df876e2 100644 --- a/src/app/shell/admin-tools/platform/platform-info/info-card/info-card.component.html +++ b/src/app/shell/admin-tools/platform/platform-info/info-card/info-card.component.html @@ -14,7 +14,7 @@

{{portalItem.sectionName}}

- +
diff --git a/src/app/shell/admin-tools/platform/platform-info/regulations-info.component.ts b/src/app/shell/admin-tools/platform/platform-info/regulations-info.component.ts index c3c75ee58f..53e920df1f 100644 --- a/src/app/shell/admin-tools/platform/platform-info/regulations-info.component.ts +++ b/src/app/shell/admin-tools/platform/platform-info/regulations-info.component.ts @@ -1,9 +1,10 @@ +import { AdminState } from 'src/app/shared/store/admin.state'; import { AdminTabsTitle } from 'src/app/shared/enum/enumUA/tech-admin/admin-tabs'; -import { Select } from '@ngxs/store'; -import { Component } from '@angular/core'; import { CompanyInformation } from 'src/app/shared/models/сompanyInformation.model'; -import { AdminState } from 'src/app/shared/store/admin.state'; +import { Component } from '@angular/core'; import { Observable } from 'rxjs'; +import { Select } from '@ngxs/store'; + @Component({ selector: 'app-regulations-info', template: '', @@ -13,6 +14,8 @@ export class RegulationsInfoComponent { @Select(AdminState.LawsAndRegulations) LawsAndRegulations$: Observable; + @Select(AdminState.isLoading) + isLoading$: Observable; constructor() {} diff --git a/src/app/shell/info/about/about.component.html b/src/app/shell/info/about/about.component.html index 52a4a323a9..e369d090ea 100644 --- a/src/app/shell/info/about/about.component.html +++ b/src/app/shell/info/about/about.component.html @@ -1,20 +1,18 @@ -
-
-
-

{{ (platformInformation$ | async).title }}

-
-
- - -
Інформації поки немає
-
+ +
Інформації поки немає
+
+ diff --git a/src/app/shell/info/about/about.component.ts b/src/app/shell/info/about/about.component.ts index 6305c03d55..c82d26769b 100644 --- a/src/app/shell/info/about/about.component.ts +++ b/src/app/shell/info/about/about.component.ts @@ -3,6 +3,7 @@ import { DeleteNavPath, } from 'src/app/shared/store/navigation.actions'; import { Component, OnDestroy, OnInit } from '@angular/core'; +import { Observable, Subject } from 'rxjs'; import { Select, Store } from '@ngxs/store'; import { AdminState } from 'src/app/shared/store/admin.state'; @@ -10,7 +11,7 @@ import { CompanyInformation } from 'src/app/shared/models/сompanyInformation.mo import { GetAboutPortal } from 'src/app/shared/store/admin.actions'; import { NavBarName } from 'src/app/shared/enum/navigation-bar'; import { NavigationBarService } from 'src/app/shared/services/navigation-bar/navigation-bar.service'; -import { Observable } from 'rxjs'; +import { takeUntil } from 'rxjs/operators'; @Component({ selector: 'app-about', @@ -18,8 +19,15 @@ import { Observable } from 'rxjs'; styleUrls: ['./about.component.scss'], }) export class AboutComponent implements OnInit, OnDestroy { -@Select(AdminState.AboutPortal) -platformInformation$: Observable; + @Select(AdminState.AboutPortal) + platformInformation$: Observable; + @Select(AdminState.isLoading) + isLoading$: Observable; + + platformInformation: CompanyInformation; + + private destroy$: Subject = new Subject(); + constructor(private store: Store, private navigationBarService: NavigationBarService) {} ngOnInit(): void { @@ -28,11 +36,15 @@ platformInformation$: Observable; this.navigationBarService.createOneNavPath({ name: NavBarName.AboutPortal, isActive: false, disable: true }) ) ); - this.store - .dispatch(new GetAboutPortal()); + this.store.dispatch(new GetAboutPortal()); + this.platformInformation$.pipe(takeUntil(this.destroy$)).subscribe( + (info: CompanyInformation) => this.platformInformation = info + ); } ngOnDestroy(): void { this.store.dispatch(new DeleteNavPath()); + this.destroy$.next(true); + this.destroy$.unsubscribe(); } } diff --git a/src/app/shell/info/info.component.html b/src/app/shell/info/info.component.html index 31750641ea..b7c9cfaf24 100644 --- a/src/app/shell/info/info.component.html +++ b/src/app/shell/info/info.component.html @@ -1,6 +1,6 @@
-
- -
- +
+ +
+
diff --git a/src/app/shell/info/info.component.ts b/src/app/shell/info/info.component.ts index 4e8a71e339..8e99a7836d 100644 --- a/src/app/shell/info/info.component.ts +++ b/src/app/shell/info/info.component.ts @@ -6,7 +6,5 @@ import { Component } from '@angular/core'; styleUrls: ['./info.component.scss'] }) export class InfoComponent { - constructor() { } - } diff --git a/src/app/shell/info/rules/rules.component.html b/src/app/shell/info/rules/rules.component.html index 368c8f9d32..bcd081a17b 100644 --- a/src/app/shell/info/rules/rules.component.html +++ b/src/app/shell/info/rules/rules.component.html @@ -1,20 +1,18 @@ -
-
-
-

{{ (platformRules$ | async)?.title }}

-
-
-
-

{{ item.sectionName }}

-

{{ item.description }}

+ +
+
+
+

{{ platformRules?.title }}

+
+
+
+

{{ item.sectionName }}

+

{{ item.description }}

+
-

- Ваші пропозиції по покращенню роботи сервісу можна надсилати: Pozashkillia@gmail.com -

-
- -
Інформації поки немає
-
+ +
Інформації поки немає
+
+ diff --git a/src/app/shell/info/rules/rules.component.ts b/src/app/shell/info/rules/rules.component.ts index 9ee42bbac8..7b907ea741 100644 --- a/src/app/shell/info/rules/rules.component.ts +++ b/src/app/shell/info/rules/rules.component.ts @@ -1,5 +1,6 @@ import { AddNavPath, DeleteNavPath } from 'src/app/shared/store/navigation.actions'; -import { Component, OnInit } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { Observable, Subject } from 'rxjs'; import { Select, Store } from '@ngxs/store'; import { AdminState } from 'src/app/shared/store/admin.state'; @@ -7,7 +8,7 @@ import { CompanyInformation } from 'src/app/shared/models/сompanyInformation.mo import { GetLawsAndRegulations } from 'src/app/shared/store/admin.actions'; import { NavBarName } from 'src/app/shared/enum/navigation-bar'; import { NavigationBarService } from 'src/app/shared/services/navigation-bar/navigation-bar.service'; -import { Observable } from 'rxjs'; +import { takeUntil } from 'rxjs/operators'; @Component({ selector: 'app-rules', @@ -15,9 +16,16 @@ import { Observable } from 'rxjs'; styleUrls: ['./rules.component.scss'], }) -export class RulesComponent { +export class RulesComponent implements OnInit, OnDestroy { @Select(AdminState.LawsAndRegulations) platformRules$: Observable; + @Select(AdminState.isLoading) + isLoading$: Observable; + + platformRules: CompanyInformation; + + private destroy$: Subject = new Subject(); + constructor(private store: Store, private navigationBarService: NavigationBarService) {} ngOnInit(): void { @@ -26,9 +34,15 @@ export class RulesComponent { this.navigationBarService.createOneNavPath({ name: NavBarName.LawsAndRegulations, isActive: false, disable: true }) ) ); + this.store.dispatch(new GetLawsAndRegulations()); + this.platformRules$.pipe(takeUntil(this.destroy$)).subscribe( + (rules: CompanyInformation) => this.platformRules = rules + ); } ngOnDestroy(): void { this.store.dispatch(new DeleteNavPath()); + this.destroy$.next(true); + this.destroy$.unsubscribe(); } } diff --git a/src/app/shell/info/support/support.component.html b/src/app/shell/info/support/support.component.html index 4e42db1ffb..529178474e 100644 --- a/src/app/shell/info/support/support.component.html +++ b/src/app/shell/info/support/support.component.html @@ -1,29 +1,18 @@ -
-
-
-

{{ (platformSupport$ | async).title }}

-
-
-
-

{{ item.sectionName }}

-

{{ item.description }}

+ +
+
+
+

{{ platformSupport.title }}

+
+
+
+

{{ item.sectionName }}

+

{{ item.description }}

+
-

У разі технічних питань писати на: - - pozashkillia@gmail.com - -

-

У разі будь яких інших питань звертатися на: - - pozashkillyainfo@gmail.com - -

-

Або за телефоном: - +38(097) 777 7 777 -

-
- -
Інформації поки немає
-
+ +
Інформації поки немає
+
+ diff --git a/src/app/shell/info/support/support.component.ts b/src/app/shell/info/support/support.component.ts index ccbe156d21..6855df998a 100644 --- a/src/app/shell/info/support/support.component.ts +++ b/src/app/shell/info/support/support.component.ts @@ -1,5 +1,6 @@ import { AddNavPath, DeleteNavPath } from 'src/app/shared/store/navigation.actions'; import { Component, OnDestroy, OnInit } from '@angular/core'; +import { Observable, Subject } from 'rxjs'; import { Select, Store } from '@ngxs/store'; import { AdminState } from 'src/app/shared/store/admin.state'; @@ -7,7 +8,7 @@ import { CompanyInformation } from 'src/app/shared/models/сompanyInformation.mo import { GetSupportInformation } from 'src/app/shared/store/admin.actions'; import { NavBarName } from 'src/app/shared/enum/navigation-bar'; import { NavigationBarService } from 'src/app/shared/services/navigation-bar/navigation-bar.service'; -import { Observable } from 'rxjs'; +import { takeUntil } from 'rxjs/operators'; @Component({ selector: 'app-support', @@ -17,6 +18,12 @@ import { Observable } from 'rxjs'; export class SupportComponent implements OnInit, OnDestroy { @Select(AdminState.SupportInformation) platformSupport$: Observable; + @Select(AdminState.isLoading) + isLoading$: Observable; + + platformSupport: CompanyInformation; + + private destroy$: Subject = new Subject(); constructor(private store: Store, public navigationBarService: NavigationBarService ) { } @@ -27,9 +34,16 @@ export class SupportComponent implements OnInit, OnDestroy { ) ); this.store.dispatch(new GetSupportInformation()); + this.platformSupport$ + .pipe(takeUntil(this.destroy$)) + .subscribe( + (support: CompanyInformation) => this.platformSupport = support + ); } ngOnDestroy(): void { this.store.dispatch(new DeleteNavPath()); + this.destroy$.next(true); + this.destroy$.unsubscribe(); } } diff --git a/src/app/shell/personal-cabinet/shared-cabinet/user-config/user-config-edit/user-config-edit.component.ts b/src/app/shell/personal-cabinet/shared-cabinet/user-config/user-config-edit/user-config-edit.component.ts index 636317cc12..e24c811d89 100644 --- a/src/app/shell/personal-cabinet/shared-cabinet/user-config/user-config-edit/user-config-edit.component.ts +++ b/src/app/shell/personal-cabinet/shared-cabinet/user-config/user-config-edit/user-config-edit.component.ts @@ -78,7 +78,7 @@ export class UserConfigEditComponent extends CreateFormComponent implements OnIn addNavPath(): void { const userRole = this.store.selectSnapshot(RegistrationState.role); - const subRole = this.store.selectSnapshot(RegistrationState.subrole); + const subRole = this.store.selectSnapshot(RegistrationState.subrole); const personalCabinetTitle = Util.getPersonalCabinetTitle(userRole, subRole); this.store.dispatch( @@ -104,4 +104,4 @@ export class UserConfigEditComponent extends CreateFormComponent implements OnIn const user = new User(this.userEditFormGroup.value, this.user.id); this.store.dispatch(new UpdateUser(user)); } -} +} \ No newline at end of file