Skip to content

Commit f166783

Browse files
committed
Prep for tree changes
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent 7501374 commit f166783

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

webui/main.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,15 +1040,15 @@ function createKeywordPanel(id, keywords, onUpdate) {
10401040

10411041
const icons = {
10421042
branch: 'folder',
1043-
leaf: 'file',
1043+
leaf: 'circle-filled',
10441044
open: 'folder-opened',
10451045
};
10461046

10471047
tree.data = keywords.map((keyword, index) => {
10481048
return {
10491049
icons,
10501050
label: keyword.name,
1051-
value: keyword.value,
1051+
value: keyword,
10521052
description: keyword.value,
10531053
actions,
10541054
subItems: keyword.conditions.map(c => ({
@@ -1059,6 +1059,11 @@ function createKeywordPanel(id, keywords, onUpdate) {
10591059
};
10601060
});
10611061

1062+
tree.addEventListener('vsc-run-action', (event) => {
1063+
console.log(event.detail);
1064+
// TODO: show UI here and update event.value with changes value
1065+
});
1066+
10621067
section.appendChild(tree);
10631068

10641069
if (onUpdate) {
@@ -1084,19 +1089,7 @@ function createKeywordPanel(id, keywords, onUpdate) {
10841089
/** @type {Keyword[]} */
10851090
let newKeywords = [];
10861091

1087-
rows.forEach(row => {
1088-
// TODO: how to handle conditions? D:
1089-
const keywordCell = row.querySelector(`[id^='c-'][id$='-keyword']`);
1090-
const valueCell = row.querySelector(`[id^='c-'][id$='-value']`);
1091-
1092-
if (keywordCell && valueCell) {
1093-
newKeywords.push({
1094-
name: keywordCell.innerText,
1095-
value: valueCell.innerText,
1096-
conditions: []
1097-
});
1098-
}
1099-
});
1092+
// Update newKeywors based on tree.data
11001093

11011094
onUpdate(newKeywords);
11021095
});

0 commit comments

Comments
 (0)