From 784853ad9965bc63019a3dff1a1b5034a55a9af4 Mon Sep 17 00:00:00 2001 From: Kevin Tumma Date: Fri, 14 Jul 2023 09:05:21 +0000 Subject: [PATCH 1/7] Add renovate.json --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..39a2b6e9a --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ] +} From f0cb21c70616d335b4a41091a9e8ee56a3a74543 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 17 Jul 2023 14:03:54 +0300 Subject: [PATCH 2/7] RED-6382: Fixed edit file attribute sizing. --- .../components/file-attribute/file-attribute.component.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.scss b/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.scss index 6049cf0ba..a4410d2b2 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.scss +++ b/apps/red-ui/src/app/modules/dossier-overview/components/file-attribute/file-attribute.component.scss @@ -183,3 +183,9 @@ .hide { visibility: hidden; } + +@media screen and (max-width: 1395px) { + .file-attribute .edit-input form .workflow-input { + width: 63%; + } +} From 095e84907d554fd1a920d9d0ea7331e5f53937c6 Mon Sep 17 00:00:00 2001 From: George Date: Mon, 17 Jul 2023 14:25:30 +0300 Subject: [PATCH 3/7] RED-7120, update common ui. --- libs/common-ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/common-ui b/libs/common-ui index a8f5fb2e2..83f13eda4 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit a8f5fb2e25cd1f150c1099d387b4f9dece3b922c +Subproject commit 83f13eda4f173fbe12d931334ef49e609ed9df56 From 45a36b8fb3c31d12a03e2d7e1e95e1405b77c552 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Mon, 17 Jul 2023 17:13:33 +0300 Subject: [PATCH 4/7] RED-6713 & RED-7138 --- .../download-dialog.component.ts | 30 +++++++++++-------- apps/red-ui/src/assets/config/config.json | 6 ++-- libs/common-ui | 2 +- 3 files changed, 22 insertions(+), 16 deletions(-) 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 806d188a4..5faffcf73 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 @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, inject } from '@angular/core'; import { Dossier, DownloadFileType, DownloadFileTypes, File, IReportTemplate, WorkflowFileStatuses } from '@red/domain'; import { downloadTypesForDownloadTranslations } from '@translations/download-types-translations'; import { ReportTemplateService } from '@services/report-template.service'; @@ -7,6 +7,7 @@ import { DefaultColorsService } from '@services/entity-services/default-colors.s import { IconButtonTypes, IqserDialogComponent } from '@iqser/common-ui'; import { Roles } from '@users/roles'; import { List } from '@iqser/common-ui/lib/utils'; +import { NGXLogger } from 'ngx-logger'; export interface DownloadDialogData { readonly dossier: Dossier; @@ -24,10 +25,13 @@ export interface DownloadDialogResult { styleUrls: ['./download-dialog.component.scss'], }) export class DownloadDialogComponent extends IqserDialogComponent { + readonly #logger = inject(NGXLogger); readonly iconButtonTypes = IconButtonTypes; readonly downloadTypes: { key: DownloadFileType; label: string }[] = this.#formDownloadTypes; readonly availableReportTypes = this.#availableReportTypes; readonly form = this.#getForm(); + readonly hasApprovedFiles = this.data.files.some(file => file.workflowStatus === WorkflowFileStatuses.APPROVED); + initialFormValue = this.form.getRawValue(); readonly roles = Roles; @@ -52,12 +56,12 @@ export class DownloadDialogComponent extends IqserDialogComponent type === DownloadFileTypes.REDACTED) && - !this.data.files.some(file => file.workflowStatus === WorkflowFileStatuses.APPROVED) - ); + const hasReportTypes = this.form.controls.reportTemplateIds.value.length; + const downloadFileTypes = this.form.controls.downloadFileTypes.value; + const onlyRedactedVersionSelected = + downloadFileTypes.length && downloadFileTypes.every(type => type === DownloadFileTypes.REDACTED); + + return !hasReportTypes || (onlyRedactedVersionSelected && !this.hasApprovedFiles); } override get valid() { @@ -77,7 +81,7 @@ export class DownloadDialogComponent extends IqserDialogComponent { - if (!this.data.files.some(file => file.workflowStatus === WorkflowFileStatuses.APPROVED)) { + if (!this.hasApprovedFiles) { return type.key !== DownloadFileTypes.REDACTED; } return true; @@ -86,7 +90,7 @@ export class DownloadDialogComponent extends IqserDialogComponent { - if (!this.data.files.some(file => file.workflowStatus === WorkflowFileStatuses.APPROVED)) { + if (!this.hasApprovedFiles) { return type !== DownloadFileTypes.REDACTED; } return true; @@ -99,18 +103,20 @@ export class DownloadDialogComponent extends IqserDialogComponent reportTemplate.templateId; - close() { + override close() { const result: DownloadDialogResult = { reportTemplateIds: this.form.controls.reportTemplateIds.value, downloadFileTypes: this.form.controls.downloadFileTypes.value, redactionPreviewColor: this.form.controls.redactionPreviewColor.value, }; + this.#logger.info('[DOWNLOAD] Closing with result', result); + if (result.reportTemplateIds.length === 0) { - return this.dialogRef.close(); + return super.close(); } - this.dialogRef.close(result); + super.close(result); } #hasReportTemplateOrDownloadType(control: AbstractControl) { diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 3e5de8134..570c25302 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,8 +1,8 @@ { "ADMIN_CONTACT_NAME": null, "ADMIN_CONTACT_URL": null, - "API_URL": "https://dev-04.iqser.cloud", - "APP_NAME": "RedactManager", + "API_URL": "https://dan.iqser.cloud", + "APP_NAME": "RedactManager very very very very long", "AUTO_READ_TIME": 3, "BACKEND_APP_VERSION": "4.4.40", "EULA_URL": "EULA_URL", @@ -11,7 +11,7 @@ "MAX_RETRIES_ON_SERVER_ERROR": 3, "OAUTH_CLIENT_ID": "redaction", "OAUTH_IDP_HINT": null, - "OAUTH_URL": "https://dev-04.iqser.cloud/auth", + "OAUTH_URL": "https://dan.iqser.cloud/auth", "RECENT_PERIOD_IN_HOURS": 24, "SELECTION_MODE": "structural", "MANUAL_BASE_URL": "https://docs.redactmanager.com/preview", diff --git a/libs/common-ui b/libs/common-ui index 83f13eda4..dc5f14c69 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 83f13eda4f173fbe12d931334ef49e609ed9df56 +Subproject commit dc5f14c696df0bba4609a9ac95d784228d75d3a3 From 7a8fb389b705bb504d39f7b6655594677aa3fb80 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 17 Jul 2023 17:29:04 +0300 Subject: [PATCH 5/7] RED-6973: Fixed enter not submitting the form. --- .../file-attribute/file-attribute.component.html | 2 +- .../file-attribute/file-attribute.component.ts | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) 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 b4c80aaa1..e27032dd8 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 @@ -40,7 +40,7 @@
-
+ { const attrValue = fileAttributes[key]; - config[key] = [ - dayjs(attrValue, 'YYYY-MM-DD', true).isValid() ? dayjs(attrValue).toDate() : attrValue, - Validators.pattern(/^(\s+\S+\s*)*(?!\s).*$/), - ]; + config[key] = [dayjs(attrValue, 'YYYY-MM-DD', true).isValid() ? dayjs(attrValue).toDate() : attrValue]; + }); + return this._formBuilder.group(config, { + validators: control => + control.get(this.fileAttribute.id).value && + !control.get(this.fileAttribute.id).value.trim().length && + !this.fileAttributeValue + ? { emptyString: true } + : null, }); - return this._formBuilder.group(config); } #formatAttributeValue(attrValue) { - return this.isDate ? attrValue && dayjs(attrValue).format('YYYY-MM-DD') : attrValue.replaceAll(/\s\s+/g, ' '); + return this.isDate ? attrValue && dayjs(attrValue).format('YYYY-MM-DD') : attrValue.trim().replaceAll(/\s\s+/g, ' '); } #toggleEdit(): void { From 19a93e57ee9c51e529208fd66ad006f78e50c0bc Mon Sep 17 00:00:00 2001 From: George Date: Mon, 17 Jul 2023 17:32:19 +0300 Subject: [PATCH 6/7] RED-7116, update commonui. --- libs/common-ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/common-ui b/libs/common-ui index dc5f14c69..d3ac14497 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit dc5f14c696df0bba4609a9ac95d784228d75d3a3 +Subproject commit d3ac14497d784fda844da062f9919d4391a425d9 From f99af18e8547f820bfdb504a387916e692bd20a1 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Mon, 17 Jul 2023 18:02:27 +0300 Subject: [PATCH 7/7] RED-7051 --- apps/red-ui/src/app/app.module.ts | 10 +++- .../page-indicator.component.html | 2 +- .../page-indicator.component.ts | 60 +++++++++++-------- .../services/annotation-manager.service.ts | 2 +- .../src/app/services/files/files.service.ts | 4 +- 5 files changed, 46 insertions(+), 32 deletions(-) diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index 944d621cd..f1b55a336 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -131,11 +131,17 @@ export const appModuleFactory = (config: AppConfig) => { features: { ANNOTATIONS: { color: 'aqua', - enabled: true, + enabled: false, level: NgxLoggerLevel.DEBUG, }, FILTERS: { - enabled: true, + enabled: false, + }, + TENANTS: { + enabled: false, + }, + ROUTES: { + enabled: false, }, PDF: { enabled: true, diff --git a/apps/red-ui/src/app/modules/file-preview/components/page-indicator/page-indicator.component.html b/apps/red-ui/src/app/modules/file-preview/components/page-indicator/page-indicator.component.html index 0d01ad29d..79da8fcd1 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/page-indicator/page-indicator.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/page-indicator/page-indicator.component.html @@ -1,7 +1,7 @@
implements OnChanges, OnInit { +export class PageIndicatorComponent implements OnChanges { readonly #config = getConfig(); + readonly #logger = inject(NGXLogger); @Input({ required: true }) number: number; @Input() showDottedIcon = false; @Input() activeSelection = false; @Input() read = false; @Output() readonly pageSelected = new EventEmitter(); pageReadTimeout: number = null; + readonly assigneeChanged$: Observable; constructor( private readonly _viewedPagesService: ViewedPagesService, @@ -38,38 +35,45 @@ export class PageIndicatorComponent extends ContextComponent prevFile.assignee !== currFile.assignee), + tap(assigneeChanged => assigneeChanged && this.handlePageRead()), + startWith(true), + map(() => true), + ); + + effect(() => { + if (this.isActive) { + this.handlePageRead(); + } + }); } get isActive() { return this.number === this._pdf.currentPage(); } - ngOnInit() { - const assigneeChanged$ = this._state.file$.pipe( - pairwise(), - map(([prevFile, currFile]) => prevFile.assignee !== currFile.assignee), - tap(assigneeChanged => assigneeChanged && this.handlePageRead()), - ); - super._initContext({ assigneeChanged: assigneeChanged$ }); - } - ngOnChanges() { this.handlePageRead(); } async toggleReadState() { - if (this._permissionService.canMarkPagesAsViewed(this._state.file())) { - if (this.read) { - await this.#markPageUnread(); - } else { - await this.#markPageRead(); - } + if (!this._permissionService.canMarkPagesAsViewed(this._state.file())) { + this.#logger.info('[PAGES] Cannot toggle read state'); + return; + } + + if (this.read) { + await this.#markPageUnread(); + } else { + await this.#markPageRead(); } } handlePageRead(): void { if (!this._permissionService.canMarkPagesAsViewed(this._state.file())) { + this.#logger.info('[PAGES] Cannot mark pages as read'); return; } @@ -87,6 +91,8 @@ export class PageIndicatorComponent extends ContextComponent { - this.#logger.info('[PDF] Annotations changed: ', annotations, action, options); + this.#logger.info('[ANNOTATIONS] Annotations changed: ', annotations, action, options); // when a rectangle is drawn, // it returns one annotation with tool name 'AnnotationCreateRectangle; // this will auto select rectangle after drawing diff --git a/apps/red-ui/src/app/services/files/files.service.ts b/apps/red-ui/src/app/services/files/files.service.ts index 34ffe30f2..36244ec74 100644 --- a/apps/red-ui/src/app/services/files/files.service.ts +++ b/apps/red-ui/src/app/services/files/files.service.ts @@ -31,7 +31,7 @@ export class FilesService extends EntitiesService { loadAll(dossierId: string) { const files$ = this.getFor(dossierId).pipe( mapEach(file => new File(file, this._userService.getName(file.assignee))), - tap(() => this._logger.info('[FILE] Loaded')), + tap(file => this._logger.info('[FILE] Loaded', file)), ); const loadStats$ = files$.pipe(switchMap(files => this._dossierStatsService.getFor([dossierId]).pipe(map(() => files)))); return loadStats$.pipe(tap(files => this._filesMapService.set(dossierId, files))); @@ -41,7 +41,7 @@ export class FilesService extends EntitiesService { const _file = await firstValueFrom(super._getOne([dossierId, file.id])); const reloadedFile = new File(_file, this._userService.getName(_file.assignee)); await firstValueFrom(this._dossierStatsService.getFor([dossierId])); - this._logger.info('[FILE] Reloaded'); + this._logger.info('[FILE] Reloaded', reloadedFile); return this._filesMapService.replace(dossierId, [reloadedFile]); }