Skip to content

Commit 0376ac7

Browse files
author
markzegarelli
authored
catalog update (#4654)
1 parent fd09cc8 commit 0376ac7

File tree

9 files changed

+385
-332
lines changed

9 files changed

+385
-332
lines changed

scripts/catalog_papi.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ const slugify = (displayName, type) => {
3333
overrides = slugOverrides.destinations
3434
}
3535

36-
37-
3836
for (key in overrides) {
3937
let original = overrides[key].original
4038
let override = overrides[key].override
@@ -44,8 +42,6 @@ const slugify = (displayName, type) => {
4442
slug = override
4543
}
4644
}
47-
48-
4945
return slug
5046
}
5147

scripts/private-destination.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const getCatalog = async (url, page_token = "MA==") => {
4747
}
4848
}
4949

50-
const slugify = (displayName) => {
50+
const slugify = (displayName, type) => {
5151
let slug = displayName
5252
.toLowerCase()
5353
.replace(/\s+/g, '-')
@@ -56,15 +56,24 @@ const slugify = (displayName) => {
5656
.replace(/[\(\)]/g, '')
5757
.replace('.', '-')
5858

59-
for (key in slugOverrides) {
60-
let original = slugOverrides[key].original
61-
let override = slugOverrides[key].override
59+
let overrides = ""
60+
if (type == "sources") {
61+
overrides = slugOverrides.sources
62+
}
63+
64+
if (type == "destinations") {
65+
overrides = slugOverrides.destinations
66+
}
67+
68+
for (key in overrides) {
69+
let original = overrides[key].original
70+
let override = overrides[key].override
6271

6372
if (slug == original) {
73+
console.log(original + " -> " + override)
6474
slug = override
6575
}
6676
}
67-
6877
return slug
6978
}
7079

@@ -111,7 +120,7 @@ const getDestinationData = async (id) => {
111120
})
112121
let actions = destination.actions
113122
let presets = destination.presets
114-
let slug = slugify(destination.name)
123+
let slug = slugify(destination.name, "destinations")
115124
let url = `connections/destinations/catalog/${slug}`
116125

117126
// Force screen method into supportedMethods object
@@ -137,7 +146,7 @@ const getDestinationData = async (id) => {
137146
id: destination.id,
138147
display_name: destination.name,
139148
name: destination.name,
140-
slug: slugify(destination.name),
149+
slug: slugify(destination.name, "destinations"),
141150
previous_names: destination.previousNames,
142151
url,
143152
website: destination.website,
@@ -194,7 +203,7 @@ const checkExistingStatus = async () => {
194203
let id = existingIds[i]
195204
let destination = await checkDestinationStatus(id)
196205
let status = destination.status
197-
let slug = slugify(destination.name)
206+
let slug = slugify(destination.name, "destinations")
198207
let url = `connections/destinations/catalog/${slug}`
199208

200209

src/_data/catalog/destination_categories.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination categories last updated 2023-04-25
2+
# destination categories last updated 2023-04-27
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

0 commit comments

Comments
 (0)