diff --git a/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts b/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts index e725d852a..dfb735ba7 100644 --- a/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts +++ b/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts @@ -28,7 +28,7 @@ export const canRemoveFromDictionary = (annotation: AnnotationWrapper, autoAnaly (annotation.isRedacted || annotation.isSkipped || annotation.isHint || (annotation.isIgnoredHint && !annotation.isRuleBased)) && (autoAnalysisDisabled || !annotation.pending) && !annotation.hasBeenResizedLocally && - (!annotation.hasBeenForcedHint || !annotation.hasBeenForcedRedaction); + !(annotation.hasBeenForcedHint || annotation.hasBeenForcedRedaction); export const canRemoveRedaction = (annotation: AnnotationWrapper, permissions: AnnotationPermissions) => (!annotation.isIgnoredHint || !annotation.isRuleBased) && @@ -58,6 +58,12 @@ export const canResizeAnnotation = ( (!annotation.isHint && hasDictionary && annotation.isRuleBased))) || annotation.isRecommendation; +export const canResizeInDictionary = (annotation: AnnotationWrapper, permissions: AnnotationPermissions) => + permissions.canResizeAnnotation && + annotation.isModifyDictionary && + !annotation.hasBeenResizedLocally && + !(annotation.hasBeenForcedHint || annotation.hasBeenForcedRedaction); + export const canEditAnnotation = (annotation: AnnotationWrapper) => (annotation.isRedacted || annotation.isSkipped) && !annotation.isImage; export const canEditHint = (annotation: AnnotationWrapper) => 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 bdb75e87d..01aa08e8d 100644 --- a/apps/red-ui/src/app/models/file/annotation.permissions.ts +++ b/apps/red-ui/src/app/models/file/annotation.permissions.ts @@ -16,6 +16,7 @@ import { canRemoveOnlyHere, canRemoveRedaction, canResizeAnnotation, + canResizeInDictionary, canUndo, } from './annotation-permissions.utils'; import { AnnotationWrapper } from './annotation.wrapper'; @@ -30,6 +31,7 @@ export class AnnotationPermissions { canForceRedaction = true; canChangeLegalBasis = true; canResizeAnnotation = true; + canResizeInDictionary = true; canRecategorizeAnnotation = true; canForceHint = true; canEditAnnotations = true; @@ -69,6 +71,7 @@ export class AnnotationPermissions { autoAnalysisDisabled, annotationEntity?.hasDictionary, ); + permissions.canResizeInDictionary = canResizeInDictionary(annotation, permissions); permissions.canEditAnnotations = canEditAnnotation(annotation); permissions.canEditHints = canEditHint(annotation); permissions.canEditImages = canEditImage(annotation); @@ -80,6 +83,7 @@ export class AnnotationPermissions { static reduce(permissions: AnnotationPermissions[]): AnnotationPermissions { const result = new AnnotationPermissions(); result.canResizeAnnotation = permissions.length === 1 && permissions[0].canResizeAnnotation; + result.canResizeInDictionary = permissions.length === 1 && permissions[0].canResizeInDictionary; result.canChangeLegalBasis = permissions.reduce((acc, next) => acc && next.canChangeLegalBasis, true); result.canRecategorizeAnnotation = permissions.reduce((acc, next) => acc && next.canRecategorizeAnnotation, true); result.canRemoveFromDictionary = permissions.reduce((acc, next) => acc && next.canRemoveFromDictionary, true); diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss index d603928a8..c9a94ddf1 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss @@ -23,9 +23,3 @@ form { font-size: 16px; opacity: 0.7; } - -.item-info { - background: var(--iqser-light); - border: 1px solid var(--iqser-grey-1); - padding: 20px; -} diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-analysis-capacity-usage/license-analysis-capacity-usage.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/components/license-analysis-capacity-usage/license-analysis-capacity-usage.component.ts index ee16e3ba9..6077a44c5 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-analysis-capacity-usage/license-analysis-capacity-usage.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-analysis-capacity-usage/license-analysis-capacity-usage.component.ts @@ -3,7 +3,7 @@ import { LicenseService } from '@services/license.service'; import { map } from 'rxjs/operators'; import { ChartDataset } from 'chart.js'; import { ChartBlue, ChartGreen, ChartRed } from '../../utils/constants'; -import { getLabelsFromLicense, getLineConfig } from '../../utils/functions'; +import { getDataUntilCurrentMonth, getLabelsFromLicense, getLineConfig } from '../../utils/functions'; import { TranslateService } from '@ngx-translate/core'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { size } from '@iqser/common-ui/lib/utils'; @@ -48,7 +48,7 @@ export class LicenseAnalysisCapacityUsageComponent { }, { - data: monthlyData.map( + data: getDataUntilCurrentMonth(monthlyData).map( (month, monthIndex) => month.analysedFilesBytes + monthlyData.slice(0, monthIndex).reduce((acc, curr) => acc + curr.analysedFilesBytes, 0), ), diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-page-usage/license-page-usage.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/components/license-page-usage/license-page-usage.component.ts index 44a45dd7e..7a15e85a1 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-page-usage/license-page-usage.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-page-usage/license-page-usage.component.ts @@ -3,7 +3,7 @@ import { LicenseService } from '@services/license.service'; import { map } from 'rxjs/operators'; import { ChartDataset } from 'chart.js'; import { ChartBlue, ChartGreen, ChartRed } from '../../utils/constants'; -import { getLabelsFromLicense, getLineConfig } from '../../utils/functions'; +import { getDataUntilCurrentMonth, getLabelsFromLicense, getLineConfig } from '../../utils/functions'; import { TranslateService } from '@ngx-translate/core'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { addPaddingToArray } from '@utils/functions'; @@ -58,7 +58,7 @@ export class LicensePageUsageComponent { order: 1, }, { - data: monthlyData.map( + data: getDataUntilCurrentMonth(monthlyData).map( (month, monthIndex) => month.numberOfAnalyzedPages + monthlyData.slice(0, monthIndex).reduce((acc, curr) => acc + curr.numberOfAnalyzedPages, 0), diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-retention-capacity-usage/license-retention-capacity.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/components/license-retention-capacity-usage/license-retention-capacity.component.ts index abefa9672..5873ed5c4 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-retention-capacity-usage/license-retention-capacity.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-retention-capacity-usage/license-retention-capacity.component.ts @@ -6,7 +6,7 @@ import { map } from 'rxjs/operators'; import type { DonutChartConfig, ILicenseReport } from '@red/domain'; import { ChartDataset } from 'chart.js'; import { ChartBlack, ChartBlue, ChartGreen, ChartGrey, ChartRed } from '../../utils/constants'; -import { getLabelsFromLicense, getLineConfig } from '../../utils/functions'; +import { getDataUntilCurrentMonth, getLabelsFromLicense, getLineConfig } from '../../utils/functions'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ @@ -60,7 +60,7 @@ export class LicenseRetentionCapacityComponent { } #getDatasets(license: ILicenseReport): ChartDataset[] { - const monthlyData = license.monthlyData; + const monthlyData = getDataUntilCurrentMonth(license.monthlyData); return [ { diff --git a/apps/red-ui/src/app/modules/admin/screens/license/license.module.ts b/apps/red-ui/src/app/modules/admin/screens/license/license.module.ts index c397b75f6..b509ca40e 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/license.module.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/license.module.ts @@ -1,19 +1,19 @@ -import { inject, NgModule } from '@angular/core'; -import { LicenseScreenComponent } from './license-screen/license-screen.component'; -import { LicenseSelectComponent } from './components/license-select/license-select.component'; -import { RouterModule, Routes } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; -import { MatSelectModule } from '@angular/material/select'; -import { IqserHelpModeModule, IqserListingModule, SizePipe } from '@iqser/common-ui'; -import { FormsModule } from '@angular/forms'; import { CommonModule } from '@angular/common'; +import { inject, NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatSelectModule } from '@angular/material/select'; +import { RouterModule, Routes } from '@angular/router'; +import { IqserHelpModeModule, IqserListingModule, SizePipe } from '@iqser/common-ui'; +import { TranslateModule } from '@ngx-translate/core'; import { LicenseService } from '@services/license.service'; -import { ChartComponent } from './components/chart/chart.component'; -import { NgChartsModule } from 'ng2-charts'; -import { LicenseRetentionCapacityComponent } from './components/license-retention-capacity-usage/license-retention-capacity.component'; import { DonutChartComponent } from '@shared/components/donut-chart/donut-chart.component'; -import { LicensePageUsageComponent } from './components/license-page-usage/license-page-usage.component'; +import { BaseChartDirective, provideCharts, withDefaultRegisterables } from 'ng2-charts'; +import { ChartComponent } from './components/chart/chart.component'; import { LicenseAnalysisCapacityUsageComponent } from './components/license-analysis-capacity-usage/license-analysis-capacity-usage.component'; +import { LicensePageUsageComponent } from './components/license-page-usage/license-page-usage.component'; +import { LicenseRetentionCapacityComponent } from './components/license-retention-capacity-usage/license-retention-capacity.component'; +import { LicenseSelectComponent } from './components/license-select/license-select.component'; +import { LicenseScreenComponent } from './license-screen/license-screen.component'; const routes: Routes = [ { @@ -43,8 +43,9 @@ const routes: Routes = [ IqserListingModule, IqserHelpModeModule, SizePipe, - NgChartsModule, DonutChartComponent, + BaseChartDirective, ], + providers: [provideCharts(withDefaultRegisterables())], }) export class LicenseModule {} diff --git a/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts b/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts index b1ac8d421..2490ef9fe 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts @@ -1,10 +1,11 @@ import dayjs, { Dayjs } from 'dayjs'; import { FillTarget } from 'chart.js'; import { addPaddingToArray, hexToRgba } from '@utils/functions'; -import { ILicenseReport } from '@red/domain'; +import { ILicenseData, ILicenseReport } from '@red/domain'; import { ComplexFillTarget } from 'chart.js/dist/types'; const monthNames = dayjs.monthsShort(); +const currentMonth = dayjs(Date.now()).month() + 1; export const verboseDate = (date: Dayjs) => `${monthNames[date.month()]} ${date.year()}`; @@ -49,3 +50,7 @@ export const getLabelsFromLicense = (license: ILicenseReport) => { return result; }; + +export const getDataUntilCurrentMonth = (monthlyData: ILicenseData[]) => { + return monthlyData.slice(0, currentMonth); +}; diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss index 75ad5bd0e..b68867a7c 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss @@ -1,5 +1,3 @@ -@use 'variables'; - .right-container { display: flex; width: 353px; @@ -15,21 +13,19 @@ } } -::ng-deep .page-header .actions > *:not(:last-child) { - margin-right: 6px; +::ng-deep .page-header .actions { + gap: 6px; } .action-buttons > div { display: flex; } -.cell { - &.no-role-alignment { - flex-direction: row; - justify-content: start; - align-items: center; - color: variables.$primary; - } +.cell.no-role-alignment { + flex-direction: row; + justify-content: start; + align-items: center; + color: var(--iqser-primary); } .opacity-1 { diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts index 014cee3d9..af58071a9 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts @@ -148,7 +148,7 @@ export class AnnotationActionsComponent implements OnChanges { acceptResize() { if (this.resized) { - return this.annotationActionsService.acceptResize(this.#annotations[0]); + return this.annotationActionsService.acceptResize(this.#annotations[0], this.annotationPermissions); } } diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts index b3b385268..1e3c5fd86 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts @@ -14,7 +14,7 @@ interface Engine { readonly translateParams?: Record; } -const Engines = { +export const Engines = { DICTIONARY: 'DICTIONARY', NER: 'NER', RULE: 'RULE', @@ -54,7 +54,7 @@ export class AnnotationDetailsComponent implements OnChanges { getChangesTooltip(): string | undefined { const changes = changesProperties.filter(key => this.annotation.item[key]); - if (!changes.length) { + if (!changes.length || !this.annotation.item.engines?.includes(Engines.MANUAL)) { return; } @@ -93,11 +93,6 @@ export class AnnotationDetailsComponent implements OnChanges { description: _('annotation-engines.imported'), show: isBasedOn(annotation, Engines.IMPORTED), }, - { - icon: 'red:redaction-changes', - description: _('annotation-engines.manual'), - show: isBasedOn(annotation, Engines.MANUAL), - }, ]; } } diff --git a/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-list/selected-annotations-list.component.html b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-list/selected-annotations-list.component.html new file mode 100644 index 000000000..63961a98f --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-list/selected-annotations-list.component.html @@ -0,0 +1,5 @@ + + + diff --git a/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-list/selected-annotations-list.component.scss b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-list/selected-annotations-list.component.scss new file mode 100644 index 000000000..1bbfb4ca9 --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-list/selected-annotations-list.component.scss @@ -0,0 +1,21 @@ +@use 'common-mixins'; + +cdk-virtual-scroll-viewport { + @include common-mixins.scroll-bar; +} + +:host ::ng-deep .cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper { + max-width: 100% !important; +} + +ul { + padding-left: 16px; + + li { + white-space: nowrap; + text-overflow: ellipsis; + list-style-position: inside; + overflow: hidden; + padding-right: 10px; + } +} diff --git a/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-list/selected-annotations-list.component.ts b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-list/selected-annotations-list.component.ts new file mode 100644 index 000000000..b3663cc17 --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-list/selected-annotations-list.component.ts @@ -0,0 +1,22 @@ +import { Component, Input } from '@angular/core'; +import { CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; +import { NgStyle } from '@angular/common'; + +const LIST_ITEM_SIZE = 16; +const MAX_ITEMS_DISPLAY = 5; + +@Component({ + selector: 'redaction-selected-annotations-list', + standalone: true, + imports: [CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport, NgStyle], + templateUrl: './selected-annotations-list.component.html', + styleUrl: './selected-annotations-list.component.scss', +}) +export class SelectedAnnotationsListComponent { + @Input({ required: true }) values: string[]; + protected readonly LIST_ITEM_SIZE = LIST_ITEM_SIZE; + + get redactedTextsAreaHeight() { + return this.values.length <= MAX_ITEMS_DISPLAY ? LIST_ITEM_SIZE * this.values.length : LIST_ITEM_SIZE * MAX_ITEMS_DISPLAY; + } +} diff --git a/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-table/selected-annotations-table.component.html b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-table/selected-annotations-table.component.html new file mode 100644 index 000000000..567b04b25 --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-table/selected-annotations-table.component.html @@ -0,0 +1,16 @@ + + + + + + + + + + + +
+ +
+ {{ cell.label }} +
diff --git a/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-table/selected-annotations-table.component.scss b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-table/selected-annotations-table.component.scss new file mode 100644 index 000000000..c4a571d6e --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-table/selected-annotations-table.component.scss @@ -0,0 +1,63 @@ +@use 'common-mixins'; + +table { + padding: 0 13px; + max-width: 100%; + min-width: 100%; + border-spacing: 0; + + tbody { + padding-top: 2px; + overflow-y: auto; + display: block; + @include common-mixins.scroll-bar; + } + + tr { + max-width: 100%; + min-width: 100%; + display: table; + + th { + label { + opacity: 0.7; + font-weight: normal; + } + } + + th, + td { + max-width: 0; + width: 25%; + text-align: start; + + white-space: nowrap; + text-overflow: ellipsis; + list-style-position: inside; + overflow: hidden; + + padding-right: 8px; + } + + th:last-child, + td:last-child { + max-width: 0; + width: 50%; + padding-right: 0; + } + } +} + +tbody tr:nth-child(odd) { + td { + background-color: var(--iqser-alt-background); + } +} + +.hide { + visibility: hidden; +} + +.bold { + font-weight: bold; +} diff --git a/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-table/selected-annotations-table.component.ts b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-table/selected-annotations-table.component.ts new file mode 100644 index 000000000..db71779c7 --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/components/selected-annotations-table/selected-annotations-table.component.ts @@ -0,0 +1,27 @@ +import { Component, Input } from '@angular/core'; +import { NgClass, NgForOf, NgStyle } from '@angular/common'; + +export interface ValueColumn { + label: string; + show: boolean; + bold?: boolean; +} + +const TABLE_ROW_SIZE = 18; +const MAX_ITEMS_DISPLAY = 10; + +@Component({ + selector: 'redaction-selected-annotations-table', + standalone: true, + imports: [NgForOf, NgClass, NgStyle], + templateUrl: './selected-annotations-table.component.html', + styleUrl: './selected-annotations-table.component.scss', +}) +export class SelectedAnnotationsTableComponent { + @Input({ required: true }) columns: ValueColumn[]; + @Input({ required: true }) data: ValueColumn[][]; + + get redactedTextsAreaHeight() { + return this.data.length <= MAX_ITEMS_DISPLAY ? TABLE_ROW_SIZE * this.data.length : TABLE_ROW_SIZE * MAX_ITEMS_DISPLAY; + } +} diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component.html index 2754b2475..47979cbd3 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component.html @@ -5,14 +5,7 @@
- -
    -
  • {{ text }}
  • -
-
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component.scss b/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component.scss index 79f0d48b8..e69de29bb 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component.scss @@ -1,21 +0,0 @@ -@use 'common-mixins'; - -cdk-virtual-scroll-viewport { - @include common-mixins.scroll-bar; -} - -:host ::ng-deep .cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper { - max-width: 100% !important; -} - -ul { - padding-left: 16px; -} - -li { - white-space: nowrap; - text-overflow: ellipsis; - list-style-position: inside; - overflow: hidden; - padding-right: 10px; -} diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html index c5af2cf10..1b2dc1399 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html @@ -7,16 +7,8 @@ >
-
- -
    -
  • {{ text }}
  • -
-
+
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.scss b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.scss index a313e2031..f78a044f5 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.scss @@ -6,23 +6,3 @@ overflow-y: auto; } } - -cdk-virtual-scroll-viewport { - @include common-mixins.scroll-bar; -} - -:host ::ng-deep .cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper { - max-width: 100% !important; -} - -ul { - padding-left: 16px; -} - -li { - white-space: nowrap; - text-overflow: ellipsis; - list-style-position: inside; - overflow: hidden; - padding-right: 10px; -} diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.html index e7225bb7b..8234cbb1c 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.html @@ -4,6 +4,7 @@
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.scss b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.scss index 07b46869c..033ed36b7 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.scss @@ -1,3 +1,7 @@ .full-width { width: 100%; } + +.dialog-content { + padding-top: 8px; +} diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts index 236caada2..3925d5752 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/force-redaction-dialog/force-annotation-dialog.component.ts @@ -7,6 +7,7 @@ import { Dossier, ILegalBasisChangeRequest } from '@red/domain'; import { firstValueFrom } from 'rxjs'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { Roles } from '@users/roles'; +import { ValueColumn } from '../../components/selected-annotations-table/selected-annotations-table.component'; export interface LegalBasisOption { label?: string; @@ -23,8 +24,24 @@ const DOCUMINE_LEGAL_BASIS = 'n-a.'; }) export class ForceAnnotationDialogComponent extends BaseDialogComponent implements OnInit { readonly isDocumine = getConfig().IS_DOCUMINE; - protected readonly roles = Roles; + + readonly tableColumns = [ + { + label: 'Value', + show: true, + }, + { + label: 'Type', + show: true, + }, + ]; + readonly tableData: ValueColumn[][] = this._data.annotations.map(redaction => [ + { label: redaction.value, show: true, bold: true }, + { label: redaction.typeLabel, show: true }, + ]); + legalOptions: LegalBasisOption[] = []; + protected readonly roles = Roles; constructor( private readonly _justificationsService: JustificationsService, @@ -33,7 +50,7 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen private readonly _data: { readonly dossier: Dossier; readonly hint: boolean; annotations: AnnotationWrapper[] }, ) { super(_dialogRef); - this.form = this._getForm(); + this.form = this.#getForm(); } get isHintDialog() { @@ -66,17 +83,17 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen } save() { - this._dialogRef.close(this._createForceRedactionRequest()); + this._dialogRef.close(this.#createForceRedactionRequest()); } - private _getForm(): UntypedFormGroup { + #getForm(): UntypedFormGroup { return this._formBuilder.group({ reason: this._data.hint ? ['Forced Hint'] : [null, !this.isDocumine ? Validators.required : null], comment: [null], }); } - private _createForceRedactionRequest(): ILegalBasisChangeRequest { + #createForceRedactionRequest(): ILegalBasisChangeRequest { const request: ILegalBasisChangeRequest = {}; request.legalBasis = !this.isDocumine ? this.form.get('reason').value.legalBasis : DOCUMINE_LEGAL_BASIS; diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.html index 17664b739..3b505bc23 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-recommendation-dialog/redact-recommendation-dialog.component.html @@ -3,9 +3,8 @@
-
- - {{ selectedText }} +
+
annotation.value); readonly form = inject(FormBuilder).group({ selectedText: this.isMulti ? null : this.firstEntry.value, comment: [null], diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html index 96dee3775..4454477ce 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html @@ -8,7 +8,11 @@ [class.fixed-height-36]="dictionaryRequest" [ngClass]="isEditingSelectedText ? 'flex relative' : 'flex-align-items-center'" > - +
    +
  • + +
  • +