dt-common-device 13.2.0 → 13.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -432,16 +432,16 @@ let AlertService = (() => {
|
|
|
432
432
|
const preferences = await typedi_1.default.get(property_1.LocalPropertyService).getPropertyPreferences(processedAlertData.propertyId, [
|
|
433
433
|
"alertsAndIssues",
|
|
434
434
|
]);
|
|
435
|
-
const
|
|
435
|
+
const disabledAlertsAndIssues = preferences?.settings?.alertsAndIssues?.disabled;
|
|
436
436
|
// Check if the property has the alertsAndIssues preferences set, if no, skip the check and create the alert
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (
|
|
437
|
+
const isAlertDisabled = disabledAlertsAndIssues &&
|
|
438
|
+
processedAlertData.type &&
|
|
439
|
+
disabledAlertsAndIssues?.includes(processedAlertData.type);
|
|
440
|
+
if (isAlertDisabled) {
|
|
441
441
|
(0, audit_1.pushAudit)({
|
|
442
442
|
auditType: constants_1.DT_EVENT_TYPES.ALERT.CREATE.SKIPPED,
|
|
443
443
|
auditData: {
|
|
444
|
-
reason: "Alert type is
|
|
444
|
+
reason: "Alert type is disabled",
|
|
445
445
|
resource: audit_1.Resource.ALERT,
|
|
446
446
|
source: constants_1.Source.SYSTEM,
|
|
447
447
|
...processedAlertData,
|
|
@@ -421,16 +421,16 @@ let IssueService = (() => {
|
|
|
421
421
|
const preferences = await typedi_1.default.get(property_1.LocalPropertyService).getPropertyPreferences(processedIssueData.propertyId, [
|
|
422
422
|
"alertsAndIssues",
|
|
423
423
|
]);
|
|
424
|
-
const
|
|
424
|
+
const disabledAlertsAndIssues = preferences?.settings?.alertsAndIssues?.disabled;
|
|
425
425
|
// Check if the property has the alertsAndIssues preferences set, if no, skip the check and create the issue
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
if (
|
|
426
|
+
const isIssueDisabled = disabledAlertsAndIssues &&
|
|
427
|
+
processedIssueData.type &&
|
|
428
|
+
disabledAlertsAndIssues?.includes(processedIssueData.type);
|
|
429
|
+
if (isIssueDisabled) {
|
|
430
430
|
(0, audit_1.pushAudit)({
|
|
431
431
|
auditType: constants_1.DT_EVENT_TYPES.ISSUE.CREATE.SKIPPED,
|
|
432
432
|
auditData: {
|
|
433
|
-
reason: "Issue type is
|
|
433
|
+
reason: "Issue type is disabled",
|
|
434
434
|
resource: audit_1.Resource.ISSUE,
|
|
435
435
|
source: Service_1.Source.SYSTEM,
|
|
436
436
|
...processedIssueData,
|