@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
package/README.md
ADDED
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
# Quick starts
|
|
2
|
+
|
|
3
|
+
Demo
|
|
4
|
+
https://quickstarts.netlify.app/
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
yarn add @patternfly/quickstarts
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Peer dependencies
|
|
13
|
+
|
|
14
|
+
If your project doesn't already have these installed, you'll need:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
yarn add @patternfly/react-core showdown
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Stylesheets
|
|
21
|
+
|
|
22
|
+
In your web-apps entry point, add these stylesheets (these should be imported before modules from @patternfly/quickstarts are imported):
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
// base styles/variables for PatternFly-react
|
|
26
|
+
import '@patternfly/react-core/dist/styles/base.css';
|
|
27
|
+
// quick starts styles
|
|
28
|
+
import '@patternfly/quickstarts/dist/quickstarts.min.css';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Stylesheets if you use an older version of PatternFly
|
|
32
|
+
|
|
33
|
+
If you use an older version of @patternfly/react-core (older than "4.115.2"), and you can't upgrade yet, you can pull in the necessary PatternFly styles that @patternfly/quickstarts depends upon.
|
|
34
|
+
|
|
35
|
+
Ideally @patternfly/quickstarts will use the consumer provided PatternFly styles, only use these stylesheets if really needed.
|
|
36
|
+
|
|
37
|
+
`quickstarts-standalone.min.css` nests the css classes within a **.pfext-quick-start\_\_base** parent, so that they have higher specificity. `patternfly-global.css` includes component styles that we cannot nest with more specificity (for example Drawer since it can include consumer components that depend on an older PF version).
|
|
38
|
+
|
|
39
|
+
> Note: Only use these stylesheets if necessary!
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
// import base from PatternFly to get the font
|
|
43
|
+
import '@patternfly/react-core/dist/styles/base.css';
|
|
44
|
+
// some global styles and variables that quickstarts uses (Drawer, Popover, Modal, Backdrop, Bullseye)
|
|
45
|
+
import '@patternfly/quickstarts/dist/patternfly-global.css';
|
|
46
|
+
// PF and quickstarts styles nested within .pfext-quick-start__base
|
|
47
|
+
import '@patternfly/quickstarts/dist/quickstarts-standalone.min.css';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Usage example
|
|
51
|
+
|
|
52
|
+
Note: You can also view this example on [codesandbox](https://codesandbox.io/s/patternfly-quickstarts-finished-cnv53)!
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
import './styles.css';
|
|
56
|
+
|
|
57
|
+
// base styles/variables for PatternFly-react
|
|
58
|
+
import '@patternfly/react-core/dist/styles/base.css';
|
|
59
|
+
// quick starts styles
|
|
60
|
+
import '@patternfly/quickstarts/dist/quickstarts.min.css';
|
|
61
|
+
|
|
62
|
+
import * as React from 'react';
|
|
63
|
+
import {
|
|
64
|
+
QuickStartContainer,
|
|
65
|
+
QuickStartCatalogPage,
|
|
66
|
+
QuickStartContext,
|
|
67
|
+
useLocalStorage,
|
|
68
|
+
setQueryArgument,
|
|
69
|
+
removeQueryArgument,
|
|
70
|
+
QUICKSTART_ID_FILTER_KEY,
|
|
71
|
+
} from '@patternfly/quickstarts';
|
|
72
|
+
import { Button } from '@patternfly/react-core';
|
|
73
|
+
import jsYaml from 'js-yaml';
|
|
74
|
+
// quick start files could be yaml files or js files, or really anything,
|
|
75
|
+
// as long as they get parsed out to the expected JSON format
|
|
76
|
+
import quickstartOne from './quick-starts/quickstart-one.yaml';
|
|
77
|
+
import quickstartTwo from './quick-starts/quickstart-two.yaml';
|
|
78
|
+
import quickstartThree from './quick-starts/quickstart-three';
|
|
79
|
+
|
|
80
|
+
const App = () => {
|
|
81
|
+
const [quickStarts, setQuickStarts] = React.useState([]);
|
|
82
|
+
const [loading, setLoading] = React.useState(true);
|
|
83
|
+
|
|
84
|
+
// You can use the useLocalStorage hook if you want to store user progress in local storage
|
|
85
|
+
// Otherwise you can use React.useState here or another means (backend) to store the active quick start ID and state
|
|
86
|
+
const [activeQuickStartID, setActiveQuickStartID] = useLocalStorage('quickstartId', '');
|
|
87
|
+
const [allQuickStartStates, setAllQuickStartStates] = useLocalStorage('quickstarts', {});
|
|
88
|
+
// or
|
|
89
|
+
// const [activeQuickStartID, setActiveQuickStartID] = React.useState("");
|
|
90
|
+
// const [allQuickStartStates, setAllQuickStartStates] = React.useState({});
|
|
91
|
+
|
|
92
|
+
React.useEffect(() => {
|
|
93
|
+
const load = () => {
|
|
94
|
+
const loadedQuickStarts = [
|
|
95
|
+
jsYaml.load(quickstartOne),
|
|
96
|
+
jsYaml.load(quickstartTwo),
|
|
97
|
+
quickstartThree,
|
|
98
|
+
];
|
|
99
|
+
setQuickStarts(loadedQuickStarts);
|
|
100
|
+
setLoading(false);
|
|
101
|
+
};
|
|
102
|
+
setTimeout(() => {
|
|
103
|
+
// simulate loading time to get the quick starts from somewhere
|
|
104
|
+
load();
|
|
105
|
+
}, 500);
|
|
106
|
+
}, []);
|
|
107
|
+
|
|
108
|
+
const withQueryParams = true;
|
|
109
|
+
|
|
110
|
+
const drawerProps = {
|
|
111
|
+
quickStarts,
|
|
112
|
+
activeQuickStartID,
|
|
113
|
+
allQuickStartStates,
|
|
114
|
+
setActiveQuickStartID,
|
|
115
|
+
setAllQuickStartStates,
|
|
116
|
+
// Set to true to opt-out of default hidden card footers
|
|
117
|
+
showCardFooters: false,
|
|
118
|
+
// Set to true to opt-out of default drawer header colors of blue with white text
|
|
119
|
+
useLegacyHeaderColors: false,
|
|
120
|
+
loading,
|
|
121
|
+
useQueryParams: withQueryParams,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const toggleQuickStart = (quickStartId: string) => {
|
|
125
|
+
if (activeQuickStartID !== quickStartId) {
|
|
126
|
+
// activate
|
|
127
|
+
setActiveQuickStartID(quickStartId);
|
|
128
|
+
// optionally add the browser URL query param
|
|
129
|
+
withQueryParams && setQueryArgument(QUICKSTART_ID_FILTER_KEY, quickStartId);
|
|
130
|
+
} else {
|
|
131
|
+
// deactivate
|
|
132
|
+
setActiveQuickStartID('');
|
|
133
|
+
// optionally remove the browser URL query param
|
|
134
|
+
withQueryParams && removeQueryArgument(QUICKSTART_ID_FILTER_KEY);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<QuickStartContainer {...drawerProps}>
|
|
140
|
+
<Button onClick={() => toggleQuickStart('node-with-s2i')}>
|
|
141
|
+
Toggle quick start through prop
|
|
142
|
+
</Button>
|
|
143
|
+
<SomeNestedComponent />
|
|
144
|
+
<QuickStartCatalogPage
|
|
145
|
+
showFilter
|
|
146
|
+
title="Quick starts"
|
|
147
|
+
hint="Learn how to create, import, and run applications with step-by-step instructions and tasks."
|
|
148
|
+
/>
|
|
149
|
+
</QuickStartContainer>
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const SomeNestedComponent = () => {
|
|
154
|
+
const qsContext = React.useContext(QuickStartContext);
|
|
155
|
+
// the quick start ID is defined in the quick start object's metadata.name field
|
|
156
|
+
return (
|
|
157
|
+
<button onClick={() => qsContext.setActiveQuickStart('monitor-sampleapp')}>
|
|
158
|
+
Toggle quick start through context
|
|
159
|
+
</button>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export default App;
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Design update, option to opt-out of new drawer header coloring
|
|
167
|
+
|
|
168
|
+
See above usage of `useLegacyHeaderColors` boolean to opt-out of update. Should only be used if new color scheme clashes with the usage context.
|
|
169
|
+
|
|
170
|
+
## Quick starts format
|
|
171
|
+
|
|
172
|
+
Quick starts are parsed as markdown. To write your own quick start, if you use Typescript you can [check out the type definition here](https://github.com/patternfly/patternfly-quickstarts/blob/main/packages/module/src/utils/quick-start-types.ts).
|
|
173
|
+
|
|
174
|
+
Here's a [yaml template](https://github.com/patternfly/patternfly-quickstarts/blob/main/packages/dev/src/quickstarts-data/yaml/template.yaml) to get you started on writing your own quick starts.
|
|
175
|
+
|
|
176
|
+
## Writing quick starts
|
|
177
|
+
|
|
178
|
+
Quick starts are typically written in yaml, but we've also seen projects use asciidoc and json. As long as you can pass in an [array of quick starts](https://github.com/patternfly/patternfly-quickstarts/blob/b086faefb0699e4259ca23d058ed330df1d87f8a/packages/module/src/QuickStartDrawer.tsx#L18) it doesn't really matter in what format your content is sourced.
|
|
179
|
+
|
|
180
|
+
- We have a [yaml starter template here](https://github.com/patternfly/patternfly-quickstarts/blob/main/packages/dev/src/quickstarts-data/yaml/template.yaml)
|
|
181
|
+
- The easiest way to preview the content as you're writing it, is to use Visual Studio code with our [quickstarts-preview extension](https://marketplace.visualstudio.com/items?itemName=PatternFly.quickstarts-preview).
|
|
182
|
+
- Alternatively, you can use [github.dev](https://github.dev/) which is basically VS Code on the web, and install the extension there, then edit your yaml content!
|
|
183
|
+
- For guidelines on writing a quick start, the fine folks at OpenShift have created [this guide](https://docs.openshift.com/container-platform/4.9/web_console/creating-quick-start-tutorials.html)
|
|
184
|
+
|
|
185
|
+
### Highlighting elements
|
|
186
|
+
|
|
187
|
+
You can highlight an element on the page from within a quick start. The element that should be highlightable needs a data-quickstart-id attribute. Example:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
<button data-quickstart-id="special-btn">Click me</button>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
In the quick start task description, you can add this type of markdown to target this element:
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
Highlight [special button]{{highlight special-btn}}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Copyable text
|
|
200
|
+
|
|
201
|
+
You can have inline or block copyable text.
|
|
202
|
+
|
|
203
|
+
#### Inline copyable text example
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
`echo "Donec id est ante"`{{copy}}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### Multiline copyable text example
|
|
210
|
+
|
|
211
|
+
````
|
|
212
|
+
```
|
|
213
|
+
First line of text.
|
|
214
|
+
Second line of text.
|
|
215
|
+
```{{copy}}
|
|
216
|
+
````
|
|
217
|
+
|
|
218
|
+
## Markdown extensions
|
|
219
|
+
|
|
220
|
+
If your source material content is defined in markdown (yaml + markdown / json + markdown), then you can add your own markdown extensions, example:
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
const drawerProps: QuickStartContainerProps = {
|
|
224
|
+
markdown: {
|
|
225
|
+
extensions: [
|
|
226
|
+
// variable substitution example
|
|
227
|
+
// this replaces the strings [APPLICATION] and [PRODUCT]
|
|
228
|
+
{
|
|
229
|
+
type: 'output',
|
|
230
|
+
filter: function(html: string) {
|
|
231
|
+
html = html.replace(/\[APPLICATION\]/g, 'Mercury');
|
|
232
|
+
html = html.replace(/\[PRODUCT\]/g, 'Lightning');
|
|
233
|
+
|
|
234
|
+
return html;
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
return <QuickStartContainer {...drawerProps}>My page content</QuickStartContainer>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Localization
|
|
245
|
+
|
|
246
|
+
We use English as the default language. You can override the default by providing your own key/value pairs to the `QuickStartContainer` or `QuickStartContextProvider` resourceBundle prop.
|
|
247
|
+
|
|
248
|
+
Example:
|
|
249
|
+
|
|
250
|
+
```js
|
|
251
|
+
// load my own resource Czech translations resource bundle using i18next
|
|
252
|
+
const resourceBundle = i18n.getResourceBundle('cs', 'quickstart');
|
|
253
|
+
const resources = {
|
|
254
|
+
...resourceBundle,
|
|
255
|
+
Start: "Let's go!",
|
|
256
|
+
Continue: 'Resume',
|
|
257
|
+
Restart: 'Start over',
|
|
258
|
+
};
|
|
259
|
+
return <QuickStartContainer resourceBundle={resources}></QuickStartContainer>;
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Use this [file](https://github.com/patternfly/patternfly-quickstarts/blob/main/packages/module/src/locales/en/quickstart.json) as a base for your translations.
|
|
263
|
+
Each language is different, especially when it comes to plurals. Try [this utility](https://jsfiddle.net/6bpxsgd4) sourced from [i18next](https://www.i18next.com/translation-function/plurals#how-to-find-the-correct-plural-suffix) to determine the suffixes for the right plural format.
|
|
264
|
+
|
|
265
|
+
For localizing the content of quick starts files, we provide the option to include `language` and `countryCode` key to your translated file. Based on these keys you can filter out quick starts. We have a demo of this behavior in our [demo app](https://quickstarts.netlify.app/quickstarts-localized). You can have a look at the code [here](https://github.com/patternfly/patternfly-quickstarts/blob/main/packages/dev/src/AppLocalized.tsx).
|
|
266
|
+
|
|
267
|
+
## In-App / In Context Help Panel
|
|
268
|
+
|
|
269
|
+
The quickstarts package is being extended to support a side panel that displays smaller chunks (defined as the `HelpTopic` type) of documentation.
|
|
270
|
+
|
|
271
|
+
### Help Topic type definition
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
type HelpTopicLink = {
|
|
275
|
+
href: string;
|
|
276
|
+
text?: string;
|
|
277
|
+
// open link in new tab
|
|
278
|
+
newTab?: boolean;
|
|
279
|
+
// add PF icon indicating link is external
|
|
280
|
+
isExternal?: boolean;
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
type HelpTopic = {
|
|
284
|
+
name: string;
|
|
285
|
+
title: string;
|
|
286
|
+
tags: string[];
|
|
287
|
+
content: string;
|
|
288
|
+
links: HelpTopicLink[];
|
|
289
|
+
};
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Example Help Topic in yaml with markdown support for content and links
|
|
293
|
+
|
|
294
|
+
```yml
|
|
295
|
+
- name: auto-deploy
|
|
296
|
+
tags:
|
|
297
|
+
- page-1
|
|
298
|
+
title: Automatic Deployment
|
|
299
|
+
content: |-
|
|
300
|
+
**An Automatic Deployment** is...
|
|
301
|
+
|
|
302
|
+
Etiam viverra et tortor et maximus. Aliquam quis scelerisque metus. Proin luctus pretium sodales. Mauris nibh nibh, auctor eu scelerisque et, hendrerit a metus. Vivamus pharetra bibendum finibus. Sed a pulvinar ipsum. Fusce pharetra venenatis porttitor. Praesent justo metus, consectetur quis erat id, congue varius metus. Suspendisse dui est, tempor nec diam quis, facilisis sodales erat. Curabitur viverra convallis ex. Ut egestas condimentum augue, id euismod leo volutpat vitae. Quisque aliquet ac dolor quis pretium. Nunc at nibh quis arcu maximus elementum vel a mi.
|
|
303
|
+
links:
|
|
304
|
+
- text: 'Creating quick starts (external)'
|
|
305
|
+
href: 'https://docs.openshift.com/container-platform/4.9/web_console/creating-quick-start-tutorials.html'
|
|
306
|
+
isExternal: true
|
|
307
|
+
- text: 'Redhat Console (opens in new tab)'
|
|
308
|
+
href: 'https://console.redhat.com'
|
|
309
|
+
newTab: true
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Usage Example
|
|
313
|
+
|
|
314
|
+
See the [HelpTopicDemo](https://github.com/patternfly/patternfly-quickstarts/blob/6b35d3c346b3e92ed0003de955421c8dff58a22b/packages/dev/src/AppHelpTopicDemo.tsx)
|
|
315
|
+
|
|
316
|
+
- Similar to standard Quickstarts usage
|
|
317
|
+
- Load yaml defined `HelpTopic` array
|
|
318
|
+
- Pass `HelpTopicContainerProps`, including loaded `HelpTopics` to the `<HelpTopicContainer/>`
|
|
319
|
+
|
|
320
|
+
```tsx
|
|
321
|
+
import './App.css';
|
|
322
|
+
import { Page } from '@patternfly/react-core';
|
|
323
|
+
import { LoadingBox, HelpTopicContainerProps, HelpTopicContainer } from '@patternfly/quickstarts';
|
|
324
|
+
import { helpTopics } from './quickstarts-data/quick-start-test-data';
|
|
325
|
+
import React from 'react';
|
|
326
|
+
import i18n from './i18n/i18n';
|
|
327
|
+
import { AppHeader, AppSidebar } from './common/Page';
|
|
328
|
+
|
|
329
|
+
type AppProps = {
|
|
330
|
+
children?: React.ReactNode;
|
|
331
|
+
showCardFooters?: boolean;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const AppHelpTopicDemo: React.FC<AppProps> = ({ children }) => {
|
|
335
|
+
const language = localStorage.getItem('bridge/language') || 'en';
|
|
336
|
+
const resourceBundle = i18n.getResourceBundle(language, 'quickstart');
|
|
337
|
+
|
|
338
|
+
const [loading, setLoading] = React.useState(true);
|
|
339
|
+
React.useEffect(() => {
|
|
340
|
+
const load = async () => {
|
|
341
|
+
setLoading(false);
|
|
342
|
+
};
|
|
343
|
+
setTimeout(() => {
|
|
344
|
+
load();
|
|
345
|
+
}, 500);
|
|
346
|
+
}, []);
|
|
347
|
+
|
|
348
|
+
const inContextHelpProps: HelpTopicContainerProps = {
|
|
349
|
+
helpTopics,
|
|
350
|
+
resourceBundle,
|
|
351
|
+
language,
|
|
352
|
+
loading,
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
return (
|
|
356
|
+
<React.Suspense fallback={<LoadingBox />}>
|
|
357
|
+
<HelpTopicContainer {...inContextHelpProps}>
|
|
358
|
+
<Page header={AppHeader} sidebar={AppSidebar} isManagedSidebar>
|
|
359
|
+
{children}
|
|
360
|
+
</Page>
|
|
361
|
+
</HelpTopicContainer>
|
|
362
|
+
</React.Suspense>
|
|
363
|
+
);
|
|
364
|
+
};
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
In the example above `<HelpTopicContainer />` wraps the `<Page/>` element as well as a mock "console" showing how to trigger the side panel and allow navigation to all `HelpTopics` available on each console page:
|
|
368
|
+
|
|
369
|
+
Live [preview](https://deploy-preview-140--quickstarts.netlify.app/in-context-help) of code below:
|
|
370
|
+
|
|
371
|
+
```tsx
|
|
372
|
+
import * as React from 'react';
|
|
373
|
+
import {
|
|
374
|
+
Banner,
|
|
375
|
+
Button,
|
|
376
|
+
Divider,
|
|
377
|
+
Form,
|
|
378
|
+
FormGroup,
|
|
379
|
+
PageSection,
|
|
380
|
+
Popover,
|
|
381
|
+
Split,
|
|
382
|
+
SplitItem,
|
|
383
|
+
TextInput,
|
|
384
|
+
Title,
|
|
385
|
+
} from '@patternfly/react-core';
|
|
386
|
+
import { HelpTopicContext, HelpTopicContextValues } from '@patternfly/quickstarts';
|
|
387
|
+
import HelpIcon from '@patternfly/react-icons/dist/js/icons/help-icon';
|
|
388
|
+
import { HelpTopic } from '@patternfly/quickstarts/dist/utils/help-topic-types';
|
|
389
|
+
|
|
390
|
+
// Example usage of topics, render certain topics depending on the page
|
|
391
|
+
// used this case when "consolePageState" below is between 4 - 6
|
|
392
|
+
// these HelpTopics with the following names will be rendered
|
|
393
|
+
const helpTopicNamesByPage = [
|
|
394
|
+
['auto-deploy', 'code-sample', 'manual-deployment'],
|
|
395
|
+
['manual-deployment', 'target-port', 'build-configuration'],
|
|
396
|
+
['deploy-configuration', 'environment-variables', 'health-checks'],
|
|
397
|
+
];
|
|
398
|
+
|
|
399
|
+
interface FormGroupWithHelpTopicPopoverProps extends React.HTMLProps<HTMLDivElement> {
|
|
400
|
+
topic: HelpTopic;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// Example usage of setActiveHelpTopicByName()
|
|
404
|
+
// render a popover with a learn more link to open the drawer
|
|
405
|
+
const FormGroupWithHelpTopicPopover: React.FC<FormGroupWithHelpTopicPopoverProps> = ({ topic }) => {
|
|
406
|
+
const { setActiveHelpTopicByName } = React.useContext<HelpTopicContextValues>(HelpTopicContext);
|
|
407
|
+
|
|
408
|
+
return (
|
|
409
|
+
<FormGroup
|
|
410
|
+
label={topic.title}
|
|
411
|
+
isRequired
|
|
412
|
+
fieldId={topic.name}
|
|
413
|
+
key={topic.name}
|
|
414
|
+
labelIcon={
|
|
415
|
+
<Popover
|
|
416
|
+
bodyContent={(hide) => (
|
|
417
|
+
<div>
|
|
418
|
+
{topic.title} is quite amazing{' '}
|
|
419
|
+
<Button
|
|
420
|
+
variant="link"
|
|
421
|
+
onClick={() => {
|
|
422
|
+
setActiveHelpTopicByName(topic.name);
|
|
423
|
+
hide();
|
|
424
|
+
}}
|
|
425
|
+
>
|
|
426
|
+
Learn more
|
|
427
|
+
</Button>
|
|
428
|
+
</div>
|
|
429
|
+
)}
|
|
430
|
+
>
|
|
431
|
+
<Button variant="plain">
|
|
432
|
+
<HelpIcon noVerticalAlign />
|
|
433
|
+
</Button>
|
|
434
|
+
</Popover>
|
|
435
|
+
}
|
|
436
|
+
>
|
|
437
|
+
<TextInput isRequired type="text" id={topic.name} />
|
|
438
|
+
</FormGroup>
|
|
439
|
+
);
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
export const MockConsole: React.FC = () => {
|
|
443
|
+
const { helpTopics, setFilteredHelpTopics, filteredHelpTopics, setActiveHelpTopicByName } =
|
|
444
|
+
React.useContext<HelpTopicContextValues>(HelpTopicContext);
|
|
445
|
+
|
|
446
|
+
// mock console page identifiers: 1 - 6
|
|
447
|
+
// click handlers to change page
|
|
448
|
+
const [consolePageState, setConsolePageState] = React.useState(1);
|
|
449
|
+
|
|
450
|
+
const handleClickNext = () => {
|
|
451
|
+
setActiveHelpTopicByName('');
|
|
452
|
+
if (consolePageState === 6) {
|
|
453
|
+
setConsolePageState(1);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
setConsolePageState(consolePageState + 1);
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
const handleClickBack = () => {
|
|
460
|
+
setActiveHelpTopicByName('');
|
|
461
|
+
if (consolePageState === 6) {
|
|
462
|
+
setConsolePageState(4);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
setConsolePageState(consolePageState - 1);
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
// Example usage setFilteredHelpTopics()
|
|
469
|
+
// After rendering the console, set the filtered help topics
|
|
470
|
+
React.useEffect(() => {
|
|
471
|
+
// set filtered topics using tags, matching to the consolePageState
|
|
472
|
+
if (consolePageState < 4) {
|
|
473
|
+
const topics = helpTopics.filter((topic: HelpTopic) => {
|
|
474
|
+
const pageTagNumbers = topic.tags.map((tag: string) => {
|
|
475
|
+
return Number(tag.slice(-1));
|
|
476
|
+
});
|
|
477
|
+
return pageTagNumbers.includes(consolePageState);
|
|
478
|
+
});
|
|
479
|
+
setFilteredHelpTopics(topics);
|
|
480
|
+
} else {
|
|
481
|
+
// set filtered topics using the appropriate helpTopicNamesByPage array above
|
|
482
|
+
setFilteredHelpTopics(
|
|
483
|
+
helpTopics.filter((topic) => {
|
|
484
|
+
return helpTopicNamesByPage[consolePageState - 4].includes(topic.name);
|
|
485
|
+
}),
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
}, [consolePageState, helpTopics, setFilteredHelpTopics]);
|
|
489
|
+
|
|
490
|
+
// Render filteredHelpTopics in a <FormGroupWithHelpTopicPopover />
|
|
491
|
+
const formGroupsFromTags = filteredHelpTopics.map((topic: HelpTopic, index) => {
|
|
492
|
+
return <FormGroupWithHelpTopicPopover topic={topic} key={index} />;
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
// From an array of topic names, render all topics in a <FormGroupWithHelpTopicPopover />
|
|
496
|
+
const formGroupsFromTopicNames = (helpTopicNames: string[]) => {
|
|
497
|
+
return helpTopicNames.map((topicName: string, index) => {
|
|
498
|
+
const topicToRender = helpTopics.find((topic) => {
|
|
499
|
+
return topicName === topic.name;
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
if (topicToRender) {
|
|
503
|
+
return <FormGroupWithHelpTopicPopover topic={topicToRender} key={index} />;
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
return (
|
|
509
|
+
<>
|
|
510
|
+
<PageSection>
|
|
511
|
+
<Banner variant="info">
|
|
512
|
+
<Title headingLevel="h1">Console Page {consolePageState}</Title>
|
|
513
|
+
</Banner>
|
|
514
|
+
</PageSection>
|
|
515
|
+
<PageSection>
|
|
516
|
+
<Title headingLevel="h3">
|
|
517
|
+
Example usage of help topics opened via popover{' '}
|
|
518
|
+
<b>
|
|
519
|
+
{consolePageState < 4
|
|
520
|
+
? 'using tags that match the Console Page number'
|
|
521
|
+
: 'by defining which help topics should be present on each page'}
|
|
522
|
+
</b>
|
|
523
|
+
</Title>
|
|
524
|
+
<Divider />
|
|
525
|
+
<Form>
|
|
526
|
+
{consolePageState < 4
|
|
527
|
+
? formGroupsFromTags
|
|
528
|
+
: formGroupsFromTopicNames(helpTopicNamesByPage[consolePageState - 4])}
|
|
529
|
+
</Form>
|
|
530
|
+
</PageSection>
|
|
531
|
+
<PageSection>
|
|
532
|
+
<Split hasGutter>
|
|
533
|
+
<SplitItem>
|
|
534
|
+
<Button onClick={handleClickBack} variant="tertiary">
|
|
535
|
+
Previous
|
|
536
|
+
</Button>
|
|
537
|
+
</SplitItem>
|
|
538
|
+
<SplitItem>
|
|
539
|
+
<Button onClick={handleClickNext}>Next</Button>
|
|
540
|
+
</SplitItem>
|
|
541
|
+
</Split>
|
|
542
|
+
</PageSection>
|
|
543
|
+
</>
|
|
544
|
+
);
|
|
545
|
+
};
|
|
546
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './_markdown-view.scss';
|
|
3
|
+
interface ShowdownExtension {
|
|
4
|
+
type: string;
|
|
5
|
+
regex?: RegExp;
|
|
6
|
+
replace?: (...args: any[]) => string;
|
|
7
|
+
}
|
|
8
|
+
export declare const markdownConvert: (markdown: any, extensions?: ShowdownExtension[]) => any;
|
|
9
|
+
interface SyncMarkdownProps {
|
|
10
|
+
content?: string;
|
|
11
|
+
emptyMsg?: string;
|
|
12
|
+
exactHeight?: boolean;
|
|
13
|
+
extensions?: ShowdownExtension[];
|
|
14
|
+
renderExtension?: (contentDocument: Document, rootSelector: string) => React.ReactNode;
|
|
15
|
+
inline?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const SyncMarkdownView: React.FC<SyncMarkdownProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { History } from 'history';
|
|
2
|
+
type AppHistory = History & {
|
|
3
|
+
pushPath: History['push'];
|
|
4
|
+
};
|
|
5
|
+
export declare const history: AppHistory;
|
|
6
|
+
export declare const removeQueryArgument: (k: string) => void;
|
|
7
|
+
export declare const setQueryArgument: (k: string, v: string) => void;
|
|
8
|
+
export declare const clearFilterParams: () => void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const Box: React.FC<BoxProps>;
|
|
3
|
+
export declare const Loading: React.FC<LoadingProps>;
|
|
4
|
+
export declare const LoadingBox: React.FC<LoadingBoxProps>;
|
|
5
|
+
export declare const EmptyBox: React.FC<EmptyBoxProps>;
|
|
6
|
+
interface BoxProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
interface LoadingProps {
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
interface LoadingBoxProps {
|
|
14
|
+
className?: string;
|
|
15
|
+
message?: string;
|
|
16
|
+
}
|
|
17
|
+
interface EmptyBoxProps {
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface AccessReviewResourceAttributes {
|
|
2
|
+
group?: string;
|
|
3
|
+
resource?: string;
|
|
4
|
+
subresource?: string;
|
|
5
|
+
verb?: K8sVerb;
|
|
6
|
+
name?: string;
|
|
7
|
+
namespace?: string;
|
|
8
|
+
}
|
|
9
|
+
export type K8sVerb = 'create' | 'get' | 'list' | 'update' | 'patch' | 'delete' | 'deletecollection' | 'watch';
|
|
10
|
+
export interface OwnerReference {
|
|
11
|
+
name: string;
|
|
12
|
+
kind: string;
|
|
13
|
+
uid: string;
|
|
14
|
+
apiVersion: string;
|
|
15
|
+
controller?: boolean;
|
|
16
|
+
blockOwnerDeletion?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ObjectMetadata {
|
|
19
|
+
name: string;
|
|
20
|
+
annotations?: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
23
|
+
clusterName?: string;
|
|
24
|
+
creationTimestamp?: string;
|
|
25
|
+
deletionGracePeriodSeconds?: number;
|
|
26
|
+
deletionTimestamp?: string;
|
|
27
|
+
finalizers?: string[];
|
|
28
|
+
generateName?: string;
|
|
29
|
+
generation?: number;
|
|
30
|
+
labels?: {
|
|
31
|
+
[key: string]: string;
|
|
32
|
+
};
|
|
33
|
+
managedFields?: any[];
|
|
34
|
+
namespace?: string;
|
|
35
|
+
ownerReferences?: OwnerReference[];
|
|
36
|
+
resourceVersion?: string;
|
|
37
|
+
uid?: string;
|
|
38
|
+
language?: string;
|
|
39
|
+
country?: string;
|
|
40
|
+
locale?: string;
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface CopyClipboardProps {
|
|
3
|
+
element: HTMLElement;
|
|
4
|
+
rootSelector: string;
|
|
5
|
+
docContext: Document;
|
|
6
|
+
}
|
|
7
|
+
export declare const CopyClipboard: React.FC<CopyClipboardProps>;
|
|
8
|
+
interface MarkdownCopyClipboardProps {
|
|
9
|
+
docContext: Document;
|
|
10
|
+
rootSelector: string;
|
|
11
|
+
}
|
|
12
|
+
declare const MarkdownCopyClipboard: React.FC<MarkdownCopyClipboardProps>;
|
|
13
|
+
export default MarkdownCopyClipboard;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import './showdown-extension.scss';
|
|
2
|
+
declare const useAccordionShowdownExtension: () => {
|
|
3
|
+
type: string;
|
|
4
|
+
regex: RegExp;
|
|
5
|
+
replace: (_text: string, accordionContent: string, _command: string, accordionHeading: string) => string;
|
|
6
|
+
};
|
|
7
|
+
export default useAccordionShowdownExtension;
|