-
-
{{ 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 }}
+
+
-
-
- Інформації поки немає
-
+
+ Інформації поки немає
+
+
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