Refactor dossiers dialog service: dossier dictionary
This commit is contained in:
parent
dc810ae491
commit
df54ab3fc2
@ -44,12 +44,9 @@ export class DossierOverviewScreenComponent
|
|||||||
implements OnInit, OnDestroy, OnDetach, OnAttach
|
implements OnInit, OnDestroy, OnDetach, OnAttach
|
||||||
{
|
{
|
||||||
readonly itemSize = 80;
|
readonly itemSize = 80;
|
||||||
protected readonly _primaryKey = 'filename';
|
|
||||||
readonly circleButtonTypes = CircleButtonTypes;
|
readonly circleButtonTypes = CircleButtonTypes;
|
||||||
readonly currentUser = this._userService.currentUser;
|
readonly currentUser = this._userService.currentUser;
|
||||||
readonly tableHeaderLabel = _('dossier-overview.table-header.title');
|
readonly tableHeaderLabel = _('dossier-overview.table-header.title');
|
||||||
private readonly _lastOpenedFileKey = 'Dossier-Recent-' + this.activeDossier.dossierId;
|
|
||||||
|
|
||||||
readonly actionConfigs: ActionConfig[] = [
|
readonly actionConfigs: ActionConfig[] = [
|
||||||
{
|
{
|
||||||
label: this._translateService.instant('dossier-overview.header-actions.edit'),
|
label: this._translateService.instant('dossier-overview.header-actions.edit'),
|
||||||
@ -90,9 +87,10 @@ export class DossierOverviewScreenComponent
|
|||||||
column: 'statusSort'
|
column: 'statusSort'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
collapsedDetails = false;
|
collapsedDetails = false;
|
||||||
dossierAttributes: DossierAttributeWithValue[] = [];
|
dossierAttributes: DossierAttributeWithValue[] = [];
|
||||||
|
protected readonly _primaryKey = 'filename';
|
||||||
|
private readonly _lastOpenedFileKey = 'Dossier-Recent-' + this.activeDossier.dossierId;
|
||||||
@ViewChild(DossierDetailsComponent, { static: false })
|
@ViewChild(DossierDetailsComponent, { static: false })
|
||||||
private readonly _dossierDetailsComponent: DossierDetailsComponent;
|
private readonly _dossierDetailsComponent: DossierDetailsComponent;
|
||||||
private _lastScrollPosition: number;
|
private _lastScrollPosition: number;
|
||||||
@ -260,7 +258,7 @@ export class DossierOverviewScreenComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
openDossierDictionaryDialog() {
|
openDossierDictionaryDialog() {
|
||||||
this._dialogService.openDossierDictionaryDialog(null, this.activeDossier, () => {
|
this._dialogService.openDialog('dossierDictionary', null, this.activeDossier, () => {
|
||||||
this.reloadDossiers();
|
this.reloadDossiers();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import { RemoveAnnotationsDialogComponent } from '../dialogs/remove-annotations-
|
|||||||
import { ForceRedactionDialogComponent } from '../dialogs/force-redaction-dialog/force-redaction-dialog.component';
|
import { ForceRedactionDialogComponent } from '../dialogs/force-redaction-dialog/force-redaction-dialog.component';
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
import { ConfirmationDialogComponent } from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component';
|
import { ConfirmationDialogComponent } from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component';
|
||||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
|
||||||
import { DocumentInfoDialogComponent } from '../dialogs/document-info-dialog/document-info-dialog.component';
|
import { DocumentInfoDialogComponent } from '../dialogs/document-info-dialog/document-info-dialog.component';
|
||||||
import { AppStateService } from '@state/app-state.service';
|
import { AppStateService } from '@state/app-state.service';
|
||||||
import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
||||||
@ -28,7 +27,15 @@ const dialogConfig = {
|
|||||||
|
|
||||||
// TODO: Continue refactor
|
// TODO: Continue refactor
|
||||||
|
|
||||||
type DialogType = 'confirm' | 'documentInfo' | 'editDossier' | 'addDossier' | 'assignFile' | 'recategorizeImage' | 'changeLegalBasis';
|
type DialogType =
|
||||||
|
| 'confirm'
|
||||||
|
| 'documentInfo'
|
||||||
|
| 'editDossier'
|
||||||
|
| 'addDossier'
|
||||||
|
| 'assignFile'
|
||||||
|
| 'recategorizeImage'
|
||||||
|
| 'changeLegalBasis'
|
||||||
|
| 'dossierDictionary';
|
||||||
|
|
||||||
type DossiersDialogConfig = {
|
type DossiersDialogConfig = {
|
||||||
[key in DialogType]: {
|
[key in DialogType]: {
|
||||||
@ -53,11 +60,7 @@ export class DossiersDialogService extends DialogService<DialogType> {
|
|||||||
},
|
},
|
||||||
addDossier: {
|
addDossier: {
|
||||||
component: AddDossierDialogComponent,
|
component: AddDossierDialogComponent,
|
||||||
dialogConfig: {
|
dialogConfig: { width: '900px', autoFocus: true }
|
||||||
...dialogConfig,
|
|
||||||
width: '900px',
|
|
||||||
autoFocus: true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
assignFile: {
|
assignFile: {
|
||||||
component: AssignReviewerApproverDialogComponent
|
component: AssignReviewerApproverDialogComponent
|
||||||
@ -67,6 +70,10 @@ export class DossiersDialogService extends DialogService<DialogType> {
|
|||||||
},
|
},
|
||||||
changeLegalBasis: {
|
changeLegalBasis: {
|
||||||
component: ChangeLegalBasisDialogComponent
|
component: ChangeLegalBasisDialogComponent
|
||||||
|
},
|
||||||
|
dossierDictionary: {
|
||||||
|
component: DossierDictionaryDialogComponent,
|
||||||
|
dialogConfig: { width: '90vw', height: '90vh' }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -126,25 +133,4 @@ export class DossiersDialogService extends DialogService<DialogType> {
|
|||||||
});
|
});
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
openDossierDictionaryDialog(
|
|
||||||
$event: MouseEvent,
|
|
||||||
dossier: DossierWrapper,
|
|
||||||
cb?: Function
|
|
||||||
): MatDialogRef<DossierDictionaryDialogComponent> {
|
|
||||||
$event?.stopPropagation();
|
|
||||||
const ref = this._dialog.open(DossierDictionaryDialogComponent, {
|
|
||||||
...dialogConfig,
|
|
||||||
width: '90vw',
|
|
||||||
height: '90vh',
|
|
||||||
autoFocus: false,
|
|
||||||
data: dossier
|
|
||||||
});
|
|
||||||
ref.afterClosed().subscribe(result => {
|
|
||||||
if (cb) {
|
|
||||||
cb(result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return ref;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user