diff --git a/webui/src/features/docs/DocsPage.tsx b/webui/src/features/docs/DocsPage.tsx index 1437e07..b94288c 100644 --- a/webui/src/features/docs/DocsPage.tsx +++ b/webui/src/features/docs/DocsPage.tsx @@ -360,10 +360,26 @@ function DocumentationTopicList({ topics, emptyText, showTechnical = false, docu } function TopicMetadata({ topic, showTechnical, documentationType, topicById }: { topic: DocsDocumentationTopic; showTechnical: boolean; documentationType: DocumentationType; topicById: Map }) { - if (topic.kind === "workflow") return ; - if (topic.kind === "reference") return ; - if (topic.kind === "pattern") return ; - return ; + const configuredDetails = ; + if (topic.kind === "workflow") return <>{configuredDetails}; + if (topic.kind === "reference") return <>{configuredDetails}; + if (topic.kind === "pattern") return <>{configuredDetails}; + return <>{configuredDetails}; +} + +function ConfiguredDetails({ topic }: { topic: DocsDocumentationTopic }) { + const currentConfiguration = metadataList(topic.metadata, "current_configuration"); + const limitations = metadataList(topic.metadata, "limitations"); + const constraints = metadataRecords(topic.metadata, "constraints"); + const prefix = topicAnchorId(topic); + if (!currentConfiguration.length && !limitations.length && !constraints.length) return null; + return ( +
+ {!!currentConfiguration.length && } + {!!constraints.length && } + {!!limitations.length && } +
+ ); } function WorkflowDetails({ topic, documentationType, topicById }: { topic: DocsDocumentationTopic; documentationType: DocumentationType; topicById: Map }) { @@ -372,16 +388,10 @@ function WorkflowDetails({ topic, documentationType, topicById }: { topic: DocsD const outcome = metadataString(topic.metadata, "outcome"); const result = metadataString(topic.metadata, "result"); const verification = metadataString(topic.metadata, "verification"); - const currentConfiguration = metadataList(topic.metadata, "current_configuration"); - const limitations = metadataList(topic.metadata, "limitations"); - const constraints = metadataRecords(topic.metadata, "constraints"); const prefix = topicAnchorId(topic); return (
{outcome && } - {!!currentConfiguration.length && } - {!!constraints.length && } - {!!limitations.length && } {!!prerequisites.length && } {!!steps.length &&
@@ -835,11 +845,11 @@ function outlineForPage(page: DocsPageNode | null, showTechnical: boolean): Outl const prefix = topicAnchorId(topic); const items: OutlineItem[] = [{ id: prefix, label: topic.title }]; if (topic.summary) items.push({ id: `${prefix}-summary`, label: "i18n:govoplan-docs.summary.d6b9936d" }); + if (metadataList(topic.metadata, "current_configuration").length) items.push({ id: `${prefix}-current-configuration`, label: "i18n:govoplan-docs.this_system.b13a51ad" }); + if (metadataRecords(topic.metadata, "constraints").length) items.push({ id: `${prefix}-constraints`, label: "i18n:govoplan-docs.requirements.09a428f9" }); + if (metadataList(topic.metadata, "limitations").length) items.push({ id: `${prefix}-limitations`, label: "i18n:govoplan-docs.details.a6b3c45f" }); if (topic.kind === "workflow") { if (metadataString(topic.metadata, "outcome")) items.push({ id: `${prefix}-outcome`, label: "i18n:govoplan-docs.outcome.10172bd3" }); - if (metadataList(topic.metadata, "current_configuration").length) items.push({ id: `${prefix}-current-configuration`, label: "i18n:govoplan-docs.this_system.b13a51ad" }); - if (metadataRecords(topic.metadata, "constraints").length) items.push({ id: `${prefix}-constraints`, label: "i18n:govoplan-docs.requirements.09a428f9" }); - if (metadataList(topic.metadata, "limitations").length) items.push({ id: `${prefix}-limitations`, label: "i18n:govoplan-docs.details.a6b3c45f" }); if (metadataList(topic.metadata, "prerequisites").length) items.push({ id: `${prefix}-prerequisites`, label: "i18n:govoplan-docs.prerequisites.fdf2407f" }); if (metadataList(topic.metadata, "steps").length) items.push({ id: `${prefix}-steps`, label: "i18n:govoplan-docs.steps.6041435e" }); if (metadataString(topic.metadata, "result")) items.push({ id: `${prefix}-result`, label: "i18n:govoplan-docs.result.1f4fbf43" });