Commit 9410e920 authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

refacto: remove useless boolean parameter on notification method

parent 09f4a18c
......@@ -151,7 +151,7 @@ export class AppComponent extends SharedAbstractPresentational {
}
if (isFalse(previousStateIsOnline) && isTrue(isOnline)) {
this._notificationService.showInformation(MARK_AS_TRANSLATABLE("app.status.backToOnline"), true);
this._notificationService.showInformation(MARK_AS_TRANSLATABLE("app.status.backToOnline"));
previousStateIsOnline = isOnline;
return;
}
......
......@@ -5,9 +5,9 @@ import {
import {SharedAbstractContainer} from "@shared/components/containers/shared-abstract/shared-abstract.container";
import {
ClipboardUtil,
MARK_AS_TRANSLATABLE,
NotificationService,
OAuth2Service,
MARK_AS_TRANSLATABLE,
} from "solidify-frontend";
@Component({
......@@ -28,7 +28,7 @@ export class TokenDialog extends SharedAbstractContainer {
copy(): void {
if (ClipboardUtil.copyStringToClipboard(this.token)) {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("app.notification.tokenCopiedToClipboardSuccess"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("app.notification.tokenCopiedToClipboardSuccess"));
} else {
this.notificationService.showWarning(MARK_AS_TRANSLATABLE("app.notification.tokenCopiedToClipboardFail"));
}
......
......@@ -118,9 +118,9 @@ export class AdminMetadataTypeState extends ResourceState<AdminMetadataTypeState
ext = "json";
}
const fileName = "metadata_type_" + StringUtil.convertToSnakeCase(action.metadataType.name) + "." + ext;
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.metadataType.file.downloadInProgress"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.metadataType.file.downloadInProgress"));
this.downloadService.download(`${this._urlResource}/${action.metadataType.resId}/${ApiResourceNameEnum.SCHEMA}`, fileName).subscribe(() => {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.metadataType.file.downloadWithSuccess"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.metadataType.file.downloadWithSuccess"));
});
}
......@@ -161,7 +161,7 @@ export class AdminMetadataTypeState extends ResourceState<AdminMetadataTypeState
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.testFile.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.testFile.success"));
}
@Action(AdminMetadataTypeAction.TestFileFail)
......
......@@ -128,7 +128,7 @@ export class DepositDataFileState extends CompositionState<DepositDataFileStateM
return this.apiService.post<void>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionEnum.RESUME}`)
.pipe(
tap(() => {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.resumed"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.resumed"));
ctx.dispatch(new DepositDataFileAction.GetAll(action.parentId, undefined, true));
}),
);
......
......@@ -623,7 +623,7 @@ export class DepositState extends ResourceState<DepositStateModel, Deposit> {
@Action(DepositAction.CancelDataFileSending)
cancelDataFileSending(ctx: StateContext<DepositStateModel>, action: DepositAction.MarkAsCancelDataFileSending): void {
DataFileUploadHelper.removeToUploadStatus(ctx, action.uploadFileStatus);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("deposit.file.upload.notification.info.canceled"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("deposit.file.upload.notification.info.canceled"));
this.checkPendingDownload(ctx);
}
......
......@@ -59,6 +59,7 @@ import {
isNullOrUndefined,
isWhiteString,
MappingObjectUtil,
MARK_AS_TRANSLATABLE,
MemoizedUtil,
NotificationService,
QueryParameters,
......@@ -66,7 +67,6 @@ import {
ResourceStateModel,
StoreUtil,
StringUtil,
MARK_AS_TRANSLATABLE,
} from "solidify-frontend";
export interface HomeStateModel extends ResourceStateModel<ArchiveMetadata> {
......@@ -315,7 +315,7 @@ export class HomeState extends BasicState<HomeStateModel> {
@Action(HomeAction.Download)
download(ctx: StateContext<HomeStateModel>, action: HomeAction.Download): any {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("home.archive.browsing.download.notification.inPreparation"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("home.archive.browsing.download.notification.inPreparation"));
this._setIsPooling(ctx, action, true);
this._setIsPendingRequest(ctx, action, false);
......
......@@ -93,9 +93,9 @@ export class PreservationAipAipState extends CompositionState<PreservationPlanni
@Action(PreservationPlanningAipAipAction.DownloadAip)
downloadAip(ctx: StateContext<PreservationPlanningAipAipStateModel>, action: PreservationPlanningAipAipAction.DownloadAip): void {
const url = `${this._urlResource}/${action.parentId}/${this._resourceName}/${action.aip.resId}/${ApiActionEnum.DL}`;
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.download"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.download"));
this.downloadService.download(url, action.aip.info.name, action.aip.archiveSize).subscribe(() => {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.downloadWithSuccess"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.downloadWithSuccess"));
});
}
......
......@@ -126,7 +126,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
@Action(PreservationPlanningAipAction.Download)
download(ctx: StateContext<PreservationPlanningAipStateModel>, action: PreservationPlanningAipAction.Download): void {
const fileName = "aip_" + action.id + ".zip";
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.file.download"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.file.download"));
this.downloadService.download(`${this._urlResource}/${action.id}/${ApiActionEnum.DL}`, fileName).subscribe(() => {
this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.aip.file.downloadWithSuccess"));
});
......@@ -182,7 +182,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.reindex.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.reindex.success"));
}
@Action(PreservationPlanningAipAction.ReindexFail)
......@@ -216,7 +216,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.deepChecksum.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.deepChecksum.success"));
}
@Action(PreservationPlanningAipAction.DeepChecksumFail)
......@@ -250,7 +250,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.simpleChecksum.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.simpleChecksum.success"));
}
@Action(PreservationPlanningAipAction.SimpleChecksumFail)
......@@ -283,7 +283,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.resume.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.resume.success"));
}
@Action(PreservationPlanningAipAction.ResumeFail)
......@@ -326,7 +326,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.check.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.check.success"));
}
@Action(PreservationPlanningAipAction.CheckFail)
......@@ -359,7 +359,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.dispose.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.dispose.success"));
}
@Action(PreservationPlanningAipAction.DisposeFail)
......@@ -396,7 +396,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.store.dispatch(new PreservationPlanningAipAction.GetById(ctx.getState().current.resId));
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposal.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposal.success"));
}
@Action(PreservationPlanningAipAction.ApproveDisposalFail)
......@@ -432,7 +432,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.store.dispatch(new PreservationPlanningAipAction.GetById(ctx.getState().current.resId));
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposalByOrgunit.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.approveDisposalByOrgunit.success"));
}
@Action(PreservationPlanningAipAction.ApproveDisposalByOrgunitFail)
......@@ -468,7 +468,7 @@ export class PreservationPlanningAipState extends ResourceState<PreservationPlan
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.store.dispatch(new PreservationPlanningAipAction.GetById(ctx.getState().current.resId));
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.extendRetention.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.aip.action.extendRetention.success"));
}
@Action(PreservationPlanningAipAction.ExtendRetentionFail)
......
......@@ -3,10 +3,6 @@ import {
Injectable,
} from "@angular/core";
import {WINDOW} from "@app/app.module";
import {
PreservationPlanningDipDataFileAction,
preservationPlanningDipDataFileActionNameSpace,
} from "@preservation-planning/dip/stores/data-file/preservation-planning-dip-data-file.action";
import {ApiActionEnum} from "@app/shared/enums/api-action.enum";
import {ApiResourceNameEnum} from "@app/shared/enums/api-resource-name.enum";
import {AccessResourceApiEnum} from "@app/shared/enums/api.enum";
......@@ -19,6 +15,10 @@ import {
Store,
} from "@ngxs/store";
import {DipDataFile} from "@preservation-planning/dip/models/dip-data-file.model";
import {
PreservationPlanningDipDataFileAction,
preservationPlanningDipDataFileActionNameSpace,
} from "@preservation-planning/dip/stores/data-file/preservation-planning-dip-data-file.action";
import {
PreservationPlanningDipDataFileStatusHistoryState,
PreservationPlanningDipDataFileStatusHistoryStateModel,
......@@ -81,7 +81,7 @@ export class PreservationPlanningDipDataFileState extends CompositionState<Prese
@Action(PreservationPlanningDipDataFileAction.Download)
download(ctx: StateContext<PreservationPlanningDipDataFileStateModel>, action: PreservationPlanningDipDataFileAction.Download): void {
const url = `${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionEnum.DL}`;
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.download"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.download"));
this.downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize).subscribe(() => {
this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.file.downloadWithSuccess"));
});
......@@ -92,7 +92,7 @@ export class PreservationPlanningDipDataFileState extends CompositionState<Prese
return this.apiService.post<void>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionEnum.RESUME}`)
.pipe(
tap(() => {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.resumed"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.resumed"));
ctx.dispatch(new PreservationPlanningDipDataFileAction.GetAll(action.parentId, undefined, true));
}),
);
......
import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core";
import {AccessResourceApiEnum} from "@app/shared/enums/api.enum";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {Dip} from "@models";
import {Navigate} from "@ngxs/router-plugin";
import {
Action,
Actions,
Selector,
State,
StateContext,
Store,
} from "@ngxs/store";
import {
defaultPreservationPlanningDipDataFileValue,
PreservationPlanningDipDataFileState,
......@@ -13,18 +25,6 @@ import {
PreservationPlanningDipStatusHistoryState,
PreservationPlanningDipStatusHistoryStateModel,
} from "@preservation-planning/dip/stores/status-history/preservation-planning-dip-status-history.state";
import {AccessResourceApiEnum} from "@app/shared/enums/api.enum";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {Dip} from "@models";
import {Navigate} from "@ngxs/router-plugin";
import {
Action,
Actions,
Selector,
State,
StateContext,
Store,
} from "@ngxs/store";
import {ApiActionEnum} from "@shared/enums/api-action.enum";
import {
DepositRoutesEnum,
......@@ -128,9 +128,9 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan
@Action(PreservationPlanningDipAction.Download)
download(ctx: StateContext<PreservationPlanningDipStateModel>, action: PreservationPlanningDipAction.Download): void {
const fileName = "dip_" + action.id + ".zip";
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.file.download"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.file.download"));
this.downloadService.download(`${this._urlResource}/${action.id}/${ApiActionEnum.DL}`, fileName).subscribe(() => {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.file.downloadWithSuccess"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.file.downloadWithSuccess"));
});
}
......@@ -156,7 +156,7 @@ export class PreservationPlanningDipState extends ResourceState<PreservationPlan
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.action.resume.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.action.resume.success"));
}
@Action(PreservationPlanningDipAction.ResumeFail)
......
......@@ -3,10 +3,6 @@ import {
Injectable,
} from "@angular/core";
import {WINDOW} from "@app/app.module";
import {
PreservationPlanningSipDataFileAction,
preservationPlanningSipDataFileActionNameSpace,
} from "@preservation-planning/sip/stores/data-file/preservation-planning-sip-data-file.action";
import {ApiActionEnum} from "@app/shared/enums/api-action.enum";
import {ApiResourceNameEnum} from "@app/shared/enums/api-resource-name.enum";
import {IngestResourceApiEnum} from "@app/shared/enums/api.enum";
......@@ -19,6 +15,10 @@ import {
Store,
} from "@ngxs/store";
import {SipDataFile} from "@preservation-planning/sip/models/sip-data-file.model";
import {
PreservationPlanningSipDataFileAction,
preservationPlanningSipDataFileActionNameSpace,
} from "@preservation-planning/sip/stores/data-file/preservation-planning-sip-data-file.action";
import {
PreservationPlanningSipDataFileStatusHistoryState,
PreservationPlanningSipDataFileStatusHistoryStateModel,
......@@ -81,7 +81,7 @@ export class PreservationPlanningSipDataFileState extends CompositionState<Prese
@Action(PreservationPlanningSipDataFileAction.Download)
download(ctx: StateContext<PreservationPlanningSipDataFileStateModel>, action: PreservationPlanningSipDataFileAction.Download): void {
const url = `${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionEnum.DL}`;
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.file.download"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.file.download"));
this.downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize).subscribe(() => {
this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.sip.file.downloadWithSuccess"));
});
......@@ -92,7 +92,7 @@ export class PreservationPlanningSipDataFileState extends CompositionState<Prese
return this.apiService.post<void>(`${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionEnum.RESUME}`)
.pipe(
tap(() => {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.file.resumed"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.file.resumed"));
ctx.dispatch(new PreservationPlanningSipDataFileAction.GetAll(action.parentId, undefined, true));
}),
);
......
import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core";
import {IngestResourceApiEnum} from "@app/shared/enums/api.enum";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {Sip} from "@models";
import {
Action,
Actions,
Selector,
State,
StateContext,
Store,
} from "@ngxs/store";
import {
defaultPreservationPlanningSipDataFileValue,
PreservationPlanningSipDataFileState,
......@@ -13,17 +24,6 @@ import {
PreservationPlanningSipStatusHistoryState,
PreservationPlanningSipStatusHistoryStateModel,
} from "@preservation-planning/sip/stores/status-history/preservation-planning-sip-status-history.state";
import {IngestResourceApiEnum} from "@app/shared/enums/api.enum";
import {LocalStateEnum} from "@app/shared/enums/local-state.enum";
import {Sip} from "@models";
import {
Action,
Actions,
Selector,
State,
StateContext,
Store,
} from "@ngxs/store";
import {ApiActionEnum} from "@shared/enums/api-action.enum";
import {DownloadService} from "@shared/services/download.service";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
......@@ -111,9 +111,9 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan
@Action(PreservationPlanningSipAction.Download)
download(ctx: StateContext<PreservationPlanningSipStateModel>, action: PreservationPlanningSipAction.Download): void {
const fileName = "sip_" + action.id + ".zip";
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.file.download"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.file.download"));
this.downloadService.download(`${this._urlResource}/${action.id}/${ApiActionEnum.DL}`, fileName).subscribe(() => {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.file.downloadWithSuccess"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.file.downloadWithSuccess"));
});
}
......@@ -139,7 +139,7 @@ export class PreservationPlanningSipState extends ResourceState<PreservationPlan
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter - 1,
});
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.resume.success"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.sip.action.resume.success"));
}
@Action(PreservationPlanningSipAction.ResumeFail)
......
......@@ -14,9 +14,9 @@ import {
} from "rxjs";
import {
ClipboardUtil,
MARK_AS_TRANSLATABLE,
NotificationService,
ObservableUtil,
MARK_AS_TRANSLATABLE,
} from "solidify-frontend";
@Component({
......@@ -52,7 +52,7 @@ export class SharedDoiMenuPresentational extends SharedAbstractPresentational {
copyLongDoi(): void {
ClipboardUtil.copyStringToClipboard(this.doi);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("doi.notification.longDoiCopyToClipboard"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("doi.notification.longDoiCopyToClipboard"));
}
copyUrlShortDoi(): void {
......@@ -64,7 +64,7 @@ export class SharedDoiMenuPresentational extends SharedAbstractPresentational {
copyUrlLongDoi(): void {
ClipboardUtil.copyStringToClipboard(environment.doiLink + this.doi);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("doi.notification.urlLongDoiCopyToClipboard"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("doi.notification.urlLongDoiCopyToClipboard"));
}
}
......
......@@ -33,8 +33,8 @@ import {
BaseStateModel,
DateUtil,
isNullOrUndefined,
NotificationService,
MARK_AS_TRANSLATABLE,
NotificationService,
urlSeparator,
} from "solidify-frontend";
......@@ -74,7 +74,7 @@ export class AppCartState {
ctx.dispatch(new AppCartArchiveAction.AddInList(action.archiveMetadata));
this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("home.archive.cart.notification.addWithSuccessInCart"));
} else {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("home.archive.cart.notification.alreadyInCart"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("home.archive.cart.notification.alreadyInCart"));
}
}
......
......@@ -27,10 +27,10 @@ import {
ApiService,
defaultResourceStateInitValue,
isFalse,
MARK_AS_TRANSLATABLE,
NotificationService,
ResourceState,
ResourceStateModel,
MARK_AS_TRANSLATABLE,
} from "solidify-frontend";
export interface AppCartDipStateModel extends ResourceStateModel<Dip> {
......@@ -65,7 +65,7 @@ export class AppCartDipState extends ResourceState<AppCartDipStateModel, Dip> {
@Action(AppCartDipAction.Download)
download(ctx: StateContext<AppCartDipStateModel>, action: AppCartDipAction.Download): void {
const fileName = "dip_" + action.id + ".zip";
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.file.download"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.file.download"));
this.actions$.pipe(
ofActionCompleted(AppCartDipDataFileAction.GetAllSuccess),
......@@ -80,7 +80,7 @@ export class AppCartDipState extends ResourceState<AppCartDipStateModel, Dip> {
size += dipDataFile.fileSize;
});
this.downloadService.download(`${this._urlResource}/${action.id}/${ApiActionEnum.DL}`, fileName, size).subscribe(() => {
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.file.downloadWithSuccess"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.dip.file.downloadWithSuccess"));
});
}),
).subscribe();
......
......@@ -58,7 +58,7 @@ export class AppCartDipDataFileState extends CompositionState<AppCartDipDataFile
@Action(PreservationPlanningDipDataFileAction.Download)
download(ctx: StateContext<AppCartDipDataFileStateModel>, action: PreservationPlanningDipDataFileAction.Download): void {
const url = `${this._urlResource}/${action.parentId}/${this._resourceName}/${action.dataFile.resId}/${ApiActionEnum.DL}`;
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.download"), true);
this.notificationService.showInformation(MARK_AS_TRANSLATABLE("notification.deposit.file.download"));
this.downloadService.download(url, action.dataFile.fileName, action.dataFile.fileSize).subscribe(() => {
this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("notification.deposit.file.downloadWithSuccess"));
});
......
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