Commit d66605fc authored by Florent Poittevin's avatar Florent Poittevin
Browse files

PROTO William-ngxs-memoized-solution

parent 3fc2db54
......@@ -56,7 +56,7 @@ export interface AdminFundingAgenciesStateModel extends ResourceStateModel<Fundi
AdminFundingAgenciesOrganizationalUnitState,
],
})
export class AdminFundingAgenciesState extends ResourceState<FundingAgencyExtended> {
export class AdminFundingAgenciesState extends ResourceState<AdminFundingAgenciesStateModel, FundingAgencyExtended> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -26,7 +26,7 @@ export interface AdminFundingAgenciesOrganizationalUnitStateModel extends Associ
...defaultAssociationStateInitValue(),
},
})
export class AdminFundingAgenciesOrganizationalUnitState extends AssociationState<OrganizationalUnit> {
export class AdminFundingAgenciesOrganizationalUnitState extends AssociationState<AdminFundingAgenciesOrganizationalUnitStateModel, OrganizationalUnit> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -31,7 +31,7 @@ export interface AdminInstitutionStateModel extends ResourceStateModel<Instituti
...defaultResourceStateInitValue(),
},
})
export class AdminInstitutionState extends ResourceState<Institution> {
export class AdminInstitutionState extends ResourceState<AdminInstitutionStateModel, Institution> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -30,7 +30,7 @@ export interface AdminLicenseStateModel extends ResourceStateModel<License> {
...defaultResourceStateInitValue(),
},
})
export class AdminLicenseState extends ResourceState<License> {
export class AdminLicenseState extends ResourceState<AdminLicenseStateModel, License> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -30,7 +30,7 @@ export interface AdminOAuth2ClientStateModel extends ResourceStateModel<Oauth2Cl
...defaultResourceStateInitValue(),
},
})
export class AdminOAuth2ClientState extends ResourceState<Oauth2Client> {
export class AdminOAuth2ClientState extends ResourceState<AdminOAuth2ClientStateModel, Oauth2Client> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
xxxIsLoadingObs : {{xxxIsLoadingObs | async | json}}
xxxIsLoading2Obs : {{xxxIsLoading2Obs | async | json}}
<div class="wrapper"
[dlcmSpinner]="isLoadingWithDependencyObs | async"
>
......
......@@ -24,6 +24,7 @@ import {SharedAbstractCreateRoutable} from "@shared/components/routables/shared-
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {LocalStateModel} from "@shared/models/local-state.model";
import {Observable} from "rxjs";
import {StoreUtil} from "solidify-frontend";
@Component({
selector: "dlcm-admin-orgunit-create-routable",
......@@ -32,6 +33,10 @@ import {Observable} from "rxjs";
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminOrgunitCreateRoutable extends SharedAbstractCreateRoutable<OrganizationalUnitExtended, AdminOrganizationalUnitStateModel> {
//@Select((state: LocalStateModel) => state.admin.admin_organizationalUnit) xxxIsLoadingWithDependencyObs: Observable<boolean>;
xxxIsLoadingObs: Observable<boolean> = StoreUtil.memoizeSelect(this.store, AdminOrganizationalUnitState, state => state.isLoadingCounter > 0, true);
xxxIsLoading2Obs: Observable<boolean> = StoreUtil.isLoading(this.store, AdminOrganizationalUnitState);
//xxxIsLoadingObs: Observable<boolean> = StoreUtil.isLoadingMemoizedSelector(AdminOrganizationalUnitState);
@Select(AdminOrganizationalUnitState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(AdminOrganizationalUnitState.isReadyToBeDisplayedInCreateMode) isReadyToBeDisplayedInCreateModeObs: Observable<boolean>;
@Select((state: LocalStateModel) => state.shared.shared_submissionPolicy.list) listSubmissionPoliciesObs: Observable<SubmissionPolicy[]>;
......
......@@ -54,7 +54,6 @@ import {
defaultAssociationStateInitValue,
defaultRelation2TiersStateInitValue,
defaultRelation3TiersStateInitValue,
defaultResourceStateInitValue,
isNullOrUndefined,
ModelAttributeEnum,
NotificationService,
......@@ -65,6 +64,7 @@ import {
StoreUtil,
TRANSLATE,
urlSeparator,
XxxResourceStateModel,
} from "solidify-frontend";
export interface AdminOrganizationalUnitStateModel extends ResourceStateModel<OrganizationalUnitExtended> {
......@@ -75,16 +75,17 @@ export interface AdminOrganizationalUnitStateModel extends ResourceStateModel<Or
admin_organizationalUnit_institution: AdminOrganizationalUnitInstitutionStateModel;
}
export class XxxAdminOrganizationalUnitStateModel extends XxxResourceStateModel<OrganizationalUnitExtended> {
admin_organizationalUnit_submissionPolicy: AdminOrganizationalUnitSubmissionPolicyStateModel = defaultRelation2TiersStateInitValue();
admin_organizationalUnit_preservationPolicy: AdminOrganizationalUnitPreservationPolicyStateModel = defaultRelation2TiersStateInitValue();
admin_organizationalUnit_personRole: AdminOrganizationalUnitPersonRoleStateModel = defaultRelation3TiersStateInitValue();
admin_organizationalUnit_fundingAgency: AdminOrganizationalUnitFundingAgencyStateModel = defaultAssociationStateInitValue();
admin_organizationalUnit_institution: AdminOrganizationalUnitInstitutionStateModel = defaultAssociationStateInitValue();
}
@State<AdminOrganizationalUnitStateModel>({
name: LocalStateEnum.admin_organizationalUnit,
defaults: {
...defaultResourceStateInitValue(),
admin_organizationalUnit_submissionPolicy: {...defaultRelation2TiersStateInitValue()},
admin_organizationalUnit_preservationPolicy: {...defaultRelation2TiersStateInitValue()},
admin_organizationalUnit_personRole: {...defaultRelation3TiersStateInitValue()},
admin_organizationalUnit_fundingAgency: {...defaultAssociationStateInitValue()},
admin_organizationalUnit_institution: {...defaultAssociationStateInitValue()},
},
defaults: {...new XxxAdminOrganizationalUnitStateModel()},
children: [
AdminOrganizationalUnitSubmissionPolicyState,
AdminOrganizationalUnitPreservationPolicyState,
......@@ -93,7 +94,7 @@ export interface AdminOrganizationalUnitStateModel extends ResourceStateModel<Or
AdminOrganizationalUnitInstitutionState,
],
})
export class AdminOrganizationalUnitState extends ResourceState<OrganizationalUnitExtended> {
export class AdminOrganizationalUnitState extends ResourceState<XxxAdminOrganizationalUnitStateModel, OrganizationalUnitExtended> {
constructor(protected apiService: ApiService,
protected store: Store,
......
......@@ -25,7 +25,7 @@ export interface AdminOrganizationalUnitFundingAgencyStateModel extends Associat
...defaultAssociationStateInitValue(),
},
})
export class AdminOrganizationalUnitFundingAgencyState extends AssociationState<FundingAgency> {
export class AdminOrganizationalUnitFundingAgencyState extends AssociationState<AdminOrganizationalUnitFundingAgencyStateModel, FundingAgency> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -25,7 +25,7 @@ export interface AdminOrganizationalUnitInstitutionStateModel extends Associatio
...defaultAssociationStateInitValue(),
},
})
export class AdminOrganizationalUnitInstitutionState extends AssociationState<Institution> {
export class AdminOrganizationalUnitInstitutionState extends AssociationState<AdminOrganizationalUnitInstitutionStateModel, Institution> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -29,7 +29,7 @@ export interface AdminOrganizationalUnitPersonRoleStateModel extends Relation3Ti
},
})
// OrganizationalUnitPersonController
export class AdminOrganizationalUnitPersonRoleState extends Relation3TiersState<PersonRole, OrganizationalUnitPersonRole> {
export class AdminOrganizationalUnitPersonRoleState extends Relation3TiersState<AdminOrganizationalUnitPersonRoleStateModel, PersonRole, OrganizationalUnitPersonRole> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -45,7 +45,7 @@ export interface AdminOrganizationalUnitPreservationPolicyStateModel extends Rel
...defaultRelation2TiersStateInitValue(),
},
})
export class AdminOrganizationalUnitPreservationPolicyState extends Relation2TiersState<PreservationPolicy, OrganizationalUnitPreservationPolicy> {
export class AdminOrganizationalUnitPreservationPolicyState extends Relation2TiersState<AdminOrganizationalUnitPreservationPolicyStateModel, PreservationPolicy, OrganizationalUnitPreservationPolicy> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -45,7 +45,7 @@ export interface AdminOrganizationalUnitSubmissionPolicyStateModel extends Relat
...defaultRelation2TiersStateInitValue(),
},
})
export class AdminOrganizationalUnitSubmissionPolicyState extends Relation2TiersState<SubmissionPolicy, OrganizationalUnitSubmissionPolicy> {
export class AdminOrganizationalUnitSubmissionPolicyState extends Relation2TiersState<AdminOrganizationalUnitSubmissionPolicyStateModel, SubmissionPolicy, OrganizationalUnitSubmissionPolicy> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -63,7 +63,7 @@ export interface AdminPersonStateModel extends ResourceStateModel<PersonExtended
AdminPersonInstitutionsState,
],
})
export class AdminPersonState extends ResourceState<PersonExtended> {
export class AdminPersonState extends ResourceState<AdminPersonStateModel, PersonExtended> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -26,7 +26,7 @@ export interface AdminPersonInstitutionsStateModel extends AssociationStateModel
...defaultAssociationStateInitValue(),
},
})
export class AdminPersonInstitutionsState extends AssociationState<Institution> {
export class AdminPersonInstitutionsState extends AssociationState<AdminPersonInstitutionsStateModel, Institution> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -29,7 +29,7 @@ export interface AdminPersonOrgUnitRoleStateModel extends Relation3TiersStateMod
},
})
// PersonOrganizationalUnitController
export class AdminPersonOrgUnitRoleState extends Relation3TiersState<OrganizationalUnitRole, OrganizationalUnitPersonRole> {
export class AdminPersonOrgUnitRoleState extends Relation3TiersState<AdminPersonOrgUnitRoleStateModel, OrganizationalUnitRole, OrganizationalUnitPersonRole> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -30,7 +30,7 @@ export interface AdminPreservationPolicyStateModel extends ResourceStateModel<Pr
...defaultResourceStateInitValue(),
},
})
export class AdminPreservationPolicyState extends ResourceState<PreservationPolicy> {
export class AdminPreservationPolicyState extends ResourceState<AdminPreservationPolicyStateModel, PreservationPolicy> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -31,7 +31,7 @@ export interface AdminRoleStateModel extends ResourceStateModel<Role> {
},
})
export class AdminRoleState extends ResourceState<Role> {
export class AdminRoleState extends ResourceState<AdminRoleStateModel, Role> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
......@@ -16,7 +16,7 @@ import {
} from "@admin/oauth2-client/stores/admin-oauth2-client.state";
import {
AdminOrganizationalUnitState,
AdminOrganizationalUnitStateModel,
XxxAdminOrganizationalUnitStateModel,
} from "@admin/orgunit/stores/admin-organizational-unit.state";
import {
AdminPersonState,
......@@ -53,7 +53,7 @@ export interface AdminStateModel extends BaseStateModel {
admin_submissionPolicy: AdminSubmissionPolicyStateModel;
admin_preservationPolicy: AdminPreservationPolicyStateModel;
admin_license: AdminLicenseStateModel;
admin_organizationalUnit: AdminOrganizationalUnitStateModel;
admin_organizationalUnit: XxxAdminOrganizationalUnitStateModel;
admin_institution: AdminInstitutionStateModel;
admin_user: AdminUserStateModel;
admin_oauth2Client: AdminOAuth2ClientStateModel;
......
......@@ -30,7 +30,7 @@ export interface AdminSubmissionPolicyStateModel extends ResourceStateModel<Subm
...defaultResourceStateInitValue(),
},
})
export class AdminSubmissionPolicyState extends ResourceState<SubmissionPolicy> {
export class AdminSubmissionPolicyState extends ResourceState<AdminSubmissionPolicyStateModel, SubmissionPolicy> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment