mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-12 12:13:58 +02:00
Add beginner friendly git and github roadmap
This commit is contained in:
@@ -38,6 +38,7 @@ function getNodeDetails(svgElement: SVGElement): RoadmapNodeDetails | null {
|
|||||||
const nodeId = targetGroup?.dataset?.nodeId;
|
const nodeId = targetGroup?.dataset?.nodeId;
|
||||||
const nodeType = targetGroup?.dataset?.type;
|
const nodeType = targetGroup?.dataset?.type;
|
||||||
const title = targetGroup?.dataset?.title;
|
const title = targetGroup?.dataset?.title;
|
||||||
|
|
||||||
if (!nodeId || !nodeType) {
|
if (!nodeId || !nodeType) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -53,6 +54,7 @@ const allowedNodeTypes = [
|
|||||||
'resourceButton',
|
'resourceButton',
|
||||||
'todo',
|
'todo',
|
||||||
'todo-checkbox',
|
'todo-checkbox',
|
||||||
|
'checklist-item',
|
||||||
];
|
];
|
||||||
|
|
||||||
export function EditorRoadmapRenderer(props: RoadmapRendererProps) {
|
export function EditorRoadmapRenderer(props: RoadmapRendererProps) {
|
||||||
@@ -94,8 +96,6 @@ export function EditorRoadmapRenderer(props: RoadmapRendererProps) {
|
|||||||
const { nodeId, nodeType, targetGroup, title } =
|
const { nodeId, nodeType, targetGroup, title } =
|
||||||
getNodeDetails(target) || {};
|
getNodeDetails(target) || {};
|
||||||
|
|
||||||
console.log(nodeId);
|
|
||||||
|
|
||||||
if (!nodeId || !nodeType || !allowedNodeTypes.includes(nodeType)) {
|
if (!nodeId || !nodeType || !allowedNodeTypes.includes(nodeType)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -155,9 +155,30 @@ export function EditorRoadmapRenderer(props: RoadmapRendererProps) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for the click on rect of checklist-item
|
||||||
|
if (nodeType === 'checklist-item' && target.tagName === 'rect') {
|
||||||
|
e.preventDefault();
|
||||||
|
if (!isLoggedIn()) {
|
||||||
|
showLoginPopup();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const newStatus = targetGroup?.classList.contains('done')
|
||||||
|
? 'pending'
|
||||||
|
: 'done';
|
||||||
|
updateTopicStatus(nodeId, newStatus);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// we don't have the topic popup for checklist-item
|
||||||
|
if (nodeType === 'checklist-item') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!title) {
|
if (!title) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const detailsPattern = `${slugify(title)}@${nodeId}`;
|
const detailsPattern = `${slugify(title)}@${nodeId}`;
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new CustomEvent('roadmap.node.click', {
|
new CustomEvent('roadmap.node.click', {
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user