From 860b94ec6c3977c33ed37fb7d5687c29d9710068 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Fri, 9 Oct 2026 16:29:17 +0200 Subject: [PATCH] feat(dashboard): Embedded Linux / Yocto is marked as a preview The type stays selectable, but a scan of it covers only secrets, malware and SAST over patches and files; there is no recipe or image SBOM yet. The onboarding card, the target header and the type select in the target settings say so with a "Vorschau" / "Preview" badge and that one line, and so do the getting-started and repositories guides. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p --- compliance-dashboard/src/i18n/texts.rs | 35 ++++++++++++++++++++ compliance-dashboard/src/pages/onboarding.rs | 11 +++++- compliance-dashboard/src/pages/target.rs | 18 +++++++++- docs/guide/getting-started.md | 2 +- docs/guide/repositories.md | 2 +- 5 files changed, 64 insertions(+), 4 deletions(-) diff --git a/compliance-dashboard/src/i18n/texts.rs b/compliance-dashboard/src/i18n/texts.rs index ed0e571..0bad902 100644 --- a/compliance-dashboard/src/i18n/texts.rs +++ b/compliance-dashboard/src/i18n/texts.rs @@ -1163,6 +1163,27 @@ pub mod kinds { label(&TARGET_TYPES, value, lang) } + /// Target types offered as a preview: selectable, but analysed only in + /// part so far (Yocto: no recipe or image SBOM yet). + pub const PREVIEW_TYPES: [&str; 1] = ["embedded_linux_yocto"]; + + /// Whether `value` is one of the [`PREVIEW_TYPES`]. + pub fn is_preview(value: &str) -> bool { + PREVIEW_TYPES.contains(&value) + } + + /// The badge on a preview type. + pub const PREVIEW: Text = Text { + de: "Vorschau", + en: "Preview", + }; + + /// What a scan of a preview type covers today. + pub const PREVIEW_NOTE: Text = Text { + de: "Heute: Secrets, Malware und SAST über Patches und Dateien; noch keine Rezept- oder Image-SBOM.", + en: "Today: secrets, malware and SAST over patches and files; no recipe or image SBOM yet.", + }; + /// An artifact kind's label; an unknown value is shown with spaces. pub fn artifact_kind(value: &str, lang: super::super::Lang) -> String { label(&ARTIFACT_KINDS, value, lang) @@ -1174,6 +1195,20 @@ pub mod kinds { .find(|(v, _)| *v == value) .map_or_else(|| value.replace('_', " "), |(_, t)| t.get(lang).to_string()) } + + #[cfg(test)] + mod preview_tests { + use super::*; + + #[test] + fn only_yocto_is_a_preview_and_it_is_offered() { + assert!(is_preview("embedded_linux_yocto")); + assert!(!is_preview("firmware_rtos")); + for value in PREVIEW_TYPES { + assert!(TARGET_TYPES.iter().any(|(v, _)| *v == value), "{value}"); + } + } + } } /// The onboarding wizard. diff --git a/compliance-dashboard/src/pages/onboarding.rs b/compliance-dashboard/src/pages/onboarding.rs index a19134c..a25911c 100644 --- a/compliance-dashboard/src/pages/onboarding.rs +++ b/compliance-dashboard/src/pages/onboarding.rs @@ -204,8 +204,17 @@ pub fn OnboardingPage() -> Element { class: "type-card", "aria-pressed": if target_type() == value { "true" } else { "false" }, onclick: move |_| target_type.set(value.to_string()), - span { class: "type-card-name", {tlabel.get(lang)} } + span { class: "type-card-name", + {tlabel.get(lang)} + if kinds::is_preview(value) { + " " + span { class: "badge badge-medium", {kinds::PREVIEW.get(lang)} } + } + } span { class: "type-card-hint", {hint.get(lang)} } + if kinds::is_preview(value) { + span { class: "type-card-hint", {kinds::PREVIEW_NOTE.get(lang)} } + } } } } diff --git a/compliance-dashboard/src/pages/target.rs b/compliance-dashboard/src/pages/target.rs index e0d744e..179671a 100644 --- a/compliance-dashboard/src/pages/target.rs +++ b/compliance-dashboard/src/pages/target.rs @@ -146,6 +146,11 @@ pub fn TargetPage(id: String) -> Element { } p { class: "target-head-meta", span { "{type_label}" } + if kinds::is_preview(str_at(&t, "target_type")) { + span { class: "badge badge-medium", title: "{kinds::PREVIEW_NOTE.get(lang)}", + {kinds::PREVIEW.get(lang)} + } + } for a in artifacts.iter() { span { class: "target-head-artifact", "{kinds::artifact_kind(str_at(a, \"kind\"), lang)}: " @@ -489,7 +494,18 @@ fn TargetEditor( value: "{edit_type}", oninput: move |e| edit_type.set(e.value()), for (v, l) in kinds::TARGET_TYPES { - option { value: "{v}", selected: edit_type() == v, {l.get(lang)} } + option { value: "{v}", selected: edit_type() == v, + if kinds::is_preview(v) { + "{l.get(lang)} ({kinds::PREVIEW.get(lang)})" + } else { + {l.get(lang)} + } + } + } + } + if kinds::is_preview(&edit_type()) { + div { style: "font-size: 0.85em; color: var(--text-secondary); margin-top: 4px;", + {kinds::PREVIEW_NOTE.get(lang)} } } } diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index e530e51..7d789d2 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -61,7 +61,7 @@ Anlagenbau sind meist diese Typen richtig: | **SPS / PLC** | Steuerungsprogramme nach IEC 61131-3 (CODESYS, PLCopen XML, Structured Text) | | **Firmware — RTOS** | Mikrocontroller-Firmware mit Echtzeitbetriebssystem, z. B. Zephyr oder FreeRTOS | | **Firmware — ohne Betriebssystem** | Mikrocontroller-Firmware ohne Betriebssystem | -| **Embedded Linux / Yocto** | BSP und Image auf Linux-Basis | +| **Embedded Linux / Yocto** (Vorschau) | BSP und Image auf Linux-Basis. Heute prüft ein Scan Secrets, Malware und SAST über Patches und Dateien; eine Rezept- oder Image-SBOM gibt es noch nicht. | Für Software auf PC oder Server wählen Sie **Webanwendung**, **Backend / API** oder **Desktop-Anwendung**. diff --git a/docs/guide/repositories.md b/docs/guide/repositories.md index 8c5f16e..c431fd1 100644 --- a/docs/guide/repositories.md +++ b/docs/guide/repositories.md @@ -39,7 +39,7 @@ Under **Maschine und Gerät** (Machine and device): | **SPS / PLC** | CODESYS, PLCopen XML, Structured Text (IEC 61131-3) | | **Firmware — ohne Betriebssystem** | Microcontroller without an operating system, e.g. STM32 with HAL | | **Firmware — RTOS** | FreeRTOS, Zephyr and other real-time operating systems | -| **Embedded Linux / Yocto** | BSP + image | +| **Embedded Linux / Yocto** (preview) | BSP + image. Today a scan covers secrets, malware and SAST over patches and files; there is no recipe or image SBOM yet. | Under **Weitere Software** (Other software): **Backend / API**, **Webanwendung**, **Desktop-Anwendung**, **Android-App**, **iOS-App**.