diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss index 78536d529..30ce46369 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.scss @@ -23,6 +23,7 @@ } .annotations-wrapper { + background-color: white; display: flex; flex: 1; overflow: hidden; @@ -45,6 +46,7 @@ &.documine-width { width: calc(var(--documine-workload-content-width) - 55px); border-right: 1px solid var(--iqser-separator); + background: white; z-index: 1; .workload-separator { diff --git a/apps/red-ui/src/app/modules/file-preview/components/structured-component-management/structured-component-management.component.scss b/apps/red-ui/src/app/modules/file-preview/components/structured-component-management/structured-component-management.component.scss index ffc3f5364..c99b62a2b 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/structured-component-management/structured-component-management.component.scss +++ b/apps/red-ui/src/app/modules/file-preview/components/structured-component-management/structured-component-management.component.scss @@ -23,6 +23,7 @@ mat-icon { } .components-container { + background: white; display: flex; flex-direction: column; font-size: 12px; diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html index 41b9e50a3..25a712301 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html @@ -3,14 +3,18 @@
-
-
+
+
+ @if (isDocumine) { +
+ } +
('resize'); + readonly container = viewChild('container'); + drag = false; + moveX = 0; protected readonly isDocumine = getConfig().IS_DOCUMINE; @ViewChild('annotationFilterTemplate', { read: TemplateRef, @@ -243,6 +242,30 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni ); } + @Bind() + mouseDown(event: MouseEvent) { + if (!this.isDocumine) return; + this.drag = true; + } + + @Bind() + mouseMove(event: MouseEvent) { + if (!this.isDocumine) return; + if (!this.drag) return; + if (this.#getPixelsInPercentage(event.screenX) <= this.#getPixelsInPercentage(250)) return; + this.moveX = event.screenX; + const newLeftWidth = this.#convertPixelsToPercent(this.moveX - this.resizeHandle().nativeElement.getBoundingClientRect().width / 2); + + document.body.style.setProperty('--structured-component-management-width', newLeftWidth); + event.preventDefault(); + } + + @Bind() + mouseUp(event: MouseEvent) { + if (!this.isDocumine) return; + this.drag = false; + } + deleteEarmarksOnViewChange$() { const isChangingFromEarmarksViewMode$ = this._viewModeService.viewMode$.pipe( pairwise(), @@ -266,12 +289,24 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni super.ngOnDetach(); this.pdf.instance.UI.hotkeys.off('esc'); this.pdf.instance.UI.iframeWindow.document.removeEventListener('click', this.handleViewerClick); + this.resizeHandle().nativeElement.removeEventListener('mousedown', this.mouseDown); + this.pdf.instance.UI.iframeWindow.document.removeEventListener('mousedown', this.mouseDown); + this.container().nativeElement.removeEventListener('mousemove', this.mouseMove); + this.pdf.instance.UI.iframeWindow.document.removeEventListener('mousemove', this.mouseMove); + this.container().nativeElement.removeEventListener('mouseup', this.mouseUp); + this.pdf.instance.UI.iframeWindow.document.removeEventListener('mouseup', this.mouseUp); this._changeRef.markForCheck(); } ngOnDestroy() { this.pdf.instance.UI.hotkeys.off('esc'); this.pdf.instance.UI.iframeWindow.document.removeEventListener('click', this.handleViewerClick); + this.resizeHandle().nativeElement.removeEventListener('mousedown', this.mouseDown); + this.pdf.instance.UI.iframeWindow.document.removeEventListener('mousedown', this.mouseDown); + this.container().nativeElement.removeEventListener('mousemove', this.mouseMove); + this.pdf.instance.UI.iframeWindow.document.removeEventListener('mousemove', this.mouseMove); + this.container().nativeElement.removeEventListener('mouseup', this.mouseUp); + this.pdf.instance.UI.iframeWindow.document.removeEventListener('mouseup', this.mouseUp); super.ngOnDestroy(); } @@ -355,6 +390,15 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni this.pdf.instance.UI.iframeWindow.document.addEventListener('click', this.handleViewerClick); } + ngAfterViewInit() { + this.resizeHandle().nativeElement.addEventListener('mousedown', this.mouseDown); + this.pdf.instance.UI.iframeWindow.document.addEventListener('mousedown', this.mouseDown); + this.container().nativeElement.addEventListener('mousemove', this.mouseMove); + this.pdf.instance.UI.iframeWindow.document.addEventListener('mousemove', this.mouseMove); + this.container().nativeElement.addEventListener('mouseup', this.mouseUp); + this.pdf.instance.UI.iframeWindow.document.addEventListener('mouseup', this.mouseUp); + } + async openRectangleAnnotationDialog(manualRedactionEntryWrapper: ManualRedactionEntryWrapper) { const file = this.state.file(); @@ -430,6 +474,14 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni ); } + #getPixelsInPercentage(pixels: number) { + return Math.round((100 - ((window.screen.width - pixels) / window.screen.width) * 100 + Number.EPSILON) * 100) / 100; + } + + #convertPixelsToPercent(pixels: number) { + return `${this.#getPixelsInPercentage(pixels)}%`; + } + async #updateViewMode(): Promise { const viewMode = untracked(this._viewModeService.viewMode); this._logger.info(`[PDF] Update ${viewMode} view mode`); diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index deb14e6da..2ccc6f6d1 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,9 +1,9 @@ { "ADMIN_CONTACT_NAME": null, "ADMIN_CONTACT_URL": null, - "API_URL": "https://dan1.iqser.cloud", + "API_URL": "https://frontend2.iqser.cloud", "APP_NAME": "RedactManager", - "IS_DOCUMINE": false, + "IS_DOCUMINE": true, "RULE_EDITOR_DEV_ONLY": false, "AUTO_READ_TIME": 3, "BACKEND_APP_VERSION": "4.4.40", @@ -13,13 +13,13 @@ "MAX_RETRIES_ON_SERVER_ERROR": 3, "OAUTH_CLIENT_ID": "redaction", "OAUTH_IDP_HINT": null, - "OAUTH_URL": "https://dan1.iqser.cloud/auth", + "OAUTH_URL": "https://frontend2.iqser.cloud/auth", "RECENT_PERIOD_IN_HOURS": 24, "SELECTION_MODE": "structural", "MANUAL_BASE_URL": "https://docs.redactmanager.com/preview", "ANNOTATIONS_THRESHOLD": 1000, - "THEME": "redact", - "BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/redact/", + "THEME": "scm", + "BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/scm/", "AVAILABLE_NOTIFICATIONS_DAYS": 30, "AVAILABLE_OLD_NOTIFICATIONS_MINUTES": 60, "NOTIFICATIONS_THRESHOLD": 1000,