From 122a9f3e8f4d5f494f3c4512dc1c34395ebca056 Mon Sep 17 00:00:00 2001 From: Thomas Junk Date: Thu, 14 Sep 2023 10:33:12 +0200 Subject: [PATCH] refactor: Key value separated into own element --- src/lib/singleview/KeyValues.svelte | 22 +++++ src/lib/singleview/general/General.svelte | 98 ++++++++++++------- .../vulnerability/GeneralSection.svelte | 55 +++++------ .../vulnerabilities/vulnerability/ID.svelte | 23 +---- 4 files changed, 111 insertions(+), 87 deletions(-) create mode 100644 src/lib/singleview/KeyValues.svelte diff --git a/src/lib/singleview/KeyValues.svelte b/src/lib/singleview/KeyValues.svelte new file mode 100644 index 0000000..aa56d1c --- /dev/null +++ b/src/lib/singleview/KeyValues.svelte @@ -0,0 +1,22 @@ + + +{#each keys as key, index} + + + + +
{key}{values[index]}
+{/each} + + diff --git a/src/lib/singleview/general/General.svelte b/src/lib/singleview/general/General.svelte index 9209f7d..ebd24b5 100644 --- a/src/lib/singleview/general/General.svelte +++ b/src/lib/singleview/general/General.svelte @@ -37,36 +37,62 @@
-
-
ID
-
{id}
-
CSAF-Version
-
{csafVersion}
-
TLP
-
{tlp} 
-
Category
-
{category}
-
Title
-
{title}
-
Publisher name
-
{publisherName}
-
Publisher category
-
{publisherCategory}
-
Publisher namespace
-
{publisherNamespace}
-
Language
-
{lang} 
-
Published
-
{published}
-
Last update
-
{lastUpdate}
-
Tracking Version
-
{trackingVersion}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {#if $appStore.doc?.status !== Status.final} -
Status
-
{status}
+ + + + {/if} - +
ID{id}
CSAF-Version{csafVersion}
TLP{tlp} 
Category{category}
Title{title}
Publisher name{publisherName}
Publisher category{publisherCategory}
Publisher namespace{publisherNamespace}
Language{lang}
Published{published}
Last update{lastUpdate}
Tracking Version{trackingVersion}
Status{status}
{#if $appStore.doc?.isRevisionHistoryPresent} @@ -98,6 +124,13 @@ {/if} + if (vulnerability.discovery_date) { + keys.push("Discovery date"); + values.push(vulnerability.discovery_date); + } + if (vulnerability.release_date) { + keys.push("Release date"); + values.push(vulnerability.release_date); + } + + + diff --git a/src/lib/singleview/vulnerabilities/vulnerability/ID.svelte b/src/lib/singleview/vulnerabilities/vulnerability/ID.svelte index 92c6d5f..3207b39 100644 --- a/src/lib/singleview/vulnerabilities/vulnerability/ID.svelte +++ b/src/lib/singleview/vulnerabilities/vulnerability/ID.svelte @@ -1,27 +1,14 @@ {#each vulnerability.ids as vulnerabilityID} -
-
Systemname
-
{vulnerabilityID.system_name}
-
Text
-
{vulnerabilityID.text}
-
+ {/each}
- -