@patternfly/quickstarts 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +546 -0
- package/dist/ConsoleInternal/components/markdown-view.d.ts +19 -0
- package/dist/ConsoleInternal/components/utils/camel-case-wrap.d.ts +6 -0
- package/dist/ConsoleInternal/components/utils/index.d.ts +3 -0
- package/dist/ConsoleInternal/components/utils/router.d.ts +9 -0
- package/dist/ConsoleInternal/components/utils/status-box.d.ts +20 -0
- package/dist/ConsoleInternal/module/k8s/types.d.ts +42 -0
- package/dist/ConsoleShared/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/index.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.d.ts +13 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/accordion-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.d.ts +6 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/admonition-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/code-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/const.d.ts +5 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/index.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-extensions/utils.d.ts +1 -0
- package/dist/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.d.ts +7 -0
- package/dist/ConsoleShared/src/components/markdown-highlight-extension/highlight-consts.d.ts +4 -0
- package/dist/ConsoleShared/src/components/markdown-highlight-extension/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/modal/Modal.d.ts +9 -0
- package/dist/ConsoleShared/src/components/modal/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/popper/Portal.d.ts +8 -0
- package/dist/ConsoleShared/src/components/popper/SimplePopper.d.ts +6 -0
- package/dist/ConsoleShared/src/components/popper/index.d.ts +2 -0
- package/dist/ConsoleShared/src/components/spotlight/InteractiveSpotlight.d.ts +7 -0
- package/dist/ConsoleShared/src/components/spotlight/Spotlight.d.ts +7 -0
- package/dist/ConsoleShared/src/components/spotlight/StaticSpotlight.d.ts +7 -0
- package/dist/ConsoleShared/src/components/spotlight/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/status/GenericStatus.d.ts +12 -0
- package/dist/ConsoleShared/src/components/status/NotStartedIcon.d.ts +3 -0
- package/dist/ConsoleShared/src/components/status/PopoverStatus.d.ts +13 -0
- package/dist/ConsoleShared/src/components/status/Status.d.ts +11 -0
- package/dist/ConsoleShared/src/components/status/StatusIconAndText.d.ts +8 -0
- package/dist/ConsoleShared/src/components/status/icons.d.ts +9 -0
- package/dist/ConsoleShared/src/components/status/index.d.ts +1 -0
- package/dist/ConsoleShared/src/components/status/statuses.d.ts +5 -0
- package/dist/ConsoleShared/src/components/status/types.d.ts +9 -0
- package/dist/ConsoleShared/src/components/utils/FallbackImg.d.ts +9 -0
- package/dist/ConsoleShared/src/components/utils/index.d.ts +1 -0
- package/dist/ConsoleShared/src/constants/index.d.ts +1 -0
- package/dist/ConsoleShared/src/constants/ui.d.ts +1 -0
- package/dist/ConsoleShared/src/hooks/index.d.ts +6 -0
- package/dist/ConsoleShared/src/hooks/scroll.d.ts +8 -0
- package/dist/ConsoleShared/src/hooks/useBoundingClientRect.d.ts +3 -0
- package/dist/ConsoleShared/src/hooks/useEventListener.d.ts +1 -0
- package/dist/ConsoleShared/src/hooks/useForceRender.d.ts +4 -0
- package/dist/ConsoleShared/src/hooks/useResizeObserver.d.ts +1 -0
- package/dist/ConsoleShared/src/hooks/useScrollShadows.d.ts +7 -0
- package/dist/ConsoleShared/src/index.d.ts +4 -0
- package/dist/ConsoleShared/src/utils/index.d.ts +1 -0
- package/dist/ConsoleShared/src/utils/useCombineRefs.d.ts +2 -0
- package/dist/HelpTopicDrawer.d.ts +33 -0
- package/dist/HelpTopicPanelContent.d.ts +11 -0
- package/dist/QuickStartCatalogPage.d.ts +14 -0
- package/dist/QuickStartCloseModal.d.ts +8 -0
- package/dist/QuickStartController.d.ts +10 -0
- package/dist/QuickStartDrawer.d.ts +62 -0
- package/dist/QuickStartMarkdownView.d.ts +9 -0
- package/dist/QuickStartPanelContent.d.ts +15 -0
- package/dist/catalog/Catalog/QuickStartCatalogHeader.d.ts +6 -0
- package/dist/catalog/Catalog/QuickStartCatalogSection.d.ts +5 -0
- package/dist/catalog/Catalog/QuickStartCatalogToolbar.d.ts +5 -0
- package/dist/catalog/Catalog/index.d.ts +3 -0
- package/dist/catalog/QuickStartCatalog.d.ts +8 -0
- package/dist/catalog/QuickStartTile.d.ts +14 -0
- package/dist/catalog/QuickStartTileDescription.d.ts +8 -0
- package/dist/catalog/QuickStartTileFooter.d.ts +8 -0
- package/dist/catalog/QuickStartTileFooterExternal.d.ts +8 -0
- package/dist/catalog/QuickStartTileHeader.d.ts +24 -0
- package/dist/catalog/Toolbar/QuickStartCatalogFilter.d.ts +10 -0
- package/dist/catalog/Toolbar/QuickStartCatalogFilterItems.d.ts +31 -0
- package/dist/catalog/index.d.ts +9 -0
- package/dist/controller/QuickStartConclusion.d.ts +12 -0
- package/dist/controller/QuickStartContent.d.ts +14 -0
- package/dist/controller/QuickStartFooter.d.ts +14 -0
- package/dist/controller/QuickStartIntroduction.d.ts +12 -0
- package/dist/controller/QuickStartTaskHeader.d.ts +15 -0
- package/dist/controller/QuickStartTaskHeaderList.d.ts +10 -0
- package/dist/controller/QuickStartTaskReview.d.ts +10 -0
- package/dist/controller/QuickStartTasks.d.ts +12 -0
- package/dist/data/mocks/json/explore-pipeline-quickstart.d.ts +2 -0
- package/dist/data/mocks/json/explore-serverless-quickstart.d.ts +2 -0
- package/dist/data/mocks/json/monitor-sampleapp-quickstart.d.ts +2 -0
- package/dist/data/mocks/json/tour-icons.d.ts +2 -0
- package/dist/data/quick-start-test-data.d.ts +2 -0
- package/dist/data/test-utils.d.ts +8 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.es.js +2593 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +2695 -0
- package/dist/index.js.map +1 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/design-guidelines.md +105 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/card-elements copy.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/card-elements.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/catalog-elements.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/check-your-work.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/introduction-screen.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/mixed-catalog.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/prerequisites.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/qs-context.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/side-panel-elements.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/side-panel-resized.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/side-panel.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/task-no.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/task-yes.png +0 -0
- package/dist/patternfly-docs/quick-starts/design-guidelines/img/task.png +0 -0
- package/dist/patternfly-docs/quick-starts/examples/Basic.jsx +73 -0
- package/dist/patternfly-docs/quick-starts/examples/HelpTopic.jsx +51 -0
- package/dist/patternfly-docs/quick-starts/examples/about.md +84 -0
- package/dist/patternfly-docs/quick-starts/examples/basic.md +29 -0
- package/dist/patternfly-docs/quick-starts/examples/example-data/example-help-topics.js +173 -0
- package/dist/patternfly-docs/quick-starts/examples/example-data/example-quickstarts.js +215 -0
- package/dist/patternfly-docs/quick-starts/examples/example-data/index.js +15 -0
- package/dist/patternfly-docs/quick-starts/examples/help-topics.md +28 -0
- package/dist/patternfly-docs/quick-starts/examples/img/catalog.png +0 -0
- package/dist/patternfly-docs/quick-starts/examples/img/help-topic.png +0 -0
- package/dist/patternfly-docs/quick-starts/examples/img/side-panel.png +0 -0
- package/dist/patternfly-global.css +1302 -0
- package/dist/patternfly-nested.css +11812 -0
- package/dist/quickstarts-base.css +1219 -0
- package/dist/quickstarts-full.es.js +31861 -0
- package/dist/quickstarts-full.es.js.map +1 -0
- package/dist/quickstarts-standalone.css +868 -0
- package/dist/quickstarts-standalone.min.css +4 -0
- package/dist/quickstarts-vendor.css +165 -0
- package/dist/quickstarts.css +1383 -0
- package/dist/quickstarts.min.css +1 -0
- package/dist/styles/patternfly-global-entry.d.ts +1 -0
- package/dist/styles/patternfly-nested-entry.d.ts +1 -0
- package/dist/styles/quickstarts-standalone-entry.d.ts +1 -0
- package/dist/styles/vendor-entry.d.ts +1 -0
- package/dist/utils/PluralResolver.d.ts +16 -0
- package/dist/utils/asciidoc-procedure-parser.d.ts +12 -0
- package/dist/utils/const.d.ts +6 -0
- package/dist/utils/help-topic-context.d.ts +23 -0
- package/dist/utils/help-topic-types.d.ts +13 -0
- package/dist/utils/quick-start-context.d.ts +81 -0
- package/dist/utils/quick-start-types.d.ts +60 -0
- package/dist/utils/quick-start-utils.d.ts +10 -0
- package/dist/utils/useLocalStorage.d.ts +1 -0
- package/dist/vendor.js +2 -0
- package/dist/vendor.js.map +1 -0
- package/package.json +105 -0
- package/src/ConsoleInternal/components/_icon-and-text.scss +14 -0
- package/src/ConsoleInternal/components/_markdown-view.scss +19 -0
- package/src/ConsoleInternal/components/catalog/_catalog.scss +392 -0
- package/src/ConsoleInternal/components/markdown-view.tsx +276 -0
- package/src/ConsoleInternal/components/utils/_status-box.scss +58 -0
- package/src/ConsoleInternal/components/utils/camel-case-wrap.tsx +33 -0
- package/src/ConsoleInternal/components/utils/index.tsx +3 -0
- package/src/ConsoleInternal/components/utils/router.ts +45 -0
- package/src/ConsoleInternal/components/utils/status-box.tsx +56 -0
- package/src/ConsoleInternal/module/k8s/types.ts +53 -0
- package/src/ConsoleShared/index.ts +1 -0
- package/src/ConsoleShared/src/components/index.ts +7 -0
- package/src/ConsoleShared/src/components/layout/PageLayout.scss +29 -0
- package/src/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.tsx +95 -0
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/MarkdownCopyClipboard.spec.tsx +25 -0
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/test-data.ts +5 -0
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-extension.tsx +51 -0
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.tsx +60 -0
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +67 -0
- package/src/ConsoleShared/src/components/markdown-extensions/code-extension.tsx +23 -0
- package/src/ConsoleShared/src/components/markdown-extensions/const.ts +5 -0
- package/src/ConsoleShared/src/components/markdown-extensions/index.ts +7 -0
- package/src/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.tsx +39 -0
- package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +44 -0
- package/src/ConsoleShared/src/components/markdown-extensions/showdown-extension.scss +52 -0
- package/src/ConsoleShared/src/components/markdown-extensions/utils.ts +1 -0
- package/src/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.tsx +65 -0
- package/src/ConsoleShared/src/components/markdown-highlight-extension/highlight-consts.ts +9 -0
- package/src/ConsoleShared/src/components/markdown-highlight-extension/index.ts +1 -0
- package/src/ConsoleShared/src/components/modal/Modal.scss +3 -0
- package/src/ConsoleShared/src/components/modal/Modal.tsx +19 -0
- package/src/ConsoleShared/src/components/modal/index.ts +1 -0
- package/src/ConsoleShared/src/components/popper/Portal.tsx +25 -0
- package/src/ConsoleShared/src/components/popper/SimplePopper.tsx +92 -0
- package/src/ConsoleShared/src/components/popper/index.ts +2 -0
- package/src/ConsoleShared/src/components/spotlight/InteractiveSpotlight.tsx +58 -0
- package/src/ConsoleShared/src/components/spotlight/Spotlight.tsx +35 -0
- package/src/ConsoleShared/src/components/spotlight/StaticSpotlight.tsx +32 -0
- package/src/ConsoleShared/src/components/spotlight/index.ts +1 -0
- package/src/ConsoleShared/src/components/spotlight/spotlight.scss +63 -0
- package/src/ConsoleShared/src/components/status/GenericStatus.tsx +34 -0
- package/src/ConsoleShared/src/components/status/NotStartedIcon.tsx +27 -0
- package/src/ConsoleShared/src/components/status/PopoverStatus.tsx +39 -0
- package/src/ConsoleShared/src/components/status/Status.tsx +38 -0
- package/src/ConsoleShared/src/components/status/StatusIconAndText.tsx +42 -0
- package/src/ConsoleShared/src/components/status/icons.tsx +39 -0
- package/src/ConsoleShared/src/components/status/index.tsx +1 -0
- package/src/ConsoleShared/src/components/status/statuses.tsx +20 -0
- package/src/ConsoleShared/src/components/status/types.ts +8 -0
- package/src/ConsoleShared/src/components/utils/FallbackImg.tsx +20 -0
- package/src/ConsoleShared/src/components/utils/index.ts +1 -0
- package/src/ConsoleShared/src/constants/index.ts +1 -0
- package/src/ConsoleShared/src/constants/ui.ts +1 -0
- package/src/ConsoleShared/src/hooks/index.ts +6 -0
- package/src/ConsoleShared/src/hooks/scroll.ts +52 -0
- package/src/ConsoleShared/src/hooks/useBoundingClientRect.ts +18 -0
- package/src/ConsoleShared/src/hooks/useEventListener.ts +14 -0
- package/src/ConsoleShared/src/hooks/useForceRender.ts +6 -0
- package/src/ConsoleShared/src/hooks/useResizeObserver.ts +19 -0
- package/src/ConsoleShared/src/hooks/useScrollShadows.ts +45 -0
- package/src/ConsoleShared/src/index.ts +4 -0
- package/src/ConsoleShared/src/utils/index.ts +1 -0
- package/src/ConsoleShared/src/utils/useCombineRefs.ts +16 -0
- package/src/HelpTopicDrawer.tsx +116 -0
- package/src/HelpTopicPanelContent.tsx +160 -0
- package/src/QuickStartCatalogPage.tsx +195 -0
- package/src/QuickStartCloseModal.tsx +47 -0
- package/src/QuickStartController.tsx +111 -0
- package/src/QuickStartDrawer.scss +11 -0
- package/src/QuickStartDrawer.tsx +265 -0
- package/src/QuickStartMarkdownView.tsx +80 -0
- package/src/QuickStartPanelContent.scss +46 -0
- package/src/QuickStartPanelContent.tsx +165 -0
- package/src/__tests__/quick-start-utils.spec.tsx +16 -0
- package/src/catalog/Catalog/QuickStartCatalogHeader.tsx +18 -0
- package/src/catalog/Catalog/QuickStartCatalogSection.tsx +9 -0
- package/src/catalog/Catalog/QuickStartCatalogToolbar.tsx +12 -0
- package/src/catalog/Catalog/index.ts +3 -0
- package/src/catalog/QuickStartCatalog.scss +8 -0
- package/src/catalog/QuickStartCatalog.tsx +42 -0
- package/src/catalog/QuickStartTile.scss +11 -0
- package/src/catalog/QuickStartTile.tsx +129 -0
- package/src/catalog/QuickStartTileDescription.scss +29 -0
- package/src/catalog/QuickStartTileDescription.tsx +79 -0
- package/src/catalog/QuickStartTileFooter.tsx +101 -0
- package/src/catalog/QuickStartTileFooterExternal.tsx +40 -0
- package/src/catalog/QuickStartTileHeader.scss +16 -0
- package/src/catalog/QuickStartTileHeader.tsx +105 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilter.scss +25 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilter.tsx +32 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +218 -0
- package/src/catalog/__tests__/QuickStartCatalog.spec.tsx +35 -0
- package/src/catalog/__tests__/QuickStartTile.spec.tsx +38 -0
- package/src/catalog/__tests__/QuickStartTileDescription.spec.tsx +44 -0
- package/src/catalog/index.ts +9 -0
- package/src/controller/QuickStartConclusion.tsx +63 -0
- package/src/controller/QuickStartContent.scss +12 -0
- package/src/controller/QuickStartContent.tsx +72 -0
- package/src/controller/QuickStartFooter.scss +13 -0
- package/src/controller/QuickStartFooter.tsx +124 -0
- package/src/controller/QuickStartIntroduction.scss +35 -0
- package/src/controller/QuickStartIntroduction.tsx +64 -0
- package/src/controller/QuickStartTaskHeader.scss +58 -0
- package/src/controller/QuickStartTaskHeader.tsx +125 -0
- package/src/controller/QuickStartTaskHeaderList.scss +17 -0
- package/src/controller/QuickStartTaskHeaderList.tsx +33 -0
- package/src/controller/QuickStartTaskReview.scss +30 -0
- package/src/controller/QuickStartTaskReview.tsx +81 -0
- package/src/controller/QuickStartTasks.scss +89 -0
- package/src/controller/QuickStartTasks.tsx +75 -0
- package/src/controller/__tests__/QuickStartConclusion.spec.tsx +95 -0
- package/src/controller/__tests__/QuickStartContent.spec.tsx +52 -0
- package/src/controller/__tests__/QuickStartFooter.spec.tsx +148 -0
- package/src/controller/__tests__/QuickStartTaskHeader.spec.tsx +43 -0
- package/src/controller/__tests__/QuickStartTaskReview.spec.tsx +45 -0
- package/src/controller/__tests__/QuickStartTasks.spec.tsx +81 -0
- package/src/data/mocks/json/explore-pipeline-quickstart.ts +66 -0
- package/src/data/mocks/json/explore-serverless-quickstart.ts +90 -0
- package/src/data/mocks/json/monitor-sampleapp-quickstart.ts +77 -0
- package/src/data/mocks/json/tour-icons.ts +3 -0
- package/src/data/mocks/yamls/add-healthchecks-quickstart.yaml +67 -0
- package/src/data/mocks/yamls/explore-pipeline-quickstart.yaml +57 -0
- package/src/data/mocks/yamls/explore-serverless-quickstart.yaml +83 -0
- package/src/data/mocks/yamls/install-associate-pipeline-quickstart.yaml +74 -0
- package/src/data/mocks/yamls/monitor-sampleapp-quickstart.yaml +66 -0
- package/src/data/mocks/yamls/sample-application-quickstart.yaml +97 -0
- package/src/data/mocks/yamls/serverless-application-quickstart.yaml +141 -0
- package/src/data/quick-start-test-data.ts +10 -0
- package/src/data/test-utils.ts +11 -0
- package/src/declaration.d.ts +2 -0
- package/src/index.ts +17 -0
- package/src/locales/en/quickstart.json +46 -0
- package/src/styles/_base.scss +54 -0
- package/src/styles/_dark-custom-override.scss +62 -0
- package/src/styles/legacy-bootstrap/README.md +21 -0
- package/src/styles/legacy-bootstrap/_code.scss +46 -0
- package/src/styles/legacy-bootstrap/_tables.scss +38 -0
- package/src/styles/legacy-bootstrap/_type.scss +92 -0
- package/src/styles/legacy-bootstrap/_variables.scss +48 -0
- package/src/styles/legacy-bootstrap.scss +5 -0
- package/src/styles/patternfly-global-entry.ts +1 -0
- package/src/styles/patternfly-global.scss +28 -0
- package/src/styles/patternfly-nested-entry.ts +1 -0
- package/src/styles/patternfly-nested.scss +18 -0
- package/src/styles/quickstarts-standalone-entry.ts +1 -0
- package/src/styles/quickstarts-standalone.scss +7 -0
- package/src/styles/style.scss +12 -0
- package/src/styles/vendor-entry.ts +1 -0
- package/src/styles/vendor.scss +7 -0
- package/src/utils/PluralResolver.ts +362 -0
- package/src/utils/asciidoc-procedure-parser.ts +130 -0
- package/src/utils/const.ts +10 -0
- package/src/utils/help-topic-context.tsx +72 -0
- package/src/utils/help-topic-types.ts +16 -0
- package/src/utils/quick-start-context.tsx +473 -0
- package/src/utils/quick-start-types.ts +73 -0
- package/src/utils/quick-start-utils.ts +88 -0
- package/src/utils/useLocalStorage.ts +38 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from '@patternfly/react-core';
|
|
3
|
+
import ArrowRightIcon from '@patternfly/react-icons/dist/js/icons/arrow-right-icon';
|
|
4
|
+
import QuickStartMarkdownView from '../QuickStartMarkdownView';
|
|
5
|
+
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
6
|
+
import { QuickStart, QuickStartTask, QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
7
|
+
import TaskHeaderList from './QuickStartTaskHeaderList';
|
|
8
|
+
|
|
9
|
+
interface QuickStartConclusionProps {
|
|
10
|
+
tasks: QuickStartTask[];
|
|
11
|
+
conclusion: string;
|
|
12
|
+
allTaskStatuses: QuickStartTaskStatus[];
|
|
13
|
+
nextQuickStarts?: QuickStart[];
|
|
14
|
+
onQuickStartChange: (quickStartid: string) => void;
|
|
15
|
+
onTaskSelect: (selectedTaskNumber: number) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const QuickStartConclusion: React.FC<QuickStartConclusionProps> = ({
|
|
19
|
+
tasks,
|
|
20
|
+
conclusion,
|
|
21
|
+
allTaskStatuses,
|
|
22
|
+
nextQuickStarts,
|
|
23
|
+
onQuickStartChange,
|
|
24
|
+
onTaskSelect,
|
|
25
|
+
}) => {
|
|
26
|
+
const hasFailedTask = allTaskStatuses.includes(QuickStartTaskStatus.FAILED);
|
|
27
|
+
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<TaskHeaderList tasks={tasks} allTaskStatuses={allTaskStatuses} onTaskSelect={onTaskSelect} />
|
|
31
|
+
<QuickStartMarkdownView
|
|
32
|
+
content={
|
|
33
|
+
hasFailedTask
|
|
34
|
+
? getResource(
|
|
35
|
+
'One or more verifications did not pass during this quick start. Revisit the tasks or the help links, and then try again.',
|
|
36
|
+
)
|
|
37
|
+
: conclusion
|
|
38
|
+
}
|
|
39
|
+
/>
|
|
40
|
+
{!hasFailedTask &&
|
|
41
|
+
nextQuickStarts &&
|
|
42
|
+
nextQuickStarts.length > 0 &&
|
|
43
|
+
nextQuickStarts.map((nextQuickStart, index) => (
|
|
44
|
+
<Button
|
|
45
|
+
variant="link"
|
|
46
|
+
onClick={() => onQuickStartChange(nextQuickStart.metadata.name)}
|
|
47
|
+
isInline
|
|
48
|
+
isBlock
|
|
49
|
+
key={index}
|
|
50
|
+
>
|
|
51
|
+
{getResource('Start {{nextQSDisplayName}} quick start').replace(
|
|
52
|
+
'{{nextQSDisplayName}}',
|
|
53
|
+
nextQuickStart?.spec?.displayName,
|
|
54
|
+
)}{' '}
|
|
55
|
+
<ArrowRightIcon
|
|
56
|
+
style={{ marginLeft: 'var(--pf-v5-global--spacer--xs)', verticalAlign: 'middle' }}
|
|
57
|
+
/>
|
|
58
|
+
</Button>
|
|
59
|
+
))}
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
export default QuickStartConclusion;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { QuickStart, QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
3
|
+
import QuickStartConclusion from './QuickStartConclusion';
|
|
4
|
+
import QuickStartIntroduction from './QuickStartIntroduction';
|
|
5
|
+
import QuickStartTasks from './QuickStartTasks';
|
|
6
|
+
|
|
7
|
+
import './QuickStartContent.scss';
|
|
8
|
+
|
|
9
|
+
interface QuickStartContentProps {
|
|
10
|
+
quickStart: QuickStart;
|
|
11
|
+
nextQuickStarts?: QuickStart[];
|
|
12
|
+
taskNumber: number;
|
|
13
|
+
allTaskStatuses: QuickStartTaskStatus[];
|
|
14
|
+
onTaskSelect: (selectedTaskNumber: number) => void;
|
|
15
|
+
onTaskReview: (taskStatus: QuickStartTaskStatus) => void;
|
|
16
|
+
onQuickStartChange?: (quickStartId: string) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const QuickStartContent = React.forwardRef<HTMLDivElement, QuickStartContentProps>(
|
|
20
|
+
(
|
|
21
|
+
{
|
|
22
|
+
quickStart,
|
|
23
|
+
nextQuickStarts = [],
|
|
24
|
+
taskNumber,
|
|
25
|
+
allTaskStatuses,
|
|
26
|
+
onTaskSelect,
|
|
27
|
+
onTaskReview,
|
|
28
|
+
onQuickStartChange,
|
|
29
|
+
},
|
|
30
|
+
ref,
|
|
31
|
+
) => {
|
|
32
|
+
const {
|
|
33
|
+
spec: { introduction, tasks, conclusion, prerequisites },
|
|
34
|
+
} = quickStart;
|
|
35
|
+
const totalTasks = tasks.length;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="pfext-quick-start-content" ref={ref}>
|
|
39
|
+
{taskNumber === -1 && (
|
|
40
|
+
<QuickStartIntroduction
|
|
41
|
+
tasks={tasks}
|
|
42
|
+
allTaskStatuses={allTaskStatuses}
|
|
43
|
+
introduction={introduction}
|
|
44
|
+
prerequisites={prerequisites}
|
|
45
|
+
onTaskSelect={onTaskSelect}
|
|
46
|
+
/>
|
|
47
|
+
)}
|
|
48
|
+
{taskNumber > -1 && taskNumber < totalTasks && (
|
|
49
|
+
<QuickStartTasks
|
|
50
|
+
tasks={tasks}
|
|
51
|
+
taskNumber={taskNumber}
|
|
52
|
+
allTaskStatuses={allTaskStatuses}
|
|
53
|
+
onTaskReview={onTaskReview}
|
|
54
|
+
onTaskSelect={onTaskSelect}
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
{taskNumber === totalTasks && (
|
|
58
|
+
<QuickStartConclusion
|
|
59
|
+
tasks={tasks}
|
|
60
|
+
conclusion={conclusion}
|
|
61
|
+
allTaskStatuses={allTaskStatuses}
|
|
62
|
+
nextQuickStarts={nextQuickStarts}
|
|
63
|
+
onQuickStartChange={onQuickStartChange}
|
|
64
|
+
onTaskSelect={onTaskSelect}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
},
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
export default QuickStartContent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.pfext-quick-start-footer {
|
|
2
|
+
background-color: var(--pf-v5-global--BackgroundColor--100); // this is an example about how we should use PF variables
|
|
3
|
+
flex: 0 0 auto;
|
|
4
|
+
padding: var(--pf-v5-global--spacer--md) var(--pf-v5-global--spacer--lg);
|
|
5
|
+
|
|
6
|
+
&__actionbtn {
|
|
7
|
+
margin-right: var(--pf-v5-global--spacer--md);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&__restartbtn {
|
|
11
|
+
float: right;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from '@patternfly/react-core';
|
|
3
|
+
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
4
|
+
import { QuickStartStatus } from '../utils/quick-start-types';
|
|
5
|
+
import { camelize } from '../utils/quick-start-utils';
|
|
6
|
+
|
|
7
|
+
import './QuickStartFooter.scss';
|
|
8
|
+
|
|
9
|
+
export interface QuickStartFooterProps {
|
|
10
|
+
status: QuickStartStatus;
|
|
11
|
+
footerClass: string;
|
|
12
|
+
taskNumber: number;
|
|
13
|
+
totalTasks: number;
|
|
14
|
+
onNext: () => void;
|
|
15
|
+
onBack: () => void;
|
|
16
|
+
quickStartId: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
20
|
+
status,
|
|
21
|
+
taskNumber,
|
|
22
|
+
totalTasks,
|
|
23
|
+
onNext,
|
|
24
|
+
onBack,
|
|
25
|
+
footerClass,
|
|
26
|
+
quickStartId,
|
|
27
|
+
}) => {
|
|
28
|
+
const { restartQuickStart, getResource } = React.useContext<QuickStartContextValues>(
|
|
29
|
+
QuickStartContext,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const PrimaryButtonText = React.useMemo(() => ({
|
|
33
|
+
START: getResource('Start'),
|
|
34
|
+
CONTINUE: getResource('Continue'),
|
|
35
|
+
NEXT: getResource('Next'),
|
|
36
|
+
CLOSE: getResource('Close'),
|
|
37
|
+
}), [getResource]);
|
|
38
|
+
|
|
39
|
+
const SecondaryButtonText = React.useMemo(() => ({
|
|
40
|
+
BACK: getResource('Back'),
|
|
41
|
+
RESTART: getResource('Restart'),
|
|
42
|
+
}), [getResource]);
|
|
43
|
+
|
|
44
|
+
const onRestart = React.useCallback(
|
|
45
|
+
(e: React.SyntheticEvent) => {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
restartQuickStart(quickStartId, totalTasks);
|
|
49
|
+
},
|
|
50
|
+
[quickStartId, restartQuickStart, totalTasks],
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const getPrimaryButtonText = React.useMemo(() => {
|
|
54
|
+
if (status === QuickStartStatus.NOT_STARTED) {
|
|
55
|
+
return PrimaryButtonText.START;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (taskNumber === totalTasks) {
|
|
59
|
+
return PrimaryButtonText.CLOSE;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (taskNumber > -1 && taskNumber < totalTasks) {
|
|
63
|
+
return PrimaryButtonText.NEXT;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return PrimaryButtonText.CONTINUE;
|
|
67
|
+
}, [taskNumber, totalTasks, PrimaryButtonText, status]);
|
|
68
|
+
|
|
69
|
+
const getPrimaryButton = React.useMemo(
|
|
70
|
+
() => (
|
|
71
|
+
<Button
|
|
72
|
+
variant="primary"
|
|
73
|
+
className="pfext-quick-start-footer__actionbtn"
|
|
74
|
+
onClick={onNext}
|
|
75
|
+
data-testid={`qs-drawer-${camelize(getPrimaryButtonText)}`}
|
|
76
|
+
data-test={`${getPrimaryButtonText} button`}
|
|
77
|
+
>
|
|
78
|
+
{getPrimaryButtonText}
|
|
79
|
+
</Button>
|
|
80
|
+
),
|
|
81
|
+
[getPrimaryButtonText, onNext],
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const getSecondaryButton = React.useMemo(
|
|
85
|
+
() =>
|
|
86
|
+
taskNumber === -1 && status !== QuickStartStatus.NOT_STARTED ? (
|
|
87
|
+
<Button variant="secondary" onClick={onRestart} data-testid="qs-drawer-restart">
|
|
88
|
+
{SecondaryButtonText.RESTART}
|
|
89
|
+
</Button>
|
|
90
|
+
) : (
|
|
91
|
+
taskNumber > -1 && (
|
|
92
|
+
<Button variant="secondary" onClick={onBack} data-testid="qs-drawer-back">
|
|
93
|
+
{SecondaryButtonText.BACK}
|
|
94
|
+
</Button>
|
|
95
|
+
)
|
|
96
|
+
),
|
|
97
|
+
[onRestart, onBack, SecondaryButtonText, status, taskNumber],
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const getSideNoteAction = React.useMemo(
|
|
101
|
+
() =>
|
|
102
|
+
taskNumber !== -1 && (
|
|
103
|
+
<Button
|
|
104
|
+
variant="link"
|
|
105
|
+
className="pfext-quick-start-footer__restartbtn"
|
|
106
|
+
onClick={onRestart}
|
|
107
|
+
data-testid="qs-drawer-side-note-action"
|
|
108
|
+
>
|
|
109
|
+
{SecondaryButtonText.RESTART}
|
|
110
|
+
</Button>
|
|
111
|
+
),
|
|
112
|
+
[taskNumber, onRestart, SecondaryButtonText.RESTART],
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<div className={`pfext-quick-start-footer ${footerClass}`}>
|
|
117
|
+
{getPrimaryButton}
|
|
118
|
+
{getSecondaryButton}
|
|
119
|
+
{getSideNoteAction}
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default QuickStartFooter;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.pfext-quick-start-intro {
|
|
2
|
+
&__prereq {
|
|
3
|
+
margin-bottom: var(--pf-v5-global--spacer--md);
|
|
4
|
+
.pf-v5-c-expandable-section__content {
|
|
5
|
+
margin-top: var(--pf-v5-global--spacer--sm);
|
|
6
|
+
}
|
|
7
|
+
.pf-v5-c-expandable-section__toggle {
|
|
8
|
+
padding-top: 0;
|
|
9
|
+
padding-bottom: 0;
|
|
10
|
+
&-text {
|
|
11
|
+
margin-left: var(--pf-v5-global--spacer--sm);
|
|
12
|
+
}
|
|
13
|
+
&-icon {
|
|
14
|
+
color: var(--pf-v5-c-expandable-section__toggle--Color);
|
|
15
|
+
&:focus, &:hover {
|
|
16
|
+
--pf-v5-c-expandable-section__toggle--Color: var(--pf-v5-c-expandable-section__toggle--focus--Color);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-list {
|
|
22
|
+
padding-left: 20px;
|
|
23
|
+
&__item {
|
|
24
|
+
&::marker {
|
|
25
|
+
font-size: 0.8rem;
|
|
26
|
+
}
|
|
27
|
+
&-content {
|
|
28
|
+
position: relative;
|
|
29
|
+
left: 2px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ExpandableSection, List, ListItem } from '@patternfly/react-core';
|
|
3
|
+
import QuickStartMarkdownView from '../QuickStartMarkdownView';
|
|
4
|
+
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
5
|
+
import { QuickStartTask, QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
6
|
+
import TaskHeaderList from './QuickStartTaskHeaderList';
|
|
7
|
+
|
|
8
|
+
import './QuickStartIntroduction.scss';
|
|
9
|
+
|
|
10
|
+
interface QuickStartIntroductionProps {
|
|
11
|
+
introduction: string;
|
|
12
|
+
tasks: QuickStartTask[];
|
|
13
|
+
allTaskStatuses: QuickStartTaskStatus[];
|
|
14
|
+
prerequisites?: string[];
|
|
15
|
+
onTaskSelect: (selectedTaskNumber: number) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const QuickStartIntroduction: React.FC<QuickStartIntroductionProps> = ({
|
|
19
|
+
tasks,
|
|
20
|
+
introduction,
|
|
21
|
+
allTaskStatuses,
|
|
22
|
+
prerequisites,
|
|
23
|
+
onTaskSelect,
|
|
24
|
+
}) => {
|
|
25
|
+
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
26
|
+
const prereqs = prerequisites?.filter((p) => p);
|
|
27
|
+
const [isPrereqsExpanded, setIsPrereqsExpanded] = React.useState(false);
|
|
28
|
+
const prereqList = prereqs?.length > 0 && (
|
|
29
|
+
<ExpandableSection
|
|
30
|
+
toggleText={getResource('View Prerequisites ({{totalPrereqs}})').replace(
|
|
31
|
+
'{{totalPrereqs}}',
|
|
32
|
+
prereqs.length,
|
|
33
|
+
)}
|
|
34
|
+
onToggle={() => setIsPrereqsExpanded(!isPrereqsExpanded)}
|
|
35
|
+
className="pfext-quick-start-intro__prereq"
|
|
36
|
+
>
|
|
37
|
+
<List className="pfext-quick-start-intro__prereq-list">
|
|
38
|
+
{prereqs.map((pr) => (
|
|
39
|
+
<ListItem key={pr} className="pfext-quick-start-intro__prereq-list__item">
|
|
40
|
+
<span className="pfext-quick-start-intro__prereq-list__item-content">
|
|
41
|
+
<QuickStartMarkdownView content={pr} />
|
|
42
|
+
</span>
|
|
43
|
+
</ListItem>
|
|
44
|
+
))}
|
|
45
|
+
</List>
|
|
46
|
+
</ExpandableSection>
|
|
47
|
+
);
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
<QuickStartMarkdownView content={introduction} />
|
|
51
|
+
{prereqList}
|
|
52
|
+
<p style={{ marginBottom: 'var(--pf-v5-global--spacer--md)' }}>
|
|
53
|
+
{getResource(
|
|
54
|
+
'In this quick start, you will complete {{count, number}} task',
|
|
55
|
+
tasks.length,
|
|
56
|
+
).replace('{{count, number}}', tasks.length)}
|
|
57
|
+
:
|
|
58
|
+
</p>
|
|
59
|
+
<TaskHeaderList tasks={tasks} allTaskStatuses={allTaskStatuses} onTaskSelect={onTaskSelect} />
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default QuickStartIntroduction;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.pfext-quick-start-task-header {
|
|
2
|
+
margin-bottom: var(--pf-v5-global--spacer--sm);
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template-columns: min-content auto;
|
|
5
|
+
font-size: var(--pf-v5-global--FontSize--md);
|
|
6
|
+
button::before {
|
|
7
|
+
content: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&__title {
|
|
11
|
+
color: var(--pf-v5-global--primary-color--100) !important;
|
|
12
|
+
margin-right: var(--pf-v5-global--spacer--md) !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&__subtitle {
|
|
16
|
+
font-size: var(--pf-v5-global--FontSize--sm);
|
|
17
|
+
color: var(--pf-v5-global--Color--dark-200) !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&__tryagain {
|
|
21
|
+
display: block;
|
|
22
|
+
font-size: var(--pf-v5-global--FontSize--md);
|
|
23
|
+
color: var(--pf-v5-global--Color--300) !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__title-success {
|
|
27
|
+
color: var(--pf-v5-global--success-color--100) !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__title-failed {
|
|
31
|
+
color: var(--pf-v5-global--danger-color--100) !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&__task-icon {
|
|
35
|
+
&-init {
|
|
36
|
+
background-color: var(--pf-v5-global--primary-color--100);
|
|
37
|
+
border-radius: var(--pf-v5-global--BorderRadius--lg);
|
|
38
|
+
color: var(--pf-v5-global--Color--light-100);
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
height: 1.5em;
|
|
42
|
+
width: 1.5em;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&-success,
|
|
46
|
+
&-failed {
|
|
47
|
+
vertical-align: middle !important;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-success {
|
|
51
|
+
color: var(--pf-v5-global--success-color--100) !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&-failed {
|
|
55
|
+
color: var(--pf-v5-global--danger-color--100) !important;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Icon, Title, WizardNavItem } from '@patternfly/react-core';
|
|
3
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
4
|
+
import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
|
|
5
|
+
import { css } from '@patternfly/react-styles';
|
|
6
|
+
import { markdownConvert } from '../ConsoleInternal/components/markdown-view';
|
|
7
|
+
import { removeParagraphWrap } from '../QuickStartMarkdownView';
|
|
8
|
+
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
9
|
+
import { QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
10
|
+
|
|
11
|
+
import './QuickStartTaskHeader.scss';
|
|
12
|
+
|
|
13
|
+
interface QuickStartTaskHeaderProps {
|
|
14
|
+
title: string;
|
|
15
|
+
taskIndex: number;
|
|
16
|
+
subtitle?: string;
|
|
17
|
+
taskStatus?: QuickStartTaskStatus;
|
|
18
|
+
size?: 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';
|
|
19
|
+
isActiveTask?: boolean;
|
|
20
|
+
onTaskSelect: (index: number) => void;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const TaskIcon: React.FC<{
|
|
25
|
+
taskIndex: number;
|
|
26
|
+
taskStatus: QuickStartTaskStatus;
|
|
27
|
+
}> = ({ taskIndex, taskStatus }) => {
|
|
28
|
+
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
29
|
+
const success = taskStatus === QuickStartTaskStatus.SUCCESS;
|
|
30
|
+
const failed = taskStatus === QuickStartTaskStatus.FAILED;
|
|
31
|
+
|
|
32
|
+
const classNames = css('pfext-icon-and-text__icon', {
|
|
33
|
+
'pfext-quick-start-task-header__task-icon-init': !failed && !success,
|
|
34
|
+
});
|
|
35
|
+
let content: React.ReactNode;
|
|
36
|
+
|
|
37
|
+
if (success) {
|
|
38
|
+
content = (
|
|
39
|
+
<Icon size="md">
|
|
40
|
+
<CheckCircleIcon className="pfext-quick-start-task-header__task-icon-success" />{' '}
|
|
41
|
+
</Icon>
|
|
42
|
+
);
|
|
43
|
+
} else if (failed) {
|
|
44
|
+
content = (
|
|
45
|
+
<Icon size="md">
|
|
46
|
+
<ExclamationCircleIcon className="pfext-quick-start-task-header__task-icon-failed" />
|
|
47
|
+
</Icon>
|
|
48
|
+
);
|
|
49
|
+
} else {
|
|
50
|
+
content = getResource('{{taskIndex, number}}', taskIndex).replace(
|
|
51
|
+
'{{taskIndex, number}}',
|
|
52
|
+
taskIndex,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return <span className={classNames}>{content}</span>;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const QuickStartTaskHeader: React.FC<QuickStartTaskHeaderProps> = ({
|
|
59
|
+
title,
|
|
60
|
+
taskIndex,
|
|
61
|
+
subtitle,
|
|
62
|
+
taskStatus,
|
|
63
|
+
size,
|
|
64
|
+
isActiveTask,
|
|
65
|
+
onTaskSelect,
|
|
66
|
+
children,
|
|
67
|
+
}) => {
|
|
68
|
+
const titleRef = React.useRef(null);
|
|
69
|
+
React.useEffect(() => {
|
|
70
|
+
if (isActiveTask) {
|
|
71
|
+
// Focus the WizardNavItem button element that contains the title
|
|
72
|
+
titleRef.current.parentNode.focus();
|
|
73
|
+
}
|
|
74
|
+
}, [isActiveTask]);
|
|
75
|
+
const classNames = css('pfext-quick-start-task-header__title', {
|
|
76
|
+
'pfext-quick-start-task-header__title-success': taskStatus === QuickStartTaskStatus.SUCCESS,
|
|
77
|
+
'pfext-quick-start-task-header__title-failed':
|
|
78
|
+
taskStatus === (QuickStartTaskStatus.FAILED || QuickStartTaskStatus.VISITED),
|
|
79
|
+
});
|
|
80
|
+
// const notCompleted = taskStatus === QuickStartTaskStatus.VISITED;
|
|
81
|
+
// const skippedReview = taskStatus === QuickStartTaskStatus.REVIEW;
|
|
82
|
+
const failedReview = taskStatus === QuickStartTaskStatus.FAILED;
|
|
83
|
+
|
|
84
|
+
// TODO: toned down when this is shown, investigate further when we should display it
|
|
85
|
+
// related: https://github.com/patternfly/patternfly-quickstarts/issues/104
|
|
86
|
+
const tryAgain = failedReview && (
|
|
87
|
+
<>
|
|
88
|
+
<div />
|
|
89
|
+
<div className="pfext-quick-start-task-header__tryagain">Try the steps again.</div>
|
|
90
|
+
</>
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
const content = (
|
|
94
|
+
<div className="pfext-quick-start-task-header" ref={titleRef}>
|
|
95
|
+
<TaskIcon taskIndex={taskIndex} taskStatus={taskStatus} />
|
|
96
|
+
<Title headingLevel="h3" size={size} className={classNames}>
|
|
97
|
+
<span dangerouslySetInnerHTML={{ __html: removeParagraphWrap(markdownConvert(title)) }} />
|
|
98
|
+
{isActiveTask && subtitle && (
|
|
99
|
+
<span
|
|
100
|
+
className="pfext-quick-start-task-header__subtitle"
|
|
101
|
+
data-test-id="quick-start-task-subtitle"
|
|
102
|
+
>
|
|
103
|
+
{' '}
|
|
104
|
+
{subtitle}
|
|
105
|
+
</span>
|
|
106
|
+
)}
|
|
107
|
+
</Title>
|
|
108
|
+
{tryAgain}
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<WizardNavItem
|
|
114
|
+
content={content}
|
|
115
|
+
stepIndex={taskIndex}
|
|
116
|
+
onClick={() => onTaskSelect(taskIndex - 1)}
|
|
117
|
+
component="button"
|
|
118
|
+
isCurrent={isActiveTask}
|
|
119
|
+
>
|
|
120
|
+
{children}
|
|
121
|
+
</WizardNavItem>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export default QuickStartTaskHeader;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.pfext-quick-start-task-header {
|
|
2
|
+
&__list {
|
|
3
|
+
padding: 0 !important;
|
|
4
|
+
|
|
5
|
+
button::before {
|
|
6
|
+
content: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
li {
|
|
10
|
+
list-style-type: none;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
align-items: center;
|
|
14
|
+
margin-bottom: var(--pf-v5-global--spacer--xs);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { List } from '@patternfly/react-core';
|
|
3
|
+
import { QuickStartTask, QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
4
|
+
import TaskHeader from './QuickStartTaskHeader';
|
|
5
|
+
|
|
6
|
+
import './QuickStartTaskHeaderList.scss';
|
|
7
|
+
|
|
8
|
+
interface QuickStartTaskHeaderListProps {
|
|
9
|
+
tasks: QuickStartTask[];
|
|
10
|
+
allTaskStatuses: QuickStartTaskStatus[];
|
|
11
|
+
onTaskSelect: (selectedTaskNumber: number) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const QuickStartTaskHeaderList: React.FC<QuickStartTaskHeaderListProps> = ({
|
|
15
|
+
tasks,
|
|
16
|
+
allTaskStatuses,
|
|
17
|
+
onTaskSelect,
|
|
18
|
+
}) => tasks.length > 0 ? (
|
|
19
|
+
<List className="pfext-quick-start-task-header__list">
|
|
20
|
+
{tasks.map((task, index) => (
|
|
21
|
+
<TaskHeader
|
|
22
|
+
key={task.title}
|
|
23
|
+
title={task.title}
|
|
24
|
+
taskIndex={index + 1}
|
|
25
|
+
size="md"
|
|
26
|
+
taskStatus={allTaskStatuses[index]}
|
|
27
|
+
onTaskSelect={onTaskSelect}
|
|
28
|
+
/>
|
|
29
|
+
))}
|
|
30
|
+
</List>
|
|
31
|
+
) : null;
|
|
32
|
+
|
|
33
|
+
export default QuickStartTaskHeaderList;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.pfext-quick-start-task-review-alert {
|
|
2
|
+
margin: var(--pf-v5-global--spacer--lg) 0;
|
|
3
|
+
}
|
|
4
|
+
.pfext-quick-start-task-review {
|
|
5
|
+
font-size: var(--pf-v5-global--FontSize--md);
|
|
6
|
+
line-height: var(--pf-v5-global--FontSize--xl);
|
|
7
|
+
font-family: var(--pf-v5-global--FontFamily--heading--sans-serif);
|
|
8
|
+
|
|
9
|
+
&__actions {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
margin-bottom: var(--pf-v5-global--spacer--sm);
|
|
13
|
+
input[type='radio'] {
|
|
14
|
+
margin-top: 0;
|
|
15
|
+
margin-right: 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__radio {
|
|
20
|
+
margin-right: var(--pf-v5-global--spacer--xl) !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--success {
|
|
24
|
+
color: var(--pf-v5-global--success-color--100) !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--failed {
|
|
28
|
+
color: var(--pf-chart-global--danger--Color--100);
|
|
29
|
+
}
|
|
30
|
+
}
|