@patternfly/quickstarts 1.3.0 → 1.4.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 +40 -1
- package/dist/catalog/QuickStartTileFooterExternal.d.ts +1 -0
- package/dist/catalog/QuickStartTileHeader.d.ts +1 -0
- package/dist/controller/QuickStartIntroduction.d.ts +2 -0
- package/dist/index.es.js +50 -40
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +49 -39
- package/dist/index.js.map +1 -1
- package/dist/patternfly-global.css +1189 -0
- package/dist/patternfly-nested.css +7233 -0
- package/dist/quickstarts-base.css +136 -17
- package/dist/quickstarts-full.es.js +318 -232
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts-standalone.css +622 -0
- package/dist/quickstarts-standalone.min.css +4 -0
- package/dist/quickstarts.css +136 -17
- package/dist/quickstarts.min.css +1 -1
- 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/package.json +6 -4
package/README.md
CHANGED
|
@@ -27,9 +27,26 @@ import '@patternfly/react-core/dist/styles/base.css';
|
|
|
27
27
|
import '@patternfly/quickstarts/dist/quickstarts.min.css';
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
### Stylesheets if you use an older version of PatternFly
|
|
31
|
+
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.
|
|
32
|
+
|
|
33
|
+
Ideally @patternfly/quickstarts will use the consumer provided PatternFly styles, only use these stylesheets if really needed.
|
|
34
|
+
|
|
35
|
+
`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 specificiy (for example Drawer since it can include consumer components that depend on an older PF version).
|
|
36
|
+
|
|
37
|
+
> Note: Only use these stylesheets if necessary!
|
|
38
|
+
```js
|
|
39
|
+
// import base from PatternFly to get the font
|
|
40
|
+
import '@patternfly/react-core/dist/styles/base.css';
|
|
41
|
+
// some global styles and variables that quickstarts uses (Drawer, Popover, Modal, Backdrop, Bullseye)
|
|
42
|
+
import '@patternfly/quickstarts/dist/patternfly-global.css';
|
|
43
|
+
// PF and quickstarts styles nested within .pfext-quick-start__base
|
|
44
|
+
import '@patternfly/quickstarts/dist/quickstarts-standalone.min.css';
|
|
45
|
+
```
|
|
46
|
+
|
|
30
47
|
## Usage example
|
|
31
48
|
|
|
32
|
-
Note: You can also view this example on [codesandbox](https://codesandbox.io/s/
|
|
49
|
+
Note: You can also view this example on [codesandbox](https://codesandbox.io/s/patternfly-quickstarts-finished-cnv53)!
|
|
33
50
|
|
|
34
51
|
```js
|
|
35
52
|
import "./styles.css";
|
|
@@ -204,4 +221,26 @@ You can have inline or block copyable text.
|
|
|
204
221
|
```{{copy}}
|
|
205
222
|
```
|
|
206
223
|
|
|
224
|
+
## Localization
|
|
225
|
+
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.
|
|
226
|
+
|
|
227
|
+
Example:
|
|
228
|
+
```js
|
|
229
|
+
// load my own resource Czech translations resource bundle using i18next
|
|
230
|
+
const resourceBundle = i18n.getResourceBundle('cs', 'quickstart');
|
|
231
|
+
const resources = {
|
|
232
|
+
...resourceBundle,
|
|
233
|
+
Start: "Let's go!",
|
|
234
|
+
Continue: 'Resume',
|
|
235
|
+
Restart: 'Start over',
|
|
236
|
+
};
|
|
237
|
+
return (
|
|
238
|
+
<QuickStartContainer resourceBundle={resources}>
|
|
239
|
+
</QuickStartContainer>
|
|
240
|
+
)
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Use this [file](https://github.com/patternfly/patternfly-quickstarts/blob/main/packages/module/src/locales/en/quickstart.json) as a base for your translations.
|
|
244
|
+
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.
|
|
245
|
+
|
|
207
246
|
####
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { QuickStartExternal } from '../utils/quick-start-types';
|
|
3
3
|
declare type QuickStartTileFooterProps = {
|
|
4
4
|
link: QuickStartExternal;
|
|
5
|
+
quickStartId?: string;
|
|
5
6
|
};
|
|
6
7
|
declare const QuickStartTileFooterExternal: React.FC<QuickStartTileFooterProps>;
|
|
7
8
|
export default QuickStartTileFooterExternal;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { QuickStartTask, QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
3
|
+
import './QuickStartIntroduction.scss';
|
|
3
4
|
declare type QuickStartIntroductionProps = {
|
|
4
5
|
introduction: string;
|
|
5
6
|
tasks: QuickStartTask[];
|
|
6
7
|
allTaskStatuses: QuickStartTaskStatus[];
|
|
8
|
+
prerequisites?: string[];
|
|
7
9
|
onTaskSelect: (selectedTaskNumber: number) => void;
|
|
8
10
|
};
|
|
9
11
|
declare const QuickStartIntroduction: React.FC<QuickStartIntroductionProps>;
|
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { createContext, useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import { Card, CardHeader, CardActions, CardTitle, CardBody, CardFooter, Modal as Modal$1, Tooltip, Popover, PopoverPosition, Button, Text, TextVariants, TextList, TextListItem, Flex, FlexItem, Title, Label, Gallery, GalleryItem, ToolbarItem, SearchInput, Select, SelectVariant, SelectOption, Toolbar, ToolbarContent, EmptyState, EmptyStateIcon, EmptyStateBody, EmptyStatePrimary, Divider, ModalVariant, WizardNavItem, List, Alert, Radio, DrawerPanelContent, DrawerHead, DrawerActions, DrawerCloseButton, DrawerPanelBody, Drawer, DrawerContent, DrawerContentBody } from '@patternfly/react-core';
|
|
3
|
+
import { Card, CardHeader, CardActions, CardTitle, CardBody, CardFooter, Modal as Modal$1, Tooltip, Popover, PopoverPosition, Button, Text, TextVariants, TextList, TextListItem, Flex, FlexItem, Title, Label, Gallery, GalleryItem, ToolbarItem, SearchInput, Select, SelectVariant, SelectOption, Toolbar, ToolbarContent, EmptyState, EmptyStateIcon, EmptyStateBody, EmptyStatePrimary, Divider, ModalVariant, WizardNavItem, List, ExpandableSection, ListItem, Alert, Radio, DrawerPanelContent, DrawerHead, DrawerActions, DrawerCloseButton, DrawerPanelBody, Drawer, DrawerContent, DrawerContentBody } from '@patternfly/react-core';
|
|
4
4
|
import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
|
|
5
5
|
import { css } from '@patternfly/react-styles';
|
|
6
6
|
import RocketIcon from '@patternfly/react-icons/dist/js/icons/rocket-icon';
|
|
@@ -139,6 +139,7 @@ var en = {
|
|
|
139
139
|
"{{count, number}} item": "{{count, number}} item",
|
|
140
140
|
"{{count, number}} item_plural": "{{count, number}} items",
|
|
141
141
|
"Prerequisites ({{totalPrereqs}})": "Prerequisites ({{totalPrereqs}})",
|
|
142
|
+
"View Prerequisites ({{totalPrereqs}})": "View Prerequisites ({{totalPrereqs}})",
|
|
142
143
|
Prerequisites: Prerequisites,
|
|
143
144
|
"Show prerequisites": "Show prerequisites",
|
|
144
145
|
Complete: Complete,
|
|
@@ -962,7 +963,7 @@ const SimplePopper = ({ children }) => {
|
|
|
962
963
|
}
|
|
963
964
|
}, [destroy, isOpen]);
|
|
964
965
|
return isOpen ? (React.createElement(Portal, null,
|
|
965
|
-
React.createElement("div", { ref: nodeRefCallback, style: { zIndex: 9999, position: 'absolute', top: 0, left: 0 } }, children))) : null;
|
|
966
|
+
React.createElement("div", { ref: nodeRefCallback, style: { zIndex: 9999, position: 'absolute', top: 0, left: 0 }, className: "pfext-quick-start__base" }, children))) : null;
|
|
966
967
|
};
|
|
967
968
|
|
|
968
969
|
const isInViewport = (elementToCheck) => {
|
|
@@ -1205,7 +1206,7 @@ const CopyClipboard = ({ element, rootSelector, docContext, }) => {
|
|
|
1205
1206
|
useEventListener(element, 'mouseleave', React.useCallback(() => {
|
|
1206
1207
|
setShowSuccessContent(false);
|
|
1207
1208
|
}, []));
|
|
1208
|
-
return showSuccessContent ? (React.createElement(Tooltip, { key: "after-copy", isVisible: true, reference: () => element, content: getResource('Successfully copied to clipboard!') })) : (React.createElement(Tooltip, { key: "before-copy", reference: () => element, content: getResource('Copy to clipboard') }));
|
|
1209
|
+
return showSuccessContent ? (React.createElement(Tooltip, { key: "after-copy", isVisible: true, reference: () => element, content: getResource('Successfully copied to clipboard!'), className: "pfext-quick-start__base" })) : (React.createElement(Tooltip, { key: "before-copy", reference: () => element, content: getResource('Copy to clipboard'), className: "pfext-quick-start__base" }));
|
|
1209
1210
|
};
|
|
1210
1211
|
const MarkdownCopyClipboard = ({ docContext, rootSelector, }) => {
|
|
1211
1212
|
const elements = docContext.querySelectorAll(`${rootSelector} [${MARKDOWN_COPY_BUTTON_ID}]`);
|
|
@@ -1530,10 +1531,11 @@ const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
|
1530
1531
|
React.createElement(Text, { component: TextVariants.h5, className: "pfext-quick-start-tile-prerequisites__text" },
|
|
1531
1532
|
getResource('Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length),
|
|
1532
1533
|
' '),
|
|
1533
|
-
React.createElement(Popover, { "aria-label": getResource('Prerequisites'), headerContent: getResource('Prerequisites'), className: "pfext-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
React.createElement(
|
|
1534
|
+
React.createElement(Popover, { "aria-label": getResource('Prerequisites'), headerContent: getResource('Prerequisites'), className: "pfext-quick-start__base", bodyContent: React.createElement("div", { className: "pfext-popover__base" },
|
|
1535
|
+
React.createElement(TextList, { "aria-label": getResource('Prerequisites'), className: "pfext-quick-start-tile-prerequisites-list" }, prereqs.map((prerequisite, index) => (
|
|
1536
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
1537
|
+
React.createElement(TextListItem, { key: index },
|
|
1538
|
+
React.createElement(QuickStartMarkdownView, { content: prerequisite })))))) },
|
|
1537
1539
|
React.createElement(Button, { variant: "link", isInline: true, className: "pfext-quick-start-tile-prerequisites__icon", "data-testid": "qs-card-prereqs", onClick: (e) => {
|
|
1538
1540
|
e.preventDefault();
|
|
1539
1541
|
e.stopPropagation();
|
|
@@ -1556,20 +1558,20 @@ const QuickStartTileFooter = ({ quickStartId, status, totalTasks, }) => {
|
|
|
1556
1558
|
}, [quickStartId, restartQuickStart, totalTasks]);
|
|
1557
1559
|
return (React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
|
|
1558
1560
|
status === QuickStartStatus.NOT_STARTED && (React.createElement(FlexItem, null,
|
|
1559
|
-
React.createElement(Button, { onClick: start, variant: "link", isInline: true, "data-testid": "qs-card-notStarted-start" }, getResource('Start')))),
|
|
1561
|
+
React.createElement(Button, { onClick: start, variant: "link", isInline: true, "data-testid": "qs-card-notStarted-start", id: `${quickStartId}-start`, "aria-labelledby": `${quickStartId}-start ${quickStartId}` }, getResource('Start')))),
|
|
1560
1562
|
status === QuickStartStatus.IN_PROGRESS && activeQuickStartID !== quickStartId && (React.createElement(FlexItem, null,
|
|
1561
|
-
React.createElement(Button, { variant: "link", isInline: true, "data-testid": "qs-card-inProgress-resume" }, getResource('Continue')))),
|
|
1563
|
+
React.createElement(Button, { variant: "link", isInline: true, "data-testid": "qs-card-inProgress-resume", id: `${quickStartId}-continue`, "aria-labelledby": `${quickStartId}-continue ${quickStartId}` }, getResource('Continue')))),
|
|
1562
1564
|
status === QuickStartStatus.COMPLETE && (React.createElement(FlexItem, null,
|
|
1563
|
-
React.createElement(Button, { onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-complete-restart" }, getResource('
|
|
1565
|
+
React.createElement(Button, { onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-complete-restart", id: `${quickStartId}-restart`, "aria-labelledby": `${quickStartId}-restart ${quickStartId}` }, getResource('Restart')))),
|
|
1564
1566
|
status === QuickStartStatus.IN_PROGRESS && (React.createElement(FlexItem, null,
|
|
1565
|
-
React.createElement(Button, { onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-inProgress-restart" }, getResource('Restart'))))));
|
|
1567
|
+
React.createElement(Button, { onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-inProgress-restart", id: `${quickStartId}-restart`, "aria-labelledby": `${quickStartId}-restart ${quickStartId}` }, getResource('Restart'))))));
|
|
1566
1568
|
};
|
|
1567
1569
|
|
|
1568
|
-
const QuickStartTileFooterExternal = ({ link }) => {
|
|
1570
|
+
const QuickStartTileFooterExternal = ({ link, quickStartId, }) => {
|
|
1569
1571
|
const { href, text } = link;
|
|
1570
1572
|
return (React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
|
|
1571
1573
|
React.createElement(FlexItem, null,
|
|
1572
|
-
React.createElement(Button, { component: "a", href: href, target: "_blank", rel: "noopener noreferrer", variant: "link", "aria-label": `Open documentation in new window`, isInline: true, icon: React.createElement(ExternalLinkAltIcon, null), iconPosition: "right" }, text || href))));
|
|
1574
|
+
React.createElement(Button, { component: "a", href: href, target: "_blank", rel: "noopener noreferrer", variant: "link", "aria-label": `Open documentation in new window`, isInline: true, icon: React.createElement(ExternalLinkAltIcon, null), iconPosition: "right", id: quickStartId, "aria-labelledby": `${quickStartId}-external ${quickStartId}` }, text || href))));
|
|
1573
1575
|
};
|
|
1574
1576
|
|
|
1575
1577
|
const statusColorMap = {
|
|
@@ -1577,7 +1579,7 @@ const statusColorMap = {
|
|
|
1577
1579
|
[QuickStartStatus.IN_PROGRESS]: 'purple',
|
|
1578
1580
|
[QuickStartStatus.NOT_STARTED]: 'grey',
|
|
1579
1581
|
};
|
|
1580
|
-
const QuickStartTileHeader = ({ status, duration, name, type, }) => {
|
|
1582
|
+
const QuickStartTileHeader = ({ status, duration, name, type, quickStartId, }) => {
|
|
1581
1583
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1582
1584
|
const statusLocaleMap = {
|
|
1583
1585
|
[QuickStartStatus.COMPLETE]: getResource('Complete'),
|
|
@@ -1585,7 +1587,7 @@ const QuickStartTileHeader = ({ status, duration, name, type, }) => {
|
|
|
1585
1587
|
[QuickStartStatus.NOT_STARTED]: getResource('Not started'),
|
|
1586
1588
|
};
|
|
1587
1589
|
return (React.createElement("div", { className: "pfext-quick-start-tile-header" },
|
|
1588
|
-
React.createElement(Title, { headingLevel: "h3", "data-test": "title" }, name),
|
|
1590
|
+
React.createElement(Title, { headingLevel: "h3", "data-test": "title", id: quickStartId }, name),
|
|
1589
1591
|
React.createElement("div", { className: "pfext-quick-start-tile-header__status" },
|
|
1590
1592
|
type && (React.createElement(Label, { className: "pfext-quick-start-tile-header--margin", color: type.color }, type.text)),
|
|
1591
1593
|
duration && (React.createElement(Label, { variant: "outline", "data-test": "duration", icon: React.createElement(OutlinedClockIcon, null), className: "pfext-quick-start-tile-header--margin" }, getResource('{{duration, number}} minutes', duration).replace('{{duration, number}}', duration))),
|
|
@@ -1603,7 +1605,7 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, })
|
|
|
1603
1605
|
else {
|
|
1604
1606
|
quickStartIcon = (React.createElement(FallbackImg, { className: "pfext-catalog-item-icon__img--large", src: icon, alt: "", fallback: React.createElement(RocketIcon, null) }));
|
|
1605
1607
|
}
|
|
1606
|
-
const footerComponent = footer && footer.show === false ? null : link ? (React.createElement(QuickStartTileFooterExternal, { link: link })) : (React.createElement(QuickStartTileFooter, { quickStartId: id, status: status, totalTasks: tasks === null || tasks === void 0 ? void 0 : tasks.length }));
|
|
1608
|
+
const footerComponent = footer && footer.show === false ? null : link ? (React.createElement(QuickStartTileFooterExternal, { link: link, quickStartId: id })) : (React.createElement(QuickStartTileFooter, { quickStartId: id, status: status, totalTasks: tasks === null || tasks === void 0 ? void 0 : tasks.length }));
|
|
1607
1609
|
const handleClick = (e) => {
|
|
1608
1610
|
var _a;
|
|
1609
1611
|
if ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
|
|
@@ -1623,7 +1625,7 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, })
|
|
|
1623
1625
|
// @ts-ignore
|
|
1624
1626
|
component: "div", style: {
|
|
1625
1627
|
cursor: 'pointer',
|
|
1626
|
-
}, icon: quickStartIcon, className: "pfext-quick-start-tile", "data-testid": `qs-card-${camelize(displayName)}`, featured: isActive, title: React.createElement(QuickStartTileHeader, { name: displayName, status: status, duration: durationMinutes, type: type }), onClick: handleClick, "data-test": `tile ${id}`, description: React.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }), footer: footerComponent })));
|
|
1628
|
+
}, icon: quickStartIcon, className: "pfext-quick-start-tile", "data-testid": `qs-card-${camelize(displayName)}`, featured: isActive, title: React.createElement(QuickStartTileHeader, { name: displayName, status: status, duration: durationMinutes, type: type, quickStartId: id }), onClick: handleClick, "data-test": `tile ${id}`, description: React.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }), footer: footerComponent })));
|
|
1627
1629
|
};
|
|
1628
1630
|
|
|
1629
1631
|
const QuickStartCatalog = ({ quickStarts }) => {
|
|
@@ -1816,7 +1818,7 @@ const QuickStartCatalogPage = ({ quickStarts, showFilter, sortFnc = (q1, q2) =>
|
|
|
1816
1818
|
if (!allQuickStarts || allQuickStarts.length === 0) {
|
|
1817
1819
|
return React.createElement(EmptyBox, { label: getResource('Quick Starts') });
|
|
1818
1820
|
}
|
|
1819
|
-
return (React.createElement(
|
|
1821
|
+
return (React.createElement("div", { className: "pfext-quick-start__base" },
|
|
1820
1822
|
showTitle && (React.createElement("div", { className: "pfext-page-layout__header" },
|
|
1821
1823
|
React.createElement(Text, { component: "h1", className: "pfext-page-layout__title", "data-test": "page-title" }, title || getResource('Quick Starts')),
|
|
1822
1824
|
hint && React.createElement("div", { className: "pfext-page-layout__hint" }, hint))),
|
|
@@ -1837,31 +1839,31 @@ const QuickStartCatalogToolbar = ({ children }) => (React.createElement(Toolbar,
|
|
|
1837
1839
|
|
|
1838
1840
|
const QuickStartCloseModal = ({ isOpen, onConfirm, onCancel, }) => {
|
|
1839
1841
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1840
|
-
return (React.createElement(Modal, { className: "pfext-quick-start-drawer__modal", isOpen: isOpen, variant: ModalVariant.small, showClose: false, "data-test": "leave-quickstart", title: getResource('Leave quick start?'), footer: React.createElement(Flex, null,
|
|
1842
|
+
return (React.createElement(Modal, { className: "pfext-quick-start-drawer__modal pfext-quick-start__base", isOpen: isOpen, variant: ModalVariant.small, showClose: false, "data-test": "leave-quickstart", title: getResource('Leave quick start?'), footer: React.createElement(Flex, null,
|
|
1841
1843
|
React.createElement(FlexItem, { align: { default: 'alignRight' } },
|
|
1842
1844
|
React.createElement(Button, { variant: "secondary", "data-test": "cancel button", onClick: onCancel }, getResource('Cancel'))),
|
|
1843
1845
|
React.createElement(FlexItem, null,
|
|
1844
1846
|
React.createElement(Button, { variant: "primary", "data-test": "leave button", onClick: onConfirm }, getResource('Leave')))), isFullScreen: true }, getResource('Your progress will be saved.')));
|
|
1845
1847
|
};
|
|
1846
1848
|
|
|
1847
|
-
const TaskIcon = ({ taskIndex, taskStatus
|
|
1849
|
+
const TaskIcon = ({ taskIndex, taskStatus }) => {
|
|
1848
1850
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1851
|
+
const success = taskStatus === QuickStartTaskStatus.SUCCESS;
|
|
1852
|
+
const failed = taskStatus === QuickStartTaskStatus.FAILED;
|
|
1853
|
+
const classNames = css('pfext-icon-and-text__icon', {
|
|
1854
|
+
'pfext-quick-start-task-header__task-icon-init': !failed && !success,
|
|
1855
|
+
});
|
|
1856
|
+
let content;
|
|
1857
|
+
if (success) {
|
|
1858
|
+
content = (React.createElement(CheckCircleIcon, { size: "md", className: "pfext-quick-start-task-header__task-icon-success" }));
|
|
1853
1859
|
}
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
return (React.createElement("span", { className: "pfext-icon-and-text__icon" },
|
|
1857
|
-
React.createElement(CheckCircleIcon, { size: "md", className: "pfext-quick-start-task-header__task-icon-success" })));
|
|
1858
|
-
case QuickStartTaskStatus.FAILED:
|
|
1859
|
-
case QuickStartTaskStatus.VISITED:
|
|
1860
|
-
return (React.createElement("span", { className: "pfext-icon-and-text__icon" },
|
|
1861
|
-
React.createElement(ExclamationCircleIcon, { size: "md", className: "pfext-quick-start-task-header__task-icon-failed" })));
|
|
1862
|
-
default:
|
|
1863
|
-
return stepNumberIcon;
|
|
1860
|
+
else if (failed) {
|
|
1861
|
+
content = (React.createElement(ExclamationCircleIcon, { size: "md", className: "pfext-quick-start-task-header__task-icon-failed" }));
|
|
1864
1862
|
}
|
|
1863
|
+
else {
|
|
1864
|
+
content = getResource('{{taskIndex, number}}', taskIndex).replace('{{taskIndex, number}}', taskIndex);
|
|
1865
|
+
}
|
|
1866
|
+
return React.createElement("span", { className: classNames }, content);
|
|
1865
1867
|
};
|
|
1866
1868
|
const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, isActiveTask, onTaskSelect, }) => {
|
|
1867
1869
|
const classNames = css('pfext-quick-start-task-header__title', {
|
|
@@ -1875,7 +1877,7 @@ const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, is
|
|
|
1875
1877
|
const content = (React.createElement(Flex, { className: "pfext-quick-start-task-header", direction: { default: 'column' }, spaceItems: { default: 'spaceItemsXs' } },
|
|
1876
1878
|
React.createElement(FlexItem, null,
|
|
1877
1879
|
React.createElement(Title, { headingLevel: "h3", size: size, className: classNames },
|
|
1878
|
-
React.createElement(TaskIcon, { taskIndex: taskIndex, taskStatus: taskStatus
|
|
1880
|
+
React.createElement(TaskIcon, { taskIndex: taskIndex, taskStatus: taskStatus }),
|
|
1879
1881
|
React.createElement("span", { dangerouslySetInnerHTML: { __html: removeParagraphWrap(markdownConvert(title)) } }),
|
|
1880
1882
|
isActiveTask && subtitle && (React.createElement(React.Fragment, null,
|
|
1881
1883
|
' ',
|
|
@@ -1908,10 +1910,18 @@ const QuickStartConclusion = ({ tasks, conclusion, allTaskStatuses, nextQuickSta
|
|
|
1908
1910
|
})));
|
|
1909
1911
|
};
|
|
1910
1912
|
|
|
1911
|
-
const QuickStartIntroduction = ({ tasks, introduction, allTaskStatuses, onTaskSelect, }) => {
|
|
1913
|
+
const QuickStartIntroduction = ({ tasks, introduction, allTaskStatuses, prerequisites, onTaskSelect, }) => {
|
|
1912
1914
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1915
|
+
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
1916
|
+
const [isPrereqsExpanded, setIsPrereqsExpanded] = React.useState(false);
|
|
1917
|
+
const prereqList = (prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (React.createElement(ExpandableSection, { toggleText: getResource('View Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length), onToggle: () => setIsPrereqsExpanded(!isPrereqsExpanded), className: "pfext-quick-start-intro__prereq" },
|
|
1918
|
+
React.createElement(List, { className: "pfext-quick-start-intro__prereq-list" }, prereqs.map((pr) => {
|
|
1919
|
+
return (React.createElement(ListItem, { key: pr, className: "pfext-quick-start-intro__prereq-list__item" },
|
|
1920
|
+
React.createElement("span", { className: "pfext-quick-start-intro__prereq-list__item-content" }, pr)));
|
|
1921
|
+
}))));
|
|
1913
1922
|
return (React.createElement(React.Fragment, null,
|
|
1914
1923
|
React.createElement(QuickStartMarkdownView, { content: introduction }),
|
|
1924
|
+
prereqList,
|
|
1915
1925
|
React.createElement("p", { style: { marginBottom: 'var(--pf-global--spacer--md)' } },
|
|
1916
1926
|
getResource('In this quick start, you will complete {{count, number}} task', tasks.length).replace('{{count, number}}', tasks.length),
|
|
1917
1927
|
":"),
|
|
@@ -1936,7 +1946,7 @@ const QuickStartTaskReview = ({ review, taskStatus, onTaskReview, }) => {
|
|
|
1936
1946
|
'pfext-quick-start-task-review--failed': taskStatus === QuickStartTaskStatus.FAILED,
|
|
1937
1947
|
});
|
|
1938
1948
|
const title = React.createElement("span", { className: alertClassNames }, getResource('Check your work'));
|
|
1939
|
-
return (React.createElement(Alert, { variant: getAlertVariant(taskStatus), title: title, isInline: true },
|
|
1949
|
+
return (React.createElement(Alert, { className: "pfext-quick-start-task-review-alert", variant: getAlertVariant(taskStatus), title: title, isInline: true },
|
|
1940
1950
|
React.createElement(QuickStartMarkdownView, { content: instructions }),
|
|
1941
1951
|
React.createElement("span", { className: "pfext-quick-start-task-review__actions" },
|
|
1942
1952
|
React.createElement(Radio, { id: "review-success", name: "review-success", "data-testid": "qs-drawer-check-yes", label: getResource('Yes'), className: "pfext-quick-start-task-review__radio", isChecked: taskStatus === QuickStartTaskStatus.SUCCESS, onChange: () => onTaskReview(QuickStartTaskStatus.SUCCESS) }),
|
|
@@ -1965,10 +1975,10 @@ const QuickStartTasks = ({ tasks, taskNumber, allTaskStatuses, onTaskReview, onT
|
|
|
1965
1975
|
};
|
|
1966
1976
|
|
|
1967
1977
|
const QuickStartContent = React.forwardRef(({ quickStart, nextQuickStarts = [], taskNumber, allTaskStatuses, onTaskSelect, onTaskReview, onQuickStartChange, }, ref) => {
|
|
1968
|
-
const { spec: { introduction, tasks, conclusion }, } = quickStart;
|
|
1978
|
+
const { spec: { introduction, tasks, conclusion, prerequisites }, } = quickStart;
|
|
1969
1979
|
const totalTasks = tasks.length;
|
|
1970
1980
|
return (React.createElement("div", { className: "pfext-quick-start-content", ref: ref },
|
|
1971
|
-
taskNumber === -1 && (React.createElement(QuickStartIntroduction, { tasks: tasks, allTaskStatuses: allTaskStatuses, introduction: introduction, onTaskSelect: onTaskSelect })),
|
|
1981
|
+
taskNumber === -1 && (React.createElement(QuickStartIntroduction, { tasks: tasks, allTaskStatuses: allTaskStatuses, introduction: introduction, prerequisites: prerequisites, onTaskSelect: onTaskSelect })),
|
|
1972
1982
|
taskNumber > -1 && taskNumber < totalTasks && (React.createElement(QuickStartTasks, { tasks: tasks, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskReview: onTaskReview, onTaskSelect: onTaskSelect })),
|
|
1973
1983
|
taskNumber === totalTasks && (React.createElement(QuickStartConclusion, { tasks: tasks, conclusion: conclusion, allTaskStatuses: allTaskStatuses, nextQuickStarts: nextQuickStarts, onQuickStartChange: onQuickStartChange, onTaskSelect: onTaskSelect }))));
|
|
1974
1984
|
});
|
|
@@ -2095,7 +2105,7 @@ const QuickStartPanelContent = (_a) => {
|
|
|
2095
2105
|
}
|
|
2096
2106
|
return Number.parseInt(taskNumber, 10) + 1;
|
|
2097
2107
|
};
|
|
2098
|
-
const content = quickStart ? (React.createElement(DrawerPanelContent, Object.assign({ isResizable: isResizable, className: "pfext-quick-
|
|
2108
|
+
const content = quickStart ? (React.createElement(DrawerPanelContent, Object.assign({ isResizable: isResizable, className: "pfext-quick-start__base", "data-testid": `qs-drawer-${camelize(quickStart.spec.displayName)}`, "data-qs": `qs-step-${getStep()}`, "data-test": "quickstart drawer" }, props),
|
|
2099
2109
|
React.createElement("div", { className: headerClasses },
|
|
2100
2110
|
React.createElement(DrawerHead, null,
|
|
2101
2111
|
React.createElement("div", { className: "pfext-quick-start-panel-content__title" },
|