diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts index 93e074a6b..f8d283271 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts @@ -27,11 +27,9 @@ interface DossierListItem extends Dossier { }) export class TrashScreenComponent extends BaseListingComponent implements OnInit { readonly itemSize = 80; - protected readonly _primaryKey = 'dossierName'; readonly circleButtonTypes = CircleButtonTypes; - readonly tableHeaderLabel = 'trash.table-header.title'; + readonly tableHeaderLabel = _('trash.table-header.title'); readonly canRestoreSelected$ = this._canRestoreSelected$; - private readonly _deleteRetentionHours = this._appConfigService.getConfig(AppConfigKey.DELETE_RETENTION_HOURS); readonly tableColumnConfigs: TableColumnConfig[] = [ { label: _('trash.table-col-names.name'), @@ -53,6 +51,8 @@ export class TrashScreenComponent extends BaseListingComponent column: 'softDeletedTime' } ]; + protected readonly _primaryKey = 'dossierName'; + private readonly _deleteRetentionHours = this._appConfigService.getConfig(AppConfigKey.DELETE_RETENTION_HOURS); constructor( readonly permissionsService: PermissionsService, @@ -78,10 +78,6 @@ export class TrashScreenComponent extends BaseListingComponent this._loadingService.stop(); } - private _getRestoreDate(softDeletedTime: string): string { - return moment(softDeletedTime).add(this._deleteRetentionHours, 'hours').toISOString(); - } - hardDelete(dossiers = this.entitiesService.selected) { const data = new ConfirmationDialogInput({ title: dossiers.length > 1 ? _('confirmation-dialog.delete-dossier.title-alt') : _('confirmation-dialog.delete-dossier.title'), @@ -105,6 +101,10 @@ export class TrashScreenComponent extends BaseListingComponent this._loadingService.loadWhile(this._restore(dossiers)); } + private _getRestoreDate(softDeletedTime: string): string { + return moment(softDeletedTime).add(this._deleteRetentionHours, 'hours').toISOString(); + } + private async _loadDossiersData(): Promise { this.entitiesService.setEntities(this._toListItems(await this._dossiersService.getDeleted())); } diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts index 70d4f0b6e..eb2ab0ab2 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts @@ -87,7 +87,6 @@ export class DossierDetailsComponent implements OnInit { const ownerName = this._userService.getNameForId(this.owner.id); const dossierName = this.appStateService.activeDossier.name; - const msg = 'Successfully assigned ' + ownerName + ' to dossier: ' + dossierName; - this._toaster.info(msg); + this._toaster.info(_('assignment.owner'), { params: { ownerName, dossierName } }); } } diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts index d270095ce..da559d2f5 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts @@ -42,7 +42,6 @@ export class DossierListingScreenComponent implements OnInit, AfterViewInit, OnDestroy, OnAttach, OnDetach { readonly itemSize = 85; - protected readonly _primaryKey = 'dossierName'; readonly currentUser = this._userService.currentUser; readonly tableHeaderLabel = _('dossier-listing.table-header.title'); readonly buttonConfigs: ButtonConfig[] = [ @@ -74,6 +73,7 @@ export class DossierListingScreenComponent ]; dossiersChartData: DoughnutChartConfig[] = []; documentsChartData: DoughnutChartConfig[] = []; + protected readonly _primaryKey = 'dossierName'; private _lastScrollPosition: number; @ViewChild('needsWorkTemplate', { read: TemplateRef, static: true }) private readonly _needsWorkTemplate: TemplateRef; @@ -147,7 +147,7 @@ export class DossierListingScreenComponent } openAddDossierDialog(): void { - this._dialogService.openAddDossierDialog(async addResponse => { + this._dialogService.openDialog('addDossier', null, null, async addResponse => { await this._router.navigate([`/main/dossiers/${addResponse.dossier.dossierId}`]); if (addResponse.addMembers) { this._dialogService.openDialog('editDossier', null, { diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 670215425..7050ca463 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -36,6 +36,7 @@ import { TranslateService } from '@ngx-translate/core'; import { AutoUnsubscribeComponent, CircleButtonTypes, NestedFilter, processFilters } from '@iqser/common-ui'; import { fileStatusTranslations } from '../../translations/file-status-translations'; import { handleFilterDelta } from '@shared/components/filters/popup-filter/utils/filter-utils'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; const ALL_HOTKEY_ARRAY = ['Escape', 'F', 'f']; @@ -471,8 +472,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribeComponent impleme const { dossierId, fileId, filename } = this.fileData.fileStatus; await this._statusControllerService.setFileReviewer(dossierId, fileId, reviewerId).toPromise(); - const msg = `Successfully assigned ${reviewerName} to file: ${filename}`; - this._toaster.info(msg); + this._toaster.info(_('assignment.reviewer'), { params: { reviewerName, filename } }); await this.appStateService.reloadActiveFile(); this._updateCanPerformActions(); this.editingReviewer = false; diff --git a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts index ac926d292..fd6b05f57 100644 --- a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts @@ -30,7 +30,7 @@ const dialogConfig = { // TODO: Continue refactor -type DialogType = 'confirm' | 'documentInfo' | 'editDossier'; +type DialogType = 'confirm' | 'documentInfo' | 'editDossier' | 'addDossier'; type DossiersDialogConfig = { [key in DialogType]: { @@ -52,6 +52,14 @@ export class DossiersDialogService extends DialogService { editDossier: { component: EditDossierDialogComponent, dialogConfig: { ...largeDialogConfig } + }, + addDossier: { + component: AddDossierDialogComponent, + dialogConfig: { + ...dialogConfig, + width: '900px', + autoFocus: true + } } }; @@ -199,18 +207,4 @@ export class DossiersDialogService extends DialogService { return ref; } - - openAddDossierDialog(cb?: Function): MatDialogRef { - const ref = this._dialog.open(AddDossierDialogComponent, { - ...dialogConfig, - width: '900px', - autoFocus: true - }); - - ref.afterClosed().subscribe(result => { - if (result && cb) cb(result); - }); - - return ref; - } } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 371e05607..6f12c9bcd 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -266,6 +266,10 @@ "cancel": "Cancel", "save": "Save" }, + "assignment": { + "owner": "Successfully assigned {ownerName} to dossier: {dossierName}.", + "reviewer": "Successfully assigned {reviewerName} to file: {filename}." + }, "audit": "Audit", "audit-screen": { "all-users": "All Users",