Commit a399b9ec authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

refactor: use new selector syntax

parent 9402a6e4
......@@ -23,7 +23,9 @@ import {
import {ThemeEnum} from "@app/shared/enums/theme.enum";
import {LocalStateModel} from "@app/shared/models/local-state.model";
import {AppAction} from "@app/stores/app.action";
import {AppState} from "@app/stores/app.state";
import {AppCartArchiveState} from "@app/stores/cart/archive/app-cart-archive.state";
import {AppUserState} from "@app/stores/user/app-user.state";
import {environment} from "@environments/environment";
import {HomeHelper} from "@home/helpers/home.helper";
import {User} from "@models";
......@@ -61,8 +63,8 @@ import {
isUndefined,
LoggingService,
MARK_AS_TRANSLATABLE,
MemoizedUtil,
NotificationService,
ResourceState,
} from "solidify-frontend";
@Component({
......@@ -79,22 +81,22 @@ export class AppComponent extends SharedAbstractPresentational {
logo: string;
@Select((state: LocalStateModel) => state.router.state) urlStateObs: Observable<RouterStateSnapshot>;
@Select((state: LocalStateModel) => state.application.appLanguage) appLanguageObs: Observable<LanguagesEnum>;
@Select((state: LocalStateModel) => state.application.isLoggedIn) isLoggedObs: Observable<boolean>;
@Select((state: LocalStateModel) => state.application.isApplicationInitialized) isApplicationInitializedObs: Observable<boolean>;
@Select((state: LocalStateModel) => state.application.theme) themeObs: Observable<ThemeEnum>;
@Select((state: LocalStateModel) => state.application.userRoles) userRolesObs: Observable<ApplicationRoleEnum[]>;
@Select((state: LocalStateModel) => state.application.application_user.current) currentUserObs: Observable<User>;
appLanguageObs: Observable<LanguagesEnum> = MemoizedUtil.select(this._store, AppState, state => state.appLanguage);
isLoggedObs: Observable<boolean> = MemoizedUtil.select(this._store, AppState, state => state.isLoggedIn);
isApplicationInitializedObs: Observable<boolean> = MemoizedUtil.select(this._store, AppState, state => state.isApplicationInitialized);
themeObs: Observable<ThemeEnum> = MemoizedUtil.select(this._store, AppState, state => state.theme);
userRolesObs: Observable<ApplicationRoleEnum[]> = MemoizedUtil.select(this._store, AppState, state => state.userRoles);
currentUserObs: Observable<User> = MemoizedUtil.current(this._store, AppUserState);
numberArchiveInCartObs: Observable<number> = ResourceState.total(this.store, AppCartArchiveState);
numberArchiveInCartObs: Observable<number> = MemoizedUtil.total(this._store, AppCartArchiveState);
ignoreGrid: boolean = false;
displayCart: boolean = false;
@HostListener("window:beforeunload", ["$event"])
leaveWithoutSaveNotification($event: Event): void {
const preventExit = this.store.selectSnapshot((state: LocalStateModel) => state.application.preventExit);
const ignorePreventExit = this.store.selectSnapshot((state: LocalStateModel) => state.application.ignorePreventLeavePopup);
const preventExit = this._store.selectSnapshot((state: LocalStateModel) => state.application.preventExit);
const ignorePreventExit = this._store.selectSnapshot((state: LocalStateModel) => state.application.ignorePreventLeavePopup);
if (isFalse(ignorePreventExit) && isTrue(preventExit)) {
$event.returnValue = true;
}
......@@ -112,18 +114,18 @@ export class AppComponent extends SharedAbstractPresentational {
return RoutesEnum;
}
constructor(private store: Store,
private router: Router,
private translate: TranslateService,
private _renderer: Renderer2,
constructor(private readonly _store: Store,
private readonly _router: Router,
private readonly _translate: TranslateService,
private readonly _renderer: Renderer2,
@Inject(DOCUMENT) private readonly _document: Document,
private _notificationService: NotificationService,
private _loggingService: LoggingService,
public appStatusService: AppStatusService,
public breakpointService: BreakpointService,
private readonly _notificationService: NotificationService,
private readonly _loggingService: LoggingService,
public readonly appStatusService: AppStatusService,
public readonly breakpointService: BreakpointService,
private readonly _dialog: MatDialog) {
super();
this.store.dispatch(new AppAction.InitApplication());
this._store.dispatch(new AppAction.InitApplication());
this._setOverrideCssStyleSheet();
this._listenCurrentModule();
this.subscribe(this._observeThemeChange());
......@@ -192,17 +194,17 @@ export class AppComponent extends SharedAbstractPresentational {
}
useLanguage(language: LanguagesEnum): void {
this.store.dispatch(new AppAction.ChangeAppLanguage(language));
this._store.dispatch(new AppAction.ChangeAppLanguage(language));
}
navigate(route: string): void {
this.store.dispatch(new Navigate([route]));
this._store.dispatch(new Navigate([route]));
}
private _setTitle(): void {
setTimeout(() => {
this._document.title = environment.appTitle;
const description = this.translate.instant("app.meta.description");
const description = this._translate.instant("app.meta.description");
this._document.querySelector("meta[name=\"description\"]").setAttribute("content", description);
}, 0);
}
......@@ -272,7 +274,7 @@ export class AppComponent extends SharedAbstractPresentational {
}
logout(): void {
this.store.dispatch(new AppAction.Logout());
this._store.dispatch(new AppAction.Logout());
}
getTitle(): string {
......@@ -280,8 +282,8 @@ export class AppComponent extends SharedAbstractPresentational {
}
themeChange(theme: ThemeEnum): void {
if (theme !== this.store.selectSnapshot((state: LocalStateModel) => state.application.theme)) {
this.store.dispatch(new AppAction.ChangeAppTheme(theme));
if (theme !== this._store.selectSnapshot((state: LocalStateModel) => state.application.theme)) {
this._store.dispatch(new AppAction.ChangeAppTheme(theme));
}
}
......@@ -337,7 +339,7 @@ export class AppComponent extends SharedAbstractPresentational {
}
search(searchTerm: string): void {
HomeHelper.navigateToSearch(this.store, searchTerm);
HomeHelper.navigateToSearch(this._store, searchTerm);
}
private _activeChemicalMoleculePreviewIfEnable(): void {
......
......@@ -6,17 +6,17 @@ import {
} from "@angular/core";
import {AppAction} from "@app/stores/app.action";
import {AppTocState} from "@app/stores/toc/app-toc.state";
import {
Select,
Store,
} from "@ngxs/store";
import {Store} from "@ngxs/store";
import {SharedAbstractContainer} from "@shared/components/containers/shared-abstract/shared-abstract.container";
import {AppUtil} from "@shared/utils/app.util";
import {
BehaviorSubject,
Observable,
} from "rxjs";
import {ObservableUtil} from "solidify-frontend";
import {
MemoizedUtil,
ObservableUtil,
} from "solidify-frontend";
@Component({
selector: "dlcm-footer-container",
......@@ -25,11 +25,11 @@ import {ObservableUtil} from "solidify-frontend";
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FooterContainer extends SharedAbstractContainer {
@Select(AppTocState.isLoading) isLoadingDocObs: Observable<boolean>;
@Select(AppTocState.toolsGuide) toolsGuideObs: Observable<string>;
@Select(AppTocState.integrationGuide) integrationGuideObs: Observable<string>;
@Select(AppTocState.apis) apisObs: Observable<string>;
@Select(AppTocState.userDocumentation) userDocumentationObs: Observable<string>;
isLoadingDocObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, AppTocState);
toolsGuideObs: Observable<string> = MemoizedUtil.select(this._store, AppTocState, state => state.toolsGuide);
integrationGuideObs: Observable<string> = MemoizedUtil.select(this._store, AppTocState, state => state.integrationGuide);
apisObs: Observable<string> = MemoizedUtil.select(this._store, AppTocState, state => state.apis);
userDocumentationObs: Observable<string> = MemoizedUtil.select(this._store, AppTocState, state => state.userDocumentation);
@Input()
updateVersion: string | undefined;
......
......@@ -20,7 +20,6 @@ import {tap} from "rxjs/operators";
import {
isTrue,
MemoizedUtil,
ResourceState,
} from "solidify-frontend";
@Component({
......@@ -32,7 +31,7 @@ import {
export class CartDialog extends SharedAbstractContainer {
isLoadingCartObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, AppCartState as any);
isLoadingArchiveObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, AppCartArchiveState);
listArchiveObs: Observable<ArchiveMetadata[]> = ResourceState.list(this._store, AppCartArchiveState);
listArchiveObs: Observable<ArchiveMetadata[]> = MemoizedUtil.list(this._store, AppCartArchiveState);
get searchScopeEnum(): typeof SearchScopeEnum {
return SearchScopeEnum;
......
......@@ -10,21 +10,18 @@ import {
MatDialogRef,
} from "@angular/material/dialog";
import {AppPersonAction} from "@app/stores/person/app-person.action";
import {AppPersonState} from "@app/stores/person/app-person.state";
import {
Person,
User,
} from "@models";
import {
Select,
Store,
} from "@ngxs/store";
import {Store} from "@ngxs/store";
import {SharedAbstractContainer} from "@shared/components/containers/shared-abstract/shared-abstract.container";
import {SharedPersonFormPresentational} from "@shared/components/presentationals/shared-person-form/shared-person-form.presentational";
import {LocalStateModel} from "@shared/models/local-state.model";
import {Observable} from "rxjs";
import {
MemoizedUtil,
ModelFormControlEvent,
StoreUtil,
} from "solidify-frontend";
@Component({
......@@ -34,14 +31,14 @@ import {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class UserDialog extends SharedAbstractContainer implements OnInit {
@Select((state: LocalStateModel) => state.application.application_person.current) currentPersonObs: Observable<Person>;
@Select((state: LocalStateModel) => StoreUtil.isLoadingState(state.application.application_person)) isLoadingPersonObs: Observable<boolean>;
currentPersonObs: Observable<Person> = MemoizedUtil.current(this._store, AppPersonState);
isLoadingPersonObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, AppPersonState);
@ViewChild("formPresentational")
readonly formPresentational: SharedPersonFormPresentational;
constructor(protected store: Store,
protected dialogRef: MatDialogRef<UserDialog>,
constructor(protected readonly _store: Store,
protected readonly _dialogRef: MatDialogRef<UserDialog>,
@Inject(MAT_DIALOG_DATA) public user: User) {
super();
}
......@@ -52,7 +49,7 @@ export class UserDialog extends SharedAbstractContainer implements OnInit {
}
savePersonInfo($event: ModelFormControlEvent<Person>): void {
this.store.dispatch(new AppPersonAction.Update($event));
this._store.dispatch(new AppPersonAction.Update($event));
// this.dialogRef.close();
}
}
......@@ -19,10 +19,11 @@ import {
} from "@ngxs/store";
import {SharedAbstractCreateRoutable} from "@shared/components/routables/shared-abstract-create/shared-abstract-create.routable";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {LocalStateModel} from "@shared/models/local-state.model";
import {sharedFundingAgencyActionNameSpace} from "@shared/stores/funding-agency/shared-funding-agency.action";
import {SharedOrganizationalUnitState} from "@shared/stores/organizational-unit/shared-organizational-unit.state";
import {Observable} from "rxjs";
import {
MemoizedUtil,
OverrideProperty,
ResourceNameSpace,
} from "solidify-frontend";
......@@ -36,7 +37,7 @@ import {
export class AdminFundingAgenciesCreateRoutable extends SharedAbstractCreateRoutable<FundingAgency, AdminFundingAgenciesStateModel> {
@Select(AdminFundingAgenciesState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminFundingAgenciesState.isReadyToBeDisplayedInCreateMode) isReadyToBeDisplayedInCreateModeObs: Observable<boolean>;
@Select((state: LocalStateModel) => state.shared.shared_organizationalUnit.list) listOrgUnitsObs: Observable<OrganizationalUnit[]>;
listOrgUnitsObs: Observable<OrganizationalUnit[]> = MemoizedUtil.list(this._store, SharedOrganizationalUnitState);
@OverrideProperty()
checkAvailableResourceNameSpace: ResourceNameSpace = sharedFundingAgencyActionNameSpace;
......
......@@ -4,6 +4,7 @@ import {
AdminFundingAgenciesStateModel,
} from "@admin/funding-agencies/stores/admin-funding-agencies.state";
import {AdminFundingAgenciesOrgUnitAction} from "@admin/funding-agencies/stores/organizational-unit/admin-organizational-unit-preservation-policy.action";
import {AdminFundingAgenciesOrganizationalUnitState} from "@admin/funding-agencies/stores/organizational-unit/admin-organizational-unit-preservation-policy.state";
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
......@@ -22,10 +23,11 @@ import {
} from "@ngxs/store";
import {SharedAbstractDetailEditCommonRoutable} from "@shared/components/routables/shared-abstract-detail-edit-common/shared-abstract-detail-edit-common.routable";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {LocalStateModel} from "@shared/models/local-state.model";
import {sharedFundingAgencyActionNameSpace} from "@shared/stores/funding-agency/shared-funding-agency.action";
import {SharedOrganizationalUnitState} from "@shared/stores/organizational-unit/shared-organizational-unit.state";
import {Observable} from "rxjs";
import {
MemoizedUtil,
OverrideProperty,
ResourceNameSpace,
} from "solidify-frontend";
......@@ -39,8 +41,8 @@ import {
export class AdminFundingAgenciesDetailEditRoutable extends SharedAbstractDetailEditCommonRoutable<FundingAgency, AdminFundingAgenciesStateModel> {
@Select(AdminFundingAgenciesState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminFundingAgenciesState.isReadyToBeDisplayed) isReadyToBeDisplayedObs: Observable<boolean>;
@Select((state: LocalStateModel) => state.shared.shared_organizationalUnit.list) listOrgUnitsObs: Observable<OrganizationalUnit[]>;
@Select((state: LocalStateModel) => state.admin.admin_fundingAgencies.admin_fundingAgencies_organizationalUnit.selected) selectedOrgUnitsObs: Observable<OrganizationalUnit[]>;
listOrgUnitsObs: Observable<OrganizationalUnit[]> = MemoizedUtil.list(this._store, SharedOrganizationalUnitState);
selectedOrgUnitsObs: Observable<OrganizationalUnit[]> = MemoizedUtil.selected(this._store, AdminFundingAgenciesOrganizationalUnitState);
@OverrideProperty()
checkAvailableResourceNameSpace: ResourceNameSpace = sharedFundingAgencyActionNameSpace;
......
......@@ -27,8 +27,8 @@ import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {SharedOrganizationalUnitState} from "@shared/stores/organizational-unit/shared-organizational-unit.state";
import {Observable} from "rxjs";
import {
MemoizedUtil,
ModelFormControlEvent,
ResourceState,
} from "solidify-frontend";
@Component({
......@@ -40,7 +40,7 @@ import {
export class AdminOaiSetBulkCreateRoutable extends SharedAbstractCreateRoutable<OaiSet, AdminOaiSetStateModel> {
@Select(AdminOaiSetState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminOaiSetState.isReadyToBeDisplayedInCreateMode) isReadyToBeDisplayedInCreateModeObs: Observable<boolean>;
listOrgUnit: Observable<OrganizationalUnit[]> = ResourceState.list(this._store, SharedOrganizationalUnitState);
listOrgUnit: Observable<OrganizationalUnit[]> = MemoizedUtil.list(this._store, SharedOrganizationalUnitState);
@ViewChild("formPresentational")
readonly formPresentational: SharedAbstractFormPresentational<OaiSet>;
......
......@@ -4,6 +4,8 @@ import {
AdminOrganizationalUnitState,
AdminOrganizationalUnitStateModel,
} from "@admin/orgunit/stores/admin-organizational-unit.state";
import {AdminOrganizationalUnitFundingAgencyState} from "@admin/orgunit/stores/funding-agency/admin-organizational-unit-funding-agency.state";
import {AdminOrganizationalUnitInstitutionState} from "@admin/orgunit/stores/institution/admin-organizational-unit-institution.state";
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
......@@ -30,8 +32,9 @@ import {
import {SharedAbstractCreateRoutable} from "@shared/components/routables/shared-abstract-create/shared-abstract-create.routable";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {RoleEnum} from "@shared/enums/role.enum";
import {LocalStateModel} from "@shared/models/local-state.model";
import {SharedDisseminationPolicyState} from "@shared/stores/dissemination-policy/shared-dissemination-policy.state";
import {sharedOrgUnitActionNameSpace} from "@shared/stores/organizational-unit/shared-organizational-unit.action";
import {SharedPreservationPolicyState} from "@shared/stores/preservation-policy/shared-preservation-policy.state";
import {SharedResearchDomainAction} from "@shared/stores/research-domain/shared-research-domain.action";
import {SharedResearchDomainState} from "@shared/stores/research-domain/shared-research-domain.state";
import {SharedRoleState} from "@shared/stores/role/shared-role.state";
......@@ -41,7 +44,6 @@ import {
MemoizedUtil,
OverrideProperty,
ResourceNameSpace,
ResourceState,
} from "solidify-frontend";
@Component({
......@@ -51,14 +53,14 @@ import {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminOrgunitCreateRoutable extends SharedAbstractCreateRoutable<OrganizationalUnit, AdminOrganizationalUnitStateModel> implements OnInit {
listSubmissionPoliciesObs: Observable<SubmissionPolicy[]> = ResourceState.list(this._store, SharedSubmissionPolicyState);
listSubmissionPoliciesObs: Observable<SubmissionPolicy[]> = MemoizedUtil.list(this._store, SharedSubmissionPolicyState);
@Select(AdminOrganizationalUnitState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminOrganizationalUnitState.isReadyToBeDisplayedInCreateMode) isReadyToBeDisplayedInCreateModeObs: Observable<boolean>;
@Select((state: LocalStateModel) => state.shared.shared_preservationPolicy.list) listPreservationPoliciesObs: Observable<PreservationPolicy[]>;
@Select((state: LocalStateModel) => state.shared.shared_disseminationPolicy.list) listDisseminationPoliciesObs: Observable<DisseminationPolicy[]>;
listRoleObs: Observable<Role[]> = ResourceState.list(this._store, SharedRoleState);
@Select((state: LocalStateModel) => state.admin.admin_organizationalUnit.admin_organizationalUnit_fundingAgency.selected) selectedFundingAgenciesObs: Observable<FundingAgency[]>;
@Select((state: LocalStateModel) => state.admin.admin_organizationalUnit.admin_organizationalUnit_institution.selected) selectedInstitutionsObs: Observable<Institution[]>;
listPreservationPoliciesObs: Observable<PreservationPolicy[]> = MemoizedUtil.list(this._store, SharedPreservationPolicyState);
listDisseminationPoliciesObs: Observable<DisseminationPolicy[]> = MemoizedUtil.list(this._store, SharedDisseminationPolicyState);
listRoleObs: Observable<Role[]> = MemoizedUtil.list(this._store, SharedRoleState);
selectedFundingAgenciesObs: Observable<FundingAgency[]> = MemoizedUtil.selected(this._store, AdminOrganizationalUnitFundingAgencyState);
selectedInstitutionsObs: Observable<Institution[]> = MemoizedUtil.selected(this._store, AdminOrganizationalUnitInstitutionState);
researchDomainSourcesObs: Observable<string[]> = MemoizedUtil.select(this._store, SharedResearchDomainState, state => state.sources);
systemPropertyObs: Observable<SystemProperty> = MemoizedUtil.select(this._store, AppSystemPropertyState, state => state.current);
......
......@@ -5,10 +5,15 @@ import {
AdminOrganizationalUnitStateModel,
} from "@admin/orgunit/stores/admin-organizational-unit.state";
import {AdminOrgUnitDisseminationPolicyAction} from "@admin/orgunit/stores/dissemination-policy/admin-organizational-unit-dissemination-policy.action";
import {AdminOrganizationalUnitDisseminationPolicyState} from "@admin/orgunit/stores/dissemination-policy/admin-organizational-unit-dissemination-policy.state";
import {AdminOrgUnitFundingAgencyAction} from "@admin/orgunit/stores/funding-agency/admin-organizational-unit-funding-agency.action";
import {AdminOrganizationalUnitFundingAgencyState} from "@admin/orgunit/stores/funding-agency/admin-organizational-unit-funding-agency.state";
import {AdminOrgUnitInstitutionAction} from "@admin/orgunit/stores/institution/admin-organizational-unit-institution.action";
import {AdminOrganizationalUnitInstitutionState} from "@admin/orgunit/stores/institution/admin-organizational-unit-institution.state";
import {AdminOrgUnitPersonRoleAction} from "@admin/orgunit/stores/person-role/admin-organizational-unit-person-role.action";
import {AdminOrganizationalUnitPersonRoleState} from "@admin/orgunit/stores/person-role/admin-organizational-unit-person-role.state";
import {AdminOrgUnitPreservationPolicyAction} from "@admin/orgunit/stores/preservation-policy/admin-organizational-unit-preservation-policy.action";
import {AdminOrganizationalUnitPreservationPolicyState} from "@admin/orgunit/stores/preservation-policy/admin-organizational-unit-preservation-policy.state";
import {AdminOrgUnitSubmissionPolicyAction} from "@admin/orgunit/stores/submission-policy/admin-organizational-unit-submission-policy.action";
import {AdminOrganizationalUnitSubmissionPolicyState} from "@admin/orgunit/stores/submission-policy/admin-organizational-unit-submission-policy.state";
import {
......@@ -37,10 +42,13 @@ import {
} from "@ngxs/store";
import {SharedAbstractDetailEditCommonRoutable} from "@shared/components/routables/shared-abstract-detail-edit-common/shared-abstract-detail-edit-common.routable";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {LocalStateModel} from "@shared/models/local-state.model";
import {SharedDisseminationPolicyState} from "@shared/stores/dissemination-policy/shared-dissemination-policy.state";
import {sharedOrgUnitActionNameSpace} from "@shared/stores/organizational-unit/shared-organizational-unit.action";
import {SharedPreservationPolicyState} from "@shared/stores/preservation-policy/shared-preservation-policy.state";
import {SharedResearchDomainAction} from "@shared/stores/research-domain/shared-research-domain.action";
import {SharedResearchDomainState} from "@shared/stores/research-domain/shared-research-domain.state";
import {SharedRoleState} from "@shared/stores/role/shared-role.state";
import {SharedSubmissionPolicyState} from "@shared/stores/submission-policy/shared-submission-policy.state";
import {Observable} from "rxjs";
import {
MemoizedUtil,
......@@ -58,15 +66,15 @@ export class AdminOrgunitDetailEditRoutable extends SharedAbstractDetailEditComm
@Select(AdminOrganizationalUnitState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminOrganizationalUnitState.isReadyToBeDisplayed) isReadyToBeDisplayedObs: Observable<boolean>;
selectedSubmissionPoliciesObs: Observable<SubmissionPolicy[]> = MemoizedUtil.selected(this._store, AdminOrganizationalUnitSubmissionPolicyState);
@Select((state: LocalStateModel) => state.admin.admin_organizationalUnit.admin_organizationalUnit_preservationPolicy.selected) selectedPreservationPoliciesObs: Observable<PreservationPolicy[]>;
@Select((state: LocalStateModel) => state.admin.admin_organizationalUnit.admin_organizationalUnit_disseminationPolicy.selected) selectedDisseminationPoliciesObs: Observable<DisseminationPolicy[]>;
@Select((state: LocalStateModel) => state.admin.admin_organizationalUnit.admin_organizationalUnit_fundingAgency.selected) selectedFundingAgenciesObs: Observable<FundingAgency[]>;
@Select((state: LocalStateModel) => state.shared.shared_submissionPolicy.list) listSubmissionPoliciesObs: Observable<SubmissionPolicy[]>;
@Select((state: LocalStateModel) => state.shared.shared_preservationPolicy.list) listPreservationPoliciesObs: Observable<PreservationPolicy[]>;
@Select((state: LocalStateModel) => state.shared.shared_disseminationPolicy.list) listDisseminationPoliciesObs: Observable<DisseminationPolicy[]>;
@Select((state: LocalStateModel) => state.shared.shared_role.list) listRoleObs: Observable<Role[]>;
@Select((state: LocalStateModel) => state.admin.admin_organizationalUnit.admin_organizationalUnit_personRole.selected) selectedPersonRoleObs: Observable<PersonRole[]>;
@Select((state: LocalStateModel) => state.admin.admin_organizationalUnit.admin_organizationalUnit_institution.selected) selectedInstitutionsObs: Observable<Institution[]>;
selectedPreservationPoliciesObs: Observable<PreservationPolicy[]> = MemoizedUtil.selected(this._store, AdminOrganizationalUnitPreservationPolicyState);
selectedDisseminationPoliciesObs: Observable<DisseminationPolicy[]> = MemoizedUtil.selected(this._store, AdminOrganizationalUnitDisseminationPolicyState);
selectedFundingAgenciesObs: Observable<FundingAgency[]> = MemoizedUtil.selected(this._store, AdminOrganizationalUnitFundingAgencyState);
listSubmissionPoliciesObs: Observable<SubmissionPolicy[]> = MemoizedUtil.list(this._store, SharedSubmissionPolicyState);
listPreservationPoliciesObs: Observable<PreservationPolicy[]> = MemoizedUtil.list(this._store, SharedPreservationPolicyState);
listDisseminationPoliciesObs: Observable<DisseminationPolicy[]> = MemoizedUtil.list(this._store, SharedDisseminationPolicyState);
listRoleObs: Observable<Role[]> = MemoizedUtil.list(this._store, SharedRoleState);
selectedPersonRoleObs: Observable<PersonRole[]> = MemoizedUtil.selected(this._store, AdminOrganizationalUnitPersonRoleState);
selectedInstitutionsObs: Observable<Institution[]> = MemoizedUtil.selected(this._store, AdminOrganizationalUnitInstitutionState);
researchDomainSourcesObs: Observable<string[]> = MemoizedUtil.select(this._store, SharedResearchDomainState, state => state.sources);
systemPropertyObs: Observable<SystemProperty> = MemoizedUtil.select(this._store, AppSystemPropertyState, state => state.current);
......
......@@ -3,6 +3,7 @@ import {
AdminPersonState,
AdminPersonStateModel,
} from "@admin/person/stores/admin-person.state";
import {AdminPersonInstitutionsState} from "@admin/person/stores/institutions/admin-people-institutions.state";
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
......@@ -22,10 +23,11 @@ import {
import {SharedAbstractFormPresentational} from "@shared/components/presentationals/shared-abstract-form/shared-abstract-form.presentational";
import {SharedAbstractCreateRoutable} from "@shared/components/routables/shared-abstract-create/shared-abstract-create.routable";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {LocalStateModel} from "@shared/models/local-state.model";
import {sharedPersonActionNameSpace} from "@shared/stores/person/shared-person.action";
import {SharedRoleState} from "@shared/stores/role/shared-role.state";
import {Observable} from "rxjs";
import {
MemoizedUtil,
OverrideProperty,
ResourceNameSpace,
} from "solidify-frontend";
......@@ -39,8 +41,8 @@ import {
export class AdminPersonCreateRoutable extends SharedAbstractCreateRoutable<Person, AdminPersonStateModel> {
@Select(AdminPersonState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminPersonState.isReadyToBeDisplayedInCreateMode) isReadyToBeDisplayedInCreateModeObs: Observable<boolean>;
@Select((state: LocalStateModel) => state.admin.admin_person.admin_person_institutions.selected) selectedInstitutionsObs: Observable<Institution[]>;
@Select((state: LocalStateModel) => state.shared.shared_role.list) listRoleObs: Observable<Role[]>;
selectedInstitutionsObs: Observable<Institution[]> = MemoizedUtil.selected(this._store, AdminPersonInstitutionsState);
listRoleObs: Observable<Role[]> = MemoizedUtil.list(this._store, SharedRoleState);
@OverrideProperty()
checkAvailableResourceNameSpace: ResourceNameSpace = sharedPersonActionNameSpace;
......
......@@ -5,7 +5,9 @@ import {
AdminPersonStateModel,
} from "@admin/person/stores/admin-person.state";
import {AdminPersonInstitutionsAction} from "@admin/person/stores/institutions/admin-people-institutions.action";
import {AdminPersonInstitutionsState} from "@admin/person/stores/institutions/admin-people-institutions.state";
import {AdminPersonOrgUnitRoleAction} from "@admin/person/stores/person-role/admin-person-orgunit-role.action";
import {AdminPersonOrgUnitRoleState} from "@admin/person/stores/person-role/admin-person-orgunit-role.state";
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
......@@ -25,10 +27,11 @@ import {
} from "@ngxs/store";
import {SharedAbstractDetailEditCommonRoutable} from "@shared/components/routables/shared-abstract-detail-edit-common/shared-abstract-detail-edit-common.routable";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {LocalStateModel} from "@shared/models/local-state.model";
import {sharedPersonActionNameSpace} from "@shared/stores/person/shared-person.action";
import {SharedRoleState} from "@shared/stores/role/shared-role.state";
import {Observable} from "rxjs";
import {
MemoizedUtil,
OverrideProperty,
ResourceNameSpace,
} from "solidify-frontend";
......@@ -42,9 +45,9 @@ import {
export class AdminPersonDetailEditRoutable extends SharedAbstractDetailEditCommonRoutable<Person, AdminPersonStateModel> {
@Select(AdminPersonState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminPersonState.isReadyToBeDisplayed) isReadyToBeDisplayedObs: Observable<boolean>;
@Select((state: LocalStateModel) => state.shared.shared_role.list) listRoleObs: Observable<Role[]>;
@Select((state: LocalStateModel) => state.admin.admin_person.admin_person_institutions.selected) selectedInstitutionsObs: Observable<Institution[]>;
@Select((state: LocalStateModel) => state.admin.admin_person.admin_person_organizationalUnitRole.selected) selectedOrgUnitRoleObs: Observable<OrganizationalUnitRole[]>;
listRoleObs: Observable<Role[]> = MemoizedUtil.list(this._store, SharedRoleState);
selectedInstitutionsObs: Observable<Institution[]> = MemoizedUtil.selected(this._store, AdminPersonInstitutionsState);
selectedOrgUnitRoleObs: Observable<OrganizationalUnitRole[]> = MemoizedUtil.selected(this._store, AdminPersonOrgUnitRoleState);
@OverrideProperty()
checkAvailableResourceNameSpace: ResourceNameSpace = sharedPersonActionNameSpace;
......
......@@ -27,9 +27,9 @@ import {SharedLanguageState} from "@shared/stores/language/shared-language.state
import {sharedResearchDomainActionNameSpace} from "@shared/stores/research-domain/shared-research-domain.action";
import {Observable} from "rxjs";
import {
MemoizedUtil,
OverrideProperty,
ResourceNameSpace,
ResourceState,
} from "solidify-frontend";
@Component({
......@@ -39,7 +39,7 @@ import {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminResearchDomainCreateEditDialog extends SharedAbstractCreateEditDialog<ResearchDomain, AdminResearchDomainStateModel> {
languagesObs: Observable<Language[]> = ResourceState.list(this._store, SharedLanguageState);
languagesObs: Observable<Language[]> = MemoizedUtil.list(this._store, SharedLanguageState);
@OverrideProperty()
checkAvailableResourceNameSpace: ResourceNameSpace = sharedResearchDomainActionNameSpace;
......