Skip to content

Commit

Permalink
fix: fix UI issue with unknown content
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Sep 29, 2023
1 parent b811a23 commit 8d0c068
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions spog/ui/src/pages/sbom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use spog_ui_backend::use_backend;
use spog_ui_common::error::components::Error;
use spog_ui_components::{
common::{NotFound, PageHeading},
content::{SourceCode, Technical, UnknownContent},
content::{SourceCode, Technical},
spdx::*,
};
use std::rc::Rc;
Expand Down Expand Up @@ -131,7 +131,24 @@ fn details(props: &DetailsProps) -> Html {
}
model::SBOM::Unknown(source) => {
html!(
<UnknownContent source={source.clone()} />
<>
<PageSection r#type={PageSectionType::Tabs} variant={PageSectionVariant::Light} sticky={[PageSectionSticky::Top]}>
<Tabs<TabIndex> inset={TabInset::Page} detached=true selected={*tab} {onselect}>
<Tab<TabIndex> index={TabIndex::Overview} title="Overview" />
<Tab<TabIndex> index={TabIndex::Source} title="Source" />
</Tabs<TabIndex>>
</PageSection>

<PageSection hidden={*tab != TabIndex::Overview} fill={PageSectionFill::Fill}>
<Grid gutter=true>
<GridItem cols={[2]}><Technical size={source.as_bytes().len()}/></GridItem>
</Grid>
</PageSection>

<PageSection hidden={*tab != TabIndex::Source} fill={PageSectionFill::Fill}>
<SourceCode source={source.clone()} />
</PageSection>
</>
)
}
}
Expand Down

0 comments on commit 8d0c068

Please sign in to comment.