From 95d0d1edf8c273f33e5cce24615dfd6d4a1e52a5 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Wed, 19 Jul 2023 12:31:51 +0300 Subject: [PATCH 1/5] Icons updates --- apps/red-ui/src/app/app.module.ts | 11 ++++++++++- .../file-preview/services/file-data.service.ts | 12 ++++++------ .../app/services/dossiers/dossier-changes.service.ts | 6 +++++- .../assets/icons/general/pdftron-action-add-hint.svg | 4 ++-- .../icons/general/pdftron-action-add-redaction.svg | 2 +- docker/red-ui/Dockerfile | 2 +- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index f1b55a336..469f657d1 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -144,7 +144,7 @@ export const appModuleFactory = (config: AppConfig) => { enabled: false, }, PDF: { - enabled: true, + enabled: false, }, FILE: { enabled: true, @@ -155,6 +155,15 @@ export const appModuleFactory = (config: AppConfig) => { STATS: { enabled: false, }, + REDACTION_LOG: { + enabled: false, + }, + VIEWED_PAGES: { + enabled: false, + }, + PAGES: { + enabled: false, + }, }, } as ILoggerConfig, }, diff --git a/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts b/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts index 63cff5a04..aeec3258d 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/file-data.service.ts @@ -43,14 +43,14 @@ export function chronologicallyBy(property: (x: T) => string) { @Injectable() export class FileDataService extends EntitiesService { + readonly #annotations = signal([]); + readonly #earmarks = signal>(new Map()); + #originalViewedPages: ViewedPage[] = []; + protected readonly _entityClass = AnnotationWrapper; missingTypes = new Set(); readonly earmarks: Signal>; readonly annotations: Signal; readonly annotations$: Observable; - protected readonly _entityClass = AnnotationWrapper; - readonly #annotations = signal([]); - readonly #earmarks = signal>(new Map()); - #originalViewedPages: ViewedPage[] = []; constructor( private readonly _state: FilePreviewStateService, @@ -155,12 +155,12 @@ export class FileDataService extends EntitiesService implements O changes.map(change => this.#load(change.dossierId).pipe(removeIfNotFound(change.dossierId))); return this.hasChangesDetails$().pipe( - tap(changes => this.#logger.info('[CHANGES] Dossier changes', changes)), + tap(changes => this.#logger.info('[DOSSIERS_CHANGES] Found changes', changes)), switchMap(dossierChanges => forkJoin([...load(dossierChanges), this.#dashboardStatsService.loadAll().pipe(take(1))]).pipe(map(() => dossierChanges)), ), @@ -45,9 +45,13 @@ export class DossiersChangesService extends GenericService implements O hasChangesDetails$(): Observable { const body = { value: this._lastCheckedForChanges.get(ROOT_CHANGES_KEY) }; const dateBeforeRequest = new Date(Date.now() - LAST_CHECKED_OFFSET).toISOString(); + + this.#logger.info('[DOSSIERS_CHANGES] Check with Last Checked Date', body.value); + return this._post(body, `${this._defaultModelPath}/changes/details`).pipe( filter(changes => changes.length > 0), tap(() => this._lastCheckedForChanges.set(ROOT_CHANGES_KEY, dateBeforeRequest)), + tap(() => this.#logger.info('[DOSSIERS_CHANGES] Save Last Checked Date value', dateBeforeRequest)), ); } diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-add-hint.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-add-hint.svg index 1fe57ac1b..e90c4b123 100644 --- a/apps/red-ui/src/assets/icons/general/pdftron-action-add-hint.svg +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-add-hint.svg @@ -2,8 +2,8 @@ - - + H diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-add-redaction.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-add-redaction.svg index 584946975..8e984bddf 100644 --- a/apps/red-ui/src/assets/icons/general/pdftron-action-add-redaction.svg +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-add-redaction.svg @@ -3,7 +3,7 @@ xmlns="http://www.w3.org/2000/svg"> - R diff --git a/docker/red-ui/Dockerfile b/docker/red-ui/Dockerfile index 5d023e232..730dfb3bc 100644 --- a/docker/red-ui/Dockerfile +++ b/docker/red-ui/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12-buster as builder +FROM node:20.4-buster as builder WORKDIR /ng-app From a5f3747c02c030f90d57d3bba377728035f163df Mon Sep 17 00:00:00 2001 From: George Date: Wed, 19 Jul 2023 12:37:31 +0300 Subject: [PATCH 2/5] DM-336, change workload icons and web-viewer add annotation icon. --- .../file-preview/services/pdf-proxy.service.ts | 2 +- apps/red-ui/src/assets/i18n/scm/en.json | 2 +- .../icons/general/pdftron-action-add-annotation.svg | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 apps/red-ui/src/assets/icons/general/pdftron-action-add-annotation.svg diff --git a/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts b/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts index b21363ca4..2d15c7a65 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts @@ -48,7 +48,7 @@ export class PdfProxyService { readonly #visibilityIcon = this._convertPath('/assets/icons/general/visibility.svg'); readonly #falsePositiveIcon = this._convertPath('/assets/icons/general/pdftron-action-false-positive.svg'); readonly #addRedactionIcon = this._iqserPermissionsService.has(Roles.getRss) - ? this._convertPath('/assets/icons/general/pdftron-action-add-component.svg') + ? this._convertPath('/assets/icons/general/pdftron-action-add-annotation.svg') : this._convertPath('/assets/icons/general/pdftron-action-add-redaction.svg'); readonly #addHintIcon = this._convertPath('/assets/icons/general/pdftron-action-add-hint.svg'); readonly annotationSelected$ = this.#annotationSelected$; diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 0df0808b5..dfb58e68e 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -1936,7 +1936,7 @@ "title": "Redact text" } }, - "redaction-abbreviation": "C", + "redaction-abbreviation": "A", "references": "{count} {count, plural, one{reference} other{references}}", "remove-redaction": { "dialog": { diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-add-annotation.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-add-annotation.svg new file mode 100644 index 000000000..0470f2fe2 --- /dev/null +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-add-annotation.svg @@ -0,0 +1,11 @@ + + + + + + A + + + From d0e06bd6a99fc917983d9bc19360f11eacc8795e Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Wed, 19 Jul 2023 14:39:40 +0300 Subject: [PATCH 3/5] RED-6382: Fixed ctrl+click functionality. --- .../file-attribute/file-attribute.component.html | 7 ++++++- .../components/file-attribute/file-attribute.component.ts | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.html b/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.html index e27032dd8..d830632cb 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.html +++ b/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.html @@ -1,5 +1,10 @@ -
+
{{ fileAttribute.label }}: Date: Wed, 19 Jul 2023 16:11:22 +0300 Subject: [PATCH 4/5] RED-7051 & RED-7138 scroll page indicators & hide chip focus --- .../components/pages/pages.component.ts | 21 +++++++++++++++++-- .../download-dialog.component.ts | 3 +-- libs/common-ui | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/pages/pages.component.ts b/apps/red-ui/src/app/modules/file-preview/components/pages/pages.component.ts index b268b15db..43974fe89 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/pages/pages.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/pages/pages.component.ts @@ -1,4 +1,4 @@ -import { Component, inject, Input } from '@angular/core'; +import { AfterViewInit, Component, inject, Input } from '@angular/core'; import { List } from '@iqser/common-ui/lib/utils'; import { PdfViewer } from '../../../pdf-viewer/services/pdf-viewer.service'; import { MultiSelectService } from '../../services/multi-select.service'; @@ -7,13 +7,14 @@ import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { FilePreviewStateService } from '../../services/file-preview-state.service'; import { ViewedPagesMapService } from '@services/files/viewed-pages-map.service'; import { ViewedPage } from '@red/domain'; +import scrollIntoView from 'scroll-into-view-if-needed'; @Component({ selector: 'redaction-pages', templateUrl: './pages.component.html', styleUrls: ['./pages.component.scss'], }) -export class PagesComponent { +export class PagesComponent implements AfterViewInit { readonly #state = inject(FilePreviewStateService); readonly #multiSelectService = inject(MultiSelectService); readonly #listingService = inject(AnnotationsListingService); @@ -22,6 +23,22 @@ export class PagesComponent { @Input({ required: true }) displayedAnnotations: Map; readonly viewedPages$ = inject(ViewedPagesMapService).get$(this.#state.fileId); + ngAfterViewInit() { + setTimeout(() => { + this.scrollToLastViewedPage(); + }, 100); + } + + scrollToLastViewedPage() { + const currentPdfPage = this._pdf.currentPage(); + scrollIntoView(document.getElementById(`quick-nav-page-${currentPdfPage}`), { + behavior: 'smooth', + scrollMode: 'if-needed', + block: 'start', + inline: 'start', + }); + } + pageSelectedByClick($event: number): void { this._pdf.navigateTo($event); } diff --git a/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.ts index 8485050a4..2af424ef7 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.ts @@ -76,12 +76,11 @@ export class DownloadDialogComponent extends IqserDialogComponent type === DownloadFileTypes.REDACTED); - return !hasReportTypes || (onlyRedactedVersionSelected && !this.hasApprovedFiles); + return onlyRedactedVersionSelected && !this.hasApprovedFiles; } override get valid() { diff --git a/libs/common-ui b/libs/common-ui index e69f8b3f0..fd4491b2a 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit e69f8b3f0df8701bbc3dbc79e2239aaad3acc889 +Subproject commit fd4491b2a39792ffe3ef76155c1572a45e38406e From 858809a80ed9ace47dd91e7050f3995ca50f904e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 19 Jul 2023 19:29:40 +0300 Subject: [PATCH 5/5] RED-6830: Fixes for license information --- .../components/chart/chart.component.ts | 2 + .../license-capacity.component.html | 62 +++++++++++++++ .../license-capacity.component.scss | 49 ++++++++++++ ...onent.ts => license-capacity.component.ts} | 28 +++---- .../license-storage.component.html | 48 ------------ .../license-storage.component.scss | 38 --------- .../license-usage.component.html | 78 ++++++++++--------- .../license-usage.component.scss | 55 +++++++------ .../license-screen.component.html | 9 ++- .../admin/screens/license/license.module.ts | 4 +- .../donut-chart/donut-chart.component.html | 4 + .../donut-chart/donut-chart.component.ts | 17 ++-- .../src/app/services/license.service.ts | 42 +++++----- apps/red-ui/src/assets/i18n/redact/de.json | 25 +++--- apps/red-ui/src/assets/i18n/redact/en.json | 25 +++--- apps/red-ui/src/assets/i18n/scm/de.json | 27 +++---- apps/red-ui/src/assets/i18n/scm/en.json | 27 +++---- 17 files changed, 283 insertions(+), 257 deletions(-) create mode 100644 apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.html create mode 100644 apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.scss rename apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/{license-storage.component.ts => license-capacity.component.ts} (84%) delete mode 100644 apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.html delete mode 100644 apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.scss diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/chart/chart.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/components/chart/chart.component.ts index fb9a9e314..1cda6e89a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/chart/chart.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/chart/chart.component.ts @@ -41,6 +41,7 @@ export class ChartComponent implements OnChanges { text: this.yAxisLabel, padding: { bottom: 20 }, }, + min: 0, }, y1: { display: this.secondaryAxis, @@ -50,6 +51,7 @@ export class ChartComponent implements OnChanges { text: this.yAxisLabelRight, padding: { bottom: 20 }, }, + min: 0, }, }, plugins: { diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.html b/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.html new file mode 100644 index 000000000..66f61dd5c --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.html @@ -0,0 +1,62 @@ +
+
+ +
+
+
{{ licenseService.currentLicenseReport.activeFilesUploadedBytes | size }}
+
+ +
+
+
{{ licenseService.currentLicenseReport.archivedFilesUploadedBytes | size }}
+
+
+
+
{{ licenseService.currentLicenseReport.trashFilesUploadedBytes | size }}
+
+ +
+
+
+ {{ licenseService.currentLicenseReport.totalFilesUploadedBytes | size }} + + ({{ uploadedBytesCapacityPercentage | number : '1.0-2' }}%) + +
+
+ +
+ +
+ +
+ +
+
+ + + + {{ 'license-info-screen.capacity.storage-capacity' | translate }} + + + + + {{ 'license-info-screen.capacity.exceeded-capacity' | translate }} + + + diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.scss b/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.scss new file mode 100644 index 000000000..eb954eec9 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.scss @@ -0,0 +1,49 @@ +:host { + display: contents; +} + +.grid-container { + width: calc(100% - 40px); + display: grid; + grid-template-columns: 1fr 2fr 2fr; + margin: 20px; + + .donut-chart-wrapper { + grid-row: 2 / span 4; + grid-column: 3; + width: fit-content; + } + + .row { + display: contents; + + > div { + padding: 8px 20px; + + &:first-of-type { + font-weight: 600; + } + } + + &:hover { + > div { + background-color: var(--iqser-alt-background); + } + } + } + + .section-title { + grid-column: span 3; + padding: 20px 20px 8px; + margin-bottom: 8px; + border-bottom: 1px solid var(--iqser-separator); + } + + redaction-chart { + grid-column: span 3; + } +} + +.exceeded-capacity { + color: var(--iqser-red-1); +} diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.ts similarity index 84% rename from apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.ts rename to apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.ts index 4795e4b96..912c03c6a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-capacity.component.ts @@ -10,15 +10,15 @@ import { getLabelsFromLicense, getLineConfig } from '../../utils/functions'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ - selector: 'red-license-storage', - templateUrl: './license-storage.component.html', - styleUrls: ['./license-storage.component.scss'], + selector: 'red-license-capacity', + templateUrl: './license-capacity.component.html', + styleUrls: ['./license-capacity.component.scss'], }) -export class LicenseStorageComponent { +export class LicenseCapacityComponent { readonly formatSize = size; uploadedBytesCapacityPercentage = -1; donutChartConfig: DonutChartConfig[] = []; - readonly data$ = this.licenseService.licenseData$.pipe( + readonly data$ = this.licenseService.selectedLicense$.pipe( map(() => this.licenseService.currentLicenseReport), tap(license => { this.uploadedBytesCapacityPercentage = this.#getUploadedBytesCapacityPercentage(license); @@ -44,22 +44,22 @@ export class LicenseStorageComponent { { value: license.activeFilesUploadedBytes, color: ChartGreen, - label: this._translateService.instant(_('license-info-screen.storage.active-documents')), + label: this._translateService.instant(_('license-info-screen.capacity.active-documents')), }, { value: license.archivedFilesUploadedBytes, color: ChartBlue, - label: this._translateService.instant(_('license-info-screen.storage.archived-documents')), + label: this._translateService.instant(_('license-info-screen.capacity.archived-documents')), }, { value: license.trashFilesUploadedBytes, color: ChartRed, - label: this._translateService.instant(_('license-info-screen.storage.trash-documents')), + label: this._translateService.instant(_('license-info-screen.capacity.trash-documents')), }, { - value: this.licenseService.uploadedBytesCapacity - license.totalFilesUploadedBytes, + value: Math.max(this.licenseService.uploadedBytesCapacity - license.totalFilesUploadedBytes, 0), color: ChartGrey, - label: this._translateService.instant(_('license-info-screen.storage.unused')), + label: this._translateService.instant(_('license-info-screen.capacity.unused')), }, ]; } @@ -70,25 +70,25 @@ export class LicenseStorageComponent { return [ { data: monthlyData.flatMap(d => d.activeFilesUploadedBytes), - label: this._translateService.instant('license-info-screen.storage.active-documents'), + label: this._translateService.instant('license-info-screen.capacity.active-documents'), ...getLineConfig(ChartGreen, false, 'origin'), stack: 'storage', }, { data: monthlyData.flatMap(d => d.archivedFilesUploadedBytes), - label: this._translateService.instant('license-info-screen.storage.archived-documents'), + label: this._translateService.instant('license-info-screen.capacity.archived-documents'), ...getLineConfig(ChartBlue, false, '-1'), stack: 'storage', }, { data: monthlyData.flatMap(d => d.trashFilesUploadedBytes), - label: this._translateService.instant('license-info-screen.storage.trash-documents'), + label: this._translateService.instant('license-info-screen.capacity.trash-documents'), ...getLineConfig(ChartRed, false, '-1'), stack: 'storage', }, { data: monthlyData.flatMap(d => d.activeFilesUploadedBytes + d.archivedFilesUploadedBytes + d.trashFilesUploadedBytes), - label: this._translateService.instant('license-info-screen.storage.all-documents'), + label: this._translateService.instant('license-info-screen.capacity.all-documents'), ...getLineConfig(ChartBlack, true, false), borderWidth: 2, }, diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.html b/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.html deleted file mode 100644 index 821f0489e..000000000 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.html +++ /dev/null @@ -1,48 +0,0 @@ -
- -
-
-
{{ licenseService.currentLicenseReport.activeFilesUploadedBytes | size }}
-
- -
-
-
{{ licenseService.currentLicenseReport.archivedFilesUploadedBytes | size }}
-
-
-
-
{{ licenseService.currentLicenseReport.trashFilesUploadedBytes | size }}
-
- -
-
-
- {{ licenseService.currentLicenseReport.totalFilesUploadedBytes | size }} - - ({{ uploadedBytesCapacityPercentage | number : '1.0-2' }}%) - -
-
- -
- -
- -
- -
diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.scss b/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.scss deleted file mode 100644 index c0a071ff5..000000000 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-storage/license-storage.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -:host { - display: contents; -} - -.donut-chart-wrapper { - grid-row: 11 / span 4; - grid-column: 3; - width: fit-content; -} - -.row { - display: contents; - - > div { - padding: 8px 20px; - - &:first-of-type { - font-weight: 600; - } - } - - &:hover { - > div { - background-color: var(--iqser-alt-background); - } - } -} - -.section-title { - grid-column: span 3; - padding: 20px 20px 8px; - margin-bottom: 8px; - border-bottom: 1px solid var(--iqser-separator); -} - -redaction-chart { - grid-column: span 3; -} diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-usage/license-usage.component.html b/apps/red-ui/src/app/modules/admin/screens/license/components/license-usage/license-usage.component.html index 9aeee0700..6f979cc53 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-usage/license-usage.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-usage/license-usage.component.html @@ -1,41 +1,43 @@ -
+
+
-
-
-
- {{ licenseService.analyzedPagesInCurrentLicensingPeriod }} - ({{ analysisPercentageOfLicense$ | async | number : '1.0-2' }}%) +
+
+
+ {{ licenseService.analyzedPagesInCurrentLicensingPeriod }} + ({{ analysisPercentageOfLicense$ | async | number : '1.0-2' }}%) +
+
+ +
+
+
{{ licenseService.currentLicenseReport.numberOfOcrPages }}
+
+ +
+
+
{{ licenseService.unlicensedPages }}
+
+ +
+
+ +
{{ licenseService.allLicensesReport.numberOfAnalyzedPages }}
+
+ +
+
+
{{ licenseService.allLicensesReport.numberOfOcrPages }}
+
+ +
+
- -
-
-
{{ licenseService.currentLicenseReport.numberOfOcrPages }}
-
- -
-
-
{{ licenseService.unlicensedPages }}
-
- -
-
- -
{{ licenseService.allLicensesReport.numberOfAnalyzedPages }}
-
- -
-
-
{{ licenseService.allLicensesReport.numberOfOcrPages }}
-
- -
- -
diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-usage/license-usage.component.scss b/apps/red-ui/src/app/modules/admin/screens/license/components/license-usage/license-usage.component.scss index 2a35a4526..bdd488e9c 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-usage/license-usage.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-usage/license-usage.component.scss @@ -2,35 +2,42 @@ display: contents; } -.row { - display: contents; +.grid-container { + width: calc(100% - 40px); + display: grid; + grid-template-columns: 1fr 2fr 2fr; + margin: 20px; - > div { - padding: 8px 20px; + .row { + display: contents; - &:first-of-type { - font-weight: 600; - } - - &:nth-child(2) { - grid-column: span 2; - } - } - - &:hover { > div { - background-color: var(--iqser-alt-background); + padding: 8px 20px; + + &:first-of-type { + font-weight: 600; + } + + &:nth-child(2) { + grid-column: span 2; + } + } + + &:hover { + > div { + background-color: var(--iqser-alt-background); + } } } -} -.section-title { - grid-column: span 3; - padding: 20px 20px 8px; - margin-bottom: 8px; - border-bottom: 1px solid var(--iqser-separator); -} + .section-title { + grid-column: span 3; + padding: 20px 20px 8px; + margin-bottom: 8px; + border-bottom: 1px solid var(--iqser-separator); + } -redaction-chart { - grid-column: span 3; + redaction-chart { + grid-column: span 3; + } } diff --git a/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.html index 7a642fc4b..4c210d01e 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.html @@ -61,9 +61,14 @@
{{ licenseService.totalLicensedNumberOfPages }}
- - +
+
{{ 'license-info-screen.licensed-capacity' | translate }}
+
{{ licenseService.uploadedBytesCapacity | size }}
+
+ + +
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 6ac357a00..70a40d2f9 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 @@ -10,7 +10,7 @@ import { CommonModule } from '@angular/common'; import { LicenseService } from '@services/license.service'; import { ChartComponent } from './components/chart/chart.component'; import { NgChartsModule } from 'ng2-charts'; -import { LicenseStorageComponent } from './components/license-storage/license-storage.component'; +import { LicenseCapacityComponent } from './components/license-storage/license-capacity.component'; import { LicenseUsageComponent } from './components/license-usage/license-usage.component'; import { DonutChartComponent } from '@shared/components/donut-chart/donut-chart.component'; @@ -25,7 +25,7 @@ const routes: Routes = [ ]; @NgModule({ - declarations: [LicenseScreenComponent, LicenseSelectComponent, ChartComponent, LicenseStorageComponent, LicenseUsageComponent], + declarations: [LicenseScreenComponent, LicenseSelectComponent, ChartComponent, LicenseCapacityComponent, LicenseUsageComponent], imports: [ RouterModule.forChild(routes), CommonModule, diff --git a/apps/red-ui/src/app/modules/shared/components/donut-chart/donut-chart.component.html b/apps/red-ui/src/app/modules/shared/components/donut-chart/donut-chart.component.html index 2de1a0ff6..b744b9f11 100644 --- a/apps/red-ui/src/app/modules/shared/components/donut-chart/donut-chart.component.html +++ b/apps/red-ui/src/app/modules/shared/components/donut-chart/donut-chart.component.html @@ -21,6 +21,10 @@
{{ getFormattedValue(displayedDataTotal) }}
{{ subtitles[0] }}
+
+ +
+ string; + @Input() subtitleTemplate?: TemplateRef; @Output() readonly subtitleChanged = new EventEmitter(); @@ -36,10 +37,6 @@ export class DonutChartComponent implements OnChanges, OnInit { size = 0; filters$: Observable; - constructor(@Optional() readonly filterService: FilterService) { - // TODO: move this component to a separate module, split into smaller components, improve filters - } - get circumference(): number { return 2 * Math.PI * this.radius; } @@ -52,6 +49,10 @@ export class DonutChartComponent implements OnChanges, OnInit { return this.totalType === 'sum' ? this.dataTotal : this.config.length; } + constructor(@Optional() readonly filterService: FilterService) { + // TODO: move this component to a separate module, split into smaller components, improve filters + } + ngOnInit() { const filterModels$ = this.filterService?.getFilterModels$(this.filterKey).pipe( map(filters => filters ?? []), diff --git a/apps/red-ui/src/app/services/license.service.ts b/apps/red-ui/src/app/services/license.service.ts index d2cabf2b8..fbcd8d306 100644 --- a/apps/red-ui/src/app/services/license.service.ts +++ b/apps/red-ui/src/app/services/license.service.ts @@ -40,11 +40,6 @@ const defaultOnError: ILicenses = { providedIn: 'root', }) export class LicenseService extends GenericService { - readonly #licenseData$ = new BehaviorSubject(undefined); - readonly #selectedLicense$ = new BehaviorSubject(undefined); - readonly #logger = inject(NGXLogger); - readonly #toaster = inject(Toaster); - protected readonly _defaultModelPath = 'report'; readonly licenseData$: Observable; readonly selectedLicense$: Observable; activeLicenseId: string; @@ -53,29 +48,21 @@ export class LicenseService extends GenericService { allLicensesReport: ILicenseReport = {}; unlicensedPages = 0; analyzedPagesInCurrentLicensingPeriod = 0; - uploadedBytesCapacity = 0; - - constructor() { - super(); - this.selectedLicense$ = this.#selectedLicense$.pipe(filter(license => !!license)); - this.licenseData$ = this.#licenseData$.pipe( - filter(licenses => !!licenses), - tap(data => (this.activeLicenseId = data.activeLicense)), - tap(() => { - const activeLicense = this.activeLicense; - if (!activeLicense) { - return; - } - const uploadedBytesCapacity = this.activeLicense.features.find(f => f.name === 'uploadedBytesCapacity')?.value; - this.uploadedBytesCapacity = uploadedBytesCapacity ? parseInt(uploadedBytesCapacity, 10) : 0; - }), - ); - } + protected readonly _defaultModelPath = 'report'; + readonly #licenseData$ = new BehaviorSubject(undefined); + readonly #selectedLicense$ = new BehaviorSubject(undefined); + readonly #logger = inject(NGXLogger); + readonly #toaster = inject(Toaster); get selectedLicense() { return this.#selectedLicense$.value; } + get uploadedBytesCapacity(): number { + const uploadedBytesCapacity = this.selectedLicense.features.find(f => f.name === 'uploadedBytesCapacity')?.value || '0'; + return parseInt(uploadedBytesCapacity, 10); + } + get activeLicense() { if (!this.#licenseData$.value) { return undefined; @@ -94,6 +81,15 @@ export class LicenseService extends GenericService { return activeLicense.features.find(f => f.name === 'pdftron').value; } + constructor() { + super(); + this.selectedLicense$ = this.#selectedLicense$.pipe(filter(license => !!license)); + this.licenseData$ = this.#licenseData$.pipe( + filter(licenses => !!licenses), + tap(data => (this.activeLicenseId = data.activeLicense)), + ); + } + async loadLicenseData(license: ILicense = this.selectedLicense) { this.totalLicensedNumberOfPages = this.getTotalLicensedNumberOfPages(license); diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index e768b6a87..81eb0aa52 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -208,9 +208,6 @@ "accept-recommendation": { "label": "Empfehlung annehmen" }, - "accept-suggestion": { - "label": "Genehmigen und zum Wörterbuch hinzufügen" - }, "convert-highlights": { "label": "" }, @@ -328,7 +325,6 @@ } }, "recategorize-image": "neu kategorisieren", - "reject-suggestion": "Vorschlag ablehnen", "remove-annotation": { "remove-redaction": "" }, @@ -477,7 +473,6 @@ "heading-with-name-and-link": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie {adminName}, um den Zugang anzufordern!", "logout": "Ausloggen" }, - "by": "von", "change-legal-basis-dialog": { "actions": { "cancel": "Abbrechen", @@ -1638,6 +1633,16 @@ }, "license-info-screen": { "backend-version": "Backend-Version der Anwendung", + "capacity-details": "", + "capacity": { + "active-documents": "", + "all-documents": "", + "archived-documents": "", + "exceeded-capacity": "", + "storage-capacity": "", + "trash-documents": "", + "unused": "" + }, "copyright-claim-text": "Copyright © 2020 - {currentYear} knecon AG (powered by IQSER)", "copyright-claim-title": "Copyright", "current-analyzed": "In aktuellem Lizenzzeitraum analysierte Seiten", @@ -1653,6 +1658,7 @@ "end-user-license-text": "Die Nutzung dieses Produkts unterliegt den Bedingungen der Endbenutzer-Lizenzvereinbarung für den RedactManager, sofern darin nichts anderweitig festgelegt.", "end-user-license-title": "Endbenutzer-Lizenzvereinbarung", "license-title": "", + "licensed-capacity": "", "licensed-page-count": "Anzahl der lizenzierten Seiten", "licensed-to": "Lizenziert für", "licensing-details": "Lizenzdetails", @@ -1667,15 +1673,6 @@ "active": "Aktiv", "inactive": "" }, - "storage-details": "", - "storage": { - "active-documents": "", - "all-documents": "", - "archived-documents": "", - "storage-capacity": "", - "trash-documents": "", - "unused": "" - }, "total-analyzed": "Seit {date} insgesamt analysierte Seiten", "total-ocr-analyzed": "", "unlicensed-analyzed": "Über Lizenz hinaus analysierte Seiten", diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index 021c6a57d..208d0bf4e 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -208,9 +208,6 @@ "accept-recommendation": { "label": "Accept Recommendation" }, - "accept-suggestion": { - "label": "Approve Suggestion" - }, "convert-highlights": { "label": "Convert Selected Earmarks" }, @@ -328,7 +325,6 @@ } }, "recategorize-image": "Recategorize", - "reject-suggestion": "Reject Suggestion", "remove-annotation": { "remove-redaction": "Remove" }, @@ -477,7 +473,6 @@ "heading-with-name-and-link": "Your user is successfully logged in but has no role assigned yet. Please contact {adminName} to assign appropriate roles.", "logout": "Logout" }, - "by": "by", "change-legal-basis-dialog": { "actions": { "cancel": "Cancel", @@ -1638,6 +1633,16 @@ }, "license-info-screen": { "backend-version": "Backend Application Version", + "capacity-details": "Capacity Details", + "capacity": { + "active-documents": "Active Documents", + "all-documents": "Retention Capacity Used", + "archived-documents": "Archived Documents", + "exceeded-capacity": "Exceeded Capacity", + "storage-capacity": "Capacity", + "trash-documents": "Documents in Trash", + "unused": "Unused Storage" + }, "copyright-claim-text": "Copyright © 2020 - {currentYear} knecon AG (powered by IQSER)", "copyright-claim-title": "Copyright Claim", "current-analyzed": "Analyzed Pages in Licensing Period", @@ -1653,6 +1658,7 @@ "end-user-license-text": "The use of this product is subject to the terms of the Redaction End User Agreement, unless otherwise specified therein.", "end-user-license-title": "End User License Agreement", "license-title": "License Title", + "licensed-capacity": "Licensed Capacity", "licensed-page-count": "Licensed Pages", "licensed-to": "Licensed to", "licensing-details": "Licensing Details", @@ -1667,15 +1673,6 @@ "active": "Active", "inactive": "Inactive" }, - "storage-details": "Storage Details", - "storage": { - "active-documents": "Active Documents", - "all-documents": "Total Storage Used", - "archived-documents": "Archived Documents", - "storage-capacity": "Storage Capacity", - "trash-documents": "Documents in Trash", - "unused": "Unused Storage" - }, "total-analyzed": "Total Analyzed Pages", "total-ocr-analyzed": "Total OCR Processed Pages", "unlicensed-analyzed": "Unlicensed Analyzed Pages", diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 2370969bb..4d505af32 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -473,7 +473,6 @@ "heading-with-name-and-link": "Ihr Benutzer verfügt nicht über die erforderlichen RED-*-Rollen, um auf diese Applikation zugreifen zu können. Bitte kontaktieren Sie {adminName}, um den Zugang anzufordern!", "logout": "Ausloggen" }, - "by": "von", "change-legal-basis-dialog": { "actions": { "cancel": "Abbrechen", @@ -1634,6 +1633,16 @@ }, "license-info-screen": { "backend-version": "Backend-Version der Anwendung", + "capacity-details": "", + "capacity": { + "active-documents": "", + "all-documents": "", + "archived-documents": "", + "exceeded-capacity": "", + "storage-capacity": "", + "trash-documents": "", + "unused": "" + }, "copyright-claim-text": "Copyright © 2020 - {currentYear} knecon AG (powered by IQSER)", "copyright-claim-title": "Copyright", "current-analyzed": "In aktuellem Lizenzzeitraum analysierte Seiten", @@ -1649,6 +1658,7 @@ "end-user-license-text": "Die Nutzung dieses Produkts unterliegt den Bedingungen der Endbenutzer-Lizenzvereinbarung für den RedactManager, sofern darin nichts anderweitig festgelegt.", "end-user-license-title": "Endbenutzer-Lizenzvereinbarung", "license-title": "", + "licensed-capacity": "", "licensed-page-count": "Anzahl der lizenzierten Seiten", "licensed-to": "Lizenziert für", "licensing-details": "Lizenzdetails", @@ -1663,15 +1673,6 @@ "active": "Aktiv", "inactive": "" }, - "storage-details": "", - "storage": { - "active-documents": "", - "all-documents": "", - "archived-documents": "", - "storage-capacity": "", - "trash-documents": "", - "unused": "" - }, "total-analyzed": "Seit {date} insgesamt analysierte Seiten", "total-ocr-analyzed": "", "unlicensed-analyzed": "Über Lizenz hinaus analysierte Seiten", @@ -2069,12 +2070,6 @@ "undo": "" }, "annotations": "", - "table-header": { - "annotation": "", - "component": "", - "transformation": "", - "value": "" - }, "title": "" }, "rules-screen": { diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index dfb58e68e..527f75897 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -473,7 +473,6 @@ "heading-with-name-and-link": "Your user is successfully logged in but has no role assigned yet. Please contact {adminName} to assign appropriate roles.", "logout": "Logout" }, - "by": "by", "change-legal-basis-dialog": { "actions": { "cancel": "Cancel", @@ -1634,6 +1633,16 @@ }, "license-info-screen": { "backend-version": "Backend Application Version", + "capacity-details": "Capacity Details", + "capacity": { + "active-documents": "Active Documents", + "all-documents": "Retention Capacity Used", + "archived-documents": "Archived Documents", + "exceeded-capacity": "Exceeded Capacity", + "storage-capacity": "Capacity", + "trash-documents": "Documents in Trash", + "unused": "Unused Storage" + }, "copyright-claim-text": "Copyright © 2020 - {currentYear} knecon AG (powered by IQSER)", "copyright-claim-title": "Copyright Claim", "current-analyzed": "Analyzed Pages in Licensing Period", @@ -1649,6 +1658,7 @@ "end-user-license-text": "The use of this product is subject to the terms of the Component End User Agreement, unless otherwise specified therein.", "end-user-license-title": "End User License Agreement", "license-title": "License Title", + "licensed-capacity": "Licensed Capacity", "licensed-page-count": "Licensed pages", "licensed-to": "Licensed to", "licensing-details": "Licensing Details", @@ -1663,15 +1673,6 @@ "active": "Active", "inactive": "Inactive" }, - "storage-details": "Storage Details", - "storage": { - "active-documents": "Active Documents", - "all-documents": "Total Storage Used", - "archived-documents": "Archived Documents", - "storage-capacity": "Storage Capacity", - "trash-documents": "Documents in Trash", - "unused": "Unused Storage" - }, "total-analyzed": "Total Analyzed Pages Since {date}", "total-ocr-analyzed": "Total OCR Processed Pages Since {date}", "unlicensed-analyzed": "Unlicensed Analyzed Pages", @@ -2069,12 +2070,6 @@ "undo": "Undo to: {value}" }, "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}", - "table-header": { - "annotation-references": "Annotation references", - "component": "Component", - "transformation-rule": "Transformation rule", - "value": "Value" - }, "title": "Structured Component Management" }, "rules-screen": {