Skip to content

Commit 37d61bf

Browse files
authored
Merge branch '7.1.x' into api-docs-gulp-7.1.x
2 parents 9c10dab + ce163ab commit 37d61bf

File tree

5 files changed

+74
-24
lines changed

5 files changed

+74
-24
lines changed

extras/docs/themes/config.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
{
22
"en": {
33
"development": {
4-
"url": "https://dev.infragistics.local"
4+
"url": "https://dev.infragistics.local",
5+
"gaID": "GTM-WLXLBZD"
56
},
67
"staging": {
7-
"url": "https://staging.infragistics.local"
8+
"url": "https://staging.infragistics.local",
9+
"gaID": "GTM-NCKNPN"
810
},
911
"production": {
10-
"url": "https://www.infragistics.com"
12+
"url": "https://www.infragistics.com",
13+
"gaID": "GTM-T65CF7"
1114
}
1215
},
1316
"jp": {
1417
"development": {
15-
"url": "https://jp.dev.infragistics.local"
18+
"url": "https://jp.dev.infragistics.local",
19+
"gaID": "GTM-NNHVMC7"
1620
},
1721
"staging": {
18-
"url": "https://jp.staging.infragistics.local"
22+
"url": "https://jp.staging.infragistics.local",
23+
"gaID": "GTM-WLWSDK"
1924
},
2025
"production": {
21-
"url": "https://jp.infragistics.com"
26+
"url": "https://jp.infragistics.com",
27+
"gaID": "GTM-KVNSWJ"
2228
}
23-
}
24-
}
29+
}
30+
}

extras/docs/themes/sassdoc/index.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,13 @@ const theme = themeleon(__dirname, function (t) {
112112
return value.substring(0, 3);
113113
},
114114
retrieveEnvLink: () => {
115-
let {
116-
NODE_ENV: node,
117-
SASSDOC_LANG: lang
118-
} = process.env;
119-
120-
if (!node || !lang) {
121-
return;
122-
}
123-
124-
const pathConfig = path.join('extras', 'docs', 'themes', 'config.json');
125-
const config_file = JSON.parse(fs.readFileSync(pathConfig, 'utf8'));
126-
const config = config_file[lang.trim()][node.trim()];
115+
const config = getConfigData(process.env);
127116
return config ? config.url : '';
128117
},
118+
gaID: () => {
119+
const config = getConfigData(process.env);
120+
return config ? config.gaID : '';
121+
},
129122
ifCond: (v1, operator, v2, options) => {
130123
switch (operator) {
131124
case '==':
@@ -290,3 +283,18 @@ module.exports = function (dest, ctx) {
290283
*/
291284
return theme.apply(this, arguments);
292285
};
286+
287+
function getConfigData(envs) {
288+
let {
289+
NODE_ENV: env,
290+
SASSDOC_LANG: lang
291+
} = envs;
292+
293+
if (!env || !lang) {
294+
return;
295+
}
296+
297+
const pathConfig = path.join('extras', 'docs', 'themes', 'config.json');
298+
const data = JSON.parse(fs.readFileSync(pathConfig, 'utf8'));
299+
return data[lang.trim()][env.trim()];
300+
}

extras/docs/themes/sassdoc/views/index.hbs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,29 @@
1616
<link rel="shortcut icon" href="https://www.infragistics.com/assets/images/favicon.ico">
1717
<link rel="stylesheet" href="https://use.typekit.net/zhy2hpz.css">
1818
<link rel="stylesheet" href="assets/css/main.css" />
19+
20+
<!-- Google Tag Manager -->
21+
<script>
22+
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
23+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
24+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
25+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
26+
})(window,document,'script','dataLayer', "{{gaID}}");
27+
</script>
28+
<!-- End Google Tag Manager -->
1929
</head>
2030

2131
<body data-base-url="{{retrieveEnvLink}}">
32+
33+
<!-- Google Tag Manager (noscript) -->
34+
<noscript>
35+
<iframe src="https://www.googletagmanager.com/ns.html?id={{gaID}}"
36+
height="0" width="0" style="display:none;visibility:hidden"></iframe>
37+
</noscript>
38+
<!-- End Google Tag Manager (noscript) -->
39+
2240
{{> header}}
41+
2342
{{!
2443
! You can access any variable you set in your configuration file from the `view` object.
2544
! Basically your configuration file is passed to the view as the `view` object.

extras/docs/themes/typedoc/src/assets/js/src/theme.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ export default class EnvironmentLinkSetup extends DefaultTheme {
1111

1212
constructor(renderer: Renderer, basePath) {
1313
super(renderer, basePath);
14-
Handlebars.registerHelper('envUrl', this.retrieveEnvUrl);
14+
Handlebars.registerHelper('getConfigData', this.getConfigData);
1515
}
1616

17-
private retrieveEnvUrl() {
17+
private getConfigData(prop) {
1818
const fileName = 'config.json';
1919
let settings;
2020
let config;
@@ -32,6 +32,6 @@ export default class EnvironmentLinkSetup extends DefaultTheme {
3232
data = config[settings.localize][process.env.NODE_ENV.trim()];
3333
}
3434

35-
return data ? data.url : '';
35+
return data ? data[prop] : '';
3636
}
3737
}

extras/docs/themes/typedoc/src/layouts/default.hbs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,25 @@
1717
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
1818
<link rel="stylesheet" href="https://use.typekit.net/zhy2hpz.css">
1919
<link rel="stylesheet" href="{{relativeURL "assets/css/main.css"}}">
20+
21+
<!-- Google Tag Manager -->
22+
<script>
23+
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
24+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
25+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
26+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
27+
})(window,document,'script','dataLayer', "{{getConfigData 'gaID'}}");
28+
</script>
29+
<!-- End Google Tag Manager -->
2030
</head>
21-
<body id="body" data-base-url="{{envUrl}}">
31+
<body id="body" data-base-url="{{getConfigData "url"}}">
32+
33+
<!-- Google Tag Manager (noscript) -->
34+
<noscript>
35+
<iframe src="https://www.googletagmanager.com/ns.html?id={{getConfigData 'gaID'}}"
36+
height="0" width="0" style="display:none;visibility:hidden"></iframe>
37+
</noscript>
38+
<!-- End Google Tag Manager (noscript) -->
2239

2340
{{> header}}
2441

0 commit comments

Comments
 (0)