@patternfly/quickstarts 2.2.2 → 2.3.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 +4 -4
- package/dist/HelpTopicDrawer.d.ts +8 -2
- package/dist/QuickStartDrawer.d.ts +21 -2
- package/dist/controller/QuickStartTaskHeader.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +104 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +104 -3
- package/dist/index.js.map +1 -1
- 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 +53 -0
- package/dist/patternfly-docs/quick-starts/examples/about.md +77 -0
- package/dist/patternfly-docs/quick-starts/examples/basic.md +27 -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 +25 -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/quickstarts-full.es.js +104 -4
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/utils/asciidoc-procedure-parser.d.ts +12 -0
- package/package.json +11 -4
- 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 +390 -0
- package/src/ConsoleInternal/components/markdown-view.tsx +305 -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 +47 -0
- package/src/ConsoleInternal/components/utils/status-box.tsx +94 -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 +93 -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/admonition-extension.tsx +66 -0
- package/src/ConsoleShared/src/components/markdown-extensions/code-extension.tsx +25 -0
- package/src/ConsoleShared/src/components/markdown-extensions/const.ts +3 -0
- package/src/ConsoleShared/src/components/markdown-extensions/index.ts +5 -0
- package/src/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.tsx +45 -0
- package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +50 -0
- package/src/ConsoleShared/src/components/markdown-extensions/showdown-extension.scss +52 -0
- package/src/ConsoleShared/src/components/markdown-extensions/utils.ts +3 -0
- package/src/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.tsx +64 -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 +23 -0
- package/src/ConsoleShared/src/components/popper/SimplePopper.tsx +90 -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 +33 -0
- package/src/ConsoleShared/src/components/status/NotStartedIcon.tsx +27 -0
- package/src/ConsoleShared/src/components/status/PopoverStatus.tsx +42 -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 +77 -0
- package/src/ConsoleShared/src/components/status/index.tsx +1 -0
- package/src/ConsoleShared/src/components/status/statuses.tsx +36 -0
- package/src/ConsoleShared/src/components/status/types.ts +7 -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 +20 -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 +17 -0
- package/src/HelpTopicDrawer.tsx +124 -0
- package/src/HelpTopicPanelContent.tsx +152 -0
- package/src/QuickStartCatalogPage.tsx +190 -0
- package/src/QuickStartCloseModal.tsx +47 -0
- package/src/QuickStartController.tsx +113 -0
- package/src/QuickStartDrawer.scss +11 -0
- package/src/QuickStartDrawer.tsx +265 -0
- package/src/QuickStartMarkdownView.tsx +75 -0
- package/src/QuickStartPanelContent.scss +46 -0
- package/src/QuickStartPanelContent.tsx +153 -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 +105 -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 +12 -0
- package/src/catalog/QuickStartTileHeader.tsx +77 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilter.scss +25 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilter.tsx +34 -0
- package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +199 -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 +128 -0
- package/src/controller/QuickStartIntroduction.scss +35 -0
- package/src/controller/QuickStartIntroduction.tsx +66 -0
- package/src/controller/QuickStartTaskHeader.scss +58 -0
- package/src/controller/QuickStartTaskHeader.tsx +116 -0
- package/src/controller/QuickStartTaskHeaderList.scss +17 -0
- package/src/controller/QuickStartTaskHeaderList.tsx +35 -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 +56 -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 +44 -0
- package/src/styles/legacy-bootstrap/_tables.scss +38 -0
- package/src/styles/legacy-bootstrap/_type.scss +90 -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 +356 -0
- package/src/utils/asciidoc-procedure-parser.ts +132 -0
- package/src/utils/const.ts +10 -0
- package/src/utils/help-topic-context.tsx +74 -0
- package/src/utils/help-topic-types.ts +16 -0
- package/src/utils/quick-start-context.tsx +477 -0
- package/src/utils/quick-start-types.ts +72 -0
- package/src/utils/quick-start-utils.ts +92 -0
- package/src/utils/useLocalStorage.ts +38 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CatalogTile } from '@patternfly/react-catalog-view-extension';
|
|
3
|
+
import RocketIcon from '@patternfly/react-icons/dist/js/icons/rocket-icon';
|
|
4
|
+
import { FallbackImg } from '@console/shared';
|
|
5
|
+
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
6
|
+
import { QuickStart, QuickStartStatus } from '../utils/quick-start-types';
|
|
7
|
+
import { camelize } from '../utils/quick-start-utils';
|
|
8
|
+
import QuickStartTileDescription from './QuickStartTileDescription';
|
|
9
|
+
import QuickStartTileFooter from './QuickStartTileFooter';
|
|
10
|
+
import QuickStartTileFooterExternal from './QuickStartTileFooterExternal';
|
|
11
|
+
import QuickStartTileHeader from './QuickStartTileHeader';
|
|
12
|
+
|
|
13
|
+
import './QuickStartTile.scss';
|
|
14
|
+
|
|
15
|
+
type QuickStartTileProps = {
|
|
16
|
+
quickStart: QuickStart;
|
|
17
|
+
status: QuickStartStatus;
|
|
18
|
+
isActive: boolean;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const QuickStartTile: React.FC<QuickStartTileProps> = ({
|
|
23
|
+
quickStart,
|
|
24
|
+
status,
|
|
25
|
+
isActive,
|
|
26
|
+
onClick = () => {},
|
|
27
|
+
}) => {
|
|
28
|
+
const {
|
|
29
|
+
metadata: { name: id },
|
|
30
|
+
spec: { icon, tasks, displayName, description, durationMinutes, prerequisites, link, type },
|
|
31
|
+
} = quickStart;
|
|
32
|
+
|
|
33
|
+
const { setActiveQuickStart, footer } = React.useContext<QuickStartContextValues>(
|
|
34
|
+
QuickStartContext,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const ref = React.useRef<HTMLDivElement>(null);
|
|
38
|
+
|
|
39
|
+
let quickStartIcon: React.ReactNode;
|
|
40
|
+
if (typeof icon === 'object') {
|
|
41
|
+
quickStartIcon = icon;
|
|
42
|
+
} else {
|
|
43
|
+
quickStartIcon = (
|
|
44
|
+
<FallbackImg
|
|
45
|
+
className="pfext-catalog-item-icon__img--large"
|
|
46
|
+
src={icon as string}
|
|
47
|
+
alt=""
|
|
48
|
+
fallback={<RocketIcon />}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const footerComponent =
|
|
54
|
+
footer && footer.show === false ? null : link ? (
|
|
55
|
+
<QuickStartTileFooterExternal link={link} quickStartId={id} />
|
|
56
|
+
) : (
|
|
57
|
+
<QuickStartTileFooter quickStartId={id} status={status} totalTasks={tasks?.length} />
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const handleClick = (e: React.SyntheticEvent<HTMLElement, Event>) => {
|
|
61
|
+
if (ref.current?.contains(e.target as Node)) {
|
|
62
|
+
if (link) {
|
|
63
|
+
window.open(link.href);
|
|
64
|
+
} else {
|
|
65
|
+
setActiveQuickStart(id, tasks?.length);
|
|
66
|
+
}
|
|
67
|
+
onClick();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<div ref={ref}>
|
|
73
|
+
<CatalogTile
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
component="div"
|
|
76
|
+
style={{
|
|
77
|
+
cursor: 'pointer',
|
|
78
|
+
}}
|
|
79
|
+
icon={quickStartIcon}
|
|
80
|
+
className="pfext-quick-start-tile"
|
|
81
|
+
data-testid={`qs-card-${camelize(displayName)}`}
|
|
82
|
+
featured={isActive}
|
|
83
|
+
title={
|
|
84
|
+
<QuickStartTileHeader
|
|
85
|
+
name={displayName}
|
|
86
|
+
status={status}
|
|
87
|
+
duration={durationMinutes}
|
|
88
|
+
type={type}
|
|
89
|
+
quickStartId={id}
|
|
90
|
+
/>
|
|
91
|
+
}
|
|
92
|
+
onClick={handleClick}
|
|
93
|
+
// https://github.com/patternfly/patternfly-react/issues/7039
|
|
94
|
+
href="#"
|
|
95
|
+
data-test={`tile ${id}`}
|
|
96
|
+
description={
|
|
97
|
+
<QuickStartTileDescription description={description} prerequisites={prerequisites} />
|
|
98
|
+
}
|
|
99
|
+
footer={footerComponent}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export default QuickStartTile;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.pfext-quick-start-tile {
|
|
2
|
+
&-description {
|
|
3
|
+
display: -webkit-box;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
-webkit-box-orient: vertical;
|
|
6
|
+
-webkit-line-clamp: 3;
|
|
7
|
+
|
|
8
|
+
p {
|
|
9
|
+
margin: 0 0 11.5px;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&-prerequisites {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
&__text {
|
|
16
|
+
margin-right: var(--pf-global--spacer--sm);
|
|
17
|
+
font-size: var(--pf-global--FontSize--md);
|
|
18
|
+
margin-top: 11.5px;
|
|
19
|
+
margin-bottom: 11.5px;
|
|
20
|
+
font-family: var(--pf-global--FontFamily--heading--sans-serif);
|
|
21
|
+
font-weight: var(--pf-global--FontWeight--normal);
|
|
22
|
+
line-height: 1.1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-list {
|
|
26
|
+
padding-left: 20px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Popover,
|
|
5
|
+
Text,
|
|
6
|
+
TextList,
|
|
7
|
+
TextListItem,
|
|
8
|
+
TextVariants,
|
|
9
|
+
} from '@patternfly/react-core';
|
|
10
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
11
|
+
import QuickStartMarkdownView from '../QuickStartMarkdownView';
|
|
12
|
+
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
13
|
+
|
|
14
|
+
import './QuickStartTileDescription.scss';
|
|
15
|
+
|
|
16
|
+
type QuickStartTileDescriptionProps = {
|
|
17
|
+
description: string;
|
|
18
|
+
prerequisites?: string[];
|
|
19
|
+
};
|
|
20
|
+
const QuickStartTileDescription: React.FC<QuickStartTileDescriptionProps> = ({
|
|
21
|
+
description,
|
|
22
|
+
prerequisites,
|
|
23
|
+
}) => {
|
|
24
|
+
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
25
|
+
const prereqs = prerequisites?.filter((p) => p);
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<QuickStartMarkdownView
|
|
29
|
+
content={description}
|
|
30
|
+
className="pfext-quick-start-tile-description"
|
|
31
|
+
/>
|
|
32
|
+
{prereqs?.length > 0 && (
|
|
33
|
+
<div className="pfext-quick-start-tile-prerequisites">
|
|
34
|
+
<Text component={TextVariants.h5} className="pfext-quick-start-tile-prerequisites__text">
|
|
35
|
+
{getResource('Prerequisites ({{totalPrereqs}})').replace(
|
|
36
|
+
'{{totalPrereqs}}',
|
|
37
|
+
prereqs.length,
|
|
38
|
+
)}{' '}
|
|
39
|
+
</Text>
|
|
40
|
+
<Popover
|
|
41
|
+
aria-label={getResource('Prerequisites')}
|
|
42
|
+
headerContent={getResource('Prerequisites')}
|
|
43
|
+
className="pfext-quick-start__base"
|
|
44
|
+
bodyContent={
|
|
45
|
+
<div className="pfext-popover__base">
|
|
46
|
+
<TextList
|
|
47
|
+
aria-label={getResource('Prerequisites')}
|
|
48
|
+
className="pfext-quick-start-tile-prerequisites-list"
|
|
49
|
+
>
|
|
50
|
+
{prereqs.map((prerequisite, index) => (
|
|
51
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
52
|
+
<TextListItem key={index}>
|
|
53
|
+
<QuickStartMarkdownView content={prerequisite} />
|
|
54
|
+
</TextListItem>
|
|
55
|
+
))}
|
|
56
|
+
</TextList>
|
|
57
|
+
</div>
|
|
58
|
+
}
|
|
59
|
+
>
|
|
60
|
+
<Button
|
|
61
|
+
variant="link"
|
|
62
|
+
isInline
|
|
63
|
+
className="pfext-quick-start-tile-prerequisites__icon"
|
|
64
|
+
data-testid="qs-card-prereqs"
|
|
65
|
+
onClick={(e) => {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
}}
|
|
69
|
+
aria-label={getResource('Show prerequisites')}
|
|
70
|
+
>
|
|
71
|
+
<InfoCircleIcon />
|
|
72
|
+
</Button>
|
|
73
|
+
</Popover>
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
export default QuickStartTileDescription;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button, Flex, FlexItem } from '@patternfly/react-core';
|
|
3
|
+
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
4
|
+
import { QuickStartStatus } from '../utils/quick-start-types';
|
|
5
|
+
|
|
6
|
+
type QuickStartTileFooterProps = {
|
|
7
|
+
quickStartId: string;
|
|
8
|
+
status: string;
|
|
9
|
+
totalTasks?: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const QuickStartTileFooter: React.FC<QuickStartTileFooterProps> = ({
|
|
13
|
+
quickStartId,
|
|
14
|
+
status,
|
|
15
|
+
totalTasks,
|
|
16
|
+
}) => {
|
|
17
|
+
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
18
|
+
const { activeQuickStartID, startQuickStart, restartQuickStart } = React.useContext<
|
|
19
|
+
QuickStartContextValues
|
|
20
|
+
>(QuickStartContext);
|
|
21
|
+
|
|
22
|
+
const start = React.useCallback(
|
|
23
|
+
(e: React.SyntheticEvent) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
startQuickStart(quickStartId, totalTasks);
|
|
27
|
+
},
|
|
28
|
+
[quickStartId, startQuickStart, totalTasks],
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const restart = React.useCallback(
|
|
32
|
+
(e: React.SyntheticEvent) => {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
restartQuickStart(quickStartId, totalTasks);
|
|
36
|
+
},
|
|
37
|
+
[quickStartId, restartQuickStart, totalTasks],
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Flex justifyContent={{ default: 'justifyContentSpaceBetween' }}>
|
|
42
|
+
{status === QuickStartStatus.NOT_STARTED && (
|
|
43
|
+
<FlexItem>
|
|
44
|
+
<Button
|
|
45
|
+
onClick={start}
|
|
46
|
+
variant="link"
|
|
47
|
+
isInline
|
|
48
|
+
data-testid="qs-card-notStarted-start"
|
|
49
|
+
id={`${quickStartId}-start`}
|
|
50
|
+
aria-labelledby={`${quickStartId}-start ${quickStartId}`}
|
|
51
|
+
>
|
|
52
|
+
{getResource('Start')}
|
|
53
|
+
</Button>
|
|
54
|
+
</FlexItem>
|
|
55
|
+
)}
|
|
56
|
+
{status === QuickStartStatus.IN_PROGRESS && activeQuickStartID !== quickStartId && (
|
|
57
|
+
<FlexItem>
|
|
58
|
+
<Button
|
|
59
|
+
variant="link"
|
|
60
|
+
isInline
|
|
61
|
+
data-testid="qs-card-inProgress-resume"
|
|
62
|
+
id={`${quickStartId}-continue`}
|
|
63
|
+
aria-labelledby={`${quickStartId}-continue ${quickStartId}`}
|
|
64
|
+
>
|
|
65
|
+
{getResource('Continue')}
|
|
66
|
+
</Button>
|
|
67
|
+
</FlexItem>
|
|
68
|
+
)}
|
|
69
|
+
{status === QuickStartStatus.COMPLETE && (
|
|
70
|
+
<FlexItem>
|
|
71
|
+
<Button
|
|
72
|
+
onClick={restart}
|
|
73
|
+
variant="link"
|
|
74
|
+
isInline
|
|
75
|
+
data-testid="qs-card-complete-restart"
|
|
76
|
+
id={`${quickStartId}-restart`}
|
|
77
|
+
aria-labelledby={`${quickStartId}-restart ${quickStartId}`}
|
|
78
|
+
>
|
|
79
|
+
{getResource('Restart')}
|
|
80
|
+
</Button>
|
|
81
|
+
</FlexItem>
|
|
82
|
+
)}
|
|
83
|
+
{status === QuickStartStatus.IN_PROGRESS && (
|
|
84
|
+
<FlexItem>
|
|
85
|
+
<Button
|
|
86
|
+
onClick={restart}
|
|
87
|
+
variant="link"
|
|
88
|
+
isInline
|
|
89
|
+
data-testid="qs-card-inProgress-restart"
|
|
90
|
+
id={`${quickStartId}-restart`}
|
|
91
|
+
aria-labelledby={`${quickStartId}-restart ${quickStartId}`}
|
|
92
|
+
>
|
|
93
|
+
{getResource('Restart')}
|
|
94
|
+
</Button>
|
|
95
|
+
</FlexItem>
|
|
96
|
+
)}
|
|
97
|
+
</Flex>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export default QuickStartTileFooter;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button, Flex, FlexItem } from '@patternfly/react-core';
|
|
3
|
+
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
4
|
+
import { QuickStartExternal } from '../utils/quick-start-types';
|
|
5
|
+
|
|
6
|
+
type QuickStartTileFooterProps = {
|
|
7
|
+
link: QuickStartExternal;
|
|
8
|
+
quickStartId?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const QuickStartTileFooterExternal: React.FC<QuickStartTileFooterProps> = ({
|
|
12
|
+
link,
|
|
13
|
+
quickStartId,
|
|
14
|
+
}) => {
|
|
15
|
+
const { href, text } = link;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Flex justifyContent={{ default: 'justifyContentSpaceBetween' }}>
|
|
19
|
+
<FlexItem>
|
|
20
|
+
<Button
|
|
21
|
+
component="a"
|
|
22
|
+
href={href}
|
|
23
|
+
target="_blank"
|
|
24
|
+
rel="noopener noreferrer"
|
|
25
|
+
variant="link"
|
|
26
|
+
aria-label={`Open documentation in new window`}
|
|
27
|
+
isInline
|
|
28
|
+
icon={<ExternalLinkAltIcon />}
|
|
29
|
+
iconPosition="right"
|
|
30
|
+
id={quickStartId}
|
|
31
|
+
aria-labelledby={`${quickStartId}-external ${quickStartId}`}
|
|
32
|
+
>
|
|
33
|
+
{text || href}
|
|
34
|
+
</Button>
|
|
35
|
+
</FlexItem>
|
|
36
|
+
</Flex>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default QuickStartTileFooterExternal;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.pfext-quick-start-tile-header {
|
|
2
|
+
&__status {
|
|
3
|
+
margin: var(--pf-global--spacer--sm) 0;
|
|
4
|
+
}
|
|
5
|
+
&--margin {
|
|
6
|
+
margin-right: var(--pf-global--spacer--sm);
|
|
7
|
+
margin-bottom: var(--pf-global--spacer--sm);
|
|
8
|
+
}
|
|
9
|
+
& .pf-c-badge:not(:last-of-type) {
|
|
10
|
+
margin-right: var(--pf-global--spacer--sm);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import './QuickStartTileHeader.scss';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Label, Title } from '@patternfly/react-core';
|
|
4
|
+
import OutlinedClockIcon from '@patternfly/react-icons/dist/js/icons/outlined-clock-icon';
|
|
5
|
+
import { StatusIcon } from '@console/shared';
|
|
6
|
+
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
7
|
+
import { QuickStartStatus, QuickStartType } from '../utils/quick-start-types';
|
|
8
|
+
|
|
9
|
+
type QuickStartTileHeaderProps = {
|
|
10
|
+
status: string;
|
|
11
|
+
duration: number;
|
|
12
|
+
name: string;
|
|
13
|
+
type?: QuickStartType;
|
|
14
|
+
quickStartId?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const statusColorMap = {
|
|
18
|
+
[QuickStartStatus.COMPLETE]: 'green',
|
|
19
|
+
[QuickStartStatus.IN_PROGRESS]: 'purple',
|
|
20
|
+
[QuickStartStatus.NOT_STARTED]: 'grey',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const QuickStartTileHeader: React.FC<QuickStartTileHeaderProps> = ({
|
|
24
|
+
status,
|
|
25
|
+
duration,
|
|
26
|
+
name,
|
|
27
|
+
type,
|
|
28
|
+
quickStartId,
|
|
29
|
+
}) => {
|
|
30
|
+
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
31
|
+
|
|
32
|
+
const statusLocaleMap = {
|
|
33
|
+
[QuickStartStatus.COMPLETE]: getResource('Complete'),
|
|
34
|
+
[QuickStartStatus.IN_PROGRESS]: getResource('In progress'),
|
|
35
|
+
[QuickStartStatus.NOT_STARTED]: getResource('Not started'),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className="pfext-quick-start-tile-header">
|
|
40
|
+
<Title headingLevel="h3" data-test="title" id={quickStartId}>
|
|
41
|
+
{name}
|
|
42
|
+
</Title>
|
|
43
|
+
<div className="pfext-quick-start-tile-header__status">
|
|
44
|
+
{type && (
|
|
45
|
+
<Label className="pfext-quick-start-tile-header--margin" color={type.color}>
|
|
46
|
+
{type.text}
|
|
47
|
+
</Label>
|
|
48
|
+
)}
|
|
49
|
+
{duration && (
|
|
50
|
+
<Label
|
|
51
|
+
variant="outline"
|
|
52
|
+
data-test="duration"
|
|
53
|
+
icon={<OutlinedClockIcon />}
|
|
54
|
+
className="pfext-quick-start-tile-header--margin"
|
|
55
|
+
>
|
|
56
|
+
{getResource('{{duration, number}} minutes', duration).replace(
|
|
57
|
+
'{{duration, number}}',
|
|
58
|
+
duration,
|
|
59
|
+
)}
|
|
60
|
+
</Label>
|
|
61
|
+
)}
|
|
62
|
+
{status !== QuickStartStatus.NOT_STARTED && (
|
|
63
|
+
<Label
|
|
64
|
+
variant="outline"
|
|
65
|
+
color={statusColorMap[status]}
|
|
66
|
+
icon={<StatusIcon status={status} />}
|
|
67
|
+
data-test="status"
|
|
68
|
+
>
|
|
69
|
+
{statusLocaleMap[status]}
|
|
70
|
+
</Label>
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default QuickStartTileHeader;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.pfext-quick-start-catalog-filter {
|
|
2
|
+
&__input {
|
|
3
|
+
flex-grow: 1;
|
|
4
|
+
max-width: 500px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
&__count {
|
|
8
|
+
font-weight: var(--pf-global--FontWeight--bold);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pf-c-toolbar.pf-m-page-insets.pfext-quick-start-catalog-filter__flex {
|
|
13
|
+
--pf-c-toolbar--PaddingBottom: var(--pf-global--spacer--sm);
|
|
14
|
+
--pf-c-toolbar--PaddingTop: var(--pf-global--spacer--sm);
|
|
15
|
+
--pf-c-toolbar--RowGap: 0;
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
|
|
18
|
+
.pf-c-select {
|
|
19
|
+
--pf-c-select__toggle--FontSize: 14px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.pf-c-check {
|
|
23
|
+
--pf-c-check__label--FontSize: 14px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Toolbar, ToolbarContent, ToolbarProps } from '@patternfly/react-core';
|
|
3
|
+
import {
|
|
4
|
+
QuickStartCatalogFilterCountWrapper,
|
|
5
|
+
QuickStartCatalogFilterSearchWrapper,
|
|
6
|
+
QuickStartCatalogFilterStatusWrapper,
|
|
7
|
+
} from './QuickStartCatalogFilterItems';
|
|
8
|
+
|
|
9
|
+
import './QuickStartCatalogFilter.scss';
|
|
10
|
+
|
|
11
|
+
interface QuickStartCatalogFilterProps extends Omit<ToolbarProps, 'ref'> {
|
|
12
|
+
quickStartsCount: number;
|
|
13
|
+
onSearchInputChange: any;
|
|
14
|
+
onStatusChange: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const QuickStartCatalogFilter: React.FC<QuickStartCatalogFilterProps> = ({
|
|
18
|
+
quickStartsCount,
|
|
19
|
+
onSearchInputChange = () => {},
|
|
20
|
+
onStatusChange = () => {},
|
|
21
|
+
...props
|
|
22
|
+
}) => {
|
|
23
|
+
return (
|
|
24
|
+
<Toolbar usePageInsets className="pfext-quick-start-catalog-filter__flex" {...props}>
|
|
25
|
+
<ToolbarContent>
|
|
26
|
+
<QuickStartCatalogFilterSearchWrapper onSearchInputChange={onSearchInputChange} />
|
|
27
|
+
<QuickStartCatalogFilterStatusWrapper onStatusChange={onStatusChange} />
|
|
28
|
+
<QuickStartCatalogFilterCountWrapper quickStartsCount={quickStartsCount} />
|
|
29
|
+
</ToolbarContent>
|
|
30
|
+
</Toolbar>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default QuickStartCatalogFilter;
|