DM-370: wip
This commit is contained in:
parent
9ebc5623fe
commit
c2e382ec73
@ -77,7 +77,15 @@ export class NotificationsScreenComponent extends BaseFormComponent implements O
|
|||||||
async save() {
|
async save() {
|
||||||
this.#loadingService.start();
|
this.#loadingService.start();
|
||||||
try {
|
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) {
|
} catch (e) {
|
||||||
this.#toaster.error(_('notifications-screen.error.generic'));
|
this.#toaster.error(_('notifications-screen.error.generic'));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,6 @@ const NOTIFICATIONS_THRESHOLD = 1000;
|
|||||||
export class NotificationsService extends EntitiesService<INotification, Notification> implements OnDestroy {
|
export class NotificationsService extends EntitiesService<INotification, Notification> implements OnDestroy {
|
||||||
readonly #config = getConfig<AppConfig>();
|
readonly #config = getConfig<AppConfig>();
|
||||||
readonly #subscription = new Subscription();
|
readonly #subscription = new Subscription();
|
||||||
readonly #filterDocumineNotifications: string[] = [NotificationTypes.ASSIGN_REVIEWER];
|
|
||||||
protected readonly _defaultModelPath = 'notification';
|
protected readonly _defaultModelPath = 'notification';
|
||||||
protected readonly _entityClass = Notification;
|
protected readonly _entityClass = Notification;
|
||||||
|
|
||||||
@ -119,10 +118,6 @@ export class NotificationsService extends EntitiesService<INotification, Notific
|
|||||||
const todayDate = dayjs(new Date());
|
const todayDate = dayjs(new Date());
|
||||||
|
|
||||||
notifications = notifications.filter(n => {
|
notifications = notifications.filter(n => {
|
||||||
if (this.#config.IS_DOCUMINE && this.#filterDocumineNotifications.includes(n.notificationType)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(n.notificationType in NotificationTypes)) {
|
if (!(n.notificationType in NotificationTypes)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"ADMIN_CONTACT_NAME": null,
|
"ADMIN_CONTACT_NAME": null,
|
||||||
"ADMIN_CONTACT_URL": null,
|
"ADMIN_CONTACT_URL": null,
|
||||||
"API_URL": "https://dan.iqser.cloud",
|
"API_URL": "https://frontend2.iqser.cloud",
|
||||||
"APP_NAME": "RedactManager",
|
"APP_NAME": "RedactManager",
|
||||||
"IS_DOCUMINE": false,
|
"IS_DOCUMINE": true,
|
||||||
"RULE_EDITOR_DEV_ONLY": false,
|
"RULE_EDITOR_DEV_ONLY": false,
|
||||||
"AUTO_READ_TIME": 3,
|
"AUTO_READ_TIME": 3,
|
||||||
"BACKEND_APP_VERSION": "4.4.40",
|
"BACKEND_APP_VERSION": "4.4.40",
|
||||||
@ -13,13 +13,13 @@
|
|||||||
"MAX_RETRIES_ON_SERVER_ERROR": 3,
|
"MAX_RETRIES_ON_SERVER_ERROR": 3,
|
||||||
"OAUTH_CLIENT_ID": "redaction",
|
"OAUTH_CLIENT_ID": "redaction",
|
||||||
"OAUTH_IDP_HINT": null,
|
"OAUTH_IDP_HINT": null,
|
||||||
"OAUTH_URL": "https://dan.iqser.cloud/auth",
|
"OAUTH_URL": "https://frontend2.iqser.cloud/auth",
|
||||||
"RECENT_PERIOD_IN_HOURS": 24,
|
"RECENT_PERIOD_IN_HOURS": 24,
|
||||||
"SELECTION_MODE": "structural",
|
"SELECTION_MODE": "structural",
|
||||||
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview",
|
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview",
|
||||||
"ANNOTATIONS_THRESHOLD": 1000,
|
"ANNOTATIONS_THRESHOLD": 1000,
|
||||||
"THEME": "redact",
|
"THEME": "scm",
|
||||||
"BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/redact/",
|
"BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/scm/",
|
||||||
"AVAILABLE_NOTIFICATIONS_DAYS": 30,
|
"AVAILABLE_NOTIFICATIONS_DAYS": 30,
|
||||||
"AVAILABLE_OLD_NOTIFICATIONS_MINUTES": 60,
|
"AVAILABLE_OLD_NOTIFICATIONS_MINUTES": 60,
|
||||||
"NOTIFICATIONS_THRESHOLD": 1000,
|
"NOTIFICATIONS_THRESHOLD": 1000,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user