diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.html b/apps/red-ui/src/app/components/base-screen/base-screen.component.html index 400a065d2..7040eba5c 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.html +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.html @@ -25,16 +25,17 @@ - + + - + {{ item.name | translate }} - diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts index 827c99fd8..12e8a0df5 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts @@ -13,6 +13,7 @@ import { FeaturesService } from '@services/features.service'; import { DOSSIERS_ARCHIVE } from '@utils/constants'; interface MenuItem { + readonly id: string; readonly name: string; readonly routerLink?: string; readonly show: boolean; @@ -31,21 +32,25 @@ export class BaseScreenComponent { readonly currentUser = this.userService.currentUser; readonly userMenuItems: readonly MenuItem[] = [ { + id: 'account', name: _('top-bar.navigation-items.my-account.children.account'), routerLink: '/main/account', show: true, }, { + id: 'admin', name: _('top-bar.navigation-items.my-account.children.admin'), routerLink: '/main/admin', show: this.currentUser.isManager || this.currentUser.isUserAdmin, }, { + id: 'downloads', name: _('top-bar.navigation-items.my-account.children.downloads'), routerLink: '/main/downloads', show: this.currentUser.isUser, }, { + id: 'trash', name: _('top-bar.navigation-items.my-account.children.trash'), routerLink: '/main/admin/trash', show: this.currentUser.isManager, diff --git a/apps/red-ui/src/app/models/file/annotation.permissions.ts b/apps/red-ui/src/app/models/file/annotation.permissions.ts index e86cec050..2c5d1e02d 100644 --- a/apps/red-ui/src/app/models/file/annotation.permissions.ts +++ b/apps/red-ui/src/app/models/file/annotation.permissions.ts @@ -37,7 +37,8 @@ export class AnnotationPermissions { const annotationEntity = entities.find(entity => entity.type === annotation.type); permissions.canMarkAsFalsePositive = annotation.canBeMarkedAsFalsePositive && annotationEntity.hasDictionary; - permissions.canRemoveOrSuggestToRemoveOnlyHere = (annotation.isRedacted || annotation.isHint) && !annotation.pending; + permissions.canRemoveOrSuggestToRemoveOnlyHere = + (annotation.isRedacted || annotation.isHint) && !annotation.pending && !annotation.isImage; permissions.canRemoveOrSuggestToRemoveFromDictionary = annotation.isModifyDictionary && (annotation.isRedacted || annotation.isSkipped || annotation.isHint) && diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 355c31935..509b98f4d 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -303,20 +303,24 @@ export class AnnotationWrapper implements IListable, Record { } } + private static _getLastRelevantManualChange(manualChanges: IManualChange[]) { + return manualChanges[manualChanges.length - 1]; + } + private static _setSuperType(annotationWrapper: AnnotationWrapper, redactionLogEntryWrapper: RedactionLogEntry) { if (redactionLogEntryWrapper.manualChanges?.length) { - const lastManualChange = redactionLogEntryWrapper.manualChanges[redactionLogEntryWrapper.manualChanges.length - 1]; + const lastRelevantManualChange = this._getLastRelevantManualChange(redactionLogEntryWrapper.manualChanges); - annotationWrapper.pending = !lastManualChange.processed; + annotationWrapper.pending = !lastRelevantManualChange.processed; annotationWrapper.superType = AnnotationWrapper._selectSuperType( redactionLogEntryWrapper, - lastManualChange, + lastRelevantManualChange, annotationWrapper.hintDictionary, ); - if (lastManualChange.annotationStatus === LogEntryStatus.REQUESTED) { - annotationWrapper.recategorizationType = lastManualChange.propertyChanges.type; + if (lastRelevantManualChange.annotationStatus === LogEntryStatus.REQUESTED) { + annotationWrapper.recategorizationType = lastRelevantManualChange.propertyChanges.type; } } else { if (redactionLogEntryWrapper.recommendation) { @@ -418,7 +422,7 @@ export class AnnotationWrapper implements IListable, Record { case LogEntryStatus.APPROVED: return SuperTypes.Redaction; case LogEntryStatus.DECLINED: - return SuperTypes.Skipped; + return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped; case LogEntryStatus.REQUESTED: return SuperTypes.SuggestionForceRedaction; } @@ -444,7 +448,7 @@ export class AnnotationWrapper implements IListable, Record { } else if (redactionLogEntry.hint) { return SuperTypes.Hint; } else { - return SuperTypes.Skipped; + return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped; } } case LogEntryStatus.REQUESTED: @@ -471,7 +475,7 @@ export class AnnotationWrapper implements IListable, Record { } else if (redactionLogEntry.hint) { return SuperTypes.Hint; } else { - return SuperTypes.Skipped; + return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped; } case LogEntryStatus.REQUESTED: return SuperTypes.SuggestionResize; diff --git a/apps/red-ui/src/app/models/file/redaction-log.entry.ts b/apps/red-ui/src/app/models/file/redaction-log.entry.ts index e0b358d78..361d1e347 100644 --- a/apps/red-ui/src/app/models/file/redaction-log.entry.ts +++ b/apps/red-ui/src/app/models/file/redaction-log.entry.ts @@ -29,6 +29,7 @@ export class RedactionLogEntry implements IRedactionLogEntry { readonly textBefore?: string; readonly type?: string; readonly value?: string; + readonly sourceId?: string; reason?: string; @@ -69,5 +70,6 @@ export class RedactionLogEntry implements IRedactionLogEntry { this.type = redactionLogEntry.type; this.value = redactionLogEntry.value; this.imported = redactionLogEntry.imported; + this.sourceId = redactionLogEntry.sourceId; } } diff --git a/apps/red-ui/src/app/modules/admin/admin.module.ts b/apps/red-ui/src/app/modules/admin/admin.module.ts index 891f59285..b13bdebea 100644 --- a/apps/red-ui/src/app/modules/admin/admin.module.ts +++ b/apps/red-ui/src/app/modules/admin/admin.module.ts @@ -12,7 +12,7 @@ import { UserListingScreenComponent } from './screens/user-listing/user-listing- import { DossierTemplateBreadcrumbsComponent } from './components/dossier-template-breadcrumbs/dossier-template-breadcrumbs.component'; import { ColorPickerModule } from 'ngx-color-picker'; import { AddEditFileAttributeDialogComponent } from './dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component'; -import { AddEditCloneDossierTemplateDialogComponent } from './dialogs/add-edit-clone-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component'; +import { AddEditDossierTemplateDialogComponent } from './dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component'; import { AddEntityDialogComponent } from './dialogs/add-entity-dialog/add-entity-dialog.component'; import { EditColorDialogComponent } from './dialogs/edit-color-dialog/edit-color-dialog.component'; import { ComboChartComponent, ComboSeriesVerticalComponent } from './components/combo-chart'; @@ -48,11 +48,13 @@ import { A11yModule } from '@angular/cdk/a11y'; import { ConfirmDeleteDossierStateDialogComponent } from './dialogs/confirm-delete-dossier-state-dialog/confirm-delete-dossier-state-dialog.component'; import { TrashTableItemComponent } from './screens/trash/trash-table-item/trash-table-item.component'; import { BaseEntityScreenComponent } from './base-entity-screen/base-entity-screen.component'; +import { CloneDossierTemplateDialogComponent } from './dialogs/clone-dossier-template-dialog/clone-dossier-template-dialog.component'; const dialogs = [ - AddEditCloneDossierTemplateDialogComponent, + AddEditDossierTemplateDialogComponent, AddEntityDialogComponent, AddEditFileAttributeDialogComponent, + CloneDossierTemplateDialogComponent, EditColorDialogComponent, SmtpAuthDialogComponent, AddEditUserDialogComponent, diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-clone-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html similarity index 81% rename from apps/red-ui/src/app/modules/admin/dialogs/add-edit-clone-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component.html rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html index 149a08ad1..a5d11d920 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-clone-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html @@ -1,19 +1,19 @@
- +
- +