From 3be199cd9cc8e210e561e702d3e873bbc7350313 Mon Sep 17 00:00:00 2001 From: Anant Jain <62471433+anantjain45823@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:34:43 +0530 Subject: [PATCH] fix: slack property name change (#2628) * chore(release): 1.42.0 * chore: change name of slack properties * Revert "chore: change name of slack properties" This reverts commit 5434ec2af3b8189a0fb94f5d832979fdae833eaa. reverted slack change * chore: change name of slack properties --------- Co-authored-by: GitHub Actions --- src/v0/destinations/slack/transform.js | 10 +++++----- test/__tests__/data/slack_input.json | 14 +++++++------- test/__tests__/data/slack_output.json | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/v0/destinations/slack/transform.js b/src/v0/destinations/slack/transform.js index b56ebfbc48..c913f3103e 100644 --- a/src/v0/destinations/slack/transform.js +++ b/src/v0/destinations/slack/transform.js @@ -180,17 +180,17 @@ const buildtemplateList = (templateListForThisEvent, eventTemplateSettings, even const processTrack = (message, destination) => { // logger.debug(JSON.stringify(destination)); const { Config } = destination; - const { eventChannelSettings, eventTemplateSettings, incomingWebhooksType, blacklistedEvents } = + const { eventChannelSettings, eventTemplateSettings, incomingWebhooksType, denyListOfEvents } = Config; const eventName = message.event; if (!eventName) { throw new InstrumentationError('Event name is required'); } - if (blacklistedEvents?.length > 0) { - const blackListedEvents = blacklistedEvents.map((item) => item.eventName); - if (blackListedEvents.includes(eventName)) { - throw new ConfigurationError('Event is blacklisted. Please check configuration.'); + if (denyListOfEvents?.length > 0) { + const denyListofEvents = denyListOfEvents.map((item) => item.eventName); + if (denyListofEvents.includes(eventName)) { + throw new ConfigurationError('Event is denied. Please check configuration.'); } } diff --git a/test/__tests__/data/slack_input.json b/test/__tests__/data/slack_input.json index 9b1ec52664..f9a0b49841 100644 --- a/test/__tests__/data/slack_input.json +++ b/test/__tests__/data/slack_input.json @@ -154,7 +154,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -390,7 +390,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -518,7 +518,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -646,7 +646,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -772,7 +772,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -899,7 +899,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -1369,7 +1369,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } diff --git a/test/__tests__/data/slack_output.json b/test/__tests__/data/slack_output.json index 853daf7801..63d7934a00 100644 --- a/test/__tests__/data/slack_output.json +++ b/test/__tests__/data/slack_output.json @@ -159,6 +159,6 @@ "error": "Something is wrong with the event template: '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}'" }, { - "error": "Event is blacklisted. Please check configuration." + "error": "Event is denied. Please check configuration." } ] \ No newline at end of file