@patternfly/quickstarts 1.2.2 → 1.4.1-rc.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 +48 -2
- package/dist/QuickStartDrawer.d.ts +2 -0
- package/dist/QuickStartPanelContent.d.ts +1 -0
- package/dist/catalog/QuickStartTileFooterExternal.d.ts +1 -0
- package/dist/catalog/QuickStartTileHeader.d.ts +1 -0
- package/dist/controller/QuickStartConclusion.d.ts +1 -1
- package/dist/controller/QuickStartIntroduction.d.ts +2 -0
- package/dist/index.es.js +119 -71
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +118 -70
- package/dist/index.js.map +1 -1
- package/dist/patternfly-global.css +1189 -0
- package/dist/patternfly-nested.css +7241 -0
- package/dist/quickstarts-base.css +249 -64
- package/dist/quickstarts-full.es.js +389 -265
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts-standalone.css +640 -0
- package/dist/quickstarts-standalone.min.css +4 -0
- package/dist/quickstarts.css +249 -64
- 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/dist/utils/quick-start-context.d.ts +5 -0
- package/package.json +9 -7
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,
|
|
@@ -166,7 +167,8 @@ var en = {
|
|
|
166
167
|
"Your progress will be saved.": "Your progress will be saved.",
|
|
167
168
|
"Not available": "Not available",
|
|
168
169
|
"Copy to clipboard": "Copy to clipboard",
|
|
169
|
-
"Successfully copied to clipboard!": "Successfully copied to clipboard!"
|
|
170
|
+
"Successfully copied to clipboard!": "Successfully copied to clipboard!",
|
|
171
|
+
"Quick start • {{duration, number}} minutes": "Quick start • {{duration, number}} minutes"
|
|
170
172
|
};
|
|
171
173
|
|
|
172
174
|
/* eslint-disable */
|
|
@@ -576,8 +578,10 @@ const QuickStartContextDefaults = {
|
|
|
576
578
|
},
|
|
577
579
|
setFilter: () => { },
|
|
578
580
|
footer: null,
|
|
581
|
+
useLegacyHeaderColors: false,
|
|
579
582
|
markdown: null,
|
|
580
583
|
loading: false,
|
|
584
|
+
alwaysShowTaskReview: false,
|
|
581
585
|
};
|
|
582
586
|
const QuickStartContext = createContext(QuickStartContextDefaults);
|
|
583
587
|
const getResource = (resource, options, resourceBundle, lng) => {
|
|
@@ -593,7 +597,7 @@ const getResource = (resource, options, resourceBundle, lng) => {
|
|
|
593
597
|
const useValuesForQuickStartContext = (value = {}) => {
|
|
594
598
|
var _a, _b;
|
|
595
599
|
const combinedValue = Object.assign(Object.assign({}, QuickStartContextDefaults), value);
|
|
596
|
-
const { activeQuickStartID, setActiveQuickStartID, setAllQuickStartStates, useQueryParams, allQuickStartStates, allQuickStarts = [], footer, markdown, } = combinedValue;
|
|
600
|
+
const { activeQuickStartID, setActiveQuickStartID, setAllQuickStartStates, useQueryParams, allQuickStartStates, allQuickStarts = [], footer, useLegacyHeaderColors, markdown, } = combinedValue;
|
|
597
601
|
const [quickStarts, setQuickStarts] = React__default.useState(combinedValue.allQuickStarts || []);
|
|
598
602
|
const [resourceBundle, setResourceBundle] = React__default.useState(Object.assign(Object.assign({}, en), combinedValue.resourceBundle));
|
|
599
603
|
const [language, setLanguage] = React__default.useState(combinedValue.language);
|
|
@@ -605,6 +609,7 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
605
609
|
return getResource(resource, count !== undefined ? { count } : null, resourceBundle, language);
|
|
606
610
|
}, [resourceBundle, language]);
|
|
607
611
|
const [loading, setLoading] = React__default.useState(combinedValue.loading);
|
|
612
|
+
const [alwaysShowTaskReview, setAlwaysShowTaskReview] = React__default.useState(combinedValue.alwaysShowTaskReview);
|
|
608
613
|
const initialSearchParams = new URLSearchParams(window.location.search);
|
|
609
614
|
const initialSearchQuery = initialSearchParams.get(QUICKSTART_SEARCH_FILTER_KEY) || '';
|
|
610
615
|
const initialStatusFilters = ((_a = initialSearchParams.get(QUICKSTART_STATUS_FILTER_KEY)) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
|
|
@@ -675,6 +680,10 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
675
680
|
});
|
|
676
681
|
setAllQuickStartStates((qs) => (Object.assign(Object.assign({}, qs), { [quickStartId]: getDefaultQuickStartState(totalTasks, QuickStartStatus.IN_PROGRESS) })));
|
|
677
682
|
}, [setActiveQuickStartID, setAllQuickStartStates, useQueryParams]);
|
|
683
|
+
// When alwaysShowTaskReview preference is enabled, skip visited step and go directly to review
|
|
684
|
+
const stepAfterInitial = alwaysShowTaskReview
|
|
685
|
+
? QuickStartTaskStatus.REVIEW
|
|
686
|
+
: QuickStartTaskStatus.VISITED;
|
|
678
687
|
const nextStep = useCallback((totalTasks) => {
|
|
679
688
|
if (!activeQuickStartID) {
|
|
680
689
|
return;
|
|
@@ -701,19 +710,19 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
701
710
|
if (taskNumber < totalTasks && !updatedTaskStatus) {
|
|
702
711
|
updatedTaskNumber = taskNumber + 1;
|
|
703
712
|
}
|
|
704
|
-
const
|
|
713
|
+
const markInitialStepVisitedOrReview = updatedTaskNumber > -1 &&
|
|
705
714
|
quickStart[getTaskStatusKey(updatedTaskNumber)] === QuickStartTaskStatus.INIT
|
|
706
|
-
?
|
|
715
|
+
? stepAfterInitial
|
|
707
716
|
: quickStart[getTaskStatusKey(updatedTaskNumber)];
|
|
708
717
|
const newState = Object.assign(Object.assign({}, qs), { [activeQuickStartID]: Object.assign(Object.assign(Object.assign(Object.assign({}, quickStart), (updatedStatus ? { status: updatedStatus } : {})), (updatedTaskNumber > -1
|
|
709
718
|
? {
|
|
710
719
|
taskNumber: updatedTaskNumber,
|
|
711
|
-
[getTaskStatusKey(updatedTaskNumber)]:
|
|
720
|
+
[getTaskStatusKey(updatedTaskNumber)]: markInitialStepVisitedOrReview,
|
|
712
721
|
}
|
|
713
722
|
: {})), (updatedTaskStatus ? { [getTaskStatusKey(taskNumber)]: updatedTaskStatus } : {})) });
|
|
714
723
|
return newState;
|
|
715
724
|
});
|
|
716
|
-
}, [activeQuickStartID, setAllQuickStartStates]);
|
|
725
|
+
}, [activeQuickStartID, setAllQuickStartStates, stepAfterInitial]);
|
|
717
726
|
const previousStep = useCallback(() => {
|
|
718
727
|
setAllQuickStartStates((qs) => {
|
|
719
728
|
const quickStart = qs[activeQuickStartID];
|
|
@@ -735,7 +744,7 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
735
744
|
let updatedTaskStatus = {};
|
|
736
745
|
for (let taskIndex = 0; taskIndex <= taskNumber; taskIndex++) {
|
|
737
746
|
const taskStatus = quickStart[getTaskStatusKey(taskIndex)];
|
|
738
|
-
const newTaskStatus = taskStatus === QuickStartTaskStatus.INIT ?
|
|
747
|
+
const newTaskStatus = taskStatus === QuickStartTaskStatus.INIT ? stepAfterInitial : undefined;
|
|
739
748
|
if (newTaskStatus) {
|
|
740
749
|
updatedTaskStatus = Object.assign(Object.assign({}, updatedTaskStatus), { [getTaskStatusKey(taskIndex)]: newTaskStatus });
|
|
741
750
|
}
|
|
@@ -743,7 +752,7 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
743
752
|
const updatedQuickStart = Object.assign(Object.assign(Object.assign(Object.assign({}, quickStart), (updatedStatus ? { status: updatedStatus } : {})), { taskNumber }), updatedTaskStatus);
|
|
744
753
|
return Object.assign(Object.assign({}, qs), { [quickStartId]: updatedQuickStart });
|
|
745
754
|
});
|
|
746
|
-
}, [setAllQuickStartStates]);
|
|
755
|
+
}, [setAllQuickStartStates, stepAfterInitial]);
|
|
747
756
|
const setQuickStartTaskStatus = useCallback((taskStatus) => {
|
|
748
757
|
const quickStart = allQuickStartStates[activeQuickStartID];
|
|
749
758
|
const { taskNumber } = quickStart;
|
|
@@ -771,6 +780,7 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
771
780
|
setQuickStartTaskStatus,
|
|
772
781
|
getQuickStartForId,
|
|
773
782
|
footer,
|
|
783
|
+
useLegacyHeaderColors,
|
|
774
784
|
useQueryParams,
|
|
775
785
|
markdown,
|
|
776
786
|
resourceBundle,
|
|
@@ -789,6 +799,8 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
789
799
|
setFilter,
|
|
790
800
|
loading,
|
|
791
801
|
setLoading,
|
|
802
|
+
alwaysShowTaskReview,
|
|
803
|
+
setAlwaysShowTaskReview,
|
|
792
804
|
};
|
|
793
805
|
};
|
|
794
806
|
const QuickStartContextProvider = ({ children, value }) => {
|
|
@@ -954,7 +966,7 @@ const SimplePopper = ({ children }) => {
|
|
|
954
966
|
}
|
|
955
967
|
}, [destroy, isOpen]);
|
|
956
968
|
return isOpen ? (React.createElement(Portal, null,
|
|
957
|
-
React.createElement("div", { ref: nodeRefCallback, style: { zIndex: 9999, position: 'absolute', top: 0, left: 0 } }, children))) : null;
|
|
969
|
+
React.createElement("div", { ref: nodeRefCallback, style: { zIndex: 9999, position: 'absolute', top: 0, left: 0 }, className: "pfext-quick-start__base" }, children))) : null;
|
|
958
970
|
};
|
|
959
971
|
|
|
960
972
|
const isInViewport = (elementToCheck) => {
|
|
@@ -1197,7 +1209,7 @@ const CopyClipboard = ({ element, rootSelector, docContext, }) => {
|
|
|
1197
1209
|
useEventListener(element, 'mouseleave', React.useCallback(() => {
|
|
1198
1210
|
setShowSuccessContent(false);
|
|
1199
1211
|
}, []));
|
|
1200
|
-
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') }));
|
|
1212
|
+
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" }));
|
|
1201
1213
|
};
|
|
1202
1214
|
const MarkdownCopyClipboard = ({ docContext, rootSelector, }) => {
|
|
1203
1215
|
const elements = docContext.querySelectorAll(`${rootSelector} [${MARKDOWN_COPY_BUTTON_ID}]`);
|
|
@@ -1522,10 +1534,11 @@ const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
|
1522
1534
|
React.createElement(Text, { component: TextVariants.h5, className: "pfext-quick-start-tile-prerequisites__text" },
|
|
1523
1535
|
getResource('Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length),
|
|
1524
1536
|
' '),
|
|
1525
|
-
React.createElement(Popover, { "aria-label": getResource('Prerequisites'), headerContent: getResource('Prerequisites'), className: "pfext-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
React.createElement(
|
|
1537
|
+
React.createElement(Popover, { "aria-label": getResource('Prerequisites'), headerContent: getResource('Prerequisites'), className: "pfext-quick-start__base", bodyContent: React.createElement("div", { className: "pfext-popover__base" },
|
|
1538
|
+
React.createElement(TextList, { "aria-label": getResource('Prerequisites'), className: "pfext-quick-start-tile-prerequisites-list" }, prereqs.map((prerequisite, index) => (
|
|
1539
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
1540
|
+
React.createElement(TextListItem, { key: index },
|
|
1541
|
+
React.createElement(QuickStartMarkdownView, { content: prerequisite })))))) },
|
|
1529
1542
|
React.createElement(Button, { variant: "link", isInline: true, className: "pfext-quick-start-tile-prerequisites__icon", "data-testid": "qs-card-prereqs", onClick: (e) => {
|
|
1530
1543
|
e.preventDefault();
|
|
1531
1544
|
e.stopPropagation();
|
|
@@ -1548,20 +1561,20 @@ const QuickStartTileFooter = ({ quickStartId, status, totalTasks, }) => {
|
|
|
1548
1561
|
}, [quickStartId, restartQuickStart, totalTasks]);
|
|
1549
1562
|
return (React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
|
|
1550
1563
|
status === QuickStartStatus.NOT_STARTED && (React.createElement(FlexItem, null,
|
|
1551
|
-
React.createElement(Button, { onClick: start, variant: "link", isInline: true, "data-testid": "qs-card-notStarted-start" }, getResource('Start')))),
|
|
1564
|
+
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')))),
|
|
1552
1565
|
status === QuickStartStatus.IN_PROGRESS && activeQuickStartID !== quickStartId && (React.createElement(FlexItem, null,
|
|
1553
|
-
React.createElement(Button, { variant: "link", isInline: true, "data-testid": "qs-card-inProgress-resume" }, getResource('Continue')))),
|
|
1566
|
+
React.createElement(Button, { variant: "link", isInline: true, "data-testid": "qs-card-inProgress-resume", id: `${quickStartId}-continue`, "aria-labelledby": `${quickStartId}-continue ${quickStartId}` }, getResource('Continue')))),
|
|
1554
1567
|
status === QuickStartStatus.COMPLETE && (React.createElement(FlexItem, null,
|
|
1555
|
-
React.createElement(Button, { onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-complete-restart" }, getResource('
|
|
1568
|
+
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')))),
|
|
1556
1569
|
status === QuickStartStatus.IN_PROGRESS && (React.createElement(FlexItem, null,
|
|
1557
|
-
React.createElement(Button, { onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-inProgress-restart" }, getResource('Restart'))))));
|
|
1570
|
+
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'))))));
|
|
1558
1571
|
};
|
|
1559
1572
|
|
|
1560
|
-
const QuickStartTileFooterExternal = ({ link }) => {
|
|
1573
|
+
const QuickStartTileFooterExternal = ({ link, quickStartId, }) => {
|
|
1561
1574
|
const { href, text } = link;
|
|
1562
1575
|
return (React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
|
|
1563
1576
|
React.createElement(FlexItem, null,
|
|
1564
|
-
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))));
|
|
1577
|
+
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))));
|
|
1565
1578
|
};
|
|
1566
1579
|
|
|
1567
1580
|
const statusColorMap = {
|
|
@@ -1569,7 +1582,7 @@ const statusColorMap = {
|
|
|
1569
1582
|
[QuickStartStatus.IN_PROGRESS]: 'purple',
|
|
1570
1583
|
[QuickStartStatus.NOT_STARTED]: 'grey',
|
|
1571
1584
|
};
|
|
1572
|
-
const QuickStartTileHeader = ({ status, duration, name, type, }) => {
|
|
1585
|
+
const QuickStartTileHeader = ({ status, duration, name, type, quickStartId, }) => {
|
|
1573
1586
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1574
1587
|
const statusLocaleMap = {
|
|
1575
1588
|
[QuickStartStatus.COMPLETE]: getResource('Complete'),
|
|
@@ -1577,7 +1590,7 @@ const QuickStartTileHeader = ({ status, duration, name, type, }) => {
|
|
|
1577
1590
|
[QuickStartStatus.NOT_STARTED]: getResource('Not started'),
|
|
1578
1591
|
};
|
|
1579
1592
|
return (React.createElement("div", { className: "pfext-quick-start-tile-header" },
|
|
1580
|
-
React.createElement(Title, { headingLevel: "h3", "data-test": "title" }, name),
|
|
1593
|
+
React.createElement(Title, { headingLevel: "h3", "data-test": "title", id: quickStartId }, name),
|
|
1581
1594
|
React.createElement("div", { className: "pfext-quick-start-tile-header__status" },
|
|
1582
1595
|
type && (React.createElement(Label, { className: "pfext-quick-start-tile-header--margin", color: type.color }, type.text)),
|
|
1583
1596
|
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))),
|
|
@@ -1595,7 +1608,7 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, })
|
|
|
1595
1608
|
else {
|
|
1596
1609
|
quickStartIcon = (React.createElement(FallbackImg, { className: "pfext-catalog-item-icon__img--large", src: icon, alt: "", fallback: React.createElement(RocketIcon, null) }));
|
|
1597
1610
|
}
|
|
1598
|
-
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 }));
|
|
1611
|
+
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 }));
|
|
1599
1612
|
const handleClick = (e) => {
|
|
1600
1613
|
var _a;
|
|
1601
1614
|
if ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
|
|
@@ -1615,7 +1628,7 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, })
|
|
|
1615
1628
|
// @ts-ignore
|
|
1616
1629
|
component: "div", style: {
|
|
1617
1630
|
cursor: 'pointer',
|
|
1618
|
-
}, 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 })));
|
|
1631
|
+
}, 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 })));
|
|
1619
1632
|
};
|
|
1620
1633
|
|
|
1621
1634
|
const QuickStartCatalog = ({ quickStarts }) => {
|
|
@@ -1808,7 +1821,7 @@ const QuickStartCatalogPage = ({ quickStarts, showFilter, sortFnc = (q1, q2) =>
|
|
|
1808
1821
|
if (!allQuickStarts || allQuickStarts.length === 0) {
|
|
1809
1822
|
return React.createElement(EmptyBox, { label: getResource('Quick Starts') });
|
|
1810
1823
|
}
|
|
1811
|
-
return (React.createElement(
|
|
1824
|
+
return (React.createElement("div", { className: "pfext-quick-start__base" },
|
|
1812
1825
|
showTitle && (React.createElement("div", { className: "pfext-page-layout__header" },
|
|
1813
1826
|
React.createElement(Text, { component: "h1", className: "pfext-page-layout__title", "data-test": "page-title" }, title || getResource('Quick Starts')),
|
|
1814
1827
|
hint && React.createElement("div", { className: "pfext-page-layout__hint" }, hint))),
|
|
@@ -1829,65 +1842,89 @@ const QuickStartCatalogToolbar = ({ children }) => (React.createElement(Toolbar,
|
|
|
1829
1842
|
|
|
1830
1843
|
const QuickStartCloseModal = ({ isOpen, onConfirm, onCancel, }) => {
|
|
1831
1844
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1832
|
-
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,
|
|
1845
|
+
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,
|
|
1833
1846
|
React.createElement(FlexItem, { align: { default: 'alignRight' } },
|
|
1834
1847
|
React.createElement(Button, { variant: "secondary", "data-test": "cancel button", onClick: onCancel }, getResource('Cancel'))),
|
|
1835
1848
|
React.createElement(FlexItem, null,
|
|
1836
1849
|
React.createElement(Button, { variant: "primary", "data-test": "leave button", onClick: onConfirm }, getResource('Leave')))), isFullScreen: true }, getResource('Your progress will be saved.')));
|
|
1837
1850
|
};
|
|
1838
1851
|
|
|
1839
|
-
const TaskIcon = ({ taskIndex, taskStatus
|
|
1852
|
+
const TaskIcon = ({ taskIndex, taskStatus }) => {
|
|
1840
1853
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1854
|
+
const success = taskStatus === QuickStartTaskStatus.SUCCESS;
|
|
1855
|
+
const failed = taskStatus === QuickStartTaskStatus.FAILED;
|
|
1856
|
+
const classNames = css('pfext-icon-and-text__icon', {
|
|
1857
|
+
'pfext-quick-start-task-header__task-icon-init': !failed && !success,
|
|
1858
|
+
});
|
|
1859
|
+
let content;
|
|
1860
|
+
if (success) {
|
|
1861
|
+
content = (React.createElement(CheckCircleIcon, { size: "md", className: "pfext-quick-start-task-header__task-icon-success" }));
|
|
1862
|
+
}
|
|
1863
|
+
else if (failed) {
|
|
1864
|
+
content = (React.createElement(ExclamationCircleIcon, { size: "md", className: "pfext-quick-start-task-header__task-icon-failed" }));
|
|
1865
|
+
}
|
|
1866
|
+
else {
|
|
1867
|
+
content = getResource('{{taskIndex, number}}', taskIndex).replace('{{taskIndex, number}}', taskIndex);
|
|
1850
1868
|
}
|
|
1869
|
+
return React.createElement("span", { className: classNames }, content);
|
|
1851
1870
|
};
|
|
1852
1871
|
const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, isActiveTask, onTaskSelect, }) => {
|
|
1853
1872
|
const classNames = css('pfext-quick-start-task-header__title', {
|
|
1854
1873
|
'pfext-quick-start-task-header__title-success': taskStatus === QuickStartTaskStatus.SUCCESS,
|
|
1855
|
-
'pfext-quick-start-task-header__title-failed': taskStatus === QuickStartTaskStatus.FAILED,
|
|
1874
|
+
'pfext-quick-start-task-header__title-failed': taskStatus === (QuickStartTaskStatus.FAILED || QuickStartTaskStatus.VISITED),
|
|
1856
1875
|
});
|
|
1857
|
-
const
|
|
1876
|
+
const notCompleted = taskStatus === QuickStartTaskStatus.VISITED;
|
|
1877
|
+
const skippedReviewOrFailed = taskStatus === QuickStartTaskStatus.REVIEW || taskStatus === QuickStartTaskStatus.FAILED;
|
|
1878
|
+
const tryAgain = !isActiveTask && (skippedReviewOrFailed || notCompleted) && (React.createElement(React.Fragment, null,
|
|
1879
|
+
React.createElement("div", null),
|
|
1880
|
+
React.createElement("div", { className: "pfext-quick-start-task-header__tryagain" }, "Try the steps again.")));
|
|
1881
|
+
const content = (React.createElement("div", { className: "pfext-quick-start-task-header" },
|
|
1882
|
+
React.createElement(TaskIcon, { taskIndex: taskIndex, taskStatus: taskStatus }),
|
|
1858
1883
|
React.createElement(Title, { headingLevel: "h3", size: size, className: classNames },
|
|
1859
|
-
React.createElement(TaskIcon, { taskIndex: taskIndex, taskStatus: taskStatus }),
|
|
1860
1884
|
React.createElement("span", { dangerouslySetInnerHTML: { __html: removeParagraphWrap(markdownConvert(title)) } }),
|
|
1861
|
-
isActiveTask && subtitle && (React.createElement(
|
|
1885
|
+
isActiveTask && subtitle && (React.createElement("span", { className: "pfext-quick-start-task-header__subtitle", "data-test-id": "quick-start-task-subtitle" },
|
|
1862
1886
|
' ',
|
|
1863
|
-
|
|
1864
|
-
|
|
1887
|
+
subtitle))),
|
|
1888
|
+
tryAgain));
|
|
1889
|
+
return (React.createElement(WizardNavItem, { content: content, step: taskIndex, onNavItemClick: () => onTaskSelect(taskIndex - 1), navItemComponent: "button", isCurrent: isActiveTask }));
|
|
1865
1890
|
};
|
|
1866
1891
|
|
|
1867
1892
|
const QuickStartTaskHeaderList = ({ tasks, allTaskStatuses, onTaskSelect, }) => {
|
|
1868
1893
|
return tasks.length > 0 ? (React.createElement(List, { className: "pfext-quick-start-task-header__list" }, tasks.map((task, index) => (React.createElement(QuickStartTaskHeader, { key: task.title, title: task.title, taskIndex: index + 1, size: "md", taskStatus: allTaskStatuses[index], onTaskSelect: onTaskSelect }))))) : null;
|
|
1869
1894
|
};
|
|
1870
1895
|
|
|
1871
|
-
const QuickStartConclusion = ({ tasks, conclusion, allTaskStatuses,
|
|
1872
|
-
var _a;
|
|
1896
|
+
const QuickStartConclusion = ({ tasks, conclusion, allTaskStatuses, nextQuickStarts, onQuickStartChange, onTaskSelect, }) => {
|
|
1873
1897
|
const hasFailedTask = allTaskStatuses.includes(QuickStartTaskStatus.FAILED);
|
|
1874
|
-
const nextQSDisplayName = (_a = nextQuickStart === null || nextQuickStart === void 0 ? void 0 : nextQuickStart.spec) === null || _a === void 0 ? void 0 : _a.displayName;
|
|
1875
1898
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1876
1899
|
return (React.createElement(React.Fragment, null,
|
|
1877
1900
|
React.createElement(QuickStartTaskHeaderList, { tasks: tasks, allTaskStatuses: allTaskStatuses, onTaskSelect: onTaskSelect }),
|
|
1878
1901
|
React.createElement(QuickStartMarkdownView, { content: hasFailedTask
|
|
1879
1902
|
? getResource('One or more verifications did not pass during this quick start. Revisit the tasks or the help links, and then try again.')
|
|
1880
1903
|
: conclusion }),
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1904
|
+
!hasFailedTask &&
|
|
1905
|
+
nextQuickStarts &&
|
|
1906
|
+
nextQuickStarts.length > 0 &&
|
|
1907
|
+
nextQuickStarts.map((nextQuickStart, index) => {
|
|
1908
|
+
var _a;
|
|
1909
|
+
return (React.createElement(Button, { variant: "link", onClick: () => onQuickStartChange(nextQuickStart.metadata.name), isInline: true, isBlock: true, key: index },
|
|
1910
|
+
getResource('Start {{nextQSDisplayName}} quick start').replace('{{nextQSDisplayName}}', (_a = nextQuickStart === null || nextQuickStart === void 0 ? void 0 : nextQuickStart.spec) === null || _a === void 0 ? void 0 : _a.displayName),
|
|
1911
|
+
' ',
|
|
1912
|
+
React.createElement(ArrowRightIcon, { style: { marginLeft: 'var(--pf-global--spacer--xs)', verticalAlign: 'middle' } })));
|
|
1913
|
+
})));
|
|
1885
1914
|
};
|
|
1886
1915
|
|
|
1887
|
-
const QuickStartIntroduction = ({ tasks, introduction, allTaskStatuses, onTaskSelect, }) => {
|
|
1916
|
+
const QuickStartIntroduction = ({ tasks, introduction, allTaskStatuses, prerequisites, onTaskSelect, }) => {
|
|
1888
1917
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1918
|
+
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
1919
|
+
const [isPrereqsExpanded, setIsPrereqsExpanded] = React.useState(false);
|
|
1920
|
+
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" },
|
|
1921
|
+
React.createElement(List, { className: "pfext-quick-start-intro__prereq-list" }, prereqs.map((pr) => {
|
|
1922
|
+
return (React.createElement(ListItem, { key: pr, className: "pfext-quick-start-intro__prereq-list__item" },
|
|
1923
|
+
React.createElement("span", { className: "pfext-quick-start-intro__prereq-list__item-content" }, pr)));
|
|
1924
|
+
}))));
|
|
1889
1925
|
return (React.createElement(React.Fragment, null,
|
|
1890
1926
|
React.createElement(QuickStartMarkdownView, { content: introduction }),
|
|
1927
|
+
prereqList,
|
|
1891
1928
|
React.createElement("p", { style: { marginBottom: 'var(--pf-global--spacer--md)' } },
|
|
1892
1929
|
getResource('In this quick start, you will complete {{count, number}} task', tasks.length).replace('{{count, number}}', tasks.length),
|
|
1893
1930
|
":"),
|
|
@@ -1912,7 +1949,7 @@ const QuickStartTaskReview = ({ review, taskStatus, onTaskReview, }) => {
|
|
|
1912
1949
|
'pfext-quick-start-task-review--failed': taskStatus === QuickStartTaskStatus.FAILED,
|
|
1913
1950
|
});
|
|
1914
1951
|
const title = React.createElement("span", { className: alertClassNames }, getResource('Check your work'));
|
|
1915
|
-
return (React.createElement(Alert, { variant: getAlertVariant(taskStatus), title: title, isInline: true },
|
|
1952
|
+
return (React.createElement(Alert, { className: "pfext-quick-start-task-review-alert", variant: getAlertVariant(taskStatus), title: title, isInline: true },
|
|
1916
1953
|
React.createElement(QuickStartMarkdownView, { content: instructions }),
|
|
1917
1954
|
React.createElement("span", { className: "pfext-quick-start-task-review__actions" },
|
|
1918
1955
|
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) }),
|
|
@@ -1921,31 +1958,32 @@ const QuickStartTaskReview = ({ review, taskStatus, onTaskReview, }) => {
|
|
|
1921
1958
|
};
|
|
1922
1959
|
|
|
1923
1960
|
const QuickStartTasks = ({ tasks, taskNumber, allTaskStatuses, onTaskReview, onTaskSelect, }) => {
|
|
1924
|
-
const { getResource } = React.useContext(QuickStartContext);
|
|
1961
|
+
const { getResource, alwaysShowTaskReview } = React.useContext(QuickStartContext);
|
|
1925
1962
|
return (React.createElement("div", { className: "pfext-quick-start-tasks__list" }, tasks
|
|
1926
1963
|
.filter((_, index) => allTaskStatuses[index] !== QuickStartTaskStatus.INIT)
|
|
1927
1964
|
.map((task, index) => {
|
|
1928
1965
|
const { title, description, review } = task;
|
|
1929
1966
|
const isActiveTask = index === taskNumber;
|
|
1930
1967
|
const taskStatus = allTaskStatuses[index];
|
|
1968
|
+
const shouldShowTaskReview = (!QUICKSTART_TASKS_INITIAL_STATES.includes(taskStatus) || alwaysShowTaskReview) &&
|
|
1969
|
+
review;
|
|
1931
1970
|
return (React.createElement(React.Fragment, { key: title },
|
|
1932
1971
|
React.createElement(QuickStartTaskHeader, { taskIndex: index + 1, title: title, size: "md", subtitle: getResource('{{index, number}} of {{tasks, number}}')
|
|
1933
1972
|
.replace('{{index, number}}', index + 1)
|
|
1934
1973
|
.replace('{{tasks, number}}', tasks.length), taskStatus: taskStatus, isActiveTask: isActiveTask, onTaskSelect: onTaskSelect }),
|
|
1935
|
-
isActiveTask && (React.createElement("div", {
|
|
1974
|
+
isActiveTask && (React.createElement("div", { className: "pfext-quick-start-task__content" },
|
|
1936
1975
|
React.createElement(QuickStartMarkdownView, { content: description }),
|
|
1937
|
-
|
|
1976
|
+
shouldShowTaskReview && (React.createElement(QuickStartTaskReview, { review: review, taskStatus: taskStatus, onTaskReview: onTaskReview }))))));
|
|
1938
1977
|
})));
|
|
1939
1978
|
};
|
|
1940
1979
|
|
|
1941
1980
|
const QuickStartContent = React.forwardRef(({ quickStart, nextQuickStarts = [], taskNumber, allTaskStatuses, onTaskSelect, onTaskReview, onQuickStartChange, }, ref) => {
|
|
1942
|
-
const { spec: { introduction, tasks, conclusion }, } = quickStart;
|
|
1981
|
+
const { spec: { introduction, tasks, conclusion, prerequisites }, } = quickStart;
|
|
1943
1982
|
const totalTasks = tasks.length;
|
|
1944
|
-
const nextQS = nextQuickStarts.length > 0 && nextQuickStarts[0];
|
|
1945
1983
|
return (React.createElement("div", { className: "pfext-quick-start-content", ref: ref },
|
|
1946
|
-
taskNumber === -1 && (React.createElement(QuickStartIntroduction, { tasks: tasks, allTaskStatuses: allTaskStatuses, introduction: introduction, onTaskSelect: onTaskSelect })),
|
|
1984
|
+
taskNumber === -1 && (React.createElement(QuickStartIntroduction, { tasks: tasks, allTaskStatuses: allTaskStatuses, introduction: introduction, prerequisites: prerequisites, onTaskSelect: onTaskSelect })),
|
|
1947
1985
|
taskNumber > -1 && taskNumber < totalTasks && (React.createElement(QuickStartTasks, { tasks: tasks, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskReview: onTaskReview, onTaskSelect: onTaskSelect })),
|
|
1948
|
-
taskNumber === totalTasks && (React.createElement(QuickStartConclusion, { tasks: tasks, conclusion: conclusion, allTaskStatuses: allTaskStatuses,
|
|
1986
|
+
taskNumber === totalTasks && (React.createElement(QuickStartConclusion, { tasks: tasks, conclusion: conclusion, allTaskStatuses: allTaskStatuses, nextQuickStarts: nextQuickStarts, onQuickStartChange: onQuickStartChange, onTaskSelect: onTaskSelect }))));
|
|
1949
1987
|
});
|
|
1950
1988
|
|
|
1951
1989
|
const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack, footerClass, quickStartId, }) => {
|
|
@@ -1983,8 +2021,7 @@ const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack, foot
|
|
|
1983
2021
|
}, [taskNumber, totalTasks, PrimaryButtonText, status]);
|
|
1984
2022
|
const getPrimaryButton = React.useMemo(() => (React.createElement(Button, { variant: "primary", className: "pfext-quick-start-footer__actionbtn", onClick: onNext, "data-testid": `qs-drawer-${camelize(getPrimaryButtonText)}`, "data-test": `${getPrimaryButtonText} button` }, getPrimaryButtonText)), [getPrimaryButtonText, onNext]);
|
|
1985
2023
|
const getSecondaryButton = React.useMemo(() => taskNumber === -1 && status !== QuickStartStatus.NOT_STARTED ? (React.createElement(Button, { variant: "secondary", onClick: onRestart, "data-testid": "qs-drawer-restart" }, SecondaryButtonText.RESTART)) : (taskNumber > -1 && (React.createElement(Button, { variant: "secondary", onClick: onBack, "data-testid": "qs-drawer-back" }, SecondaryButtonText.BACK))), [onRestart, onBack, SecondaryButtonText, status, taskNumber]);
|
|
1986
|
-
const getSideNoteAction = React.useMemo(() =>
|
|
1987
|
-
taskNumber === totalTasks && (React.createElement(Button, { variant: "link", className: "pfext-quick-start-footer__restartbtn", onClick: onRestart, "data-testid": "qs-drawer-side-note-action" }, SecondaryButtonText.RESTART)), [status, SecondaryButtonText, onRestart, taskNumber, totalTasks]);
|
|
2024
|
+
const getSideNoteAction = React.useMemo(() => taskNumber !== -1 && (React.createElement(Button, { variant: "link", className: "pfext-quick-start-footer__restartbtn", onClick: onRestart, "data-testid": "qs-drawer-side-note-action" }, SecondaryButtonText.RESTART)), [taskNumber, onRestart, SecondaryButtonText.RESTART]);
|
|
1988
2025
|
return (React.createElement("div", { className: `pfext-quick-start-footer ${footerClass}` },
|
|
1989
2026
|
getPrimaryButton,
|
|
1990
2027
|
getSecondaryButton,
|
|
@@ -2038,17 +2075,26 @@ const getElement = (appendTo) => {
|
|
|
2038
2075
|
}
|
|
2039
2076
|
return appendTo;
|
|
2040
2077
|
};
|
|
2078
|
+
const useScrollTopOnTaskNumberChange = (node, taskNumber) => {
|
|
2079
|
+
React.useEffect(() => {
|
|
2080
|
+
if (node) {
|
|
2081
|
+
node.scrollTo({ top: 0, behavior: 'smooth' });
|
|
2082
|
+
}
|
|
2083
|
+
}, [taskNumber, node]);
|
|
2084
|
+
};
|
|
2041
2085
|
const QuickStartPanelContent = (_a) => {
|
|
2042
|
-
var { quickStarts = [], handleClose, activeQuickStartID, appendTo, isResizable = true, showClose = true } = _a, props = __rest(_a, ["quickStarts", "handleClose", "activeQuickStartID", "appendTo", "isResizable", "showClose"]);
|
|
2086
|
+
var { quickStarts = [], handleClose, activeQuickStartID, appendTo, isResizable = true, showClose = true, headerVariant = '' } = _a, props = __rest(_a, ["quickStarts", "handleClose", "activeQuickStartID", "appendTo", "isResizable", "showClose", "headerVariant"]);
|
|
2043
2087
|
const { getResource } = React.useContext(QuickStartContext);
|
|
2044
2088
|
const [contentRef, setContentRef] = React.useState();
|
|
2045
2089
|
const shadows = useScrollShadows(contentRef);
|
|
2046
2090
|
const quickStart = quickStarts.find((qs) => qs.metadata.name === activeQuickStartID);
|
|
2047
2091
|
const { activeQuickStartState } = React.useContext(QuickStartContext);
|
|
2048
2092
|
const taskNumber = activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.taskNumber;
|
|
2093
|
+
useScrollTopOnTaskNumberChange(contentRef, taskNumber);
|
|
2049
2094
|
const nextQuickStarts = quickStarts.filter((qs) => { var _a; return (_a = quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.nextQuickStart) === null || _a === void 0 ? void 0 : _a.includes(qs.metadata.name); });
|
|
2050
2095
|
const headerClasses = css('pfext-quick-start-panel-content__header', {
|
|
2051
2096
|
'pfext-quick-start-panel-content__header__shadow': shadows === Shadows.top || shadows === Shadows.both,
|
|
2097
|
+
'pfext-quick-start-panel-content__header--blue-white': headerVariant === 'blue-white',
|
|
2052
2098
|
});
|
|
2053
2099
|
const footerClass = css({
|
|
2054
2100
|
'pfext-quick-start-panel-content__footer__shadow': shadows === Shadows.bottom || shadows === Shadows.both,
|
|
@@ -2063,16 +2109,16 @@ const QuickStartPanelContent = (_a) => {
|
|
|
2063
2109
|
}
|
|
2064
2110
|
return Number.parseInt(taskNumber, 10) + 1;
|
|
2065
2111
|
};
|
|
2066
|
-
const content = quickStart ? (React.createElement(DrawerPanelContent, Object.assign({ isResizable: isResizable, className: "pfext-quick-
|
|
2112
|
+
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),
|
|
2067
2113
|
React.createElement("div", { className: headerClasses },
|
|
2068
2114
|
React.createElement(DrawerHead, null,
|
|
2069
2115
|
React.createElement("div", { className: "pfext-quick-start-panel-content__title" },
|
|
2070
|
-
React.createElement(Title, { headingLevel: "h1", size: "xl", style: { marginRight: 'var(--pf-global--spacer--md)' } }, quickStart === null || quickStart === void 0 ? void 0 :
|
|
2116
|
+
React.createElement(Title, { headingLevel: "h1", size: "xl", className: "pfext-quick-start-panel-content__name", style: { marginRight: 'var(--pf-global--spacer--md)' } }, quickStart === null || quickStart === void 0 ? void 0 :
|
|
2071
2117
|
quickStart.spec.displayName,
|
|
2072
2118
|
' ',
|
|
2073
|
-
React.createElement("small", { className: "pfext-quick-start-panel-content__duration
|
|
2119
|
+
React.createElement("small", { className: "pfext-quick-start-panel-content__duration" }, getResource('Quick start • {{duration, number}} minutes', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes).replace('{{duration, number}}', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)))),
|
|
2074
2120
|
showClose && (React.createElement(DrawerActions, null,
|
|
2075
|
-
React.createElement(DrawerCloseButton, { onClick: handleClose, "data-testid": "qs-drawer-close" }))))),
|
|
2121
|
+
React.createElement(DrawerCloseButton, { onClick: handleClose, className: "pfext-quick-start-panel-content__close-button", "data-testid": "qs-drawer-close" }))))),
|
|
2076
2122
|
React.createElement(DrawerPanelBody, { hasNoPadding: true, className: "pfext-quick-start-panel-content__body", "data-test": "content" },
|
|
2077
2123
|
React.createElement(QuickStartController, { quickStart: quickStart, nextQuickStarts: nextQuickStarts, footerClass: footerClass, contentRef: setContentRef })))) : null;
|
|
2078
2124
|
if (appendTo) {
|
|
@@ -2082,15 +2128,17 @@ const QuickStartPanelContent = (_a) => {
|
|
|
2082
2128
|
};
|
|
2083
2129
|
|
|
2084
2130
|
const QuickStartContainer = (_a) => {
|
|
2085
|
-
var { quickStarts, children, activeQuickStartID, allQuickStartStates, setActiveQuickStartID, setAllQuickStartStates, appendTo, fullWidth, onCloseInProgress, onCloseNotInProgress, resourceBundle, showCardFooters, language, loading = false, useQueryParams = true, markdown, contextProps } = _a, props = __rest(_a, ["quickStarts", "children", "activeQuickStartID", "allQuickStartStates", "setActiveQuickStartID", "setAllQuickStartStates", "appendTo", "fullWidth", "onCloseInProgress", "onCloseNotInProgress", "resourceBundle", "showCardFooters", "language", "loading", "useQueryParams", "markdown", "contextProps"]);
|
|
2131
|
+
var { quickStarts, children, activeQuickStartID, allQuickStartStates, setActiveQuickStartID, setAllQuickStartStates, appendTo, fullWidth, onCloseInProgress, onCloseNotInProgress, resourceBundle, showCardFooters, useLegacyHeaderColors, language, loading = false, useQueryParams = true, markdown, contextProps, alwaysShowTaskReview = false } = _a, props = __rest(_a, ["quickStarts", "children", "activeQuickStartID", "allQuickStartStates", "setActiveQuickStartID", "setAllQuickStartStates", "appendTo", "fullWidth", "onCloseInProgress", "onCloseNotInProgress", "resourceBundle", "showCardFooters", "useLegacyHeaderColors", "language", "loading", "useQueryParams", "markdown", "contextProps", "alwaysShowTaskReview"]);
|
|
2086
2132
|
const valuesForQuickstartContext = useValuesForQuickStartContext(Object.assign({ allQuickStarts: quickStarts, activeQuickStartID,
|
|
2087
2133
|
setActiveQuickStartID,
|
|
2088
2134
|
allQuickStartStates,
|
|
2089
2135
|
setAllQuickStartStates, footer: {
|
|
2090
2136
|
show: showCardFooters,
|
|
2091
|
-
},
|
|
2137
|
+
}, useLegacyHeaderColors,
|
|
2138
|
+
language, resourceBundle: Object.assign({}, resourceBundle), loading,
|
|
2092
2139
|
useQueryParams,
|
|
2093
|
-
markdown
|
|
2140
|
+
markdown,
|
|
2141
|
+
alwaysShowTaskReview }, contextProps));
|
|
2094
2142
|
React.useEffect(() => {
|
|
2095
2143
|
if (quickStarts &&
|
|
2096
2144
|
JSON.stringify(quickStarts) !== JSON.stringify(valuesForQuickstartContext.allQuickStarts)) {
|
|
@@ -2111,7 +2159,7 @@ const QuickStartContainer = (_a) => {
|
|
|
2111
2159
|
};
|
|
2112
2160
|
const QuickStartDrawer = (_a) => {
|
|
2113
2161
|
var { quickStarts = [], children, appendTo, fullWidth, onCloseInProgress, onCloseNotInProgress } = _a, props = __rest(_a, ["quickStarts", "children", "appendTo", "fullWidth", "onCloseInProgress", "onCloseNotInProgress"]);
|
|
2114
|
-
const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], activeQuickStartState, allQuickStartStates, setAllQuickStartStates, } = React.useContext(QuickStartContext);
|
|
2162
|
+
const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], activeQuickStartState, allQuickStartStates, setAllQuickStartStates, useLegacyHeaderColors, } = React.useContext(QuickStartContext);
|
|
2115
2163
|
const combinedQuickStarts = allQuickStarts.concat(quickStarts);
|
|
2116
2164
|
React.useEffect(() => {
|
|
2117
2165
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -2170,7 +2218,7 @@ const QuickStartDrawer = (_a) => {
|
|
|
2170
2218
|
},
|
|
2171
2219
|
}
|
|
2172
2220
|
: {};
|
|
2173
|
-
const panelContent = (React.createElement(QuickStartPanelContent, Object.assign({ quickStarts: combinedQuickStarts, handleClose: handleClose, activeQuickStartID: activeQuickStartID, appendTo: appendTo, isResizable: !fullWidth }, fullWidthPanelStyle)));
|
|
2221
|
+
const panelContent = (React.createElement(QuickStartPanelContent, Object.assign({ quickStarts: combinedQuickStarts, handleClose: handleClose, activeQuickStartID: activeQuickStartID, appendTo: appendTo, isResizable: !fullWidth, headerVariant: useLegacyHeaderColors ? '' : 'blue-white' }, fullWidthPanelStyle)));
|
|
2174
2222
|
return (React.createElement(React.Fragment, null,
|
|
2175
2223
|
React.createElement(Drawer, Object.assign({ isExpanded: !!activeQuickStartID, isInline: true }, props), children ? (React.createElement(DrawerContent, Object.assign({ panelContent: panelContent }, fullWidthBodyStyle),
|
|
2176
2224
|
React.createElement(DrawerContentBody, { className: "pfext-quick-start-drawer__body" }, children))) : (React.createElement("div", { className: "pf-c-drawer__main" }, panelContent))),
|