RED-3800: update confirmation dialog stuff
This commit is contained in:
parent
3c378eb3c7
commit
d827ef171a
@ -1,6 +1,6 @@
|
||||
import { CanDeactivate } from '@angular/router';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { map, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs';
|
||||
import { ConfirmationDialogService, ConfirmOptions } from '@iqser/common-ui';
|
||||
|
||||
export interface ComponentCanDeactivate {
|
||||
@ -15,23 +15,24 @@ export interface ComponentCanDeactivate {
|
||||
export class PendingChangesGuard implements CanDeactivate<ComponentCanDeactivate> {
|
||||
constructor(private _dialogService: ConfirmationDialogService) {}
|
||||
|
||||
canDeactivate(component: ComponentCanDeactivate): boolean | Observable<boolean> {
|
||||
if (component.changed) {
|
||||
component.isLeavingPage = true;
|
||||
|
||||
const dialogRef = this._dialogService.openDialog({ disableConfirm: component.valid === false });
|
||||
return dialogRef.afterClosed().pipe(
|
||||
map(result => {
|
||||
if (result === ConfirmOptions.CONFIRM) {
|
||||
component.save().then();
|
||||
} else {
|
||||
component.discard?.().then();
|
||||
}
|
||||
component.isLeavingPage = false;
|
||||
return !!result;
|
||||
}),
|
||||
);
|
||||
canDeactivate(component: ComponentCanDeactivate) {
|
||||
if (!component.changed) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
component.isLeavingPage = true;
|
||||
|
||||
const dialogRef = this._dialogService.open({ disableConfirm: component.valid === false });
|
||||
return dialogRef.afterClosed().pipe(
|
||||
map(result => {
|
||||
if (result === ConfirmOptions.CONFIRM) {
|
||||
component.save().then();
|
||||
} else {
|
||||
component.discard?.().then();
|
||||
}
|
||||
component.isLeavingPage = false;
|
||||
return !!result;
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,9 +2,9 @@ import { Injectable } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import {
|
||||
ConfirmationDialogComponent,
|
||||
ConfirmationDialogInput,
|
||||
DialogConfig,
|
||||
DialogService,
|
||||
IConfirmationDialogData,
|
||||
LoadingService,
|
||||
TitleColors,
|
||||
} from '@iqser/common-ui';
|
||||
@ -39,7 +39,7 @@ export class JustificationsDialogService extends DialogService<DialogType> {
|
||||
}
|
||||
|
||||
confirmDelete(justifications: Justification[], dossierTemplateId: string) {
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('confirmation-dialog.delete-justification.title'),
|
||||
titleColor: TitleColors.WARN,
|
||||
question: _('confirmation-dialog.delete-justification.question'),
|
||||
@ -47,7 +47,7 @@ export class JustificationsDialogService extends DialogService<DialogType> {
|
||||
count: justifications.length,
|
||||
justificationName: justifications[0].name,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
this.openDialog('confirm', data, async () => {
|
||||
this._loadingService.start();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { DOSSIER_TEMPLATE_ID, IPlaceholdersResponse, IReportTemplate, User } from '@red/domain';
|
||||
import { download } from '@utils/file-download-utils';
|
||||
import { ConfirmationDialogInput, getCurrentUser, getParam, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { getCurrentUser, getParam, IConfirmationDialogData, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import {
|
||||
generalPlaceholdersDescriptionsTranslations,
|
||||
@ -80,7 +80,7 @@ export class ReportsScreenComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('confirmation-dialog.upload-report-template.title'),
|
||||
question: _('confirmation-dialog.upload-report-template.question'),
|
||||
confirmationText: _('confirmation-dialog.upload-report-template.confirmation-text'),
|
||||
@ -89,7 +89,8 @@ export class ReportsScreenComponent implements OnInit {
|
||||
translateParams: {
|
||||
fileName: file.name,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
this._dialogService.openDialog('confirm', data, null, async result => {
|
||||
if (result) {
|
||||
const multiFileReport = result > 1;
|
||||
@ -119,7 +120,7 @@ export class ReportsScreenComponent implements OnInit {
|
||||
}
|
||||
|
||||
private async _openOverwriteConfirmationDialog(file: File, multiFileReport: boolean): Promise<void> {
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('confirmation-dialog.report-template-same-name.title'),
|
||||
question: _('confirmation-dialog.report-template-same-name.question'),
|
||||
confirmationText: _('confirmation-dialog.report-template-same-name.confirmation-text'),
|
||||
@ -127,7 +128,7 @@ export class ReportsScreenComponent implements OnInit {
|
||||
translateParams: {
|
||||
fileName: file.name,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
this._dialogService.openDialog('confirm', data, null, async result => {
|
||||
if (result) {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
CircleButtonTypes,
|
||||
ConfirmationDialogInput,
|
||||
getCurrentUser,
|
||||
getParam,
|
||||
IconButtonTypes,
|
||||
IConfirmationDialogData,
|
||||
IqserPermissionsService,
|
||||
ListingComponent,
|
||||
listingProvidersFactory,
|
||||
@ -54,9 +54,10 @@ export class WatermarksListingScreenComponent extends ListingComponent<Watermark
|
||||
async openConfirmDeleteWatermarkDialog(watermark: Watermark) {
|
||||
const isUsed = await this._watermarkService.isWatermarkUsed(watermark.id);
|
||||
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
question: isUsed ? _('watermarks-listing.watermark-is-used') : null,
|
||||
});
|
||||
};
|
||||
|
||||
this._dialogService.openDialog('confirm', data, async () => {
|
||||
await this._deleteWatermark(watermark);
|
||||
});
|
||||
|
||||
@ -10,10 +10,10 @@ import { FileAttributesCsvImportDialogComponent } from '../dialogs/file-attribut
|
||||
import { AddEditDossierAttributeDialogComponent } from '../dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component';
|
||||
import {
|
||||
ConfirmationDialogComponent,
|
||||
ConfirmationDialogInput,
|
||||
ConfirmOptions,
|
||||
DialogConfig,
|
||||
DialogService,
|
||||
IConfirmationDialogData,
|
||||
largeDialogConfig,
|
||||
LoadingService,
|
||||
TitleColors,
|
||||
@ -109,7 +109,7 @@ export class AdminDialogService extends DialogService<DialogType> {
|
||||
}
|
||||
|
||||
deleteUsers(userIds: string[], cb?: () => Promise<void> | void): void {
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('confirm-delete-users.title'),
|
||||
question: _('confirm-delete-users.warning'),
|
||||
confirmationText: _('confirm-delete-users.delete'),
|
||||
@ -121,7 +121,7 @@ export class AdminDialogService extends DialogService<DialogType> {
|
||||
{ value: false, label: _('confirm-delete-users.impacted-documents') },
|
||||
],
|
||||
toastMessage: _('confirm-delete-users.toast-error'),
|
||||
});
|
||||
};
|
||||
|
||||
this.openDialog('confirm', data, async result => {
|
||||
if (result === ConfirmOptions.CONFIRM) {
|
||||
@ -149,7 +149,7 @@ export class AdminDialogService extends DialogService<DialogType> {
|
||||
const uniqueTemplates = Array.from(templateIds).map(id => templates.find(t => t.templateId === id));
|
||||
this._loadingService.stop();
|
||||
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('confirm-delete-attribute.title'),
|
||||
question: _('confirm-delete-attribute.warning'),
|
||||
confirmationText: _('confirm-delete-attribute.delete'),
|
||||
@ -173,7 +173,7 @@ export class AdminDialogService extends DialogService<DialogType> {
|
||||
],
|
||||
toastMessage: _('confirm-delete-attribute.toast-error'),
|
||||
translateParams: { reportsCount: uniqueTemplates.length, count: attributes.length, name: attributes[0].label },
|
||||
});
|
||||
};
|
||||
|
||||
if (templates.length) {
|
||||
data.checkboxes.push({
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Dossier, File, WorkflowFileStatus, WorkflowFileStatuses } from '@red/domain';
|
||||
import { DossiersDialogService } from '../../shared-dossiers/services/dossiers-dialog.service';
|
||||
import { ConfirmationDialogInput, LoadingService } from '@iqser/common-ui';
|
||||
import { IConfirmationDialogData, LoadingService } from '@iqser/common-ui';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { FilesService } from '@services/files/files.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@ -47,10 +47,10 @@ export class BulkActionsService {
|
||||
delete(files: File[]) {
|
||||
this._dialogService.openDialog(
|
||||
'confirm',
|
||||
new ConfirmationDialogInput({
|
||||
{
|
||||
title: _('confirmation-dialog.delete-file.title'),
|
||||
question: _('confirmation-dialog.delete-file.question'),
|
||||
}),
|
||||
} as IConfirmationDialogData,
|
||||
async () => {
|
||||
this._loadingService.start();
|
||||
await firstValueFrom(this._fileManagementService.delete(files, files[0].dossierId));
|
||||
@ -97,7 +97,7 @@ export class BulkActionsService {
|
||||
if (foundAnalysisRequiredFile || foundUpdatedFile) {
|
||||
this._dialogService.openDialog(
|
||||
'confirm',
|
||||
new ConfirmationDialogInput({
|
||||
{
|
||||
title: foundAnalysisRequiredFile
|
||||
? _('confirmation-dialog.approve-multiple-files-without-analysis.title')
|
||||
: _('confirmation-dialog.approve-multiple-files.title'),
|
||||
@ -108,7 +108,7 @@ export class BulkActionsService {
|
||||
? _('confirmation-dialog.approve-multiple-files-without-analysis.confirmationText')
|
||||
: null,
|
||||
denyText: foundAnalysisRequiredFile ? _('confirmation-dialog.approve-multiple-files-without-analysis.denyText') : null,
|
||||
}),
|
||||
} as IConfirmationDialogData,
|
||||
async () => {
|
||||
this._loadingService.start();
|
||||
await this._filesService.setApproved(files);
|
||||
|
||||
@ -5,7 +5,7 @@ import { FilePreviewStateService } from '../../services/file-preview-state.servi
|
||||
import { combineLatest, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { FileDataService } from '../../services/file-data.service';
|
||||
import { BASE_HREF, ConfirmationDialogInput, ConfirmOptions, Toaster } from '@iqser/common-ui';
|
||||
import { BASE_HREF, ConfirmOptions, IConfirmationDialogData, Toaster } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { UserPreferenceService } from '@users/user-preference.service';
|
||||
import { FilePreviewDialogService } from '../../services/file-preview-dialog.service';
|
||||
@ -66,7 +66,7 @@ export class ViewSwitchComponent {
|
||||
const question = displaySuggestionsInPreview
|
||||
? _('unapproved-suggestions.confirmation-dialog.displayed-question')
|
||||
: _('unapproved-suggestions.confirmation-dialog.not-displayed-question');
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('unapproved-suggestions.confirmation-dialog.title'),
|
||||
question: question,
|
||||
confirmationText: _('unapproved-suggestions.confirmation-dialog.confirmation-text'),
|
||||
@ -78,7 +78,7 @@ export class ViewSwitchComponent {
|
||||
},
|
||||
],
|
||||
checkboxesValidation: false,
|
||||
});
|
||||
};
|
||||
|
||||
return this._dialogService.openDialog('confirm', data, result => {
|
||||
if (!result) {
|
||||
|
||||
@ -15,13 +15,14 @@ import {
|
||||
AutoUnsubscribe,
|
||||
bool,
|
||||
CircleButtonTypes,
|
||||
ConfirmationDialogInput,
|
||||
ConfirmOption,
|
||||
ConfirmOptions,
|
||||
CustomError,
|
||||
Debounce,
|
||||
ErrorService,
|
||||
FilterService,
|
||||
HelpModeService,
|
||||
IConfirmationDialogData,
|
||||
List,
|
||||
LoadingService,
|
||||
NestedFilter,
|
||||
@ -644,11 +645,12 @@ export class FilePreviewScreenComponent
|
||||
filter(event => event.type === ViewerEvents.LOAD_ALL_ANNOTATIONS),
|
||||
switchMap(() => this._fileDataService.annotations),
|
||||
switchMap<AnnotationWrapper[], Observable<readonly [boolean, AnnotationWrapper[]]>>(annotations => {
|
||||
// TODO: this switchMap is ugly, to be refactored
|
||||
const showWarning = !this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning);
|
||||
const annotationsExceedThreshold = annotations.length >= this.configService.values.ANNOTATIONS_THRESHOLD;
|
||||
|
||||
if (annotationsExceedThreshold && showWarning) {
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data = {
|
||||
question: _('load-all-annotations-threshold-exceeded'),
|
||||
checkboxes: [
|
||||
{
|
||||
@ -660,17 +662,18 @@ export class FilePreviewScreenComponent
|
||||
translateParams: {
|
||||
threshold: this.configService.values.ANNOTATIONS_THRESHOLD,
|
||||
},
|
||||
});
|
||||
} as IConfirmationDialogData;
|
||||
|
||||
const ref = this._dialogService.openDialog('confirm', data);
|
||||
return ref.afterClosed().pipe(
|
||||
switchMap(async (result: ConfirmOptions) => {
|
||||
switchMap(async (result: ConfirmOption) => {
|
||||
const doNotShowWarningAgain = result === ConfirmOptions.SECOND_CONFIRM;
|
||||
if (doNotShowWarningAgain) {
|
||||
await this.userPreferenceService.save(PreferencesKeys.loadAllAnnotationsWarning, 'true');
|
||||
await this.userPreferenceService.reload();
|
||||
}
|
||||
const shouldLoad = [ConfirmOptions.CONFIRM, ConfirmOptions.SECOND_CONFIRM].includes(result);
|
||||
const validOptions: number[] = [ConfirmOptions.CONFIRM, ConfirmOptions.SECOND_CONFIRM];
|
||||
const shouldLoad = validOptions.includes(result);
|
||||
return [shouldLoad, annotations] as const;
|
||||
}),
|
||||
);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, ElementRef, ViewChild } from '@angular/core';
|
||||
import { HeaderElements } from '../../../file-preview/utils/constants';
|
||||
import { ConfirmationDialogInput, ConfirmOptions, LoadingService } from '@iqser/common-ui';
|
||||
import { ConfirmOption, ConfirmOptions, IConfirmationDialogData, LoadingService } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { FilesMapService } from '@services/files/files-map.service';
|
||||
import { SharedDialogService } from '@shared/services/dialog.service';
|
||||
@ -81,18 +81,15 @@ export class CompareFileInputComponent {
|
||||
}
|
||||
|
||||
#askForConfirmation(fileName: string, currentDocumentPageCount: number, compareDocumentPageCount: number) {
|
||||
const ref: MatDialogRef<unknown, ConfirmOptions> = this._dialogService.openDialog(
|
||||
'confirm',
|
||||
new ConfirmationDialogInput({
|
||||
title: _('confirmation-dialog.compare-file.title'),
|
||||
question: _('confirmation-dialog.compare-file.question'),
|
||||
translateParams: {
|
||||
fileName,
|
||||
currentDocumentPageCount,
|
||||
compareDocumentPageCount,
|
||||
},
|
||||
}),
|
||||
);
|
||||
const ref: MatDialogRef<unknown, ConfirmOption> = this._dialogService.openDialog('confirm', {
|
||||
title: _('confirmation-dialog.compare-file.title'),
|
||||
question: _('confirmation-dialog.compare-file.question'),
|
||||
translateParams: {
|
||||
fileName,
|
||||
currentDocumentPageCount,
|
||||
compareDocumentPageCount,
|
||||
},
|
||||
} as IConfirmationDialogData);
|
||||
|
||||
return firstValueFrom(ref.afterClosed());
|
||||
}
|
||||
|
||||
@ -5,9 +5,10 @@ import { FileManagementService } from '@services/files/file-management.service';
|
||||
import { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';
|
||||
import {
|
||||
ConfirmationDialogComponent,
|
||||
ConfirmationDialogInput,
|
||||
ConfirmOption,
|
||||
ConfirmOptions,
|
||||
defaultDialogConfig,
|
||||
IConfirmationDialogData,
|
||||
LoadingService,
|
||||
} from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
@ -93,15 +94,15 @@ export class PageRotationService {
|
||||
#showConfirmationDialog() {
|
||||
const ref = this._injector.get(MatDialog).open(ConfirmationDialogComponent, {
|
||||
...defaultDialogConfig,
|
||||
data: new ConfirmationDialogInput({
|
||||
data: {
|
||||
title: _('page-rotation.confirmation-dialog.title'),
|
||||
question: _('page-rotation.confirmation-dialog.question'),
|
||||
confirmationText: _('page-rotation.apply'),
|
||||
discardChangesText: _('page-rotation.discard'),
|
||||
}),
|
||||
} as IConfirmationDialogData,
|
||||
});
|
||||
|
||||
const closed$ = ref.afterClosed().pipe(map((option: ConfirmOptions) => option === ConfirmOptions.CONFIRM));
|
||||
const closed$ = ref.afterClosed().pipe(map((option: ConfirmOption) => option === ConfirmOptions.CONFIRM));
|
||||
|
||||
return closed$.pipe(tap(apply => (apply ? this.applyRotation() : this.discardRotation())));
|
||||
}
|
||||
|
||||
@ -5,8 +5,8 @@ import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
import {
|
||||
CircleButtonType,
|
||||
CircleButtonTypes,
|
||||
ConfirmationDialogInput,
|
||||
getCurrentUser,
|
||||
IConfirmationDialogData,
|
||||
IqserPermissionsService,
|
||||
IqserTooltipPosition,
|
||||
LoadingService,
|
||||
@ -298,22 +298,18 @@ export class FileActionsComponent implements OnChanges {
|
||||
return;
|
||||
}
|
||||
|
||||
this._dialogService.openDialog(
|
||||
'confirm',
|
||||
new ConfirmationDialogInput({
|
||||
title: this.file.analysisRequired
|
||||
? _('confirmation-dialog.approve-file-without-analysis.title')
|
||||
: _('confirmation-dialog.approve-file.title'),
|
||||
question: this.file.analysisRequired
|
||||
? _('confirmation-dialog.approve-file-without-analysis.question')
|
||||
: _('confirmation-dialog.approve-file.question'),
|
||||
confirmationText: this.file.analysisRequired
|
||||
? _('confirmation-dialog.approve-file-without-analysis.confirmationText')
|
||||
: null,
|
||||
denyText: this.file.analysisRequired ? _('confirmation-dialog.approve-file-without-analysis.denyText') : null,
|
||||
}),
|
||||
() => this.#setFileApproved(),
|
||||
);
|
||||
const data: IConfirmationDialogData = {
|
||||
title: this.file.analysisRequired
|
||||
? _('confirmation-dialog.approve-file-without-analysis.title')
|
||||
: _('confirmation-dialog.approve-file.title'),
|
||||
question: this.file.analysisRequired
|
||||
? _('confirmation-dialog.approve-file-without-analysis.question')
|
||||
: _('confirmation-dialog.approve-file.question'),
|
||||
confirmationText: this.file.analysisRequired ? _('confirmation-dialog.approve-file-without-analysis.confirmationText') : null,
|
||||
denyText: this.file.analysisRequired ? _('confirmation-dialog.approve-file-without-analysis.denyText') : null,
|
||||
};
|
||||
|
||||
this._dialogService.openDialog('confirm', data, () => this.#setFileApproved());
|
||||
}
|
||||
|
||||
forceReanalysisAction($event: LongPressEvent) {
|
||||
@ -322,11 +318,11 @@ export class FileActionsComponent implements OnChanges {
|
||||
}
|
||||
|
||||
#showOCRConfirmationDialog(): Observable<boolean> {
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('ocr.confirmation-dialog.title'),
|
||||
question: _('ocr.confirmation-dialog.question'),
|
||||
denyText: _('ocr.confirmation-dialog.cancel'),
|
||||
});
|
||||
};
|
||||
|
||||
const ref = this._dialogService.openDialog('confirm', data);
|
||||
return ref.afterClosed();
|
||||
@ -339,10 +335,10 @@ export class FileActionsComponent implements OnChanges {
|
||||
private _openDeleteFileDialog() {
|
||||
this._dialogService.openDialog(
|
||||
'confirm',
|
||||
new ConfirmationDialogInput({
|
||||
{
|
||||
title: _('confirmation-dialog.delete-file.title'),
|
||||
question: _('confirmation-dialog.delete-file.question'),
|
||||
}),
|
||||
} as IConfirmationDialogData,
|
||||
async () => {
|
||||
this._loadingService.start();
|
||||
try {
|
||||
|
||||
@ -7,7 +7,7 @@ import { PermissionsService } from '@services/permissions.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { EditDossierDialogComponent } from '../edit-dossier-dialog.component';
|
||||
import { ConfirmationDialogInput, ConfirmOptions, IconButtonTypes, LoadingService, TitleColors, Toaster } from '@iqser/common-ui';
|
||||
import { ConfirmOptions, IconButtonTypes, IConfirmationDialogData, LoadingService, TitleColors, Toaster } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { DossierStatsService } from '@services/dossiers/dossier-stats.service';
|
||||
@ -127,7 +127,7 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
}
|
||||
|
||||
deleteDossier() {
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('confirmation-dialog.delete-dossier.title'),
|
||||
titleColor: TitleColors.WARN,
|
||||
question: _('confirmation-dialog.delete-dossier.question'),
|
||||
@ -138,7 +138,8 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
dossierName: this.dossier.dossierName,
|
||||
dossiersCount: 1,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
this._dialogService.openDialog('confirm', data, async () => {
|
||||
this._loadingService.start();
|
||||
await firstValueFrom(this._trashService.deleteDossier(this.dossier));
|
||||
@ -154,7 +155,7 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
}
|
||||
|
||||
archiveDossier() {
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('confirm-archive-dossier.title'),
|
||||
details: _('confirm-archive-dossier.details'),
|
||||
question: _('confirm-archive-dossier.warning'),
|
||||
@ -164,7 +165,8 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
translateParams: { ...this.dossier },
|
||||
checkboxes: [{ value: false, label: _('confirm-archive-dossier.checkbox.documents') }],
|
||||
toastMessage: _('confirm-archive-dossier.toast-error'),
|
||||
});
|
||||
};
|
||||
|
||||
this._dialogService.openDialog('confirm', data, async result => {
|
||||
if (result === ConfirmOptions.CONFIRM) {
|
||||
this._loadingService.start();
|
||||
|
||||
@ -3,7 +3,7 @@ import { Dossier, File, User, WorkflowFileStatus, WorkflowFileStatuses } from '@
|
||||
import { DossiersDialogService } from './dossiers-dialog.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { FilesService } from '@services/files/files.service';
|
||||
import { ConfirmationDialogInput, getCurrentUser, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { getCurrentUser, IConfirmationDialogData, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
|
||||
@ -33,13 +33,13 @@ export class FileAssignService {
|
||||
};
|
||||
|
||||
if (atLeastOneAssignee(files)) {
|
||||
const dialogInput = new ConfirmationDialogInput({
|
||||
const dialogInput: IConfirmationDialogData = {
|
||||
title: _('confirmation-dialog.assign-file-to-me.title'),
|
||||
question:
|
||||
files.length === 1
|
||||
? _('confirmation-dialog.assign-file-to-me.question.single')
|
||||
: _('confirmation-dialog.assign-file-to-me.question.multiple'),
|
||||
});
|
||||
};
|
||||
const ref = this._dialogService.openDialog('confirm', dialogInput, assignReq);
|
||||
return firstValueFrom(ref.afterClosed());
|
||||
}
|
||||
|
||||
@ -2,9 +2,9 @@ import { Injectable } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import {
|
||||
ConfirmationDialogComponent,
|
||||
ConfirmationDialogInput,
|
||||
DialogConfig,
|
||||
DialogService,
|
||||
IConfirmationDialogData,
|
||||
LoadingService,
|
||||
TitleColors,
|
||||
} from '@iqser/common-ui';
|
||||
@ -32,7 +32,7 @@ export class TrashDialogService extends DialogService<DialogType> {
|
||||
}
|
||||
|
||||
confirmHardDelete(items: TrashItem[]): void {
|
||||
const data = new ConfirmationDialogInput({
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('confirmation-dialog.delete-items.title'),
|
||||
titleColor: TitleColors.WARN,
|
||||
question: _('confirmation-dialog.delete-items.question'),
|
||||
@ -40,7 +40,7 @@ export class TrashDialogService extends DialogService<DialogType> {
|
||||
name: items[0].name,
|
||||
itemsCount: items.length,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
this.openDialog('confirm', data, async () => {
|
||||
this._loadingService.start();
|
||||
|
||||
@ -45,8 +45,11 @@ export class DossierTemplatesService extends EntitiesService<IDossierTemplate, D
|
||||
return forkJoin([
|
||||
this._dossierTemplateStatsService.getFor(dossierTemplateIds(templates)),
|
||||
...getAttributes(templates),
|
||||
// TODO: this should be removed and called only when needed
|
||||
this._dictionaryService.loadDictionaryData(dossierTemplateIds(templates)),
|
||||
// TODO: this should be removed and called only when needed
|
||||
this._defaultColorsService.loadAll(dossierTemplateIds(templates)),
|
||||
// TODO: this should be removed and called only when needed
|
||||
this._watermarksService.loadAll(dossierTemplateIds(templates)),
|
||||
]).pipe(map(() => templates));
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit cb8a0ddcf9a3858ec698e52488a51fabaff55849
|
||||
Subproject commit a1d11cd9eb91cebe729a70cf57a778b385edcca0
|
||||
Loading…
x
Reference in New Issue
Block a user