Skip to content

Commit 3192d72

Browse files
committed
first pass of engage cmode replacement
1 parent 7357e57 commit 3192d72

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

scripts/catalog/updateDestinations.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const {
77
getConnectionModes,
88
isCatalogItemHidden,
99
sanitize,
10-
doesCatalogItemExist
10+
doesCatalogItemExist,
11+
engageDestinations,
1112
} = require('./utilities.js');
1213

1314
require('dotenv').config();
@@ -120,6 +121,7 @@ const updateDestinations = async () => {
120121
name: destination.name,
121122
slug,
122123
hidden: isCatalogItemHidden(url),
124+
engage: engageDestinations(url),
123125
endpoints,
124126
regions,
125127
url,

scripts/catalog/utilities.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,20 @@ const isCatalogItemHidden = (itemURL) => {
159159
}
160160
};
161161

162+
const engageDestinations = (itemURL) => {
163+
try {
164+
const catalogPath = path.resolve('src', itemURL, 'index.md');
165+
if (fs.existsSync(catalogPath)) {
166+
const f = fm(fs.readFileSync(catalogPath, 'utf8'));
167+
if (f.attributes.engage) return true;
168+
}
169+
return false;
170+
} catch (e) {
171+
console.log(error);
172+
return false;
173+
}
174+
};
175+
162176
const sanitize = (text) => {
163177
const regex = /(<[^\/a].*?>)/ig;
164178
result = text.replace(regex, "`$1`");
@@ -173,3 +187,4 @@ exports.getConnectionModes = getConnectionModes;
173187
exports.isCatalogItemHidden = isCatalogItemHidden;
174188
exports.sanitize = sanitize;
175189
exports.doesCatalogItemExist = doesCatalogItemExist;
190+
exports.engageDestinations = engageDestinations;

src/_includes/content/destination-dossier.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h6>Components</h6>
7070
</ul>
7171
{% endunless %}
7272
</div>
73-
{% unless page.hide-cmodes %}
73+
{% unless page.hide-cmodes or page.engage %}
7474
<div class="qi-content">
7575
<h6>Connection Modes <a href="/docs/connections/destinations/#connection-modes"><img src="/docs/images/help.svg"/></a></h6>
7676
<table>
@@ -98,6 +98,11 @@ <h6>Connection Modes <a href="/docs/connections/destinations/#connection-modes">
9898
</div>
9999
{% endunless %}
100100
{% endif %}
101+
{% if page.engage == true %}
102+
<div>
103+
<b>This destination is only compatible with <a href="/docs/engage">Twilio Engage</a>.</b>
104+
</div>
105+
{% endif %}
101106
{% if destinationInfo.partnerOwned == true %}
102107
<div>
103108
<h6>Partner Owned</h6>

src/connections/destinations/catalog/actions-display-video-360/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ strat: google
44
hide-settings: true
55
id: 65302a3acb309a8a3d5593f2
66
beta: true
7+
engage: true
78
---
89

910
> info ""

src/connections/destinations/catalog/personas-facebook-custom-audiences/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ strat: facebook
44
hide-boilerplate: true
55
redirect_from: '/connections/destinations/catalog/personas-facebook-ads/'
66
id: 5a4d24dcc5836400017188f6
7+
engage: true
78
---
89
## Overview
910

0 commit comments

Comments
 (0)