diff --git a/SCHEMA_COVERAGE.md b/SCHEMA_COVERAGE.md index b3c4cc4..a2a0278 100644 --- a/SCHEMA_COVERAGE.md +++ b/SCHEMA_COVERAGE.md @@ -33,6 +33,9 @@ exclusive with `name`. ## parent +The whole section is optional: a devfile that does not inherit from a parent is valid, so an empty +parent step generates no `parent` key and raises neither an error nor a warning. + Source: `uri`, `id` (with `registryUrl` and `version`) or `kubernetes` (`name`, `namespace`). Overrides: `components`, `commands`, `projects`, `starterProjects`, `dependentProjects`, diff --git a/src/components/steps/ParentStep.jsx b/src/components/steps/ParentStep.jsx index 876681d..7011ab4 100644 --- a/src/components/steps/ParentStep.jsx +++ b/src/components/steps/ParentStep.jsx @@ -10,6 +10,7 @@ import { getComponentType, getParentSourceType } from '../../utils/factories' +import Badge from '../common/Badge' import CommandEditor from '../editors/CommandEditor' import ComponentEditor from '../editors/ComponentEditor' import ProjectEditor from '../editors/ProjectEditor' @@ -26,6 +27,18 @@ import WizardNavigation from '../wizard/WizardNavigation' const ISSUE_PREFIXES = ['Parent'] +const DOCS_URL = 'https://devfile.io/docs/2.3.0/referring-to-a-parent-devfile' +const SCHEMA_DOCS_URL = 'https://devfile.io/docs/2.3.0/devfile-schema' + +/** Link to the devfile.io page describing the section edited here. */ +function DocsLink({ href, children }) { + return ( + + {children} + + ) +} + const PROJECT_LISTS = [ { kind: 'projects', title: 'Project overrides', prefix: 'parent-project', addButtonText: 'Add Project Override' }, { @@ -68,14 +81,27 @@ export default function ParentStep() { if (!parent) { return (
-

Parent

-

+

+

Parent

+ Optional +
+

A devfile can inherit from a parent devfile and override parts of it. Everything defined here is merged on - top of the parent. + top of the parent. Most devfiles do not use a parent — skipping this step is perfectly normal and the{' '} + parent section is simply left out of the + generated devfile. +

+

+ See Referring to a parent devfile and the{' '} + devfile 2.3.0 schema.

-

This devfile does not inherit from a parent.

+

This devfile does not inherit from a parent.

+

+ Leave it this way unless you are extending a stack from a registry, a devfile URI or a + DevWorkspaceTemplate. +

@@ -105,14 +131,21 @@ export default function ParentStep() { return (
-

Parent

+
+

Parent

+ Optional +
-

+

The parent devfile this one inherits from. Overrides below are merged on top of the parent content, so no - field is mandatory in them. + field is mandatory in them. Remove the parent to go back to a devfile without inheritance. +

+

+ See Referring to a parent devfile and the{' '} + devfile 2.3.0 schema.

{/* A parent that was just added has no source yet, which the required diff --git a/src/components/steps/ReviewStep.jsx b/src/components/steps/ReviewStep.jsx index 06a2def..d36b431 100644 --- a/src/components/steps/ReviewStep.jsx +++ b/src/components/steps/ReviewStep.jsx @@ -21,14 +21,14 @@ function countBy(items, resolve) { return [...counts.entries()].map(([key, count]) => `${count} ${key}`).join(', ') } -function SummaryCard({ title, stepId, configured, onEdit, children }) { +function SummaryCard({ title, stepId, configured, notConfiguredLabel = 'Not configured', onEdit, children }) { return (

{title}

- {configured ? 'Configured' : 'Not configured'} + {configured ? 'Configured' : notConfiguredLabel}