Skip to content

Commit f510138

Browse files
author
markzegarelli
authored
Merge branch 'master' into DOC-151_Redshift-update
2 parents 99bb0fd + 29bd300 commit f510138

File tree

49 files changed

+8001
-5980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+8001
-5980
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ src/assets/docs.bundle.js
1212
yarn-error.log
1313
# Make sure to update `analytics` to the full path to your Typewriter client.
1414
.vscode/spellright.dict
15+
16+
# Local Netlify folder
17+
.netlify

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ group :jekyll_plugins do
1818
gem "premonition", "~> 2.0.0"
1919
gem "jekyll-include-cache"
2020
gem 'jekyll-algolia'
21+
gem 'jekyll-dotenv'
2122
end
2223

2324
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem

Gemfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ GEM
6060
jekyll-commonmark (1.3.1)
6161
commonmarker (~> 0.14)
6262
jekyll (>= 3.7, < 5.0)
63+
jekyll-dotenv (0.2.0)
64+
dotenv (~> 2.7)
65+
jekyll (~> 4)
6366
jekyll-include-cache (0.2.1)
6467
jekyll (>= 3.7, < 5.0)
6568
jekyll-last-modified-at (1.3.0)
@@ -90,6 +93,8 @@ GEM
9093
nokogiri (1.11.1)
9194
mini_portile2 (~> 2.5.0)
9295
racc (~> 1.4)
96+
nokogiri (1.11.1-x86_64-darwin)
97+
racc (~> 1.4)
9398
nokogiri (1.11.1-x86_64-linux)
9499
racc (~> 1.4)
95100
pathutil (0.16.2)
@@ -124,6 +129,7 @@ GEM
124129

125130
PLATFORMS
126131
ruby
132+
x86_64-darwin-20
127133
x86_64-linux
128134

129135
DEPENDENCIES
@@ -132,6 +138,7 @@ DEPENDENCIES
132138
jekyll!
133139
jekyll-algolia
134140
jekyll-commonmark
141+
jekyll-dotenv
135142
jekyll-include-cache
136143
jekyll-last-modified-at
137144
jekyll-redirect-from

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ plugins:
4949
- premonition
5050
- jekyll-commonmark
5151
- jekyll-last-modified-at
52+
- jekyll-dotenv
5253
algolia:
5354
application_id: UINQ2M4D9S
5455
index_name: segment-docs
5556
files_to_exclude:
5657
- _release_notes/*
58+
nodes_to_index: 'p, table#limit'

devguide.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,25 @@ The script also “calculates” the values for the `connection-modes` table for
4747

4848
It also does some slugification and destination-name normalization, since our handling of dots and dashes hasn't been consistent over time. Finally, it checks to see if there’s a folder for each destination. If it finds a new one, the script makes a folder with a “stub” markdown file for that destination, and then adds a line for it to an "incompleteDocs.txt" file. (It doesn't check to see if it's already listed, just appends to the file.)
4949

50+
### Connection Modes in the Catalog script
51+
52+
As part of the Dossiers project we worked on making the Connection Modes table more readable. Originally we were going to have per-page liquid run, but these modes don't change often so it would've added a lot of build time for very little benefit. Instead we pushed it into `catalog.js`.
53+
Once the connection modes device and cloud arrays are set, we do a bunch of calculations, and add a text summary, a number which corresponds to that summary for easier programmatic writing, and a rough category.
54+
55+
| Case | Summary | Type | Message |
56+
| ---- | -------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
57+
| 0 | No data available | none | No connection mode information available. |
58+
| 1 | Both device, no cloud | device-only | accepts device-mode data from both Analytics.js and mobile sources. It does not accept data in cloud-mode. |
59+
| 2 | AJS (web device) only | device-only | accepts device-mode data only from Analytics.js. |
60+
| 3 | Mobile device mode only | device-only | accepts device-mode data only from a mobile source. |
61+
| 4 | Accepts from all | all | accepts cloud-mode data from all Segment source types. It can accept device-mode data from both web and mobile sources. |
62+
| 5 | All cloud types | cloud-only | accepts cloud-mode data from all Segment source types. It does not offer device-mode connections. |
63+
| 6 | Mobile and Server cloud only | cloud-only | accepts data from any Segment mobile or server source in cloud mode. It does not accept data from a web source, and does not offer device-mode connections. |
64+
| 7 | Web and mobile cloud only | cloud-only | accepts only cloud-mode data from web and mobile sources. |
65+
| 8 | Mobile cloud only | cloud-only | accepts only cloud-mode data from mobile sources. |
66+
| 9 | All cloud types, 1 device mode | mixed | accepts data in cloud-mode from all source types, and can accept data in device-mode from [Analytics.js or mobile] sources. |
67+
| 10 | Web and mobile cloud, 1 device | mixed | accepts data in cloud-mode from web and mobile sources, and can accept data in device-mode from [Analytics.js or mobile] sources. |
68+
| 11 | Mobile and server cloud, mobile device | mixed | accepts data in cloud-mode from mobile and server sources, and can accept data in device-mode from mobile sources. |
5069

5170
## Developer information
5271

@@ -63,9 +82,10 @@ default.html
6382
|- destination.html
6483
|- source.html
6584
|- main.html
66-
|- catalog.html
67-
|- home.html
68-
|- page.html
85+
|- catalog.html - used for connections catalog pages only
86+
|- home.html - for main landing page only
87+
|- page.html - used for all pages outside Connections catalogs, without an explicit override
88+
|- search.html - search results page only
6989
```
7090

7191
### Platform Config API + Catalog

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# Ignore builds unless [netlify-build] is present in commit message
44
# ignore = "git log -1 --pretty=%B | ( ! grep -q '\[netlify\-build\]' )"
55
# Ignore if [netlify-ignore] is present
6-
ignore = "git log -1 --pretty=%B | ( grep -q '\\[netlify\\-ignore\\]' )"
76

87
[context.deploy-preview]
98
command = "yarn develop"
9+
ignore = "git log -1 --pretty=%B | ( grep -q '\\[netlify\\-ignore\\]' )"
1010

1111
[[redirects]]
1212
from = "/docs/*"

scripts/catalog.js

Lines changed: 100 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ const getConnectionModes = (destination) => {
5454
web: false,
5555
mobile: false,
5656
server: false
57-
}
57+
},
58+
summary: "testing",
59+
cmode_type: ""
5860
}
5961
destination.components.forEach(component => {
6062
switch (component.type) {
@@ -90,11 +92,103 @@ const getConnectionModes = (destination) => {
9092
break
9193
}
9294
})
95+
96+
// summarize connection modes in plain english.
97+
// start with no-cloud
98+
if (connectionModes.cloud.web == false && connectionModes.cloud.mobile == false && connectionModes.cloud.server == false){
99+
// first check if no info at all available - these need backfill
100+
if (connectionModes.device.web == false && connectionModes.device.mobile == false) {
101+
connectionModes.summary = "No connection mode information available."
102+
connectionModes.case = "0"
103+
connectionModes.cmode_type = "none"
104+
}
105+
// handle has-device-modes: three cases
106+
else if (connectionModes.device.web == true || connectionModes.device.mobile == true){
107+
connectionModes.cmode_type = "device-only"
108+
if (connectionModes.device.web == true && connectionModes.device.mobile == true) {
109+
connectionModes.summary = "accepts device-mode data from both Analytics.js and mobile sources. It does not accept data in cloud-mode."
110+
connectionModes.case = "1"
111+
}
112+
if (connectionModes.device.web == true && connectionModes.device.mobile == false) {
113+
connectionModes.summary = "accepts device-mode data only from Analytics.js."
114+
connectionModes.case = "2"
115+
}
116+
if (connectionModes.device.web == false && connectionModes.device.mobile == true) {
117+
connectionModes.summary = "accepts device-mode data only from a mobile source."
118+
connectionModes.case = "3"
119+
}
120+
}
121+
122+
}
123+
//next check if all are true.
124+
else if (connectionModes.cloud.web == true && connectionModes.cloud.mobile == true && connectionModes.cloud.server == true && connectionModes.device.web == true && connectionModes.device.mobile == true) {
125+
connectionModes.cmode_type = "all"
126+
connectionModes.summary = "accepts cloud-mode data from all Segment source types. It can accept device-mode data from both web and mobile sources."
127+
connectionModes.case = "4"
128+
}
129+
130+
//next handle all cloud-only (no-device-mode) cases
131+
else if ((connectionModes.device.web == false && connectionModes.device.mobile == false) && (connectionModes.cloud.web == true || connectionModes.cloud.mobile == true || connectionModes.cloud.server == true)) {
132+
connectionModes.cmode_type = "cloud-only"
133+
// accepts all cloud-mode
134+
if (connectionModes.cloud.web == true && connectionModes.cloud.mobile == true && connectionModes.cloud.server == true){
135+
connectionModes.summary = "accepts cloud-mode data from all Segment source types. It does not offer device-mode connections."
136+
connectionModes.case = "5"
137+
}
138+
//edge-case-y: only mobile and server cloud
139+
else if (connectionModes.cloud.web == false && connectionModes.cloud.mobile == true && connectionModes.cloud.server == true){
140+
connectionModes.summary = "accepts data from any Segment mobile or server source in cloud mode. It does not accept data from a web source, and does not offer device-mode connections."
141+
connectionModes.case = "6"
142+
}
143+
//edge-case-y: web and mobile cloud, no server.
144+
else if (connectionModes.cloud.web == true && connectionModes.cloud.mobile == true && connectionModes.cloud.server == false){
145+
connectionModes.summary = "accepts only cloud-mode data from web and mobile sources."
146+
connectionModes.case = "7"
147+
}
148+
//edge-case-y: mobile cloud only.
149+
else if (connectionModes.cloud.web == false && connectionModes.cloud.mobile == true && connectionModes.cloud.server == false){
150+
connectionModes.summary = "accepts only cloud-mode data from mobile sources."
151+
connectionModes.case = "8"
152+
}
153+
}
154+
155+
//handle mixed-case - in the dossier, use the case, or type: "mixed" to invoke a check for what type of device mode
156+
else if ((connectionModes.cloud.web == true || connectionModes.cloud.mobile == true || connectionModes.cloud.server == true) && (connectionModes.device.mobile == true || connectionModes.device.web == true)){
157+
// remove "both" as that would be covered under ALL
158+
if (!(connectionModes.device.mobile == true && connectionModes.device.web == true)){
159+
connectionModes.cmode_type = "mixed"
160+
// all cloud-mode plus one device
161+
if ((connectionModes.cloud.web == true && connectionModes.cloud.mobile == true && connectionModes.cloud.server == true) && (connectionModes.device.mobile == true || connectionModes.device.web == true)){
162+
if (connectionModes.device.mobile == true || connectionModes.device.web == false){
163+
connectionModes.summary = "accepts data in cloud-mode from all source types, and can accept data in device-mode from mobile sources."
164+
}
165+
else if (connectionModes.device.mobile == false || connectionModes.device.web == true){
166+
connectionModes.summary = "accepts data in cloud-mode from all source types, and can accept data in device-mode from Analytics.js sources."
167+
}
168+
connectionModes.case = "9"
169+
}
170+
// edge-case-y: cloud web and mobile, no server, one device
171+
else if ((connectionModes.cloud.web == true && connectionModes.cloud.mobile == true && connectionModes.cloud.server == false) && (connectionModes.device.mobile == true || connectionModes.device.web == true)){
172+
if (connectionModes.device.mobile == true || connectionModes.device.web == false){
173+
connectionModes.summary = "accepts data in cloud-mode from web and mobile sources, and can accept data in device-mode from mobile sources."
174+
}
175+
else if (connectionModes.device.mobile == false || connectionModes.device.web == true){
176+
connectionModes.summary = "accepts data in cloud-mode from web and mobile sources, and can accept data in device-mode from Analytics.js sources."
177+
}
178+
connectionModes.case = "10"
179+
}
180+
// edge-case-y: cloud mobile and server, device mobile, no web
181+
else if (connectionModes.cloud.web == false && connectionModes.cloud.mobile == true && connectionModes.cloud.server == true && connectionModes.device.mobile == true && connectionModes.device.web == false){
182+
connectionModes.summary = "accepts data in cloud-mode from mobile and server sources, and can accept data in device-mode from mobile sources."
183+
connectionModes.case = "11"
184+
}
185+
}
186+
}
187+
93188
return connectionModes
94189
}
95190

96191
/**
97-
*
98192
* If catalog item does not exist, create folder and index.md file for it, and record it as incomplete for later fill in
99193
*/
100194
const doesCatalogItemExist = (item) => {
@@ -266,25 +360,25 @@ const updateDestinations = async () => {
266360
display_name: destination.display_name,
267361
slug,
268362
name: destination.name,
363+
url,
269364
description: destination.description,
270365
hidden: isCatalogItemHidden(url),
271-
url,
272366
status: destination.status,
367+
previous_names: destination.previous_names,
273368
logo: {
274369
url: destination.logos.logo
275370
},
276371
mark: {
277372
url: destination.logos.mark
278373
},
279374
categories: tempCategories,
375+
methods: destination.methods,
280376
components: destination.components,
281377
platforms: destination.platforms,
282378
browserUnbundlingSupported: destination.browserUnbundlingSupported,
283379
browserUnbundlingPublic: destination.browserUnbundlingPublic,
284-
methods: destination.methods,
285-
settings,
286380
connection_modes,
287-
previous_names: destination.previous_names
381+
settings
288382
}
289383

290384
destinationsUpdated.push(updatedDestination)

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 PLATFORM API. DO NOT EDIT
2-
# destination categories last updated 2021-04-01
2+
# destination categories last updated 2021-04-20
33
items:
44
- display_name: Email Marketing
55
slug: email-marketing

0 commit comments

Comments
 (0)