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

Rename State enum

parent 8d1da587
......@@ -17,8 +17,8 @@ import {Observable} from "rxjs";
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DepositFileContainer extends SharedAbstractContainer {
@Select((state: StateModel) => state[StateEnum.deposit][StateEnum.depositDataFile].list) listDataFileObs: Observable<DepositDataFile[]>;
@Select((state: StateModel) => StoreUtil.isLoadingState(state[StateEnum.deposit][StateEnum.depositDataFile])) isLoadingDataFileObs: Observable<boolean>;
@Select((state: StateModel) => state[StateEnum.deposit][StateEnum.deposit_dataFile].list) listDataFileObs: Observable<DepositDataFile[]>;
@Select((state: StateModel) => StoreUtil.isLoadingState(state[StateEnum.deposit][StateEnum.deposit_dataFile])) isLoadingDataFileObs: Observable<boolean>;
@Select((state: StateModel) => state[StateEnum.deposit].uploadStatus) uploadStatusObs: Observable<UploadFileStatus>;
@Input()
......
......@@ -5,7 +5,7 @@ import {SubmissionPoliciesModel} from "@app/generated-api";
import {TypeDefaultAction} from "@app/shared/decorators/type-default-action.decorator";
import {StateEnum} from "@app/shared/enums/state.enum";
const state = StateEnum.depositDataFile;
const state = StateEnum.deposit_dataFile;
export namespace DepositDataFileAction {
@TypeDefaultAction(state)
......
......@@ -17,7 +17,7 @@ export interface DepositDataFileStateModel extends CompositionStateModel<Deposit
}
@State<DepositDataFileStateModel>({
name: StateEnum.depositDataFile,
name: StateEnum.deposit_dataFile,
defaults: {
...defaultCompositionStateInitValue,
},
......@@ -38,7 +38,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFile> {
}
defineState(): StateEnum {
return StateEnum.depositDataFile;
return StateEnum.deposit_dataFile;
}
defineResourceName(): ApiResourceNameEnum {
......
......@@ -28,7 +28,7 @@ import {map, tap} from "rxjs/operators";
import {ResourceNameSpace} from "../../../../core/stores/resource/resource-namespace.model";
export interface DepositStateModel extends ResourceStateModel<DepositsModel> {
[StateEnum.depositDataFile]: DepositDataFileStateModel;
[StateEnum.deposit_dataFile]: DepositDataFileStateModel;
listDataFile: DepositDataFile[];
isLoadingDataFile: boolean;
uploadStatus: UploadFileStatus;
......@@ -38,7 +38,7 @@ export interface DepositStateModel extends ResourceStateModel<DepositsModel> {
name: StateEnum.deposit,
defaults: {
...defaultResourceStateInitValue,
[StateEnum.depositDataFile]: null,
[StateEnum.deposit_dataFile]: null,
listDataFile: [],
isLoadingDataFile: false,
uploadStatus: null,
......
......@@ -20,8 +20,8 @@ import {Observable} from "rxjs";
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrgunitDetailPresentational extends SharedAbstractDetailRoutable<OrganizationalUnitsModel, OrganizationalUnitStateModel> {
@Select((state: StateModel) => StoreUtil.isLoadingState(state[StateEnum.organizationalUnit][StateEnum.organizationalUnitSubResourceSubmissionPolicy])) isLoadingSubmissionPoliciesObs: Observable<boolean>;
@Select((state: StateModel) => state[StateEnum.organizationalUnit][StateEnum.organizationalUnitSubResourceSubmissionPolicy].selected) selectedSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: StateModel) => StoreUtil.isLoadingState(state[StateEnum.organizationalUnit][StateEnum.organizationalUnit_submissionPolicy])) isLoadingSubmissionPoliciesObs: Observable<boolean>;
@Select((state: StateModel) => state[StateEnum.organizationalUnit][StateEnum.organizationalUnit_submissionPolicy].selected) selectedSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: StateModel) => state[StateEnum.shared][StateEnum.submissionPolicy].list) listSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: StateModel) => state[StateEnum.shared][StateEnum.preservationPolicy].list) listPreservationPoliciesObs: Observable<PreservationPoliciesModel[]>;
......
......@@ -18,8 +18,8 @@ import {Observable} from "rxjs";
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrgunitEditPresentational extends SharedAbstractEditRoutable<OrganizationalUnitsModel, OrganizationalUnitStateModel> implements OnInit {
@Select((state: StateModel) => StoreUtil.isLoadingState(state[StateEnum.organizationalUnit][StateEnum.organizationalUnitSubResourceSubmissionPolicy])) isLoadingSubmissionPoliciesObs: Observable<boolean>;
@Select((state: StateModel) => state[StateEnum.organizationalUnit][StateEnum.organizationalUnitSubResourceSubmissionPolicy].selected) selectedSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: StateModel) => StoreUtil.isLoadingState(state[StateEnum.organizationalUnit][StateEnum.organizationalUnit_submissionPolicy])) isLoadingSubmissionPoliciesObs: Observable<boolean>;
@Select((state: StateModel) => state[StateEnum.organizationalUnit][StateEnum.organizationalUnit_submissionPolicy].selected) selectedSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: StateModel) => state[StateEnum.shared][StateEnum.submissionPolicy].list) listSubmissionPoliciesObs: Observable<SubmissionPoliciesModel[]>;
@Select((state: StateModel) => state[StateEnum.shared][StateEnum.preservationPolicy].list) listPreservationPoliciesObs: Observable<PreservationPoliciesModel[]>;
......
......@@ -2,10 +2,10 @@ export enum StateEnum {
router = "router",
application = "application",
deposit = "deposit",
depositDataFile = "deposit_dataFile",
deposit_dataFile = "deposit_dataFile",
access = "access",
organizationalUnit = "organizationalUnit",
organizationalUnitSubResourceSubmissionPolicy = "organizationalUnit_submissionPolicy",
organizationalUnit_submissionPolicy = "organizationalUnit_submissionPolicy",
shared = "shared",
language = "language",
license = "license",
......
......@@ -28,7 +28,7 @@ import {tap} from "rxjs/internal/operators/tap";
import {ResourceNameSpace} from "../../../core/stores/resource/resource-namespace.model";
export interface OrganizationalUnitStateModel extends ResourceStateModel<OrganizationalUnitsModel> {
[StateEnum.organizationalUnitSubResourceSubmissionPolicy]?: OrganizationalUnitSubmissionPolicyStateModel;
[StateEnum.organizationalUnit_submissionPolicy]?: OrganizationalUnitSubmissionPolicyStateModel;
}
@State<OrganizationalUnitStateModel>({
......@@ -147,7 +147,7 @@ export class OrganizationalUnitState extends ResourceState<OrganizationalUnitsMo
return super.internalUpdate(ctx, action)
.pipe(
tap(model => {
const oldSubmissionPolicies = _.map(ctx.getState()[StateEnum.organizationalUnitSubResourceSubmissionPolicy].selected, ModelAttributeEnum.resId);
const oldSubmissionPolicies = _.map(ctx.getState()[StateEnum.organizationalUnit_submissionPolicy].selected, ModelAttributeEnum.resId);
const newSubmissionPolicies = action.model[ModelAttributeEnum.submissionPolicies];
StoreUtil.dispatchActionAndWaitForSubActionsCompletion(
......
......@@ -4,7 +4,7 @@ import {Relation2TiersAction} from "@app/core/stores/relation-2-tiers/relation-2
import {TypeDefaultAction} from "@app/shared/decorators/type-default-action.decorator";
import {StateEnum} from "@app/shared/enums/state.enum";
const state = StateEnum.organizationalUnitSubResourceSubmissionPolicy;
const state = StateEnum.organizationalUnit_submissionPolicy;
export namespace OrgUnitSubmissionPolicyAction {
......
......@@ -18,7 +18,7 @@ export interface OrganizationalUnitSubmissionPolicyStateModel extends Relation2T
}
@State<OrganizationalUnitSubmissionPolicyStateModel>({
name: StateEnum.organizationalUnitSubResourceSubmissionPolicy,
name: StateEnum.organizationalUnit_submissionPolicy,
defaults: {
...defaultRelation2TiersStateInitValue,
},
......
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