From c2e382ec7383d61e5449453c226e91abaa8e4571 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 5 Sep 2023 18:23:03 +0300 Subject: [PATCH] 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,