mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-02 22:02:39 +02:00
Add event for roadmap switch
This commit is contained in:
@@ -108,16 +108,15 @@ export class Renderer {
|
|||||||
window.history.pushState(null, '', url.toString());
|
window.history.pushState(null, '', url.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
const pageTitle = this.resourceId.replace(/\b\w/g, (l) => l.toUpperCase());
|
|
||||||
const pageType = this.resourceType.replace(/\b\w/g, (l) => l.toUpperCase());
|
const pageType = this.resourceType.replace(/\b\w/g, (l) => l.toUpperCase());
|
||||||
const newRoadmapType = newJsonFileSlug.replace(/\b\w/g, (l) => l.toUpperCase()).replace('-', ' ');
|
|
||||||
|
|
||||||
window.fireEvent({
|
window.fireEvent({
|
||||||
// RoadmapClick, BestPracticesClick, etc
|
// RoadmapClick, BestPracticesClick, etc
|
||||||
category: `${pageType.replace('-', '')}Click`,
|
category: `${pageType.replace('-', '')}Click`,
|
||||||
// Roadmap Switch, BestPractices Switch, etc
|
// roadmap/frontend/switch-version
|
||||||
action: `${pageType} Switch`,
|
action: `${this.resourceType}/${this.resourceId}/switch-version`,
|
||||||
label: `${pageTitle} / ${newRoadmapType}`,
|
// roadmap/frontend/switch-version
|
||||||
|
label: `${newJsonFileSlug}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.jsonToSvg(newJsonUrl).then(() => {
|
this.jsonToSvg(newJsonUrl).then(() => {
|
||||||
|
Reference in New Issue
Block a user