Skip to content

Commit 184c6a6

Browse files
Merge pull request #71 from kamranahmedse/master
Create a new pull request by comparing changes across two branches
2 parents db3ad0e + 3d65596 commit 184c6a6

File tree

7 files changed

+34
-9
lines changed

7 files changed

+34
-9
lines changed

src/components/Analytics/analytics.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ export {};
22

33
declare global {
44
interface Window {
5+
// To selectively enable/disable debug logs
6+
__DEBUG__: boolean;
57
gtag: any;
68
fireEvent: (props: GAEventType) => void;
79
}
@@ -27,6 +29,10 @@ window.fireEvent = (props: GAEventType) => {
2729
return;
2830
}
2931

32+
if (window.__DEBUG__) {
33+
console.log('Analytics event fired', props);
34+
}
35+
3036
window.gtag('event', action, {
3137
event_category: category,
3238
event_label: label,

src/components/FrameRenderer/renderer.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,15 @@ export class Renderer {
108108
window.history.pushState(null, '', url.toString());
109109
}
110110

111-
const pageTitle = this.resourceId.replace(/\b\w/g, (l) => l.toUpperCase());
112111
const pageType = this.resourceType.replace(/\b\w/g, (l) => l.toUpperCase());
113-
const newRoadmapType = newJsonFileSlug.replace(/\b\w/g, (l) => l.toUpperCase()).replace('-', ' ');
114112

115113
window.fireEvent({
116114
// RoadmapClick, BestPracticesClick, etc
117115
category: `${pageType.replace('-', '')}Click`,
118-
// Roadmap Switch, BestPractices Switch, etc
119-
action: `${pageType} Switch`,
120-
label: `${pageTitle} / ${newRoadmapType}`,
116+
// roadmap/frontend/switch-version
117+
action: `${this.resourceId}/switch-version`,
118+
// roadmap/frontend/switch-version
119+
label: `${newJsonFileSlug}`,
121120
});
122121

123122
this.jsonToSvg(newJsonUrl).then(() => {

src/components/TopicOverlay/TopicOverlay.astro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const { contentContributionLink } = Astro.props;
2222
<div id='topic-actions' class='hidden mb-2'>
2323
<button
2424
id='mark-topic-done'
25+
ga-category='TopicClick'
26+
ga-action='topic/mark-completion'
27+
ga-label='done'
2528
class='bg-green-600 text-white p-1 px-2 text-sm rounded-md hover:bg-green-700 inline-flex items-center'
2629
>
2730
<Icon icon='check' />
@@ -30,6 +33,9 @@ const { contentContributionLink } = Astro.props;
3033

3134
<button
3235
id='mark-topic-pending'
36+
ga-category='TopicClick'
37+
ga-action='topic/mark-completion'
38+
ga-label='pending'
3339
class='hidden bg-red-600 text-white p-1 px-2 text-sm rounded-md hover:bg-red-700 inline-flex items-center'
3440
>
3541
<Icon icon='reset' />

src/components/TopicOverlay/topic.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ export class Topic {
177177
this.activeTopicId = topicId;
178178

179179
this.resetDOM();
180-
this.renderTopicFromUrl(`/best-practices/${bestPracticeId}/${topicId.replaceAll(':', '/')}`);
180+
181+
const topicUrl = `/best-practices/${bestPracticeId}/${topicId.replaceAll(':', '/')}`;
182+
183+
this.renderTopicFromUrl(topicUrl).then(() => null);
181184
}
182185

183186
handleRoadmapTopicClick(e) {
@@ -192,7 +195,15 @@ export class Topic {
192195
this.activeTopicId = topicId;
193196

194197
this.resetDOM();
195-
this.renderTopicFromUrl(`/${roadmapId}/${topicId.replaceAll(':', '/')}`);
198+
const topicUrl = `/${roadmapId}/${topicId.replaceAll(':', '/')}`;
199+
200+
window.fireEvent({
201+
category: `RoadmapClick`,
202+
action: `${roadmapId}/load-topic`,
203+
label: topicUrl,
204+
});
205+
206+
this.renderTopicFromUrl(topicUrl).then(() => null);
196207
}
197208

198209
querySvgElementsByTopicId(topicId) {

src/data/roadmaps/cyber-security/cyber-security.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ dimensions:
1212
width: 968
1313
height: 3316.15
1414
schema:
15-
headline: "Cyber Security Roadmap"
15+
headline: "Cyber Security Roadmap: Learn to become a Cyber Security Expert"
1616
description: "Learn how to become a Cyber Security expert with this interactive step by step guide in 2023. We also have resources and short descriptions attached to the roadmap items so you can get everything you want to learn in one place."
1717
imageUrl: "https://roadmap.sh/roadmaps/cyber-security.png"
1818
datePublished: "2023-01-05"
1919
dateModified: "2023-01-20"
2020
seo:
21-
title: "Cyber Security Roadmap"
21+
title: "Cyber Security Roadmap: Learn to become a Cyber Security Expert"
2222
description: "Community driven, articles, resources, guides, interview questions, quizzes for cyber security. Learn to become a modern Cyber Security Expert by following the steps, skills, resources and guides listed in this roadmap."
2323
keywords:
2424
- "guide to becoming a cyber security expert"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Learn a Language
22

33
It doesn't matter what language you pick, but it is important to learn at least one. You will be able to use that language to write automation scripts.
4+
5+
- [Guide to Picking a Language for DevOps](https://cs.fyi/guide/programming-language-for-devops)

src/data/roadmaps/devops/content/105-infrastructure-as-code/105-secret-management/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Effective secret management is essential for maintaining the security and integr
1212

1313
Visit the following resources to learn more:
1414

15+
- [How to Manage Secrets in Web Applications?](https://cs.fyi/guide/secret-management-best-practices)
1516
- [Secrets management guide — approaches, open source tools, commercial products, challenges and questions](https://medium.com/@burshteyn/secrets-management-guide-approaches-open-source-tools-commercial-products-challenges-db560fd0584d)
1617
- [Secret Management Architectures: Finding the balance between security and complexity](https://medium.com/slalom-technology/secret-management-architectures-finding-the-balance-between-security-and-complexity-9e56f2078e54)
1718

0 commit comments

Comments
 (0)