Skip to content

Commit af55467

Browse files
author
sanscontext
committed
fix sorting issue that has always bothered me.
1 parent 4a8b797 commit af55467

10 files changed

+4711
-4711
lines changed

scripts/catalog.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ const updateSources = async () => {
240240
}
241241

242242
sources.sort((a, b) => {
243-
if(a.display_name < b.display_name) { return -1; }
244-
if(a.display_name > b.display_name) { return 1; }
243+
if(a.display_name.toLowerCase() < b.display_name.toLowerCase()) { return -1; }
244+
if(a.display_name.toLowerCase() > b.display_name.toLowerCase()) { return 1; }
245245
return 0;
246246
})
247247

@@ -322,8 +322,8 @@ const updateDestinations = async () => {
322322
nextPageToken = res.next_page_token
323323
}
324324
destinations.sort((a, b) => {
325-
if(a.display_name < b.display_name) { return -1; }
326-
if(a.display_name > b.display_name) { return 1; }
325+
if(a.display_name.toLowerCase() < b.display_name.toLowerCase()) { return -1; }
326+
if(a.display_name.toLowerCase() > b.display_name.toLowerCase()) { return 1; }
327327
return 0;
328328
})
329329
destinations.forEach(destination => {
@@ -344,15 +344,15 @@ const updateDestinations = async () => {
344344

345345
let settings = destination.settings
346346
settings.sort((a, b) => {
347-
if(a.display_name < b.display_name) { return -1; }
348-
if(a.display_name > b.display_name) { return 1; }
347+
if(a.display_name.toLowerCase() < b.display_name.toLowerCase()) { return -1; }
348+
if(a.display_name.toLowerCase() > b.display_name.toLowerCase()) { return 1; }
349349
return 0;
350350
})
351351
settings.forEach(setting => {
352352
if (setting.settings.length > 0) {
353353
setting.settings.sort((a, b) => {
354-
if(a.display_name < b.display_name) { return -1; }
355-
if(a.display_name > b.display_name) { return 1; }
354+
if(a.display_name.toLowerCase() < b.display_name.toLowerCase()) { return -1; }
355+
if(a.display_name.toLowerCase() > b.display_name.toLowerCase()) { return 1; }
356356
return 0;
357357
})
358358
}

scripts/papi.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ const updateSources = async () => {
243243
}
244244

245245
sources.sort((a, b) => {
246-
if(a.name < b.name) { return -1; }
247-
if(a.name > b.name) { return 1; }
246+
if(a.name.toLowerCase() < b.name.toLowerCase()) { return -1; }
247+
if(a.name.toLowerCase() > b.name.toLowerCase()) { return 1; }
248248
return 0;
249249
})
250250

@@ -277,8 +277,8 @@ const updateSources = async () => {
277277

278278
// sort the sources alphabetically
279279
settings.sort((a, b) => {
280-
if(a.name < b.name) { return -1; }
281-
if(a.name > b.name) { return 1; }
280+
if(a.name.toLowerCase() < b.name.toLowerCase()) { return -1; }
281+
if(a.name.toLowerCase() > b.name.toLowerCase()) { return 1; }
282282
return 0;
283283
})
284284

@@ -352,8 +352,8 @@ const updateDestinations = async () => {
352352
}
353353

354354
destinations.sort((a, b) => {
355-
if(a.name < b.name) { return -1; }
356-
if(a.name > b.name) { return 1; }
355+
if(a.name.toLowerCase() < b.name.toLowerCase()) { return -1; }
356+
if(a.name.toLowerCase() > b.name.toLowerCase()) { return 1; }
357357
return 0;
358358
})
359359

@@ -376,8 +376,8 @@ const updateDestinations = async () => {
376376

377377
let settings = destination.options
378378
settings.sort((a, b) => {
379-
if(a.name < b.name) { return -1; }
380-
if(a.name > b.name) { return 1; }
379+
if(a.name.toLowerCase() < b.name.toLowerCase()) { return -1; }
380+
if(a.name.toLowerCase() > b.name.toLowerCase()) { return 1; }
381381
return 0;
382382
})
383383

@@ -453,8 +453,8 @@ const updateWarehouses = async () => {
453453
}
454454

455455
warehouses.sort((a, b) => {
456-
if(a.name < b.name) { return -1; }
457-
if(a.name > b.name) { return 1; }
456+
if(a.name.toLowerCase() < b.name.toLowerCase()) { return -1; }
457+
if(a.name.toLowerCase() > b.name.toLowerCase()) { return 1; }
458458
return 0;
459459
})
460460

@@ -464,8 +464,8 @@ const updateWarehouses = async () => {
464464

465465
let settings = warehouse.options
466466
settings.sort((a, b) => {
467-
if(a.name < b.name) { return -1; }
468-
if(a.name > b.name) { return 1; }
467+
if(a.name.toLowerCase() < b.name.toLowerCase()) { return -1; }
468+
if(a.name.toLowerCase() > b.name.toLowerCase()) { return 1; }
469469
return 0;
470470
})
471471

src/_data/catalog/destination_categories.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ items:
55
slug: email-marketing
66
- display_name: Advertising
77
slug: advertising
8+
- display_name: Attribution
9+
slug: attribution
10+
- display_name: Deep Linking
11+
slug: deep-linking
812
- display_name: Analytics
913
slug: analytics
1014
- display_name: Enrichment
1115
slug: enrichment
1216
- display_name: A/B Testing
1317
slug: a-b-testing
18+
- display_name: Video
19+
slug: video
1420
- display_name: Customer Success
1521
slug: customer-success
1622
- display_name: Performance Monitoring
1723
slug: performance-monitoring
18-
- display_name: Attribution
19-
slug: attribution
20-
- display_name: Deep Linking
21-
slug: deep-linking
22-
- display_name: Video
23-
slug: video
2424
- display_name: SMS & Push Notifications
2525
slug: sms-push-notifications
2626
- display_name: Marketing Automation

src/_data/catalog/destination_categories_papi.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination categories last updated 2021-06-29
2+
# destination categories last updated 2021-06-30
33
items:
44
- display_name: Email Marketing
55
slug: email-marketing
66
- display_name: Advertising
77
slug: advertising
8+
- display_name: Attribution
9+
slug: attribution
10+
- display_name: Deep Linking
11+
slug: deep-linking
812
- display_name: Analytics
913
slug: analytics
1014
- display_name: Enrichment
1115
slug: enrichment
1216
- display_name: A/B Testing
1317
slug: a-b-testing
18+
- display_name: Video
19+
slug: video
1420
- display_name: Customer Success
1521
slug: customer-success
1622
- display_name: Performance Monitoring
1723
slug: performance-monitoring
18-
- display_name: Attribution
19-
slug: attribution
20-
- display_name: Deep Linking
21-
slug: deep-linking
22-
- display_name: Video
23-
slug: video
2424
- display_name: SMS & Push Notifications
2525
slug: sms-push-notifications
2626
- display_name: Marketing Automation

0 commit comments

Comments
 (0)