Skip to content

Commit 51add34

Browse files
authored
Merge branch 'master' into Remove-beta-note
2 parents 816dc3e + e7397d5 commit 51add34

File tree

24 files changed

+1130
-483
lines changed

24 files changed

+1130
-483
lines changed

scripts/catalog_papi.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const regionalSupport = yaml.load(fs.readFileSync(path.resolve(__dirname, `../sr
1515
const slugOverrides = yaml.load(fs.readFileSync(path.resolve(__dirname, `../src/_data/catalog/slugs.yml`)))
1616

1717

18-
const slugify = (displayName) => {
18+
const slugify = (displayName, type) => {
1919
let slug = displayName
2020
.toLowerCase()
2121
.replace(/\s+/g, '-')
@@ -24,16 +24,24 @@ const slugify = (displayName) => {
2424
.replace(/[\(\)]/g, '')
2525
.replace('.', '-')
2626

27-
for (key in slugOverrides) {
28-
let original = slugOverrides[key].original
29-
let override = slugOverrides[key].override
27+
let overrides = ""
28+
if (type == "sources") {
29+
overrides = slugOverrides.sources
30+
}
31+
32+
if (type == "destinations") {
33+
overrides = slugOverrides.destinations
34+
}
35+
36+
for (key in overrides) {
37+
let original = overrides[key].original
38+
let override = overrides[key].override
3039

3140
if (slug == original) {
3241
console.log(original + " -> " + override)
3342
slug = override
3443
}
3544
}
36-
3745
return slug
3846
}
3947

@@ -120,7 +128,7 @@ const getConnectionModes = (destination) => {
120128
connectionModes.cloud.server = true
121129
}
122130
}
123-
131+
124132
return connectionModes
125133
}
126134

@@ -208,7 +216,7 @@ const updateSources = async () => {
208216
const regionalSourceRegion = regionalSupport.sources.region
209217

210218
sources.forEach(source => {
211-
let slug = slugify(source.name)
219+
let slug = slugify(source.name, "sources")
212220
let settings = source.options
213221
let hidden = false
214222
let regions = ['us']
@@ -362,14 +370,14 @@ const updateDestinations = async () => {
362370
let endpoints = []
363371
let regions = []
364372

365-
let slug = slugify(destination.name)
366-
373+
let slug = slugify(destination.name, "destinations")
374+
367375
if (typeof destination.supportedRegions != "undefined") {
368376
regions = destination.supportedRegions
369377
} else {
370-
regions.push('us-west-2','eu-west-1')
378+
regions.push('us-west-2', 'eu-west-1')
371379
}
372-
if (typeof destination.regionEndpoints != "undefined"){
380+
if (typeof destination.regionEndpoints != "undefined") {
373381
endpoints = destination.regionEndpoints
374382
} else {
375383
endpoints.push('US')
@@ -418,7 +426,7 @@ const updateDestinations = async () => {
418426
return clonedObj;
419427
};
420428

421-
429+
422430
// Force screen method into supportedMethods object
423431
destination.supportedMethods.screen = false
424432
// Set it true for LiveLike, per request

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)