Skip to content

Commit

Permalink
Improve handling of entities with dots in their name
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Apr 22, 2024
1 parent f446d70 commit 71c8e83
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions etc/js/entity_tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,15 @@ Vue.component('entity-tree', {
for (var r = 0; r < data.results.length; r ++) {
const elem = data.results[r];
for (var e = 0; e < elem.entities.length; e ++) {
let path = elem.entities[e] + "";
let name;
const name = elem.entities[e] + "";
const name_esc = name.replaceAll(".", "\\.");
let path = name_esc
if (elem.parent) {
name = path;
path = elem.parent + "." + path;
} else {
// Backwards compatibility
name = this.get_name(path);
path = elem.parent + "." + name_esc
}

console.log(path);

let label;
let color;
if (elem.entity_labels) {
Expand All @@ -325,6 +324,10 @@ Vue.component('entity-tree', {
type: elem.type
};
}

console.log(`label: ${label}`);
console.log(`name: ${name}`);
console.log(`path: ${path}`);

entity.label = label;
entity.color = color;
Expand Down

0 comments on commit 71c8e83

Please sign in to comment.