Commit 0a0d7739 authored by Florent Poittevin's avatar Florent Poittevin
Browse files

fix: refactor admin org unit update action to allow safe sequential call

- Make sequential call on update org unit with preservation policy (with default value), submission policy (with default value) and person/role
parent ac1b65eb
......@@ -9240,9 +9240,9 @@
}
},
"solidify-frontend": {
"version": "0.1.10",
"resolved": "https://packages.dlcm.ch/repository/npm-group/solidify-frontend/-/solidify-frontend-0.1.10.tgz",
"integrity": "sha512-MqSRlWRFT/MiQwune+l3YldTUeHIt/TG+BoWhwEe8SJNdJ5QgVuEwbf/mu1foS/XXzhcZYoEN0uya16df2jPVA==",
"version": "0.1.11",
"resolved": "https://packages.dlcm.ch/repository/npm-group/solidify-frontend/-/solidify-frontend-0.1.11.tgz",
"integrity": "sha512-pXQGie2UBamZiYDgW7ypGOuYfDBNHwnvDYVAyWkDfR6SXcvklEF2XBXgdNTGQ0Q6jyc6krb0QeG093rZrCzyuA==",
"requires": {
"tslib": "^1.9.0"
}
......
......@@ -102,6 +102,14 @@ export class AdminOrgunitFormPresentational extends SharedAbstractFormPresentati
organizationalUnit.closingDate = DateUtil.convertToLocalDateDateSimple(organizationalUnit.closingDate);
organizationalUnit.defaultSubmissionPolicy = {resId: organizationalUnit[this.formDefinition.defaultSubmissionPolicy]};
organizationalUnit.defaultPreservationPolicy = {resId: organizationalUnit[this.formDefinition.defaultPreservationPolicy]};
organizationalUnit.preservationPolicies = [];
this.form.get(this.formDefinition.preservationPolicies).value.forEach(resId => {
organizationalUnit.preservationPolicies.push({resId: resId});
});
organizationalUnit.submissionPolicies = [];
this.form.get(this.formDefinition.submissionPolicies).value.forEach(resId => {
organizationalUnit.submissionPolicies.push({resId: resId});
});
return organizationalUnit;
}
}
......
import {OrganizationalUnitPreservationPolicy} from "@admin/models/organizational-unit-preservation-policy.model";
import {OrganizationalUnitSubmissionPolicy} from "@admin/models/organizational-unit-submission-policy.model";
import {
AdminOrgUnitAction,
adminOrgUnitActionNameSpace,
......@@ -9,12 +7,12 @@ import {
AdminOrganizationalUnitPersonRoleState,
AdminOrganizationalUnitPersonRoleStateModel,
} from "@admin/orgunit/stores/person-role/admin-organizational-unit-person-role.state";
import {adminOrgUnitPreservationPolicyActionNameSpace} from "@admin/orgunit/stores/preservation-policy/admin-organizational-unit-preservation-policy.action";
import {AdminOrgUnitPreservationPolicyAction} from "@admin/orgunit/stores/preservation-policy/admin-organizational-unit-preservation-policy.action";
import {
AdminOrganizationalUnitPreservationPolicyState,
AdminOrganizationalUnitPreservationPolicyStateModel,
} from "@admin/orgunit/stores/preservation-policy/admin-organizational-unit-preservation-policy.state";
import {adminOrgUnitSubmissionPolicyActionNameSpace} from "@admin/orgunit/stores/submission-policy/admin-organizational-unit-submission-policy.action";
import {AdminOrgUnitSubmissionPolicyAction} from "@admin/orgunit/stores/submission-policy/admin-organizational-unit-submission-policy.action";
import {
AdminOrganizationalUnitSubmissionPolicyState,
AdminOrganizationalUnitSubmissionPolicyStateModel,
......@@ -31,28 +29,20 @@ import {
} from "@ngxs/store";
import {AdminResourceApiEnum} from "@shared/enums/api.enum";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {LocalModelAttributeEnum} from "@shared/enums/model-attribute.enum";
import {RoutesEnum} from "@shared/enums/routes.enum";
import {SharedPersonAction} from "@shared/stores/person/shared-person.action";
import {SharedPreservationPolicyAction} from "@shared/stores/preservation-policy/shared-preservation-policy.action";
import {SharedRoleAction} from "@shared/stores/role/shared-role.action";
import {SharedSubmissionPolicyAction} from "@shared/stores/submission-policy/shared-submission-policy.action";
import _ from "lodash";
import {Observable} from "rxjs";
import {tap} from "rxjs/internal/operators/tap";
import {
ActionSubActionCompletionsWrapper,
ApiService,
ChangeModeEnum,
defaultResourceStateInitValue,
isNotNullNorUndefined,
ModelAttributeEnum,
NotificationService,
ObjectUtil,
OverrideDefaultAction,
Relation2TiersActionHelper,
Relation2TiersNameSpace,
ResourceState,
ResourceStateModel,
StoreUtil,
......@@ -124,23 +114,17 @@ export class AdminOrganizationalUnitState extends ResourceState<OrganizationalUn
@OverrideDefaultAction()
@Action(AdminOrgUnitAction.Create)
create(ctx: StateContext<AdminOrganizationalUnitStateModel>, action: AdminOrgUnitAction.Create): Observable<OrganizationalUnitExtended> {
const oldDefaultSubmissionPolicyId = undefined;
const oldDefaultPreservationPolicyId = undefined;
return super.internalCreate(ctx, action)
.pipe(
tap(model => {
this.updateSubResource(model, action, ctx)
.subscribe(success => {
if (success) {
ctx.dispatch(new AdminOrgUnitAction.UpdateSuccess(action, model));
ctx.dispatch(new AdminOrgUnitAction.CreateSuccess(action, model));
} else {
ctx.dispatch(new AdminOrgUnitAction.UpdateFail(action));
ctx.dispatch(new AdminOrgUnitAction.CreateFail(action));
}
});
// TODO Move in update sub resource to have a bulk update
const parentResId = model.resId;
this.updateSubResourceSubmissionAndPreservationPolicy(ChangeModeEnum.create, action, ctx, oldDefaultSubmissionPolicyId, oldDefaultPreservationPolicyId, parentResId);
}),
);
}
......@@ -148,9 +132,6 @@ export class AdminOrganizationalUnitState extends ResourceState<OrganizationalUn
@OverrideDefaultAction()
@Action(AdminOrgUnitAction.Update)
update(ctx: StateContext<AdminOrganizationalUnitStateModel>, action: AdminOrgUnitAction.Update): Observable<OrganizationalUnitExtended> {
const oldDefaultSubmissionPolicyId = ObjectUtil.getValue(ctx.getState().current.defaultSubmissionPolicy, ModelAttributeEnum.resId) as string;
const oldDefaultPreservationPolicyId = ObjectUtil.getValue(ctx.getState().current.defaultPreservationPolicy, ModelAttributeEnum.resId) as string;
return super.internalUpdate(ctx, action)
.pipe(
tap(model => {
......@@ -162,100 +143,45 @@ export class AdminOrganizationalUnitState extends ResourceState<OrganizationalUn
ctx.dispatch(new AdminOrgUnitAction.UpdateFail(action));
}
});
// TODO Move in update sub resource to have a bulk update
const parentResId = action.modelFormControlEvent.model.resId;
this.updateSubResourceSubmissionAndPreservationPolicy(ChangeModeEnum.update, action, ctx, oldDefaultSubmissionPolicyId, oldDefaultPreservationPolicyId, parentResId);
}),
);
}
private updateSubResource(model: OrganizationalUnitExtended, action: AdminOrgUnitAction.Create | AdminOrgUnitAction.Update, ctx: StateContext<AdminOrganizationalUnitStateModel>): Observable<boolean> {
const orgUnitId = model.resId;
const newPersonRole = action.modelFormControlEvent.formControl.get("personRole").value;
return StoreUtil.dispatchParallelActionAndWaitForSubActionsCompletion(ctx, [{
action: new AdminOrgUnitPersonRoleAction.Update(orgUnitId, newPersonRole),
subActionCompletions: [
this.actions$.pipe(ofActionCompleted(AdminOrgUnitPersonRoleAction.UpdateSuccess)),
this.actions$.pipe(ofActionCompleted(AdminOrgUnitPersonRoleAction.UpdateFail)),
],
}]);
}
private updateSubResourceSubmissionAndPreservationPolicy(changeMode: ChangeModeEnum, action: AdminOrgUnitAction.Create | AdminOrgUnitAction.Update, ctx: StateContext<AdminOrganizationalUnitStateModel>, oldDefaultSubmissionPolicyId: string | undefined, oldDefaultPreservationPolicyId: string | undefined, parentResId: string): void {
const listSubmissionPoliciesActionSubActionCompletionsWrapper = this.getListSubresourceUpdateActionSubActionCompletionsWrapper(
changeMode,
adminOrgUnitSubmissionPolicyActionNameSpace,
action,
ctx,
oldDefaultSubmissionPolicyId,
parentResId,
LocalModelAttributeEnum.defaultSubmissionPolicy,
LocalModelAttributeEnum.submissionPolicies,
LocalStateEnum.admin_organizationalUnit_submissionPolicy);
const listPreservationPoliciesActionSubActionCompletionsWrapper = this.getListSubresourceUpdateActionSubActionCompletionsWrapper(
changeMode,
adminOrgUnitPreservationPolicyActionNameSpace,
action,
ctx,
oldDefaultPreservationPolicyId,
parentResId,
LocalModelAttributeEnum.defaultPreservationPolicy,
LocalModelAttributeEnum.preservationPolicies,
LocalStateEnum.admin_organizationalUnit_preservationPolicy);
StoreUtil.updateSequentialSubResourceCustom(changeMode, ctx, adminOrgUnitActionNameSpace, [...listSubmissionPoliciesActionSubActionCompletionsWrapper, ...listPreservationPoliciesActionSubActionCompletionsWrapper]);
}
private getListSubresourceUpdateActionSubActionCompletionsWrapper(changeMode: ChangeModeEnum,
nameSpace: Relation2TiersNameSpace,
action: AdminOrgUnitAction.Create | AdminOrgUnitAction.Update,
ctx: StateContext<AdminOrganizationalUnitStateModel>,
oldDefaultId: string | undefined,
parentResId: string,
defaultFormKey: string,
selectedFormKey: string,
subStateKey: LocalStateEnum): ActionSubActionCompletionsWrapper[] {
const newDefaultId = action.modelFormControlEvent.model[defaultFormKey].resId;
const oldSelectedValues = changeMode === ChangeModeEnum.create ? [] : _.map(ctx.getState()[subStateKey].selected, LocalModelAttributeEnum.resId);
const newSelectedValues = action.modelFormControlEvent.model[selectedFormKey];
return this.getUpdateRelationActionsWrapper(nameSpace, oldDefaultId, newDefaultId, parentResId, oldSelectedValues, newSelectedValues);
}
private getUpdateRelationActionsWrapper(nameSpace: Relation2TiersNameSpace, oldDefaultResId: string | undefined, newDefaultResId: string, parentResId: string, oldSelectedValuesId: string[], newSelectedValuesId: string[]): ActionSubActionCompletionsWrapper[] {
const listActionSubActionCompletionsWrapper: ActionSubActionCompletionsWrapper[] = [];
const oldDefaultPreservationPolicyId = ObjectUtil.getValue(ctx.getState().current.defaultPreservationPolicy, ModelAttributeEnum.resId) as string;
const newDefaultPreservationPolicyId = action.modelFormControlEvent.model.defaultPreservationPolicy.resId;
const newPreservationPoliciesIds = action.modelFormControlEvent.model.preservationPolicies.map(p => p.resId);
listActionSubActionCompletionsWrapper.push({
action: Relation2TiersActionHelper.update(nameSpace, parentResId, oldSelectedValuesId, newSelectedValuesId),
subActionCompletions: [
this.actions$.pipe(ofActionCompleted(nameSpace.UpdateSuccess)),
this.actions$.pipe(ofActionCompleted(nameSpace.UpdateFail)),
],
});
const oldDefaultSubmissionPolicyId = ObjectUtil.getValue(ctx.getState().current.defaultSubmissionPolicy, ModelAttributeEnum.resId) as string;
const newDefaultSubmissionPolicyId = action.modelFormControlEvent.model.defaultSubmissionPolicy.resId;
const newSubmissionPoliciesIds = action.modelFormControlEvent.model.submissionPolicies.map(p => p.resId);
if (oldDefaultResId !== newDefaultResId) {
if (isNotNullNorUndefined(oldDefaultResId) && newSelectedValuesId.includes(oldDefaultResId)) {
listActionSubActionCompletionsWrapper.push({
action: Relation2TiersActionHelper.updateRelation(nameSpace, parentResId, oldDefaultResId, {defaultPolicy: false} as OrganizationalUnitSubmissionPolicy | OrganizationalUnitPreservationPolicy),
subActionCompletions: [
this.actions$.pipe(ofActionCompleted(nameSpace.UpdateRelationSuccess)),
this.actions$.pipe(ofActionCompleted(nameSpace.UpdateRelationFail)),
],
});
}
const newPersonRole = action.modelFormControlEvent.formControl.get("personRole").value;
if (isNotNullNorUndefined(newDefaultResId)) {
listActionSubActionCompletionsWrapper.push({
action: Relation2TiersActionHelper.updateRelation(nameSpace, parentResId, newDefaultResId, {defaultPolicy: true} as OrganizationalUnitSubmissionPolicy | OrganizationalUnitPreservationPolicy),
subActionCompletions: [
this.actions$.pipe(ofActionCompleted(nameSpace.UpdateRelationSuccess)),
this.actions$.pipe(ofActionCompleted(nameSpace.UpdateRelationFail)),
],
});
}
}
return listActionSubActionCompletionsWrapper;
return StoreUtil.dispatchParallelActionAndWaitForSubActionsCompletion(ctx, [
{
action: new AdminOrgUnitPreservationPolicyAction.Update(orgUnitId, newPreservationPoliciesIds, oldDefaultPreservationPolicyId, newDefaultPreservationPolicyId),
subActionCompletions: [
this.actions$.pipe(ofActionCompleted(AdminOrgUnitPreservationPolicyAction.UpdateSuccess)),
this.actions$.pipe(ofActionCompleted(AdminOrgUnitPreservationPolicyAction.UpdateFail)),
],
},
{
action: new AdminOrgUnitSubmissionPolicyAction.Update(orgUnitId, newSubmissionPoliciesIds, oldDefaultSubmissionPolicyId, newDefaultSubmissionPolicyId),
subActionCompletions: [
this.actions$.pipe(ofActionCompleted(AdminOrgUnitSubmissionPolicyAction.UpdateSuccess)),
this.actions$.pipe(ofActionCompleted(AdminOrgUnitSubmissionPolicyAction.UpdateFail)),
],
},
{
action: new AdminOrgUnitPersonRoleAction.Update(orgUnitId, newPersonRole),
subActionCompletions: [
this.actions$.pipe(ofActionCompleted(AdminOrgUnitPersonRoleAction.UpdateSuccess)),
this.actions$.pipe(ofActionCompleted(AdminOrgUnitPersonRoleAction.UpdateFail)),
],
},
]);
}
}
......@@ -37,6 +37,9 @@ export namespace AdminOrgUnitPreservationPolicyAction {
@TypeDefaultAction(state)
export class Update extends Relation2TiersAction.Update {
constructor(public parentId: string, public newResId: string[], public oldDefaultResId: string, public newDefaultResId: string) {
super(parentId, newResId);
}
}
@TypeDefaultAction(state)
......
import {OrganizationalUnitPreservationPolicy} from "@admin/models/organizational-unit-preservation-policy.model";
import {adminOrgUnitPreservationPolicyActionNameSpace} from "@admin/orgunit/stores/preservation-policy/admin-organizational-unit-preservation-policy.action";
import {
AdminOrgUnitPreservationPolicyAction,
adminOrgUnitPreservationPolicyActionNameSpace,
} from "@admin/orgunit/stores/preservation-policy/admin-organizational-unit-preservation-policy.action";
import {PreservationPolicy} from "@app/generated-api";
import {
Action,
ActionCompletion,
Actions,
ofActionCompleted,
State,
StateContext,
Store,
} from "@ngxs/store";
import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum";
import {AdminResourceApiEnum} from "@shared/enums/api.enum";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {
Observable,
of,
} from "rxjs";
import {tap} from "rxjs/operators";
import {
ActionSubActionCompletionsWrapper,
ApiService,
BaseSubAction,
defaultRelation2TiersStateInitValue,
isEmptyArray,
isNotNullNorUndefined,
NotificationService,
OverrideDefaultAction,
Relation2TiersState,
Relation2TiersStateModel,
StoreUtil,
} from "solidify-frontend";
export interface AdminOrganizationalUnitPreservationPolicyStateModel extends Relation2TiersStateModel<PreservationPolicy> {
......@@ -38,4 +56,59 @@ export class AdminOrganizationalUnitPreservationPolicyState extends Relation2Tie
resourceName: ApiResourceNameEnum.PRES_POLICY,
});
}
@OverrideDefaultAction()
@Action(AdminOrgUnitPreservationPolicyAction.Update)
update(ctx: StateContext<AdminOrganizationalUnitPreservationPolicyStateModel>, action: AdminOrgUnitPreservationPolicyAction.Update): Observable<boolean> {
return super.internalUpdate(ctx, action)
.pipe(
tap((isSuccess: boolean) => {
if (!isSuccess) {
ctx.dispatch(new AdminOrgUnitPreservationPolicyAction.UpdateFail(action, action.parentId));
return;
}
this.updateSubResource(action, ctx)
.subscribe(success => {
if (success) {
ctx.dispatch(new AdminOrgUnitPreservationPolicyAction.UpdateSuccess(action, action.parentId));
} else {
ctx.dispatch(new AdminOrgUnitPreservationPolicyAction.UpdateFail(action, action.parentId));
}
});
}),
);
}
private updateSubResource(action: AdminOrgUnitPreservationPolicyAction.Update, ctx: StateContext<AdminOrganizationalUnitPreservationPolicyStateModel>): Observable<boolean> {
const orgUnitId = action.parentId;
const listActionSubActionCompletionsWrapper: ActionSubActionCompletionsWrapper[] = [];
if (action.oldDefaultResId !== action.newDefaultResId) {
if (isNotNullNorUndefined(action.oldDefaultResId) && action.newResId.includes(action.oldDefaultResId)) {
listActionSubActionCompletionsWrapper.push({
action: new AdminOrgUnitPreservationPolicyAction.UpdateRelation(orgUnitId, action.oldDefaultResId, {defaultPolicy: false} as OrganizationalUnitPreservationPolicy),
subActionCompletions: this.getSubActionCompletions(),
});
}
if (isNotNullNorUndefined(action.newDefaultResId)) {
listActionSubActionCompletionsWrapper.push({
action: new AdminOrgUnitPreservationPolicyAction.UpdateRelation(orgUnitId, action.newDefaultResId, {defaultPolicy: true} as OrganizationalUnitPreservationPolicy),
subActionCompletions: this.getSubActionCompletions(),
});
}
}
if (isEmptyArray(listActionSubActionCompletionsWrapper)) {
return of(true);
}
return StoreUtil.dispatchParallelActionAndWaitForSubActionsCompletion(ctx, listActionSubActionCompletionsWrapper);
}
private getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<AdminOrgUnitPreservationPolicyAction.UpdateRelation>, Error>>[] | undefined {
return [
this.actions$.pipe(ofActionCompleted(AdminOrgUnitPreservationPolicyAction.UpdateRelationSuccess)),
this.actions$.pipe(ofActionCompleted(AdminOrgUnitPreservationPolicyAction.UpdateRelationFail)),
];
}
}
......@@ -37,6 +37,9 @@ export namespace AdminOrgUnitSubmissionPolicyAction {
@TypeDefaultAction(state)
export class Update extends Relation2TiersAction.Update {
constructor(public parentId: string, public newResId: string[], public oldDefaultResId: string, public newDefaultResId: string) {
super(parentId, newResId);
}
}
@TypeDefaultAction(state)
......
import {OrganizationalUnitSubmissionPolicy} from "@admin/models/organizational-unit-submission-policy.model";
import {adminOrgUnitSubmissionPolicyActionNameSpace} from "@admin/orgunit/stores/submission-policy/admin-organizational-unit-submission-policy.action";
import {
AdminOrgUnitSubmissionPolicyAction,
adminOrgUnitSubmissionPolicyActionNameSpace,
} from "@admin/orgunit/stores/submission-policy/admin-organizational-unit-submission-policy.action";
import {SubmissionPolicy} from "@app/generated-api";
import {
Action,
ActionCompletion,
Actions,
ofActionCompleted,
State,
StateContext,
Store,
} from "@ngxs/store";
import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum";
import {AdminResourceApiEnum} from "@shared/enums/api.enum";
import {LocalStateEnum} from "@shared/enums/local-state.enum";
import {
Observable,
of,
} from "rxjs";
import {tap} from "rxjs/operators";
import {
ActionSubActionCompletionsWrapper,
ApiService,
BaseSubAction,
defaultRelation2TiersStateInitValue,
isEmptyArray,
isNotNullNorUndefined,
NotificationService,
OverrideDefaultAction,
Relation2TiersState,
Relation2TiersStateModel,
StoreUtil,
} from "solidify-frontend";
export interface AdminOrganizationalUnitSubmissionPolicyStateModel extends Relation2TiersStateModel<SubmissionPolicy> {
......@@ -38,4 +56,59 @@ export class AdminOrganizationalUnitSubmissionPolicyState extends Relation2Tiers
resourceName: ApiResourceNameEnum.SUB_POLICY,
});
}
@OverrideDefaultAction()
@Action(AdminOrgUnitSubmissionPolicyAction.Update)
update(ctx: StateContext<AdminOrganizationalUnitSubmissionPolicyStateModel>, action: AdminOrgUnitSubmissionPolicyAction.Update): Observable<boolean> {
return super.internalUpdate(ctx, action)
.pipe(
tap((isSuccess: boolean) => {
if (!isSuccess) {
ctx.dispatch(new AdminOrgUnitSubmissionPolicyAction.UpdateFail(action, action.parentId));
return;
}
this.updateSubResource(action, ctx)
.subscribe(success => {
if (success) {
ctx.dispatch(new AdminOrgUnitSubmissionPolicyAction.UpdateSuccess(action, action.parentId));
} else {
ctx.dispatch(new AdminOrgUnitSubmissionPolicyAction.UpdateFail(action, action.parentId));
}
});
}),
);
}
private updateSubResource(action: AdminOrgUnitSubmissionPolicyAction.Update, ctx: StateContext<AdminOrganizationalUnitSubmissionPolicyStateModel>): Observable<boolean> {
const orgUnitId = action.parentId;
const listActionSubActionCompletionsWrapper: ActionSubActionCompletionsWrapper[] = [];
if (action.oldDefaultResId !== action.newDefaultResId) {
if (isNotNullNorUndefined(action.oldDefaultResId) && action.newResId.includes(action.oldDefaultResId)) {
listActionSubActionCompletionsWrapper.push({
action: new AdminOrgUnitSubmissionPolicyAction.UpdateRelation(orgUnitId, action.oldDefaultResId, {defaultPolicy: false} as OrganizationalUnitSubmissionPolicy),
subActionCompletions: this.getSubActionCompletions(),
});
}
if (isNotNullNorUndefined(action.newDefaultResId)) {
listActionSubActionCompletionsWrapper.push({
action: new AdminOrgUnitSubmissionPolicyAction.UpdateRelation(orgUnitId, action.newDefaultResId, {defaultPolicy: true} as OrganizationalUnitSubmissionPolicy),
subActionCompletions: this.getSubActionCompletions(),
});
}
}
if (isEmptyArray(listActionSubActionCompletionsWrapper)) {
return of(true);
}
return StoreUtil.dispatchParallelActionAndWaitForSubActionsCompletion(ctx, listActionSubActionCompletionsWrapper);
}
private getSubActionCompletions(): Observable<ActionCompletion<BaseSubAction<AdminOrgUnitSubmissionPolicyAction.UpdateRelation>, Error>>[] | undefined {
return [
this.actions$.pipe(ofActionCompleted(AdminOrgUnitSubmissionPolicyAction.UpdateRelationSuccess)),
this.actions$.pipe(ofActionCompleted(AdminOrgUnitSubmissionPolicyAction.UpdateRelationFail)),
];
}
}
......@@ -155,10 +155,6 @@ export class DepositState extends DlcmResourceState<DepositExtended> {
ctx.dispatch(new DepositAction.CreateFail(action));
}
});
// const oldAuthors = [];
// const newAuthors = action.modelFormControlEvent.model[LocalModelAttributeEnum.authors];
// const updateSubResourceAction = AssociationRemoteActionHelper.update(depositPersonActionNameSpace, model.resId, oldAuthors, newAuthors);
// StoreUtil.updateSubResource(ChangeModeEnum.create, this.actions$, ctx, updateSubResourceAction, depositActionNameSpace, depositPersonActionNameSpace);
}),
);
}
......@@ -177,11 +173,6 @@ export class DepositState extends DlcmResourceState<DepositExtended> {
ctx.dispatch(new DepositAction.UpdateFail(action));
}
});
// const oldAuthors = _.map(ctx.getState().deposit_person.selected, LocalModelAttributeEnum.resId);
// const newAuthors = action.modelFormControlEvent.model[LocalModelAttributeEnum.authors];
// const updateSubResourceAction = AssociationRemoteActionHelper.update(depositPersonActionNameSpace, action.modelFormControlEvent.model.resId, oldAuthors, newAuthors);
// StoreUtil.updateSubResource(ChangeModeEnum.update, this.actions$, ctx, updateSubResourceAction, depositActionNameSpace, depositPersonActionNameSpace);
}),
);
}
......
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