From 3c1122fa99a028c96e90ac590009d2a02d712ddc Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 5 Sep 2023 17:35:33 +0300 Subject: [PATCH 01/24] DM-358 - WIP on implementing Help Mode-IDs for DocuMine --- .../base-screen/base-screen.component.html | 2 +- .../breadcrumbs/breadcrumbs.component.html | 22 ++++---- .../account-side-nav.component.html | 2 +- .../account-side-nav.component.ts | 5 ++ .../admin-side-nav.component.ts | 13 +++-- .../template-stats.component.html | 16 +++--- .../src/assets/help-mode/help-mode-keys.json | 55 ++++++++++++++----- 7 files changed, 75 insertions(+), 40 deletions(-) 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 20eb64e45..0cc8595f3 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 @@ -21,7 +21,7 @@ diff --git a/apps/red-ui/src/app/components/breadcrumbs/breadcrumbs.component.html b/apps/red-ui/src/app/components/breadcrumbs/breadcrumbs.component.html index 25dae2bc4..0c2b76d41 100644 --- a/apps/red-ui/src/app/components/breadcrumbs/breadcrumbs.component.html +++ b/apps/red-ui/src/app/components/breadcrumbs/breadcrumbs.component.html @@ -1,4 +1,4 @@ -
- +
@@ -44,7 +42,7 @@ [config]="translateChartService.translateDossierStates(dossierTemplate.dossiersChartConfig, dossierTemplate.id)" [radius]="63" [strokeWidth]="15" - [subtitles]="['dossier-template-stats.active-dossiers' | translate : { count: dossierTemplate.numberOfActiveDossiers }]" + [subtitles]="['dossier-template-stats.active-dossiers' | translate: { count: dossierTemplate.numberOfActiveDossiers }]" direction="row" totalType="sum" > @@ -76,7 +74,7 @@ *ngIf="permissionsService.canCreateDossier(dossierTemplate)" [label]="'dashboard.empty-template.new-dossier' | translate" [type]="iconButtonTypes.primary" - [attr.help-mode-key]="'new_dossier_button'" + [attr.help-mode-key]="'new_dossier'" icon="iqser:plus" > diff --git a/apps/red-ui/src/assets/help-mode/help-mode-keys.json b/apps/red-ui/src/assets/help-mode/help-mode-keys.json index e6765529b..27a5d1a00 100644 --- a/apps/red-ui/src/assets/help-mode/help-mode-keys.json +++ b/apps/red-ui/src/assets/help-mode/help-mode-keys.json @@ -27,14 +27,19 @@ "documentKey": "filter_dossier_list" }, { - "elementKey": "navigate_in_breadcrumbs", - "documentKey": "navigate_in_breadcrumbs" + "elementKey": "navigate_breadcrumbs", + "documentKey": "navigate_breadcrumbs" }, { "elementKey": "new_dossier_button", "documentKey": "new_dossier_button", "overlappingElements": ["USER_MENU"] }, + { + "elementKey": "new_dossier", + "documentKey": "new_dossier", + "overlappingElements": ["USER_MENU"] + }, { "elementKey": "open_notifications", "documentKey": "open_notifications" @@ -48,8 +53,8 @@ "documentKey": "views" }, { - "elementKey": "search_in_entire_application", - "documentKey": "search_in_entire_application" + "elementKey": "search_entire_application", + "documentKey": "search_entire_application" }, { "elementKey": "edit_dossier_in_dossier", @@ -155,8 +160,20 @@ "overlappingElements": ["USER_MENU", "DOCUMENT_INFO"] }, { - "elementKey": "user_account", - "documentKey": "user_account" + "elementKey": "my_profile", + "documentKey": "my_profile" + }, + { + "elementKey": "notification_preferences", + "documentKey": "notification_preferences" + }, + { + "elementKey": "user_preferences", + "documentKey": "user_preferences" + }, + { + "elementKey": "prompts_and_dialogs", + "documentKey": "prompts_and_dialogs" }, { "elementKey": "my_downloads", @@ -167,8 +184,8 @@ "documentKey": "trash" }, { - "elementKey": "dossier_overview", - "documentKey": "dossier_overview" + "elementKey": "open_dossier_template", + "documentKey": "open_dossier_template" }, { "elementKey": "home", @@ -189,7 +206,8 @@ { "elementKey": "dossier", "documentKey": "dossier", - "scrollableParentView": "VIRTUAL_SCROLL" + "scrollableParentView": "VIRTUAL_SCROLL", + "overlappingElements": ["BREADCRUMBS_MENU"] }, { "elementKey": "document_in_editor", @@ -198,7 +216,8 @@ }, { "elementKey": "dossier_list", - "documentKey": "dossier_list" + "documentKey": "dossier_list", + "overlappingElements": ["BREADCRUMBS_MENU"] }, { "elementKey": "dossier_templates", @@ -210,13 +229,17 @@ "overlappingElements": ["USER_MENU"] }, { - "elementKey": "dossier_templates_info", - "documentKey": "dossier_templates_info" + "elementKey": "user_dossier_template_info", + "documentKey": "user_dossier_template_info" }, { "elementKey": "entities", "documentKey": "entities" }, + { + "elementKey": "user_dossier_template_entities", + "documentKey": "user_dossier_template_entities" + }, { "elementKey": "edit_delete_entities", "documentKey": "edit_delete_entities", @@ -280,8 +303,8 @@ "overlappingElements": ["USER_MENU"] }, { - "elementKey": "dossier_states", - "documentKey": "dossier_states" + "elementKey": "user_dossier_template_dossier_states", + "documentKey": "user_dossier_template_dossier_states" }, { "elementKey": "create_new_dossier_state", @@ -296,6 +319,10 @@ "documentKey": "reports", "overlappingElements": ["USER_MENU"] }, + { + "elementKey": "user_dossier_template_reports", + "documentKey": "user_dossier_template_reports" + }, { "elementKey": "justifications", "documentKey": "justifications" From c2e382ec7383d61e5449453c226e91abaa8e4571 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 5 Sep 2023 18:23:03 +0300 Subject: [PATCH 02/24] DM-370: wip --- .../notifications-screen.component.ts | 10 +++++++++- apps/red-ui/src/app/services/notifications.service.ts | 5 ----- apps/red-ui/src/assets/config/config.json | 10 +++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts b/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts index a6a2b4fe5..0b0be7f6a 100644 --- a/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts @@ -77,7 +77,15 @@ export class NotificationsScreenComponent extends BaseFormComponent implements O async save() { this.#loadingService.start(); try { - await firstValueFrom(this.#notificationPreferencesService.update(this.form.value)); + const preferences = this.isPreferenceChecked('inAppNotifications', 'ASSIGN_APPROVER') + ? this.form.value + : { + ...this.form.value, + inAppNotifications: this.form + .get('inAppNotifications') + .value.filter((preference: string) => !RSS_EXCLUDED_SETTINGS.includes(preference)), + }; + await firstValueFrom(this.#notificationPreferencesService.update(preferences)); } catch (e) { this.#toaster.error(_('notifications-screen.error.generic')); } diff --git a/apps/red-ui/src/app/services/notifications.service.ts b/apps/red-ui/src/app/services/notifications.service.ts index 6e1a91769..c5fb6477e 100644 --- a/apps/red-ui/src/app/services/notifications.service.ts +++ b/apps/red-ui/src/app/services/notifications.service.ts @@ -25,7 +25,6 @@ const NOTIFICATIONS_THRESHOLD = 1000; export class NotificationsService extends EntitiesService implements OnDestroy { readonly #config = getConfig(); readonly #subscription = new Subscription(); - readonly #filterDocumineNotifications: string[] = [NotificationTypes.ASSIGN_REVIEWER]; protected readonly _defaultModelPath = 'notification'; protected readonly _entityClass = Notification; @@ -119,10 +118,6 @@ export class NotificationsService extends EntitiesService { - if (this.#config.IS_DOCUMINE && this.#filterDocumineNotifications.includes(n.notificationType)) { - return false; - } - if (!(n.notificationType in NotificationTypes)) { return false; } diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 42bf5941f..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://dan.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://dan.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, From dad25c7c2efc7d9913b1bfff55f8a80011adf797 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 5 Sep 2023 18:27:26 +0300 Subject: [PATCH 03/24] DM-370: added documine condition --- .../notifications-screen.component.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts b/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts index 0b0be7f6a..637c3e69e 100644 --- a/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts @@ -77,14 +77,15 @@ export class NotificationsScreenComponent extends BaseFormComponent implements O async save() { this.#loadingService.start(); try { - const preferences = this.isPreferenceChecked('inAppNotifications', 'ASSIGN_APPROVER') - ? this.form.value - : { - ...this.form.value, - inAppNotifications: this.form - .get('inAppNotifications') - .value.filter((preference: string) => !RSS_EXCLUDED_SETTINGS.includes(preference)), - }; + const preferences = + !this.isPreferenceChecked('inAppNotifications', 'ASSIGN_APPROVER') && this.#config.IS_DOCUMINE + ? { + ...this.form.value, + inAppNotifications: this.form + .get('inAppNotifications') + .value.filter((preference: string) => !RSS_EXCLUDED_SETTINGS.includes(preference)), + } + : this.form.value; await firstValueFrom(this.#notificationPreferencesService.update(preferences)); } catch (e) { this.#toaster.error(_('notifications-screen.error.generic')); From 841cf2e50c37571dff9acbdf2724ef7d27d132d1 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Wed, 6 Sep 2023 17:29:11 +0300 Subject: [PATCH 04/24] DM-413: enabled bulk edit only for skipped and annotations. --- .../app/models/file/annotation.permissions.ts | 3 ++ .../edit-annotation-dialog.component.html | 33 +++++++++++++++---- .../edit-annotation-dialog.component.scss | 14 ++++++++ .../edit-annotation-dialog.component.ts | 14 +++++--- .../services/annotation-actions.service.ts | 6 ++-- .../pdf-annotation-actions.service.ts | 12 +++---- apps/red-ui/src/assets/i18n/scm/en.json | 5 +-- 7 files changed, 65 insertions(+), 22 deletions(-) create mode 100644 apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/edit-annotation-dialog/edit-annotation-dialog.component.scss 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 16eef7da4..d88d42868 100644 --- a/apps/red-ui/src/app/models/file/annotation.permissions.ts +++ b/apps/red-ui/src/app/models/file/annotation.permissions.ts @@ -29,6 +29,7 @@ export class AnnotationPermissions { canResizeAnnotation = true; canRecategorizeAnnotation = true; canForceHint = true; + canEditAnnotations = true; static forUser( isApprover: boolean, @@ -58,6 +59,7 @@ export class AnnotationPermissions { permissions.canChangeLegalBasis = canChangeLegalBasis(annotation, canAddRedaction); permissions.canRecategorizeAnnotation = canRecategorizeAnnotation(annotation, canAddRedaction); permissions.canResizeAnnotation = canResizeAnnotation(annotation, canAddRedaction); + permissions.canEditAnnotations = annotation.isSkipped || annotation.isRedacted; summedPermissions._merge(permissions); } @@ -77,6 +79,7 @@ export class AnnotationPermissions { result.canRemoveOnlyHere = permissions.reduce((acc, next) => acc && next.canRemoveOnlyHere, true); result.canRemoveRedaction = permissions.reduce((acc, next) => acc && next.canRemoveRedaction, true); result.canUndo = permissions.reduce((acc, next) => acc && next.canUndo, true); + result.canEditAnnotations = permissions.reduce((acc, next) => acc && next.canEditAnnotations, true); return result; } 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 10baea1b0..f680ef1c2 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 @@ -3,16 +3,26 @@
-
- - {{ redactedText }} +
+ + +
    +
  • {{ text }}
  • +
+
- - + {{ displayedDictionaryLabel }}