Commit 135bdcbc authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

refactor: use result model from solidify

parent 961d018c
......@@ -1225,15 +1225,6 @@ export namespace Enums {
];
}
export namespace Result {
export type ActionStatusEnum = "EXECUTED" | "NOT_EXECUTED" | "NON_APPLICABLE";
export const ActionStatusEnum = {
EXECUTED: "EXECUTED" as ActionStatusEnum,
NOT_EXECUTED: "NOT_EXECUTED" as ActionStatusEnum,
NON_APPLICABLE: "NON_APPLICABLE" as ActionStatusEnum,
};
}
export namespace RetentionPolicy {
export type RetentionPolicyEnum =
"days"
......
import {DepositDataFile} from "@app/features/deposit/models/deposit-data-file.model";
import {Result} from "@shared/models/business/result.model";
import {StateEnum} from "@shared/enums/state.enum";
import {
BaseAction,
BaseSubAction,
CompositionAction,
CompositionNameSpace,
Result,
TypeDefaultAction,
} from "solidify-frontend";
import {MappingObject} from "solidify-frontend/lib/models";
import {StateEnum} from "@shared/enums/state.enum";
const state = StateEnum.deposit_dataFile;
......
......@@ -9,10 +9,8 @@ import {
DepositDataFileAction,
depositDataFileActionNameSpace,
} from "@app/features/deposit/stores/data-file/deposit-data-file.action";
import {ApiActionNameEnum} from "@shared/enums/api-action-name.enum";
import {ApiResourceNameEnum} from "@app/shared/enums/api-resource-name.enum";
import {ApiEnum} from "@app/shared/enums/api.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {DepositDataFileHelper} from "@deposit/helpers/deposit-data-file.helper";
import {DepositDataFileMetadataTypeState} from "@deposit/stores/data-file/metadata-type/deposit-data-file-metadata-type.state";
import {
......@@ -20,11 +18,7 @@ import {
DepositDataFileStatusHistoryStateModel,
} from "@deposit/stores/data-file/status-history/deposit-data-file-status-history.state";
import {DepositAction} from "@deposit/stores/deposit.action";
import {
DepositState,
DepositStateModel,
} from "@deposit/stores/deposit.state";
import {Enums} from "@enums";
import {DepositState} from "@deposit/stores/deposit.state";
import {
Action,
Actions,
......@@ -33,8 +27,9 @@ import {
StateContext,
Store,
} from "@ngxs/store";
import {ApiActionNameEnum} from "@shared/enums/api-action-name.enum";
import {LabelTranslateEnum} from "@shared/enums/label-translate.enum";
import {Result} from "@shared/models/business/result.model";
import {StateEnum} from "@shared/enums/state.enum";
import {DownloadService} from "@shared/services/download.service";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
import {Observable} from "rxjs";
......@@ -56,6 +51,8 @@ import {
NotificationService,
OverrideDefaultAction,
QueryParametersUtil,
Result,
ResultActionStatusEnum,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
......@@ -123,7 +120,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
return this.apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
this.notificationService.showInformation(LabelTranslateEnum.resourceResumed);
ctx.dispatch(new DepositDataFileAction.GetAll(action.parentId, undefined, true));
} else {
......@@ -297,7 +294,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
return this.httpClient.post<Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.VALIDATE}`, null)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new DepositDataFileAction.ValidateSuccess(action));
} else {
ctx.dispatch(new DepositDataFileAction.ValidateFail(action, result));
......
import {DepositDataFile} from "@app/features/deposit/models/deposit-data-file.model";
import {FileUploadWrapper} from "@app/features/deposit/models/file-upload-wrapper.model";
import {UploadFileStatus} from "@app/features/deposit/models/upload-file-status.model";
import {StateEnum} from "@shared/enums/state.enum";
import {DepositTabStatusEnum} from "@deposit/enums/deposit-tab-status.enum";
import {Enums} from "@enums";
import {Deposit} from "@models";
import {StateEnum} from "@shared/enums/state.enum";
import {FileListModel} from "@shared/models/business/file-list.model";
import {Result} from "@shared/models/business/result.model";
import {ResourceLogoNameSpace} from "@shared/stores/resource-logo/resource-logo-namespace.model";
import {ResourceLogoAction} from "@shared/stores/resource-logo/resource-logo.action";
import {
......@@ -14,6 +13,7 @@ import {
BaseSubAction,
ErrorDto,
ResourceAction,
Result,
TypeDefaultAction,
ValidationErrorDto,
} from "solidify-frontend";
......
......@@ -80,7 +80,6 @@ import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {DataFile} from "@shared/models/business/data-file.model";
import {FileListModel} from "@shared/models/business/file-list.model";
import {Result} from "@shared/models/business/result.model";
import {LocalStateModel} from "@shared/models/local-state.model";
import {DownloadService} from "@shared/services/download.service";
import {SecurityService} from "@shared/services/security.service";
......@@ -126,6 +125,8 @@ import {
PollingHelper,
QueryParameters,
QueryParametersUtil,
Result,
ResultActionStatusEnum,
SolidifyStateError,
StoreUtil,
StringUtil,
......@@ -448,7 +449,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + suffix)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new DepositAction.SubmitSuccess(result));
} else {
ctx.dispatch(new DepositAction.SubmitFail());
......@@ -489,7 +490,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.APPROVE)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new DepositAction.ApproveSuccess(result));
} else {
ctx.dispatch(new DepositAction.ApproveFail());
......@@ -518,7 +519,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
return this.apiService.post<any, Result>(`${this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.REJECT}?${this._DEPOSIT_REJECT_REASON}=${action.message}`)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new DepositAction.RejectSuccess(result));
} else {
ctx.dispatch(new DepositAction.RejectFail());
......
import {Injectable} from "@angular/core";
import {Enums} from "@enums";
import {Order} from "@models";
import {
Action,
......@@ -29,15 +28,14 @@ import {
OrderAllOrderStatusHistoryState,
OrderAllOrderStatusHistoryStateModel,
} from "@order/features/all-order/stores/status-history/order-all-order-status-history.state";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
import {ApiEnum} from "@shared/enums/api.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {
RoutesEnum,
urlSeparator,
} from "@shared/enums/routes.enum";
import {SessionStorageEnum} from "@shared/enums/session-storage.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {OrderArchive} from "@shared/models/business/order-archive.model";
import {Result} from "@shared/models/business/result.model";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
import {Observable} from "rxjs";
import {
......@@ -53,11 +51,13 @@ import {
NotificationService,
ResourceState,
ResourceStateModel,
Result,
ResultActionStatusEnum,
SessionStorageHelper,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
import {SessionStorageEnum} from "@shared/enums/session-storage.enum";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
export interface OrderAllOrderStateModel extends ResourceStateModel<Order> {
order_allOrder_statusHistory: OrderAllOrderStatusHistoryStateModel;
......@@ -141,7 +141,7 @@ export class OrderAllOrderState extends ResourceState<OrderAllOrderStateModel, O
return this.apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SUBMIT}`, null)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new OrderAllOrderAction.SubmitSuccess(action));
} else {
ctx.dispatch(new OrderAllOrderAction.SubmitFail(action));
......@@ -181,7 +181,7 @@ export class OrderAllOrderState extends ResourceState<OrderAllOrderStateModel, O
return this.apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.RESUME}`, null)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new OrderAllOrderAction.ResumeSuccess(action));
} else {
ctx.dispatch(new OrderAllOrderAction.ResumeFail(action));
......
import {Injectable} from "@angular/core";
import {Enums} from "@enums";
import {Order} from "@models";
import {
Action,
......@@ -25,15 +24,13 @@ import {
OrderMyOrderStatusHistoryState,
OrderMyOrderStatusHistoryStateModel,
} from "@order/features/my-order/stores/status-history/order-my-order-status-history.state";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
import {ApiEnum} from "@shared/enums/api.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {
RoutesEnum,
urlSeparator,
} from "@shared/enums/routes.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {OrderArchive} from "@shared/models/business/order-archive.model";
import {Result} from "@shared/models/business/result.model";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
import {Observable} from "rxjs";
import {
......@@ -49,9 +46,12 @@ import {
NotificationService,
ResourceState,
ResourceStateModel,
Result,
ResultActionStatusEnum,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
export interface OrderMyOrderStateModel extends ResourceStateModel<Order> {
[StateEnum.order_myOrder_statusHistory]: OrderMyOrderStatusHistoryStateModel;
......@@ -132,7 +132,7 @@ export class OrderMyOrderState extends ResourceState<OrderMyOrderStateModel, Ord
return this.apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.SUBMIT}`, null)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new OrderMyOrderAction.SubmitSuccess(action));
} else {
ctx.dispatch(new OrderMyOrderAction.SubmitFail(action));
......@@ -169,7 +169,7 @@ export class OrderMyOrderState extends ResourceState<OrderMyOrderStateModel, Ord
return this.apiService.post<any, Result>(`${this._urlResource}/${action.resId}/${ApiActionNameEnum.RESUME}`, null)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new OrderMyOrderAction.ResumeSuccess(action));
} else {
ctx.dispatch(new OrderMyOrderAction.ResumeFail(action));
......
......@@ -3,11 +3,8 @@ import {
Injectable,
} from "@angular/core";
import {WINDOW} from "@app/app.module";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
import {ApiResourceNameEnum} from "@app/shared/enums/api-resource-name.enum";
import {ApiEnum} from "@app/shared/enums/api.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {Enums} from "@enums";
import {
Action,
Actions,
......@@ -25,7 +22,7 @@ import {
PreservationPlanningDipDataFileStatusHistoryStateModel,
} from "@preservation-planning/dip/stores/data-file/status-history/preservation-planning-dip-data-file-status-history.state";
import {LabelTranslateEnum} from "@shared/enums/label-translate.enum";
import {Result} from "@shared/models/business/result.model";
import {StateEnum} from "@shared/enums/state.enum";
import {DownloadService} from "@shared/services/download.service";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
import {Observable} from "rxjs";
......@@ -39,8 +36,11 @@ import {
CompositionStateModel,
defaultCompositionStateInitValue,
NotificationService,
Result,
ResultActionStatusEnum,
SolidifyStateError,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
export const defaultPreservationPlanningDipDataFileValue: () => PreservationPlanningDipDataFileStateModel = () =>
({
......@@ -95,7 +95,7 @@ export class PreservationPlanningDipDataFileState extends CompositionState<Prese
return this.apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
this.notificationService.showInformation(LabelTranslateEnum.resourceResumed);
ctx.dispatch(new PreservationPlanningDipDataFileAction.GetAll(action.parentId, undefined, true));
} else {
......
import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core";
import {ApiEnum} from "@app/shared/enums/api.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {Enums} from "@enums";
import {Dip} from "@models";
import {Navigate} from "@ngxs/router-plugin";
import {
......@@ -30,12 +28,11 @@ import {
PreservationPlanningDipStatusHistoryState,
PreservationPlanningDipStatusHistoryStateModel,
} from "@preservation-planning/dip/stores/status-history/preservation-planning-dip-status-history.state";
import {ApiActionNameEnum} from "../../../../shared/enums/api-action-name.enum";
import {
DepositRoutesEnum,
RoutesEnum,
} from "@shared/enums/routes.enum";
import {Result} from "@shared/models/business/result.model";
import {StateEnum} from "@shared/enums/state.enum";
import {DownloadService} from "@shared/services/download.service";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
import {Observable} from "rxjs";
......@@ -53,8 +50,11 @@ import {
OverrideDefaultAction,
ResourceState,
ResourceStateModel,
Result,
ResultActionStatusEnum,
StoreUtil,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../shared/enums/api-action-name.enum";
export interface PreservationPlanningDipStateModel extends ResourceStateModel<Dip> {
[StateEnum.preservationPlanning_dip_dataFile]: PreservationPlanningDipDataFileStateModel;
......@@ -154,7 +154,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan
return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new PreservationPlanningDipAction.ResumeSuccess(action));
} else {
ctx.dispatch(new PreservationPlanningDipAction.ResumeFail(action));
......@@ -191,7 +191,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan
return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new PreservationPlanningDipAction.ResumeSuccess(action));
} else {
ctx.dispatch(new PreservationPlanningDipAction.ResumeFail(action));
......
import {Injectable} from "@angular/core";
import {urlSeparator} from "@shared/enums/routes.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {Enums} from "@enums";
import {
Action,
Actions,
......@@ -21,12 +18,12 @@ import {
PreservationPlanningJobExecutionAction,
} from "@preservation-planning/job/stores/job-execution/preservation-planning-job-execution.action";
import {PreservationPlanningJobStateModel} from "@preservation-planning/job/stores/preservation-planning-job.state";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum";
import {ApiEnum} from "@shared/enums/api.enum";
import {urlSeparator} from "@shared/enums/routes.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {JobExecutionReport} from "@shared/models/business/job-execution-report.model";
import {JobExecution} from "@shared/models/business/job-execution.model";
import {Result} from "@shared/models/business/result.model";
import {Observable} from "rxjs";
import {
catchError,
......@@ -41,9 +38,12 @@ import {
MARK_AS_TRANSLATABLE,
NotificationService,
OverrideDefaultAction,
Result,
ResultActionStatusEnum,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
export const defaultPreservationPlanningJobExecutionInitValue: () => PreservationPlanningJobExecutionStateModel = () =>
({
......@@ -113,7 +113,7 @@ export class PreservationPlanningJobExecutionState extends CompositionState<Pres
return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.parentId + urlSeparator + ApiResourceNameEnum.PRES_JOB_EXECUTION + urlSeparator + action.jobExecutionId + urlSeparator + ApiActionNameEnum.RESUME)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new PreservationPlanningJobExecutionAction.ResumeSuccess(action));
} else {
ctx.dispatch(new PreservationPlanningJobExecutionAction.ResumeFail(action));
......
import {Injectable} from "@angular/core";
import {StateEnum} from "@shared/enums/state.enum";
import {Enums} from "@enums";
import {environment} from "@environments/environment";
import {
......@@ -23,17 +22,16 @@ import {
PreservationPlanningJobAction,
preservationPlanningJobActionNameSpace,
} from "@preservation-planning/job/stores/preservation-planning-job.action";
import {ApiActionNameEnum} from "../../../../shared/enums/api-action-name.enum";
import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum";
import {ApiEnum} from "@shared/enums/api.enum";
import {
RoutesEnum,
urlSeparator,
} from "@shared/enums/routes.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {JobExecution} from "@shared/models/business/job-execution.model";
import {JobRecurrence} from "@shared/models/business/job-recurrence.model";
import {JobType} from "@shared/models/business/job-type.model";
import {Result} from "@shared/models/business/result.model";
import {Observable} from "rxjs";
import {
catchError,
......@@ -50,9 +48,12 @@ import {
QueryParameters,
ResourceState,
ResourceStateModel,
Result,
ResultActionStatusEnum,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../shared/enums/api-action-name.enum";
export interface PreservationPlanningJobStateModel extends ResourceStateModel<PreservationJob> {
listJobTypes: JobType[] | undefined;
......@@ -131,7 +132,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan
return this.apiService.post<any, Result>(this._urlResource + urlSeparator + ApiActionNameEnum.INIT).pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new PreservationPlanningJobAction.InitSuccess(action));
} else {
ctx.dispatch(new PreservationPlanningJobAction.InitFail(action));
......@@ -210,7 +211,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan
return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiActionNameEnum.START).pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new PreservationPlanningJobAction.StartSuccess(action));
} else {
ctx.dispatch(new PreservationPlanningJobAction.StartFail(action));
......@@ -247,7 +248,7 @@ export class PreservationPlanningJobState extends ResourceState<PreservationPlan
return this.apiService.post<any, Result>(this._urlResource + urlSeparator + action.resId + urlSeparator + ApiActionNameEnum.RESUME).pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new PreservationPlanningJobAction.ResumeSuccess(action));
} else {
ctx.dispatch(new PreservationPlanningJobAction.ResumeFail(action));
......
......@@ -3,11 +3,8 @@ import {
Injectable,
} from "@angular/core";
import {WINDOW} from "@app/app.module";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
import {ApiResourceNameEnum} from "@app/shared/enums/api-resource-name.enum";
import {ApiEnum} from "@app/shared/enums/api.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {Enums} from "@enums";
import {
Action,
Actions,
......@@ -25,7 +22,7 @@ import {
SharedAipDataFileStatusHistoryStateModel,
} from "@preservation-planning/sip/stores/data-file/status-history/preservation-planning-sip-data-file-status-history.state";
import {LabelTranslateEnum} from "@shared/enums/label-translate.enum";
import {Result} from "@shared/models/business/result.model";
import {StateEnum} from "@shared/enums/state.enum";
import {DownloadService} from "@shared/services/download.service";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
import {Observable} from "rxjs";
......@@ -39,8 +36,11 @@ import {
CompositionStateModel,
defaultCompositionStateInitValue,
NotificationService,
Result,
ResultActionStatusEnum,
SolidifyStateError,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
export const defaultPreservationPlanningSipDataFileValue: () => PreservationPlanningSipDataFileStateModel = () =>
({
......@@ -95,7 +95,7 @@ export class PreservationPlanningSipDataFileState extends CompositionState<Prese
return this.apiService.post<any, Result>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionNameEnum.RESUME}`)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
this.notificationService.showInformation(LabelTranslateEnum.resourceResumed);
ctx.dispatch(new PreservationPlanningSipDataFileAction.GetAll(action.parentId, undefined, true));
} else {
......
import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core";
import {ApiEnum} from "@app/shared/enums/api.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {Enums} from "@enums";
import {Sip} from "@models";
import {
Action,
......@@ -26,8 +24,7 @@ import {
PreservationPlanningSipStatusHistoryState,
PreservationPlanningSipStatusHistoryStateModel,
} from "@preservation-planning/sip/stores/status-history/preservation-planning-sip-status-history.state";
import {ApiActionNameEnum} from "../../../../shared/enums/api-action-name.enum";
import {Result} from "@shared/models/business/result.model";
import {StateEnum} from "@shared/enums/state.enum";
import {DownloadService} from "@shared/services/download.service";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
import {Observable} from "rxjs";
......@@ -43,8 +40,11 @@ import {
NotificationService,
ResourceState,
ResourceStateModel,
Result,
ResultActionStatusEnum,
StoreUtil,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../shared/enums/api-action-name.enum";
export interface PreservationPlanningSipStateModel extends ResourceStateModel<Sip> {
[StateEnum.preservationPlanning_sip_dataFile]: PreservationPlanningSipDataFileStateModel;
......@@ -126,7 +126,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan
return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUME}`, null)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new PreservationPlanningSipAction.ResumeSuccess(action));
} else {
ctx.dispatch(new PreservationPlanningSipAction.ResumeFail(action));
......@@ -163,7 +163,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan
return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.RESUBMIT}`, null)
.pipe(
tap(result => {
if (result?.status === Enums.Result.ActionStatusEnum.EXECUTED) {
if (result?.status === ResultActionStatusEnum.EXECUTED) {
ctx.dispatch(new PreservationPlanningSipAction.ResubmitSuccess(action));
} else {
ctx.dispatch(new PreservationPlanningSipAction.ResubmitFail(action));
......@@ -200,7 +200,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan
return this.httpClient.post<Result>(`${this._urlResource}/${action.id}/${ApiActionNameEnum.PUT_IN_ERROR}`, null)
.pipe(
tap(result => {