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

chore: update to solidify 1.5.14 and use solidify http error response

parent 72b81b82
......@@ -14924,9 +14924,9 @@
}
},
"solidify-frontend": {
"version": "1.5.8",
"resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-1.5.8.tgz",
"integrity": "sha512-l/cjOdal9X9GTnWPgZRkuUqDFp+h21BkKr+d3d801HrFH5TloOjESESlLUEzYGw3gD9oWUP2eoI5DCnOp7GFTA==",
"version": "1.5.14",
"resolved": "https://nexus.unige.ch/repository/npm-all/solidify-frontend/-/solidify-frontend-1.5.14.tgz",
"integrity": "sha512-S6lnRZmaTLCOA3V91iJxU8I4jRAQmJGACmBTG11IWI5RqHVpkOQm20g13N2572KWI5OFI/csZfjUGKDcXG2M2w==",
"requires": {
"tslib": "^2.0.0"
}
......
......@@ -20,7 +20,6 @@ import {User} from "@models";
import {TranslateService} from "@ngx-translate/core";
import {Store} from "@ngxs/store";
import {ApplicationRolePermissionEnum} from "@shared/enums/application-role-permission.enum";
import {ChemicalMoleculeVisualizationEnum} from "@shared/enums/chemical-molecule-visualization.enum";
import {LabelTranslateEnum} from "@shared/enums/label-translate.enum";
import {SessionStorageEnum} from "@shared/enums/session-storage.enum";
import {TourEnum} from "@shared/enums/tour.enum";
......@@ -42,7 +41,6 @@ import {
AppStatusService,
BreakpointService,
isNotNullNorUndefined,
isNullOrUndefined,
LoggingService,
MARK_AS_TRANSLATABLE,
MemoizedUtil,
......@@ -120,7 +118,6 @@ export class AppComponent extends AbstractAppComponent {
this._listenCurrentModule();
this.subscribe(this.observeLoggedUserForCart());
this.checkOrcidQueryParam();
this._activeChemicalMoleculePreviewIfEnable();
this._googleAnalyticsService.init(this._renderer);
}
......@@ -224,60 +221,6 @@ export class AppComponent extends AbstractAppComponent {
HomeHelper.navigateToSearch(this._store, searchTerm);
}
private _activeChemicalMoleculePreviewIfEnable(): void {
if (environment.visualizationChemicalMoleculeMode === ChemicalMoleculeVisualizationEnum.disabled) {
return;
}
const threeDimensionalLib = environment.visualizationChemicalMolecule3dLib;
const twoDimensionalLibs = environment.visualizationChemicalMolecule2dLibs;
const listScript = [];
this._document.querySelectorAll(`script[${this._ATTRIBUTE_SRC_DIFFER_KEY}]`).forEach(script => {
listScript.push(script);
});
if (environment.visualizationChemicalMoleculeMode === ChemicalMoleculeVisualizationEnum.threeDimensionalOnly
|| environment.visualizationChemicalMoleculeMode === ChemicalMoleculeVisualizationEnum.threeAndTwoDimensional) {
const jsmolScript = this._getScriptWithValueEndWith(listScript, threeDimensionalLib);
if (isNullOrUndefined(jsmolScript)) {
this._loggingService.logWarning(`Unable to enable chemical molecule visualization, missing ${threeDimensionalLib}`);
return;
}
this._activeScriptDiffer([jsmolScript]);
}
if (environment.visualizationChemicalMoleculeMode === ChemicalMoleculeVisualizationEnum.threeAndTwoDimensional) {
const listScriptToTreat = [];
twoDimensionalLibs.forEach(libNameNeeded => {
const scriptLibNeeded = this._getScriptWithValueEndWith(listScript, libNameNeeded);
if (isNullOrUndefined(scriptLibNeeded)) {
this._loggingService.logWarning(`Unable to enable chemical molecule visualization 2D, missing ${libNameNeeded}`);
return;
}
listScriptToTreat.push(scriptLibNeeded);
});
if (listScriptToTreat.length !== twoDimensionalLibs.length) {
this._loggingService.logWarning(`Swith to chemical molecule visualization 3D`);
environment.visualizationChemicalMoleculeMode = ChemicalMoleculeVisualizationEnum.threeDimensionalOnly;
return;
}
// Need to differ lib JSME to avoid error at startup
setTimeout(() => {
this._activeScriptDiffer(listScriptToTreat);
}, 1000);
}
}
private _activeScriptDiffer(listScript: Element[]): void {
listScript.forEach(script => {
const value = this._getValueScriptDiffer(script);
if (isNullOrUndefined(value)) {
return;
}
this._renderer.setAttribute(script, this._ATTRIBUTE_SRC, value);
this._renderer.removeAttribute(script, this._ATTRIBUTE_SRC_DIFFER_KEY);
});
}
openUserGuideSidebar(): void {
this._store.dispatch(new appActionNameSpace.ChangeDisplaySidebarUserGuide(true));
}
......
......@@ -4,7 +4,6 @@ import {
} from "@admin/metadata-type/stores/admin-metadata-type.action";
import {
HttpClient,
HttpErrorResponse,
HttpEventType,
} from "@angular/common/http";
import {Injectable} from "@angular/core";
......@@ -19,14 +18,13 @@ import {
Store,
} from "@ngxs/store";
import {PreservationPlanningSipStateModel} from "@preservation-planning/sip/stores/preservation-planning-sip.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 {StateEnum} from "@shared/enums/state.enum";
import {
RoutesEnum,
urlSeparator,
} from "@shared/enums/routes.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {DownloadService} from "@shared/services/download.service";
import {Observable} from "rxjs";
import {
......@@ -43,11 +41,13 @@ import {
NotificationService,
ResourceState,
ResourceStateModel,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
StoreUtil,
StringUtil,
UploadEventModel,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../shared/enums/api-action-name.enum";
export interface AdminMetadataTypeStateModel extends ResourceStateModel<MetadataType> {
}
......@@ -149,7 +149,7 @@ export class AdminMetadataTypeState extends ResourceState<AdminMetadataTypeState
return;
}
}),
catchError((error: Error | HttpErrorResponse) => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new AdminMetadataTypeAction.TestFileFail(action));
throw new SolidifyStateError(this, error);
}),
......
......@@ -28,6 +28,7 @@ import {
NotificationService,
OverrideDefaultAction,
QueryParameters,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
} from "solidify-frontend";
import GetCurrentMetadataFormFail = AdminOrganizationalUnitAdditionalFieldsFormAction.GetCurrentMetadataFormFail;
......@@ -74,7 +75,7 @@ export class AdminOrganizationalUnitAdditionalFieldsFormState extends Compositio
return this.apiService.getByIdInPath<AdditionalFieldsForm>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiResourceNameEnum.CURRENT_VERSION}`)
.pipe(
tap(result => ctx.dispatch(new GetCurrentMetadataFormSuccess(action, result))),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new GetCurrentMetadataFormFail(action));
throw new SolidifyStateError(this, error);
}),
......
......@@ -41,6 +41,7 @@ import {
NotificationService,
OverrideDefaultAction,
QueryParameters,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
......@@ -170,7 +171,7 @@ export class DepositCollectionState extends AssociationRemoteState<DepositCollec
tap(collection => {
ctx.dispatch(new DepositCollectionAction.GetNumberCollectionsSuccess(action, collection._page.totalItems));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositCollectionAction.GetNumberCollectionsFail(action));
throw new SolidifyStateError(this, error);
}),
......
......@@ -53,6 +53,7 @@ import {
QueryParametersUtil,
Result,
ResultActionStatusEnum,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
......@@ -127,7 +128,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
this.notificationService.showError(LabelTranslateEnum.unableResumedResource);
}
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
this.notificationService.showError(LabelTranslateEnum.unableResumedResource);
throw new SolidifyStateError(this, error);
}),
......@@ -249,7 +250,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
tap((listFolder: string[]) => {
ctx.dispatch(new DepositDataFileAction.GetListFolderSuccess(action, listFolder));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositDataFileAction.GetListFolderFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -300,7 +301,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
ctx.dispatch(new DepositDataFileAction.ValidateFail(action, result));
}
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositDataFileAction.ValidateFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -337,7 +338,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
tap(result => {
ctx.dispatch(new DepositDataFileAction.MoveSuccess(action, result));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositDataFileAction.MoveFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -377,7 +378,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
tap(result => {
ctx.dispatch(new DepositDataFileAction.ChangeDataCategorySuccess(action, result));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositDataFileAction.ChangeDataCategoryFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -417,7 +418,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
tap(collection => {
ctx.dispatch(new DepositDataFileAction.DeleteAllSuccess(action));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositDataFileAction.DeleteAllFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -451,7 +452,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
tap(collection => {
ctx.dispatch(new DepositDataFileAction.ResumeAllSuccess(action));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositDataFileAction.ResumeAllFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -485,7 +486,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
tap(collection => {
ctx.dispatch(new DepositDataFileAction.ValidateAllSuccess(action));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositDataFileAction.ValidateAllFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -519,7 +520,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
tap(result => {
ctx.dispatch(new DepositDataFileAction.DeleteFolderSuccess(action));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositDataFileAction.DeleteFolderFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -555,7 +556,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
tap(result => {
ctx.dispatch(new DepositDataFileAction.GetListCurrentStatusSuccess(action, result));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositDataFileAction.GetListCurrentStatusFail(action));
throw new SolidifyStateError(this, error);
}),
......
......@@ -123,6 +123,7 @@ import {
QueryParametersUtil,
Result,
ResultActionStatusEnum,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
StoreUtil,
StringUtil,
......@@ -452,7 +453,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
ctx.dispatch(new DepositAction.SubmitFail());
}
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositAction.SubmitFail(ErrorHelper.extractValidationErrors(error)));
throw new SolidifyStateError(this, error);
}),
......@@ -493,7 +494,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
ctx.dispatch(new DepositAction.ApproveFail());
}
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositAction.ApproveFail());
throw new SolidifyStateError(this, error);
}),
......@@ -522,7 +523,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
ctx.dispatch(new DepositAction.RejectFail());
}
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositAction.RejectFail());
throw new SolidifyStateError(this, error);
}),
......@@ -545,7 +546,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
return this.apiService.post<Result>(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.ENABLE_REVISION)
.pipe(
tap(result => ctx.dispatch(new DepositAction.BackToEditSuccess(result))),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositAction.BackToEditFail());
throw new SolidifyStateError(this, error);
}),
......@@ -571,7 +572,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
return this.apiService.post(this._urlResource + urlSeparator + action.deposit.resId + urlSeparator + ApiActionNameEnum.RESERVE_DOI)
.pipe(
tap(deposit => ctx.dispatch(new DepositAction.ReserveDOISuccess(deposit))),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositAction.ReserveDOIFail());
throw new SolidifyStateError(this, error);
}),
......@@ -641,7 +642,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
ctx.dispatch(new DepositAction.RefreshCounterStatusTabSuccess(action, action.status, totalItem));
return totalItem;
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositAction.RefreshCounterStatusTabFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -722,7 +723,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
return this.apiService.getByIdInPath<FileListModel>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_EXCLUDE_FILES)
.pipe(
tap(fileList => ctx.dispatch(new DepositAction.GetExcludedListFilesSuccess(action, fileList))),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositAction.GetExcludedListFilesFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -752,7 +753,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
return this.apiService.getByIdInPath<FileListModel>(this._urlResource + urlSeparator + ApiActionNameEnum.LIST_IGNORE_FILES)
.pipe(
tap(fileList => ctx.dispatch(new DepositAction.GetIgnoredListFilesSuccess(action, fileList))),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new DepositAction.GetIgnoredListFilesFail(action));
throw new SolidifyStateError(this, error);
}),
......@@ -907,7 +908,7 @@ export class DepositState extends ResourceLogoState<DepositStateModel, Deposit>
ctx.dispatch(new DepositAction.GetPhoto(depositId));
}
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
throw new SolidifyStateError(this, error);
}),
);
......
......@@ -4,7 +4,8 @@ import {AdditionalFieldsForm} from "@models";
import {
Action,
Actions,
State, StateContext,
State,
StateContext,
Store,
} from "@ngxs/store";
import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum";
......@@ -14,14 +15,20 @@ import {
CompositionState,
CompositionStateModel,
defaultCompositionStateInitValue,
NotificationService, QueryParameters, SolidifyStateError,
NotificationService,
QueryParameters,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
} from "solidify-frontend";
import {
DepositOrganizationalUnitAdditionalFieldsFormAction,
depositOrganizationalUnitAdditionalFieldsFormActionNameSpace
depositOrganizationalUnitAdditionalFieldsFormActionNameSpace,
} from "@deposit/stores/organizational-unit/additional-fields-form/deposit-organizational-unit-additional-fields-form.action";
import {Observable} from "rxjs";
import {catchError, tap} from "rxjs/operators";
import {
catchError,
tap,
} from "rxjs/operators";
import GetCurrentMetadataFormSuccess = DepositOrganizationalUnitAdditionalFieldsFormAction.GetCurrentMetadataFormSuccess;
import GetCurrentMetadataFormFail = DepositOrganizationalUnitAdditionalFieldsFormAction.GetCurrentMetadataFormFail;
......@@ -29,7 +36,7 @@ export const defaultDepositOrganizationalUnitAdditionalFieldsFormStateModel: ()
({
...defaultCompositionStateInitValue(),
queryParameters: new QueryParameters(20),
loaded: false
loaded: false,
});
export interface DepositOrganizationalUnitAdditionalFieldsFormStateModel extends CompositionStateModel<AdditionalFieldsForm> {
......@@ -61,15 +68,16 @@ export class DepositOrganizationalUnitAdditionalFieldsFormState extends Composit
@Action(DepositOrganizationalUnitAdditionalFieldsFormAction.GetCurrentMetadataForm)
getCurrentMetadataForm(ctx: StateContext<DepositOrganizationalUnitAdditionalFieldsFormStateModel>, action: DepositOrganizationalUnitAdditionalFieldsFormAction.GetCurrentMetadataForm): Observable<AdditionalFieldsForm> {
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter + 1
isLoadingCounter: ctx.getState().isLoadingCounter + 1,
});
return this.apiService.getByIdInPath<AdditionalFieldsForm>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiResourceNameEnum.CURRENT_VERSION}`).pipe(
tap(result => ctx.dispatch(new GetCurrentMetadataFormSuccess(action, result))),
catchError(error => {
ctx.dispatch(new GetCurrentMetadataFormFail(action));
throw new SolidifyStateError(this, error);
})
);
return this.apiService.getByIdInPath<AdditionalFieldsForm>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${ApiResourceNameEnum.CURRENT_VERSION}`)
.pipe(
tap(result => ctx.dispatch(new GetCurrentMetadataFormSuccess(action, result))),
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new GetCurrentMetadataFormFail(action));
throw new SolidifyStateError(this, error);
}),
);
}
@Action(DepositOrganizationalUnitAdditionalFieldsFormAction.GetCurrentMetadataFormSuccess)
......@@ -77,14 +85,14 @@ export class DepositOrganizationalUnitAdditionalFieldsFormState extends Composit
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
current: action.currentForm,
loaded: true
loaded: true,
});
}
@Action(DepositOrganizationalUnitAdditionalFieldsFormAction.GetCurrentMetadataFormFail)
getCurrentMetadataFormFail(ctx: StateContext<DepositOrganizationalUnitAdditionalFieldsFormStateModel>, action: DepositOrganizationalUnitAdditionalFieldsFormAction.GetCurrentMetadataFormFail): void {
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
}
}
......@@ -29,6 +29,7 @@ import {
isTrue,
NotificationService,
QueryParameters,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
......@@ -107,9 +108,9 @@ export class HomeArchiveCollectionState extends BasicState<HomeArchiveCollection
collection._data = ArchiveDataFileHelper.adaptListArchivesMetadataInArchive(collection._data) as ArchiveDataFile[] | any;
ctx.dispatch(new HomeArchiveCollectionAction.GetAllSuccess(action, collection as CollectionTyped<ArchiveDataFile>));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new HomeArchiveCollectionAction.GetAllFail(action));
throw new SolidifyStateError(error);
throw new SolidifyStateError(this, error);
}),
);
}
......@@ -142,7 +143,7 @@ export class HomeArchiveCollectionState extends BasicState<HomeArchiveCollection
return this.apiService.getById<ArchiveMetadataDataFile>(this.evaluateSubResourceUrl(action.parentId), action.resId)
.pipe(
tap(model => ctx.dispatch(new HomeArchiveCollectionAction.GetByIdSuccess(action, ArchiveDataFileHelper.adaptArchiveMetadataInArchiveDataFile(model)))),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new HomeArchiveCollectionAction.GetByIdFail(action));
throw error;
}),
......
import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core";
import {ApiEnum} from "@app/shared/enums/api.enum";
import {urlSeparator} from "@shared/enums/routes.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {DepositDataFileHelper} from "@deposit/helpers/deposit-data-file.helper";
import {ArchiveDataFile} from "@home/models/archive-data-file.model";
import {HomeArchiveDataFileAction} from "@home/stores/archive/data-file/home-archive-data-file.action";
......@@ -15,8 +13,9 @@ import {
StateContext,
Store,
} from "@ngxs/store";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum";
import {urlSeparator} from "@shared/enums/routes.enum";
import {StateEnum} from "@shared/enums/state.enum";
import {ArchiveDataFileHelper} from "@shared/helpers/archive-data-file.helper";
import {ArchiveMetadataDataFile} from "@shared/models/business/archive-metadata-data-file.model";
import {Observable} from "rxjs";
......@@ -36,9 +35,11 @@ import {
NotificationService,
QueryParameters,
QueryParametersUtil,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../../shared/enums/api-action-name.enum";
export const defaultHomeArchiveDataFileValue: () => HomeArchiveDataFileStateModel = () =>
({
......@@ -138,9 +139,9 @@ export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStat
collection._data = ArchiveDataFileHelper.adaptListArchivesMetadataInArchive(collection._data) as ArchiveDataFile[] | any;
ctx.dispatch(new HomeArchiveDataFileAction.GetAllSuccess(action, collection as CollectionTyped<ArchiveDataFile>));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new HomeArchiveDataFileAction.GetAllFail(action));
throw new SolidifyStateError(error);
throw new SolidifyStateError(this, error);
}),
);
}
......@@ -173,7 +174,7 @@ export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStat
return this.apiService.getById<ArchiveMetadataDataFile>(this.evaluateSubResourceUrl(action.parentId), action.resId)
.pipe(
tap(model => ctx.dispatch(new HomeArchiveDataFileAction.GetByIdSuccess(action, ArchiveDataFileHelper.adaptArchiveMetadataInArchiveDataFile(model)))),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new HomeArchiveDataFileAction.GetByIdFail(action));
throw error;
}),
......@@ -252,9 +253,9 @@ export class HomeArchiveDataFileState extends BasicState<HomeArchiveDataFileStat
tap((listFolder: string[]) => {
ctx.dispatch(new HomeArchiveDataFileAction.GetListFolderSuccess(action, listFolder));
}),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new HomeArchiveDataFileAction.GetListFolderFail(action));
throw new SolidifyStateError(error);
throw new SolidifyStateError(this, error);
}),
);
}
......
......@@ -24,6 +24,7 @@ import {
BasicState,
isFalse,
NotificationService,
SolidifyHttpErrorResponseModel,
} from "solidify-frontend";
export const defaultHomeArchivePackageValue: () => HomeArchivePackageStateModel = () =>
......@@ -73,7 +74,7 @@ export class HomeArchivePackageState extends BasicState<HomeArchivePackageStateM
return this.apiService.getByIdInPath<ArchiveMetadataPackages>(this._urlResource + urlSeparator + action.resId + urlSeparator + this._resourceName)
.pipe(
tap(model => ctx.dispatch(new HomeArchivePackageAction.GetByIdSuccess(action, model))),
catchError(error => {
catchError((error: SolidifyHttpErrorResponseModel) => {
ctx.dispatch(new HomeArchivePackageAction.GetByIdFail(action));
throw error;
}),
......
......@@ -32,6 +32,7 @@ import {
defaultCompositionStateInitValue,
NotificationService,
OverrideDefaultAction,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
StoreUtil,