From 06c561de345e10587263aa44cb141de05cc81d99 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Sun, 4 Jun 2023 04:35:50 +0200 Subject: [PATCH 01/25] Update product_tree and choices --- yace/data/product-list.json | 18 +++++++----------- yace/data/products/1.json | 22 ++++++++++++++-------- yace/data/products/2.json | 22 ++++++++++++++-------- yace/data/products/3.json | 22 ++++++++++++++-------- yace/data/products/4.json | 22 ++++++++++++++-------- yace/data/products/994_44.json | 18 ------------------ 6 files changed, 63 insertions(+), 61 deletions(-) delete mode 100644 yace/data/products/994_44.json diff --git a/yace/data/product-list.json b/yace/data/product-list.json index a57741c..d50fd6e 100644 --- a/yace/data/product-list.json +++ b/yace/data/product-list.json @@ -2,23 +2,19 @@ "products": [ { "id": 1, - "label": "Controller v1.0" + "label": "Product A 1.0" }, { "id": 2, - "label": "Controller v2.0" + "label": "Product B 1.0" }, { "id": 3, - "label": "Controller v3.0" + "label": "Product C 4.2" }, - { - "id": 4, - "label": "Controller v4.0" - }, - { - "id": "994_44", - "label": "Sensor 994 v4.4" - } + { + "id": 4, + "label": "Product C 4.3" + } ] } \ No newline at end of file diff --git a/yace/data/products/1.json b/yace/data/products/1.json index dcca939..cedf6e9 100644 --- a/yace/data/products/1.json +++ b/yace/data/products/1.json @@ -1,16 +1,22 @@ { "branches": [ { - "category": "product_family", - "name": "controller", + "category": "vendor", + "name": "Example Company", "branches": [ { - "category": "product_version", - "name": "1.0", - "product": { - "name": "controller 1.0", - "product_id": "1" - } + "category": "product_name", + "name": "Product A", + "branches": [ + { + "category": "product_version", + "name": "1.0", + "product": { + "name": "Product A 1.0", + "product_id": "1" + } + } + ] } ] } diff --git a/yace/data/products/2.json b/yace/data/products/2.json index 828f7bf..4c89899 100644 --- a/yace/data/products/2.json +++ b/yace/data/products/2.json @@ -1,16 +1,22 @@ { "branches": [ { - "category": "product_family", - "name": "controller", + "category": "vendor", + "name": "Example Company", "branches": [ { - "category": "product_version", - "name": "2.0", - "product": { - "name": "controller 2.0", - "product_id": "2" - } + "category": "product_name", + "name": "Product B", + "branches": [ + { + "category": "product_version", + "name": "1.0", + "product": { + "name": "Product B 1.0", + "product_id": "2" + } + } + ] } ] } diff --git a/yace/data/products/3.json b/yace/data/products/3.json index 252cb6e..a6c09ea 100644 --- a/yace/data/products/3.json +++ b/yace/data/products/3.json @@ -1,16 +1,22 @@ { "branches": [ { - "category": "product_family", - "name": "controller", + "category": "vendor", + "name": "Example Company", "branches": [ { - "category": "product_version", - "name": "3.0", - "product": { - "name": "controller 3.0", - "product_id": "3" - } + "category": "product_name", + "name": "Product C", + "branches": [ + { + "category": "product_version", + "name": "4.2", + "product": { + "name": "Product C 4.2", + "product_id": "3" + } + } + ] } ] } diff --git a/yace/data/products/4.json b/yace/data/products/4.json index 252cb6e..b011967 100644 --- a/yace/data/products/4.json +++ b/yace/data/products/4.json @@ -1,16 +1,22 @@ { "branches": [ { - "category": "product_family", - "name": "controller", + "category": "vendor", + "name": "Example Company", "branches": [ { - "category": "product_version", - "name": "3.0", - "product": { - "name": "controller 3.0", - "product_id": "3" - } + "category": "product_name", + "name": "Product C", + "branches": [ + { + "category": "product_version", + "name": "4.3", + "product": { + "name": "Product C 4.3", + "product_id": "4" + } + } + ] } ] } diff --git a/yace/data/products/994_44.json b/yace/data/products/994_44.json deleted file mode 100644 index 44a7508..0000000 --- a/yace/data/products/994_44.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "branches": [ - { - "category": "product_family", - "name": "sensor", - "branches": [ - { - "category": "product_version", - "name": "3.0", - "product": { - "name": "sensor 994 v4.4", - "product_id": "994_44" - } - } - ] - } - ] -} \ No newline at end of file From 08fd0fe86f00ba23630886886a625c96b1f509df Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Sun, 4 Jun 2023 04:37:07 +0200 Subject: [PATCH 02/25] Update default values --- yace/js/store/state.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yace/js/store/state.js b/yace/js/store/state.js index a56d0be..f9c5511 100644 --- a/yace/js/store/state.js +++ b/yace/js/store/state.js @@ -5,10 +5,10 @@ export default { csaf_version:"2.0", category: "csaf_security_advisory", "publisher": { - "category": "coordinator", - "name": "ACME Cooperation", - "namespace": "https://acme.example", - "contact_details": "csaf@acme.example" + "category": "vendor", + "name": "Example Company", + "namespace": "https://www.example.com", + "contact_details": "psirt@example.com" }, tracking:{ "revision_history": [ @@ -21,7 +21,7 @@ export default { } }, product_tree:[ - {branches:[{category:"product_family", name:"controller", branches: [{category:"product_version", name:"1.0", product:{name:"controller 1.0",product_id:"1"}}]}]} + {} ] } }; From 673ecc94d1c59204234d6ff0d6e636c1b2106846 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Sun, 4 Jun 2023 04:37:22 +0200 Subject: [PATCH 03/25] Minor corrections --- yace/index.html | 4 ++-- yace/js/main.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/yace/index.html b/yace/index.html index 8cd8409..459de69 100644 --- a/yace/index.html +++ b/yace/index.html @@ -10,7 +10,7 @@
- +
@@ -22,7 +22,7 @@

Overview

From 7706dee182182e07358b4d6f50cb8224fcb859a3 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Sun, 4 Jun 2023 06:02:34 +0200 Subject: [PATCH 10/25] Fix product_tree product removal --- yace/js/store/mutations.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yace/js/store/mutations.js b/yace/js/store/mutations.js index e21da56..2d14f72 100644 --- a/yace/js/store/mutations.js +++ b/yace/js/store/mutations.js @@ -29,7 +29,7 @@ export default { }, addProduct(state, payload) { let prod = payload; - if (!('product_tree' in state.csaf)) {console.log('Add missing product_tree'); state.csaf.product_tree = {}} + if (!('product_tree' in state.csaf)) {state.csaf.product_tree = {}} if (!('branches' in state.csaf.product_tree)){ state.csaf.product_tree.branches = [prod.branches]; } else { @@ -38,7 +38,7 @@ export default { return state; }, removeProduct(state, payload) { - state.csaf.product_tree.splice(payload.index, 1); + state.csaf.product_tree.branches.splice(payload.index, 1); return state; }, From 741beb7c8ba30a6d80f59af9e2bf8fdc10ba6f15 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Sun, 4 Jun 2023 06:21:02 +0200 Subject: [PATCH 11/25] Correct product_status implemenation --- yace/js/components/vulnerabilityList.js | 2 +- yace/js/store/mutations.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/yace/js/components/vulnerabilityList.js b/yace/js/components/vulnerabilityList.js index a24c600..3199f50 100644 --- a/yace/js/components/vulnerabilityList.js +++ b/yace/js/components/vulnerabilityList.js @@ -52,7 +52,7 @@ export default class List extends Component { diff --git a/yace/js/store/mutations.js b/yace/js/store/mutations.js index 2d14f72..427ad90 100644 --- a/yace/js/store/mutations.js +++ b/yace/js/store/mutations.js @@ -114,9 +114,13 @@ export default { vulStatus[payload.status] = []; } Object.keys(vulStatus).forEach((status) =>{ - vulStatus[status].filter((productId => productId !== payload.productId)); + vulStatus[status] = vulStatus[status].filter((productId => productId !== payload.productId)); }); vulStatus[payload.status].push(payload.productId); + //remove empty product_status + Object.keys(vulStatus).forEach((status) =>{ + if (vulStatus[status].length == 0) {delete vulStatus[status]} + }); return state; }, loadDocument(state, payload){ From e457fba9e2409ab24197005c60f7328de8f4c9b0 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Sun, 4 Jun 2023 06:27:05 +0200 Subject: [PATCH 12/25] change h2 to h3 for subsub elements --- yace/js/components/notesList.js | 4 ++-- yace/js/components/referencesList.js | 4 ++-- yace/js/components/revisionList.js | 4 ++-- yace/js/components/vulnerabilityNotesList.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/yace/js/components/notesList.js b/yace/js/components/notesList.js index 7bbd362..d2d01a6 100644 --- a/yace/js/components/notesList.js +++ b/yace/js/components/notesList.js @@ -24,13 +24,13 @@ export default class NotesList extends Component { // If there are no items to show, render a little status instead if(store.state.csaf?.document?.notes == undefined) { self.element.innerHTML = ` -

Notes

+

Notes

`; } else { // Loop the items and generate a list of elements self.element.innerHTML = ` -

Notes

+

Notes

${store.state.csaf?.document?.notes.map((notesItem, index) => { return `
diff --git a/yace/js/components/referencesList.js b/yace/js/components/referencesList.js index 0f407f0..64b29cc 100644 --- a/yace/js/components/referencesList.js +++ b/yace/js/components/referencesList.js @@ -24,13 +24,13 @@ export default class ReferencesList extends Component { // If there are no items to show, render a little status instead if(store.state.csaf?.document?.references == undefined) { self.element.innerHTML = ` -

References

+

References

`; } else { // Loop the items and generate a list of elements self.element.innerHTML = ` -

Revision

+

Revision

${store.state.csaf?.document?.references.map((item, index) => { return `
diff --git a/yace/js/components/revisionList.js b/yace/js/components/revisionList.js index 5a39962..ed129a6 100644 --- a/yace/js/components/revisionList.js +++ b/yace/js/components/revisionList.js @@ -24,7 +24,7 @@ export default class RevisionList extends Component { // If there are no items to show, render a little status instead if(store.state.csaf?.document?.tracking?.revision_history == undefined) { self.element.innerHTML = ` -

Revision

+

Revision