You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 2. FIX: Flip flag strictly AFTER modules attach to Highcharts
197
+
this.modulesReady=true;
198
+
}
199
+
200
+
if (this.tree) {
201
+
this.flattenedOriginalTree(this.tree);
202
+
}
222
203
},
223
204
methods: {
224
-
/**
225
-
* Recursively flattens a hierarchical tree structure into a single array of nodes.
226
-
* Each node is added to the `subjectsArrList` array. If a node has children,
227
-
* the method is called recursively on the children.
228
-
*
229
-
* @param{Array<Object>}tree - The hierarchical tree structure to be flattened. Each node may have a `children` property containing an array of child nodes.
230
-
* @return{void} This method does not return a value. It modifies the `subjectsArrList` array in place.
231
-
*/
232
205
flattenedOriginalTree(tree) {
206
+
if (!tree ||!Array.isArray(tree)) return;
233
207
tree.forEach((item) => {
234
208
this.subjectsArrList.push(item);
235
209
if (item["children"] && item["children"].length) {
236
210
this.flattenedOriginalTree(item["children"]);
237
211
}
238
212
});
239
213
},
240
-
241
-
/**
242
-
* Handles click events on a node and performs routing or emits a selected subject node to the parent component.
243
-
*
244
-
* @param{Object}node - The node object that was clicked. This object contains properties such as `descendants_count`,`name`, `identifier`, and `ancestors` which are used in processing the click event.
245
-
* @return{void} This method does not return any value. It performs routing or emits an event based on the clicked node.
246
-
*/
247
214
processClickEvent(node) {
248
215
if (node.name!=="Subject") {
249
216
if (node.descendants_count===0) {
@@ -258,8 +225,6 @@ export default {
258
225
}
259
226
}
260
227
261
-
//If the node is clicked for the first time emit node, if the same node is clicked second time while it is active this means that node was already open.
262
-
//Hence it's ancestor should be passed.
263
228
if (node["ancestors"] &&!node["ancestors"].length) {
264
229
this.$emit("subjectNode", []);
265
230
} else {
@@ -270,30 +235,25 @@ export default {
270
235
this.nodeClicked= nodeAncestor;
271
236
}
272
237
273
-
//Filter the selected subject from the arrayList and emit to the parent component
0 commit comments