Browse Source

Merge branch 'docs-analytics' into fix/misc-ui

pull/6400/head
Pranav C 1 year ago
parent
commit
2c170930a3
  1. 1
      packages/noco-docs/docusaurus.config.js
  2. 23
      packages/noco-docs/package-lock.json
  3. 1
      packages/noco-docs/package.json
  4. 16
      packages/noco-docs/src/modules/tele.js

1
packages/noco-docs/docusaurus.config.js

@ -121,6 +121,7 @@ const config = {
darkTheme: darkCodeTheme,
},
}),
clientModules: [require.resolve('./src/modules/tele.js')],
};
module.exports = config;

23
packages/noco-docs/package-lock.json generated

@ -14,6 +14,7 @@
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"docusaurus-plugin-sass": "^0.2.5",
"nc-analytics": "^0.0.3",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
@ -28,6 +29,18 @@
"node": ">=16.14"
}
},
"../../../nc-tele": {
"name": "xc-test123",
"version": "2.0.1",
"extraneous": true,
"license": "ISC",
"devDependencies": {
"@types/lodash.debounce": "^4.0.7",
"esbuild": "^0.19.3",
"lodash.debounce": "^4.0.8",
"uuid": "^9.0.1"
}
},
"node_modules/@algolia/autocomplete-core": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz",
@ -8219,6 +8232,11 @@
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/nc-analytics": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/nc-analytics/-/nc-analytics-0.0.3.tgz",
"integrity": "sha512-enZVnSr4RvvalD9dmF+Af6+v5YEW+bCIDmP2cxyZ0Ppyj1BKfzQUngoZ75a3Imr6c+O0u3tWKcPB9Y5lEZIkQA=="
},
"node_modules/negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
@ -18723,6 +18741,11 @@
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA=="
},
"nc-analytics": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/nc-analytics/-/nc-analytics-0.0.3.tgz",
"integrity": "sha512-enZVnSr4RvvalD9dmF+Af6+v5YEW+bCIDmP2cxyZ0Ppyj1BKfzQUngoZ75a3Imr6c+O0u3tWKcPB9Y5lEZIkQA=="
},
"negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",

1
packages/noco-docs/package.json

@ -33,6 +33,7 @@
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"docusaurus-plugin-sass": "^0.2.5",
"nc-analytics": "^0.0.3",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",

16
packages/noco-docs/src/modules/tele.js

@ -0,0 +1,16 @@
import { init, push } from 'nc-analytics';
init();
export function onRouteDidUpdate({ location, previousLocation }) {
// Don't execute if we are still on the same page; the lifecycle may be fired
// because the hash changes (e.g. when navigating between headings)
if (location.pathname !== previousLocation?.pathname || location.hash !== previousLocation?.hash) {
push({
event: '$pageview',
$current_url: location.pathname,
hash: location.hash,
});
}
}
Loading…
Cancel
Save