Skip to content

Commit

Permalink
fix: slack property name change (#2628)
Browse files Browse the repository at this point in the history
* chore(release): 1.42.0

* chore: change name of slack properties

* Revert "chore: change name of slack properties"

This reverts commit 5434ec2.

reverted slack change

* chore: change name of slack properties

---------

Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
anantjain45823 and web-flow authored Sep 19, 2023
1 parent 9069d22 commit 3be199c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/v0/destinations/slack/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
}

Expand Down
14 changes: 7 additions & 7 deletions test/__tests__/data/slack_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"trait": ""
}
],
"blacklistedEvents": [
"denyListOfEvents": [
{
"eventName": "black_event"
}
Expand Down Expand Up @@ -390,7 +390,7 @@
"trait": ""
}
],
"blacklistedEvents": [
"denyListOfEvents": [
{
"eventName": "black_event"
}
Expand Down Expand Up @@ -518,7 +518,7 @@
"trait": ""
}
],
"blacklistedEvents": [
"denyListOfEvents": [
{
"eventName": "black_event"
}
Expand Down Expand Up @@ -646,7 +646,7 @@
"trait": ""
}
],
"blacklistedEvents": [
"denyListOfEvents": [
{
"eventName": "black_event"
}
Expand Down Expand Up @@ -772,7 +772,7 @@
"trait": ""
}
],
"blacklistedEvents": [
"denyListOfEvents": [
{
"eventName": "black_event"
}
Expand Down Expand Up @@ -899,7 +899,7 @@
"trait": ""
}
],
"blacklistedEvents": [
"denyListOfEvents": [
{
"eventName": "black_event"
}
Expand Down Expand Up @@ -1369,7 +1369,7 @@
"trait": ""
}
],
"blacklistedEvents": [
"denyListOfEvents": [
{
"eventName": "black_event"
}
Expand Down
2 changes: 1 addition & 1 deletion test/__tests__/data/slack_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
]

0 comments on commit 3be199c

Please sign in to comment.