Add beginner version of frontend roadmap

pull/3524/head
Kamran Ahmed 2 years ago
parent 01c090f62d
commit cb32a9610d
  1. 1
      public/jsons/roadmaps/frontend-beginner.json
  2. 2
      public/jsons/roadmaps/frontend.json
  3. 13
      src/components/FrameRenderer/renderer.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -5,7 +5,7 @@ export class Renderer {
this.resourceId = ''; this.resourceId = '';
this.resourceType = ''; this.resourceType = '';
this.jsonUrl = ''; this.jsonUrl = '';
this.loaderNode = null; this.loaderHTML = null;
this.containerId = 'resource-svg-wrap'; this.containerId = 'resource-svg-wrap';
this.loaderId = 'resource-loader'; this.loaderId = 'resource-loader';
@ -31,7 +31,7 @@ export class Renderer {
} }
// Clone it so we can use it later // Clone it so we can use it later
this.loaderNode = this.loaderEl.cloneNode(); this.loaderHTML = this.loaderEl.innerHTML;
const dataset = this.containerEl.dataset; const dataset = this.containerEl.dataset;
this.resourceType = dataset.resourceType; this.resourceType = dataset.resourceType;
@ -51,7 +51,7 @@ export class Renderer {
return null; return null;
} }
this.containerEl.replaceChildren(this.loaderNode); this.containerEl.innerHTML = this.loaderHTML;
return fetch(jsonUrl) return fetch(jsonUrl)
.then((res) => { .then((res) => {
@ -100,6 +100,13 @@ export class Renderer {
return; return;
} }
if (/^json:/.test(groupId)) {
this.jsonToSvg(groupId.replace('json:', '')).then(() => {
this.containerEl.setAttribute('style', '');
});
return;
}
if (/^check:/.test(groupId)) { if (/^check:/.test(groupId)) {
window.dispatchEvent( window.dispatchEvent(
new CustomEvent(`${this.resourceType}.topic.toggle`, { new CustomEvent(`${this.resourceType}.topic.toggle`, {

Loading…
Cancel
Save