@patternfly/quickstarts 6.0.0-alpha.2 → 6.0.0-alpha.4
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/dist/ConsoleInternal/components/markdown-view.d.ts +0 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/accordion-extension.d.ts +0 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/admonition-extension.d.ts +0 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/code-extension.d.ts +0 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.d.ts +0 -1
- package/dist/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.d.ts +0 -1
- package/dist/ConsoleShared/src/components/modal/Modal.d.ts +1 -2
- package/dist/ConsoleShared/src/components/spotlight/InteractiveSpotlight.d.ts +0 -1
- package/dist/ConsoleShared/src/components/spotlight/StaticSpotlight.d.ts +0 -1
- package/dist/HelpTopicDrawer.d.ts +0 -1
- package/dist/HelpTopicPanelContent.d.ts +0 -1
- package/dist/QuickStartDrawer.d.ts +0 -1
- package/dist/QuickStartPanelContent.d.ts +2 -2
- package/dist/catalog/QuickStartCatalog.d.ts +0 -1
- package/dist/catalog/QuickStartTile.d.ts +16 -2
- package/dist/catalog/QuickStartTileDescription.d.ts +0 -1
- package/dist/catalog/QuickStartTileFooter.d.ts +1 -0
- package/dist/catalog/QuickStartTileHeader.d.ts +1 -17
- package/dist/catalog/Toolbar/QuickStartCatalogFilter.d.ts +0 -1
- package/dist/catalog/index.d.ts +1 -1
- package/dist/controller/QuickStartContent.d.ts +1 -1
- package/dist/controller/QuickStartFooter.d.ts +1 -1
- package/dist/controller/QuickStartIntroduction.d.ts +0 -1
- package/dist/controller/QuickStartTaskHeaderList.d.ts +0 -1
- package/dist/controller/QuickStartTaskReview.d.ts +0 -1
- package/dist/controller/QuickStartTasks.d.ts +0 -1
- package/dist/index.es.js +188 -291
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +189 -292
- package/dist/index.js.map +1 -1
- package/dist/patternfly-docs/quick-starts/examples/HelpTopic.jsx +4 -4
- package/dist/patternfly-docs/quick-starts/examples/example-data/example-help-topics.js +9 -18
- package/dist/patternfly-global.css +7 -53
- package/dist/patternfly-nested.css +1749 -1778
- package/dist/quickstarts-base.css +40 -420
- package/dist/quickstarts-full.es.js +1181 -1238
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts-standalone.css +41 -382
- package/dist/quickstarts-standalone.min.css +3 -3
- package/dist/quickstarts-vendor.css +6 -11
- package/dist/quickstarts.css +46 -431
- package/dist/quickstarts.min.css +1 -1
- package/dist/utils/quick-start-types.d.ts +1 -1
- package/package.json +10 -11
- package/src/ConsoleInternal/components/markdown-view.tsx +29 -9
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-extension.tsx +10 -17
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +5 -11
- package/src/ConsoleShared/src/components/markdown-extensions/code-extension.tsx +2 -2
- package/src/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.tsx +0 -1
- package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +2 -6
- package/src/ConsoleShared/src/components/markdown-extensions/utils.ts +2 -1
- package/src/ConsoleShared/src/components/modal/Modal.tsx +1 -2
- package/src/ConsoleShared/src/components/popper/SimplePopper.tsx +5 -2
- package/src/ConsoleShared/src/components/spotlight/InteractiveSpotlight.tsx +0 -1
- package/src/ConsoleShared/src/components/spotlight/StaticSpotlight.tsx +0 -1
- package/src/ConsoleShared/src/components/status/icons.tsx +1 -5
- package/src/HelpTopicDrawer.tsx +1 -4
- package/src/HelpTopicPanelContent.tsx +4 -16
- package/src/QuickStartCatalogPage.tsx +34 -25
- package/src/QuickStartCloseModal.tsx +2 -2
- package/src/QuickStartController.tsx +1 -1
- package/src/QuickStartDrawer.tsx +2 -7
- package/src/QuickStartPanelContent.scss +7 -39
- package/src/QuickStartPanelContent.tsx +20 -44
- package/src/catalog/Catalog/QuickStartCatalogHeader.tsx +5 -4
- package/src/catalog/Catalog/QuickStartCatalogSection.tsx +1 -1
- package/src/catalog/Catalog/QuickStartCatalogToolbar.tsx +1 -3
- package/src/catalog/QuickStartCatalog.tsx +12 -16
- package/src/catalog/QuickStartTile.scss +11 -9
- package/src/catalog/QuickStartTile.tsx +133 -72
- package/src/catalog/QuickStartTileDescription.tsx +28 -42
- package/src/catalog/QuickStartTileFooter.tsx +13 -19
- package/src/catalog/QuickStartTileHeader.tsx +9 -86
- package/src/catalog/Toolbar/QuickStartCatalogFilter.tsx +8 -10
- package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +2 -5
- package/src/catalog/__tests__/QuickStartCatalog.spec.tsx +3 -3
- package/src/catalog/__tests__/QuickStartTile.spec.tsx +5 -5
- package/src/catalog/__tests__/QuickStartTileDescription.spec.tsx +1 -1
- package/src/catalog/index.ts +1 -1
- package/src/controller/QuickStartConclusion.tsx +4 -4
- package/src/controller/QuickStartContent.scss +3 -7
- package/src/controller/QuickStartContent.tsx +3 -5
- package/src/controller/QuickStartFooter.scss +1 -11
- package/src/controller/QuickStartFooter.tsx +27 -21
- package/src/controller/QuickStartIntroduction.tsx +11 -16
- package/src/controller/QuickStartTaskHeader.scss +20 -42
- package/src/controller/QuickStartTaskHeader.tsx +21 -60
- package/src/controller/QuickStartTaskHeaderList.tsx +4 -6
- package/src/controller/QuickStartTaskReview.tsx +6 -12
- package/src/controller/QuickStartTasks.tsx +6 -8
- package/src/controller/__tests__/QuickStartConclusion.spec.tsx +6 -19
- package/src/controller/__tests__/QuickStartFooter.spec.tsx +9 -54
- package/src/controller/__tests__/QuickStartTaskHeader.spec.tsx +1 -1
- package/src/controller/__tests__/QuickStartTaskReview.spec.tsx +3 -6
- package/src/controller/__tests__/QuickStartTasks.spec.tsx +3 -6
- package/src/styles/_base.scss +3 -45
- package/src/styles/style.scss +1 -6
- package/src/utils/help-topic-context.tsx +2 -3
- package/src/utils/quick-start-context.tsx +10 -13
- package/src/utils/quick-start-types.ts +1 -1
- package/src/utils/quick-start-utils.ts +4 -2
- package/src/ConsoleInternal/components/_icon-and-text.scss +0 -14
- package/src/ConsoleInternal/components/_markdown-view.scss +0 -19
- package/src/ConsoleInternal/components/catalog/_catalog.scss +0 -392
- package/src/ConsoleInternal/components/utils/_status-box.scss +0 -58
- package/src/ConsoleShared/src/components/layout/PageLayout.scss +0 -29
- package/src/ConsoleShared/src/components/markdown-extensions/showdown-extension.scss +0 -52
- package/src/ConsoleShared/src/components/modal/Modal.scss +0 -3
- package/src/ConsoleShared/src/components/spotlight/spotlight.scss +0 -63
- package/src/QuickStartDrawer.scss +0 -11
- package/src/catalog/QuickStartCatalog.scss +0 -8
- package/src/catalog/QuickStartTileDescription.scss +0 -29
- package/src/catalog/QuickStartTileHeader.scss +0 -16
- package/src/catalog/Toolbar/QuickStartCatalogFilter.scss +0 -25
- package/src/controller/QuickStartIntroduction.scss +0 -35
- package/src/controller/QuickStartTaskHeaderList.scss +0 -17
- package/src/controller/QuickStartTaskReview.scss +0 -30
- package/src/controller/QuickStartTasks.scss +0 -90
- package/src/styles/_dark-custom-override.scss +0 -47
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ var React = require('react');
|
|
|
6
6
|
var reactCore = require('@patternfly/react-core');
|
|
7
7
|
var SearchIcon = require('@patternfly/react-icons/dist/js/icons/search-icon');
|
|
8
8
|
var reactStyles = require('@patternfly/react-styles');
|
|
9
|
-
var tslib = require('tslib');
|
|
10
|
-
require('@patternfly/react-styles/css/components/Form/form');
|
|
11
9
|
var RocketIcon = require('@patternfly/react-icons/dist/js/icons/rocket-icon');
|
|
10
|
+
var tslib = require('tslib');
|
|
11
|
+
var deprecated = require('@patternfly/react-core/deprecated');
|
|
12
12
|
var ReactDOM = require('react-dom');
|
|
13
13
|
var server = require('react-dom/server');
|
|
14
14
|
var CopyIcon = require('@patternfly/react-icons/dist/js/icons/copy-icon');
|
|
@@ -20,8 +20,8 @@ var CheckCircleIcon = require('@patternfly/react-icons/dist/js/icons/check-circl
|
|
|
20
20
|
require('@patternfly/react-icons/dist/js/icons/exclamation-circle-icon');
|
|
21
21
|
var InfoCircleIcon = require('@patternfly/react-icons/dist/js/icons/info-circle-icon');
|
|
22
22
|
var ExternalLinkAltIcon = require('@patternfly/react-icons/dist/js/icons/external-link-alt-icon');
|
|
23
|
-
var OutlinedClockIcon = require('@patternfly/react-icons/dist/js/icons/outlined-clock-icon');
|
|
24
23
|
var OutlinedBookmarkIcon = require('@patternfly/react-icons/dist/js/icons/outlined-bookmark-icon');
|
|
24
|
+
var OutlinedClockIcon = require('@patternfly/react-icons/dist/js/icons/outlined-clock-icon');
|
|
25
25
|
var ArrowRightIcon = require('@patternfly/react-icons/dist/js/icons/arrow-right-icon');
|
|
26
26
|
var BarsIcon = require('@patternfly/react-icons/dist/js/icons/bars-icon');
|
|
27
27
|
|
|
@@ -59,8 +59,8 @@ var SyncAltIcon__default = /*#__PURE__*/_interopDefaultLegacy(SyncAltIcon);
|
|
|
59
59
|
var CheckCircleIcon__default = /*#__PURE__*/_interopDefaultLegacy(CheckCircleIcon);
|
|
60
60
|
var InfoCircleIcon__default = /*#__PURE__*/_interopDefaultLegacy(InfoCircleIcon);
|
|
61
61
|
var ExternalLinkAltIcon__default = /*#__PURE__*/_interopDefaultLegacy(ExternalLinkAltIcon);
|
|
62
|
-
var OutlinedClockIcon__default = /*#__PURE__*/_interopDefaultLegacy(OutlinedClockIcon);
|
|
63
62
|
var OutlinedBookmarkIcon__default = /*#__PURE__*/_interopDefaultLegacy(OutlinedBookmarkIcon);
|
|
63
|
+
var OutlinedClockIcon__default = /*#__PURE__*/_interopDefaultLegacy(OutlinedClockIcon);
|
|
64
64
|
var ArrowRightIcon__default = /*#__PURE__*/_interopDefaultLegacy(ArrowRightIcon);
|
|
65
65
|
var BarsIcon__default = /*#__PURE__*/_interopDefaultLegacy(BarsIcon);
|
|
66
66
|
|
|
@@ -796,9 +796,7 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
796
796
|
setAllQuickStartStates((qs) => (Object.assign(Object.assign({}, qs), { [activeQuickStartID]: updatedQuickStart })));
|
|
797
797
|
}, [allQuickStartStates, activeQuickStartID, setAllQuickStartStates]);
|
|
798
798
|
const activeQuickStartState = (_b = allQuickStartStates === null || allQuickStartStates === void 0 ? void 0 : allQuickStartStates[activeQuickStartID]) !== null && _b !== void 0 ? _b : {};
|
|
799
|
-
const getQuickStartForId = React.useCallback((id) => allQuickStartStates[id], [
|
|
800
|
-
allQuickStartStates,
|
|
801
|
-
]);
|
|
799
|
+
const getQuickStartForId = React.useCallback((id) => allQuickStartStates[id], [allQuickStartStates]);
|
|
802
800
|
return {
|
|
803
801
|
allQuickStarts: quickStarts,
|
|
804
802
|
setAllQuickStarts: updateAllQuickStarts,
|
|
@@ -877,69 +875,9 @@ const CamelCaseWrap = ({ value, dataTest }) => {
|
|
|
877
875
|
return rendered;
|
|
878
876
|
};
|
|
879
877
|
|
|
880
|
-
class CatalogTile extends React__namespace.Component {
|
|
881
|
-
constructor(props) {
|
|
882
|
-
super(props);
|
|
883
|
-
this.handleClick = (e) => {
|
|
884
|
-
const { onClick, href } = this.props;
|
|
885
|
-
if (!href) {
|
|
886
|
-
e.preventDefault();
|
|
887
|
-
}
|
|
888
|
-
if (onClick) {
|
|
889
|
-
onClick(e);
|
|
890
|
-
}
|
|
891
|
-
};
|
|
892
|
-
this.renderBadges = (badges) => {
|
|
893
|
-
if (!badges || !badges.length) {
|
|
894
|
-
return null;
|
|
895
|
-
}
|
|
896
|
-
return (React__namespace.createElement("div", { className: "catalog-tile-pf-badge-container" }, badges.map((badge, index) => (React__namespace.createElement("span", { key: `badge-${index}` }, badge)))));
|
|
897
|
-
};
|
|
898
|
-
this.generatedId = reactCore.getUniqueId('pf-catalog-tile');
|
|
899
|
-
}
|
|
900
|
-
render() {
|
|
901
|
-
const _a = this.props, { id, className, featured, onClick, href, icon, iconImg, iconAlt, iconClass, badges, title, vendor, description, footer,
|
|
902
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
903
|
-
ref, children } = _a, props = tslib.__rest(_a, ["id", "className", "featured", "onClick", "href", "icon", "iconImg", "iconAlt", "iconClass", "badges", "title", "vendor", "description", "footer", "ref", "children"]);
|
|
904
|
-
return (React__namespace.createElement(reactCore.Card, Object.assign({ component: href ? 'a' : 'div', id: id || this.generatedId, href: href || '#', className: reactStyles.css('catalog-tile-pf', { featured }, className), variant: featured ? 'secondary' : 'default', isClickable: !!onClick }, props),
|
|
905
|
-
(badges.length > 0 || iconImg || iconClass || icon || onClick) && (React__namespace.createElement(reactCore.CardHeader, { actions: { actions: badges.length > 0 && this.renderBadges(badges), hasNoOffset: true }, selectableActions: onClick && {
|
|
906
|
-
selectableActionId: id + '-input',
|
|
907
|
-
onClickAction: (e) => this.handleClick(e),
|
|
908
|
-
selectableActionAriaLabelledby: id
|
|
909
|
-
} },
|
|
910
|
-
iconImg && React__namespace.createElement("img", { className: "catalog-tile-pf-icon", src: iconImg, alt: iconAlt }),
|
|
911
|
-
!iconImg && (iconClass || icon) && React__namespace.createElement("span", { className: `catalog-tile-pf-icon ${iconClass}` }, icon))),
|
|
912
|
-
React__namespace.createElement(reactCore.CardTitle, { className: "catalog-tile-pf-header" },
|
|
913
|
-
React__namespace.createElement("div", { className: "catalog-tile-pf-title" }, title),
|
|
914
|
-
vendor && React__namespace.createElement("div", { className: "catalog-tile-pf-subtitle" }, vendor)),
|
|
915
|
-
(description || children) && (React__namespace.createElement(reactCore.CardBody, { className: "catalog-tile-pf-body" },
|
|
916
|
-
description && (React__namespace.createElement("div", { className: "catalog-tile-pf-description" },
|
|
917
|
-
React__namespace.createElement("span", { className: reactStyles.css({ 'has-footer': footer }) }, description))),
|
|
918
|
-
children)),
|
|
919
|
-
footer && React__namespace.createElement(reactCore.CardFooter, { className: "catalog-tile-pf-footer" }, footer)));
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
CatalogTile.displayName = 'CatalogTile';
|
|
923
|
-
CatalogTile.defaultProps = {
|
|
924
|
-
id: null,
|
|
925
|
-
className: '',
|
|
926
|
-
featured: false,
|
|
927
|
-
onClick: null,
|
|
928
|
-
href: null,
|
|
929
|
-
iconImg: null,
|
|
930
|
-
iconAlt: '',
|
|
931
|
-
iconClass: '',
|
|
932
|
-
icon: null,
|
|
933
|
-
badges: [],
|
|
934
|
-
vendor: null,
|
|
935
|
-
description: null,
|
|
936
|
-
footer: null,
|
|
937
|
-
children: null
|
|
938
|
-
};
|
|
939
|
-
|
|
940
878
|
const Modal = (_a) => {
|
|
941
879
|
var { isFullScreen = false, className } = _a, props = tslib.__rest(_a, ["isFullScreen", "className"]);
|
|
942
|
-
return (React__namespace.createElement(
|
|
880
|
+
return (React__namespace.createElement(deprecated.Modal, Object.assign({}, props, { className: reactStyles.css('pfext-modal', className), appendTo: () => (isFullScreen ? document.body : document.querySelector('#modal-container')) })));
|
|
943
881
|
};
|
|
944
882
|
|
|
945
883
|
const getContainer = (container) => typeof container === 'function' ? container() : container;
|
|
@@ -1070,44 +1008,6 @@ var Shadows;
|
|
|
1070
1008
|
Shadows["top"] = "top";
|
|
1071
1009
|
Shadows["bottom"] = "bottom";
|
|
1072
1010
|
})(Shadows || (Shadows = {}));
|
|
1073
|
-
const useScrollShadows = (node) => {
|
|
1074
|
-
const [shadows, setShadows] = React__namespace.useState(Shadows.none);
|
|
1075
|
-
const computeShadows = React__namespace.useCallback(() => {
|
|
1076
|
-
if (node) {
|
|
1077
|
-
const { scrollTop, clientHeight, scrollHeight } = node;
|
|
1078
|
-
const top = scrollTop !== 0;
|
|
1079
|
-
const bottom = scrollTop + clientHeight < scrollHeight;
|
|
1080
|
-
if (top && bottom) {
|
|
1081
|
-
setShadows(Shadows.both);
|
|
1082
|
-
}
|
|
1083
|
-
else if (top) {
|
|
1084
|
-
setShadows(Shadows.top);
|
|
1085
|
-
}
|
|
1086
|
-
else if (bottom) {
|
|
1087
|
-
setShadows(Shadows.bottom);
|
|
1088
|
-
}
|
|
1089
|
-
else {
|
|
1090
|
-
setShadows(Shadows.none);
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
}, [node]);
|
|
1094
|
-
// recompute when the scroll container changes in size
|
|
1095
|
-
useResizeObserver(computeShadows, node);
|
|
1096
|
-
React__namespace.useEffect(() => {
|
|
1097
|
-
if (node) {
|
|
1098
|
-
// compute initial shadows
|
|
1099
|
-
computeShadows();
|
|
1100
|
-
// listen for scroll events
|
|
1101
|
-
node.addEventListener('scroll', computeShadows);
|
|
1102
|
-
}
|
|
1103
|
-
return () => {
|
|
1104
|
-
if (node) {
|
|
1105
|
-
node.removeEventListener('scroll', computeShadows);
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
}, [node, computeShadows]);
|
|
1109
|
-
return shadows;
|
|
1110
|
-
};
|
|
1111
1011
|
|
|
1112
1012
|
const useBoundingClientRect = (targetElement) => {
|
|
1113
1013
|
const [clientRect, setClientRect] = React__namespace.useState(() => targetElement ? targetElement.getBoundingClientRect() : null);
|
|
@@ -1280,6 +1180,7 @@ const useInlineCopyClipboardShowdownExtension = () => {
|
|
|
1280
1180
|
}), [getResource]);
|
|
1281
1181
|
};
|
|
1282
1182
|
|
|
1183
|
+
/* eslint-disable max-len */
|
|
1283
1184
|
const useMultilineCopyClipboardShowdownExtension = () => {
|
|
1284
1185
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1285
1186
|
return React__namespace.useMemo(() => ({
|
|
@@ -1300,10 +1201,7 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1300
1201
|
</div>
|
|
1301
1202
|
</div>
|
|
1302
1203
|
<div class="pf-v6-c-code-block__content">
|
|
1303
|
-
<pre class="pf-v6-c-code-block__pre pfext-code-block__pre">
|
|
1304
|
-
<code class="pf-v6-c-code-block__code"
|
|
1305
|
-
${MARKDOWN_SNIPPET_ID}="${groupId}">${group.trim()}</code>
|
|
1306
|
-
</pre>
|
|
1204
|
+
<pre class="pf-v6-c-code-block__pre pfext-code-block__pre"><code class="pf-v6-c-code-block__code"${MARKDOWN_SNIPPET_ID}="${groupId}">${group.trim()}</code></pre>
|
|
1307
1205
|
</div>
|
|
1308
1206
|
</div>`;
|
|
1309
1207
|
},
|
|
@@ -1324,16 +1222,40 @@ const markdownConvert = (markdown, extensions) => {
|
|
|
1324
1222
|
}
|
|
1325
1223
|
DOMPurify.addHook('beforeSanitizeElements', function (node) {
|
|
1326
1224
|
// nodeType 1 = element type
|
|
1225
|
+
var _a;
|
|
1327
1226
|
// transform anchor tags
|
|
1328
1227
|
if (node.nodeType === 1 && node.nodeName.toLowerCase() === 'a') {
|
|
1329
1228
|
node.setAttribute('rel', 'noopener noreferrer');
|
|
1330
1229
|
return node;
|
|
1331
1230
|
}
|
|
1332
|
-
// add PF
|
|
1333
|
-
if (node.nodeType === 1
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1231
|
+
// add PF content classes
|
|
1232
|
+
if (node.nodeType === 1) {
|
|
1233
|
+
const contentElements = [
|
|
1234
|
+
'ul',
|
|
1235
|
+
'ol',
|
|
1236
|
+
'p',
|
|
1237
|
+
'li',
|
|
1238
|
+
'hr',
|
|
1239
|
+
'h1',
|
|
1240
|
+
'h2',
|
|
1241
|
+
'h3',
|
|
1242
|
+
'h4',
|
|
1243
|
+
'h5',
|
|
1244
|
+
'h6',
|
|
1245
|
+
'blockquote',
|
|
1246
|
+
'pre',
|
|
1247
|
+
'dl',
|
|
1248
|
+
'dt',
|
|
1249
|
+
'dd',
|
|
1250
|
+
'table',
|
|
1251
|
+
];
|
|
1252
|
+
if (contentElements.includes(node.nodeName.toLowerCase())) {
|
|
1253
|
+
// don't overwrite elements already being styled by PatternFly
|
|
1254
|
+
if (!((_a = node.getAttribute('class')) === null || _a === void 0 ? void 0 : _a.includes('pf-v6-c-'))) {
|
|
1255
|
+
node.setAttribute('class', `pf-v6-c-content--${node.nodeName.toLowerCase()}`);
|
|
1256
|
+
return node;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1337
1259
|
}
|
|
1338
1260
|
});
|
|
1339
1261
|
// Add a hook to make all links open a new window
|
|
@@ -1401,7 +1323,7 @@ const RenderExtension = ({ renderExtension, selector, markup, docContext, }) =>
|
|
|
1401
1323
|
};
|
|
1402
1324
|
const InlineMarkdownView = ({ markup, isEmpty, renderExtension, className, }) => {
|
|
1403
1325
|
const id = React__namespace.useMemo(() => uniqueId('markdown'), []);
|
|
1404
|
-
return (React__namespace.createElement("div", { className: reactStyles.css(
|
|
1326
|
+
return (React__namespace.createElement("div", { className: reactStyles.css({ 'is-empty': isEmpty }, className), id: id },
|
|
1405
1327
|
React__namespace.createElement("div", { dangerouslySetInnerHTML: { __html: markup } }),
|
|
1406
1328
|
renderExtension && (React__namespace.createElement(RenderExtension, { renderExtension: renderExtension, selector: `#${id}`, markup: markup }))));
|
|
1407
1329
|
};
|
|
@@ -1473,7 +1395,6 @@ const SELECTOR_ID = `[\\w-]+`;
|
|
|
1473
1395
|
// [linkLabel]{{action id}}
|
|
1474
1396
|
const HIGHLIGHT_REGEXP = new RegExp(`\\[(${LINK_LABEL})]{{(${HIGHLIGHT_ACTIONS.join('|')}) (${SELECTOR_ID})}}`, 'g');
|
|
1475
1397
|
|
|
1476
|
-
const removeParagraphWrap = (markdown) => markdown.replace(/^<p>|<\/p>$/g, '');
|
|
1477
1398
|
const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
1478
1399
|
const { markdown } = React__namespace.useContext(QuickStartContext);
|
|
1479
1400
|
const inlineCopyClipboardShowdownExtension = useInlineCopyClipboardShowdownExtension();
|
|
@@ -1525,7 +1446,7 @@ var AdmonitionType;
|
|
|
1525
1446
|
})(AdmonitionType || (AdmonitionType = {}));
|
|
1526
1447
|
const admonitionToAlertVariantMap = {
|
|
1527
1448
|
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
1528
|
-
[AdmonitionType.TIP]: { variant: '
|
|
1449
|
+
[AdmonitionType.TIP]: { variant: 'custom', customIcon: React__namespace.createElement(LightbulbIcon__default['default'], null) },
|
|
1529
1450
|
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
1530
1451
|
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: React__namespace.createElement(FireIcon__default['default'], null) },
|
|
1531
1452
|
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
@@ -1541,9 +1462,8 @@ React__namespace.useMemo(() => ({
|
|
|
1541
1462
|
}
|
|
1542
1463
|
admonitionType = admonitionType.toUpperCase();
|
|
1543
1464
|
const { variant, customIcon } = admonitionToAlertVariantMap[admonitionType];
|
|
1544
|
-
const style = admonitionType === AdmonitionType.CAUTION ? { backgroundColor: '#ec7a0915' } : {};
|
|
1545
1465
|
const mdContent = React__namespace.createElement(QuickStartMarkdownView, { content: content });
|
|
1546
|
-
const pfAlert = (React__namespace.createElement(reactCore.Alert, { variant: variant, customIcon
|
|
1466
|
+
const pfAlert = (React__namespace.createElement(reactCore.Alert, Object.assign({ variant: variant }, (customIcon && { customIcon }), { isInline: true, title: admonitionType, className: "pfext-markdown-admonition" }), mdContent));
|
|
1547
1467
|
return removeTemplateWhitespace(server.renderToStaticMarkup(pfAlert));
|
|
1548
1468
|
},
|
|
1549
1469
|
}), []);
|
|
@@ -1652,42 +1572,39 @@ const StatusIcon = ({ status }) => (React__namespace.createElement(Status, { sta
|
|
|
1652
1572
|
const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
1653
1573
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1654
1574
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
1575
|
+
const buttonRef = React__namespace.useRef(null);
|
|
1655
1576
|
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
1656
|
-
React__namespace.createElement(QuickStartMarkdownView, { content: description
|
|
1657
|
-
(prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (React__namespace.createElement(
|
|
1658
|
-
React__namespace.createElement(
|
|
1577
|
+
React__namespace.createElement(QuickStartMarkdownView, { content: description }),
|
|
1578
|
+
(prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (React__namespace.createElement(reactCore.Flex, { spaceItems: { default: 'spaceItemsSm' } },
|
|
1579
|
+
React__namespace.createElement("h5", null,
|
|
1659
1580
|
getResource('Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length),
|
|
1660
1581
|
' '),
|
|
1661
|
-
React__namespace.createElement(reactCore.
|
|
1662
|
-
|
|
1582
|
+
React__namespace.createElement(reactCore.Button, { variant: "link", isInline: true, "data-testid": "qs-card-prereqs", ref: buttonRef, onClick: (e) => {
|
|
1583
|
+
e.preventDefault();
|
|
1584
|
+
e.stopPropagation();
|
|
1585
|
+
}, "aria-label": getResource('Show prerequisites') },
|
|
1586
|
+
React__namespace.createElement(InfoCircleIcon__default['default'], null)),
|
|
1587
|
+
React__namespace.createElement(reactCore.Popover, { "aria-label": getResource('Prerequisites'), headerContent: getResource('Prerequisites'), triggerRef: buttonRef, bodyContent: React__namespace.createElement("div", null,
|
|
1588
|
+
React__namespace.createElement("ul", { "aria-label": getResource('Prerequisites') }, prereqs.map((prerequisite, index) => (
|
|
1663
1589
|
// eslint-disable-next-line react/no-array-index-key
|
|
1664
|
-
React__namespace.createElement(
|
|
1665
|
-
React__namespace.createElement(QuickStartMarkdownView, { content: prerequisite })))))) }
|
|
1666
|
-
React__namespace.createElement(reactCore.Button, { variant: "link", isInline: true, className: "pfext-quick-start-tile-prerequisites__icon", "data-testid": "qs-card-prereqs", onClick: (e) => {
|
|
1667
|
-
e.preventDefault();
|
|
1668
|
-
e.stopPropagation();
|
|
1669
|
-
}, "aria-label": getResource('Show prerequisites') },
|
|
1670
|
-
React__namespace.createElement(InfoCircleIcon__default['default'], null)))))));
|
|
1590
|
+
React__namespace.createElement("li", { key: index },
|
|
1591
|
+
React__namespace.createElement(QuickStartMarkdownView, { content: prerequisite })))))) })))));
|
|
1671
1592
|
};
|
|
1672
1593
|
|
|
1673
|
-
const QuickStartTileFooter = ({ quickStartId, status, totalTasks, }) => {
|
|
1594
|
+
const QuickStartTileFooter = ({ quickStartId, status, totalTasks, onClickContinue, }) => {
|
|
1674
1595
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1675
1596
|
const { activeQuickStartID, startQuickStart, restartQuickStart } = React__namespace.useContext(QuickStartContext);
|
|
1676
|
-
const start = React__namespace.useCallback((
|
|
1677
|
-
e.preventDefault();
|
|
1678
|
-
e.stopPropagation();
|
|
1597
|
+
const start = React__namespace.useCallback(() => {
|
|
1679
1598
|
startQuickStart(quickStartId, totalTasks);
|
|
1680
1599
|
}, [quickStartId, startQuickStart, totalTasks]);
|
|
1681
|
-
const restart = React__namespace.useCallback((
|
|
1682
|
-
e.preventDefault();
|
|
1683
|
-
e.stopPropagation();
|
|
1600
|
+
const restart = React__namespace.useCallback(() => {
|
|
1684
1601
|
restartQuickStart(quickStartId, totalTasks);
|
|
1685
1602
|
}, [quickStartId, restartQuickStart, totalTasks]);
|
|
1686
1603
|
return (React__namespace.createElement(reactCore.Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
|
|
1687
1604
|
status === exports.QuickStartStatus.NOT_STARTED && (React__namespace.createElement(reactCore.FlexItem, null,
|
|
1688
1605
|
React__namespace.createElement(reactCore.Button, { onClick: start, variant: "link", isInline: true, "data-testid": "qs-card-notStarted-start", id: `${quickStartId}-start`, "aria-labelledby": `${quickStartId}-start ${quickStartId}` }, getResource('Start')))),
|
|
1689
1606
|
status === exports.QuickStartStatus.IN_PROGRESS && activeQuickStartID !== quickStartId && (React__namespace.createElement(reactCore.FlexItem, null,
|
|
1690
|
-
React__namespace.createElement(reactCore.Button, { variant: "link", isInline: true, "data-testid": "qs-card-inProgress-resume", id: `${quickStartId}-continue`, "aria-labelledby": `${quickStartId}-continue ${quickStartId}` }, getResource('Continue')))),
|
|
1607
|
+
React__namespace.createElement(reactCore.Button, { variant: "link", onClick: onClickContinue, isInline: true, "data-testid": "qs-card-inProgress-resume", id: `${quickStartId}-continue`, "aria-labelledby": `${quickStartId}-continue ${quickStartId}` }, getResource('Continue')))),
|
|
1691
1608
|
status === exports.QuickStartStatus.COMPLETE && (React__namespace.createElement(reactCore.FlexItem, null,
|
|
1692
1609
|
React__namespace.createElement(reactCore.Button, { onClick: restart, variant: "link", isInline: true, "data-testid": "qs-card-complete-restart", id: `${quickStartId}-restart`, "aria-labelledby": `${quickStartId}-restart ${quickStartId}` }, getResource('Restart')))),
|
|
1693
1610
|
status === exports.QuickStartStatus.IN_PROGRESS && (React__namespace.createElement(reactCore.FlexItem, null,
|
|
@@ -1701,42 +1618,43 @@ const QuickStartTileFooterExternal = ({ link, quickStartId, }) => {
|
|
|
1701
1618
|
React__namespace.createElement(reactCore.Button, { component: "a", href: href, target: "_blank", rel: "noopener noreferrer", variant: "link", "aria-label": `Open documentation in new window`, isInline: true, icon: React__namespace.createElement(ExternalLinkAltIcon__default['default'], null), iconPosition: "right", id: quickStartId, "aria-labelledby": `${quickStartId}-external ${quickStartId}` }, text || href))));
|
|
1702
1619
|
};
|
|
1703
1620
|
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1621
|
+
const QuickStartTileHeader = ({ name, quickStartId, onSelect, }) => {
|
|
1622
|
+
return (React__namespace.createElement(reactCore.Flex, { flexWrap: { default: 'nowrap' } },
|
|
1623
|
+
React__namespace.createElement(reactCore.Title, { headingLevel: "h3", "data-test": "title", id: quickStartId },
|
|
1624
|
+
React__namespace.createElement(reactCore.Button, { variant: "link", isInline: true, onClick: onSelect },
|
|
1625
|
+
React__namespace.createElement(QuickStartMarkdownView, { content: name })))));
|
|
1708
1626
|
};
|
|
1709
|
-
|
|
1710
|
-
|
|
1627
|
+
|
|
1628
|
+
const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, action, }) => {
|
|
1629
|
+
const { metadata: { name: id }, spec: { icon, tasks, displayName, description, durationMinutes, prerequisites, link, type }, } = quickStart;
|
|
1630
|
+
const { setActiveQuickStart, footer, getResource } = React__namespace.useContext(QuickStartContext);
|
|
1631
|
+
const statusColorMap = {
|
|
1632
|
+
[exports.QuickStartStatus.COMPLETE]: 'green',
|
|
1633
|
+
[exports.QuickStartStatus.IN_PROGRESS]: 'purple',
|
|
1634
|
+
[exports.QuickStartStatus.NOT_STARTED]: 'grey',
|
|
1635
|
+
};
|
|
1711
1636
|
const statusLocaleMap = {
|
|
1712
1637
|
[exports.QuickStartStatus.COMPLETE]: getResource('Complete'),
|
|
1713
1638
|
[exports.QuickStartStatus.IN_PROGRESS]: getResource('In progress'),
|
|
1714
1639
|
[exports.QuickStartStatus.NOT_STARTED]: getResource('Not started'),
|
|
1715
1640
|
};
|
|
1716
|
-
const ActionIcon = (action === null || action === void 0 ? void 0 : action.icon) || OutlinedBookmarkIcon__default['default'];
|
|
1717
|
-
return (React__namespace.createElement("div", { className: "pfext-quick-start-tile-header" },
|
|
1718
|
-
React__namespace.createElement(reactCore.Flex, { flexWrap: { default: 'nowrap' } },
|
|
1719
|
-
React__namespace.createElement(reactCore.Title, { headingLevel: "h3", "data-test": "title", id: quickStartId },
|
|
1720
|
-
React__namespace.createElement(QuickStartMarkdownView, { content: name })),
|
|
1721
|
-
action && (React__namespace.createElement(reactCore.Button, Object.assign({ "aria-label": action['aria-label'], icon: React__namespace.createElement(ActionIcon, null), variant: "plain", onClick: action.onClick }, action.buttonProps)))),
|
|
1722
|
-
React__namespace.createElement("div", { className: "pfext-quick-start-tile-header__status" },
|
|
1723
|
-
type && (React__namespace.createElement(reactCore.Label, { className: "pfext-quick-start-tile-header--margin", color: type.color }, type.text)),
|
|
1724
|
-
duration && (React__namespace.createElement(reactCore.Label, { variant: "outline", "data-test": "duration", icon: React__namespace.createElement(OutlinedClockIcon__default['default'], null), className: "pfext-quick-start-tile-header--margin" }, getResource('{{duration, number}} minutes', duration).replace('{{duration, number}}', duration))),
|
|
1725
|
-
status !== exports.QuickStartStatus.NOT_STARTED && (React__namespace.createElement(reactCore.Label, { variant: "outline", color: statusColorMap[status], icon: React__namespace.createElement(StatusIcon, { status: status }), "data-test": "status" }, statusLocaleMap[status])))));
|
|
1726
|
-
};
|
|
1727
|
-
|
|
1728
|
-
const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, action, }) => {
|
|
1729
|
-
const { metadata: { name: id }, spec: { icon, tasks, displayName, description, durationMinutes, prerequisites, link, type }, } = quickStart;
|
|
1730
|
-
const { setActiveQuickStart, footer } = React__namespace.useContext(QuickStartContext);
|
|
1731
|
-
const ref = React__namespace.useRef(null);
|
|
1732
1641
|
let quickStartIcon;
|
|
1733
1642
|
if (typeof icon === 'object') {
|
|
1734
|
-
quickStartIcon = React__namespace.createElement(reactCore.Icon, { size: "
|
|
1643
|
+
quickStartIcon = React__namespace.createElement(reactCore.Icon, { size: "2xl" }, icon);
|
|
1735
1644
|
}
|
|
1736
1645
|
else {
|
|
1737
|
-
quickStartIcon = (React__namespace.createElement(reactCore.Icon, { size: "
|
|
1738
|
-
React__namespace.createElement(FallbackImg, { className: "pfext-catalog-item-icon__img
|
|
1646
|
+
quickStartIcon = (React__namespace.createElement(reactCore.Icon, { size: "2xl" },
|
|
1647
|
+
React__namespace.createElement(FallbackImg, { src: icon, alt: "", className: "pfext-catalog-item-icon__img", fallback: React__namespace.createElement(RocketIcon__default['default'], null) })));
|
|
1739
1648
|
}
|
|
1649
|
+
const onSelect = () => {
|
|
1650
|
+
if (!link) {
|
|
1651
|
+
setActiveQuickStart(id, tasks === null || tasks === void 0 ? void 0 : tasks.length);
|
|
1652
|
+
}
|
|
1653
|
+
else {
|
|
1654
|
+
window.open(link.href, '_blank', 'noopener,noreferrer');
|
|
1655
|
+
}
|
|
1656
|
+
onClick();
|
|
1657
|
+
};
|
|
1740
1658
|
const footerComponent = React__namespace.useMemo(() => {
|
|
1741
1659
|
if (footer && footer.show === false) {
|
|
1742
1660
|
return null;
|
|
@@ -1744,52 +1662,44 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, act
|
|
|
1744
1662
|
if (link) {
|
|
1745
1663
|
return React__namespace.createElement(QuickStartTileFooterExternal, { link: link, quickStartId: id });
|
|
1746
1664
|
}
|
|
1747
|
-
return React__namespace.createElement(QuickStartTileFooter, { quickStartId: id, status: status, totalTasks: tasks === null || tasks === void 0 ? void 0 : tasks.length });
|
|
1665
|
+
return (React__namespace.createElement(QuickStartTileFooter, { quickStartId: id, status: status, totalTasks: tasks === null || tasks === void 0 ? void 0 : tasks.length, onClickContinue: onSelect }));
|
|
1748
1666
|
}, [footer, id, link, status, tasks === null || tasks === void 0 ? void 0 : tasks.length]);
|
|
1749
|
-
const
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
setActiveQuickStart(id, tasks === null || tasks === void 0 ? void 0 : tasks.length);
|
|
1771
|
-
onClick();
|
|
1772
|
-
}
|
|
1773
|
-
} }, linkProps, { "data-test": `tile ${id}`, description: React__namespace.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }), footer: footerComponent, tabIndex: 0,
|
|
1774
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1775
|
-
// @ts-ignore-next-line
|
|
1776
|
-
isSelectableRaised: true }))));
|
|
1667
|
+
const ActionIcon = (action === null || action === void 0 ? void 0 : action.icon) || OutlinedBookmarkIcon__default['default'];
|
|
1668
|
+
const additionalAction = action ? (React__namespace.createElement(reactCore.Button, Object.assign({ "aria-label": action['aria-label'], icon: React__namespace.createElement(ActionIcon, null), variant: "plain", onClick: action.onClick }, action.buttonProps))) : undefined;
|
|
1669
|
+
return (React__namespace.createElement(reactCore.Card, Object.assign({ id: `${id}-catalog-tile`, style: { height: '100%' }, "data-testid": `qs-card-${camelize(displayName)}` }, (isActive && {
|
|
1670
|
+
isClickable: true,
|
|
1671
|
+
isSelectable: true,
|
|
1672
|
+
isSelected: true,
|
|
1673
|
+
isClicked: true,
|
|
1674
|
+
})),
|
|
1675
|
+
React__namespace.createElement(reactCore.CardHeader, Object.assign({}, (action && {
|
|
1676
|
+
actions: { actions: additionalAction },
|
|
1677
|
+
})), quickStartIcon),
|
|
1678
|
+
React__namespace.createElement(reactCore.CardTitle, null,
|
|
1679
|
+
React__namespace.createElement(QuickStartTileHeader, { name: displayName, onSelect: onSelect, quickStartId: id })),
|
|
1680
|
+
React__namespace.createElement(reactCore.CardBody, null,
|
|
1681
|
+
React__namespace.createElement(reactCore.Stack, { hasGutter: true },
|
|
1682
|
+
React__namespace.createElement(reactCore.Flex, { spaceItems: { default: 'spaceItemsSm' } },
|
|
1683
|
+
type && React__namespace.createElement(reactCore.Label, { color: type.color }, type.text),
|
|
1684
|
+
durationMinutes && (React__namespace.createElement(reactCore.Label, { variant: "outline", "data-test": "duration", icon: React__namespace.createElement(OutlinedClockIcon__default['default'], null) }, getResource('{{duration, number}} minutes', durationMinutes).replace('{{duration, number}}', durationMinutes))),
|
|
1685
|
+
status !== exports.QuickStartStatus.NOT_STARTED && (React__namespace.createElement(reactCore.Label, { variant: "outline", color: statusColorMap[status], icon: React__namespace.createElement(StatusIcon, { status: status }), "data-test": "status" }, statusLocaleMap[status]))),
|
|
1686
|
+
React__namespace.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }))),
|
|
1687
|
+
React__namespace.createElement(reactCore.CardFooter, null, footerComponent)));
|
|
1777
1688
|
};
|
|
1778
1689
|
|
|
1779
1690
|
const QuickStartCatalog = ({ quickStarts }) => {
|
|
1780
1691
|
const { activeQuickStartID, allQuickStartStates } = React__namespace.useContext(QuickStartContext);
|
|
1781
|
-
return (React__namespace.createElement("div",
|
|
1782
|
-
React__namespace.createElement(reactCore.Gallery, {
|
|
1692
|
+
return (React__namespace.createElement("div", null,
|
|
1693
|
+
React__namespace.createElement(reactCore.Gallery, { hasGutter: true }, quickStarts.map((quickStart, index) => {
|
|
1783
1694
|
const { metadata: { name: id }, } = quickStart;
|
|
1784
|
-
return (React__namespace.createElement(
|
|
1785
|
-
React__namespace.createElement(QuickStartTile, { quickStart: quickStart, isActive: id === activeQuickStartID, status: getQuickStartStatus(allQuickStartStates, id) })));
|
|
1695
|
+
return (React__namespace.createElement(QuickStartTile, { key: index, quickStart: quickStart, isActive: id === activeQuickStartID, status: getQuickStartStatus(allQuickStartStates, id) }));
|
|
1786
1696
|
}))));
|
|
1787
1697
|
};
|
|
1788
1698
|
|
|
1789
1699
|
const QuickStartCatalogFilterSearch = (_a) => {
|
|
1790
1700
|
var { searchInputText, handleTextChange } = _a, props = tslib.__rest(_a, ["searchInputText", "handleTextChange"]);
|
|
1791
1701
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1792
|
-
return (React__namespace.createElement(reactCore.ToolbarItem,
|
|
1702
|
+
return (React__namespace.createElement(reactCore.ToolbarItem, null,
|
|
1793
1703
|
React__namespace.createElement(reactCore.SearchInput, Object.assign({ placeholder: getResource('Filter by keyword...'), value: searchInputText, onChange: (_ev, value) => handleTextChange(value), onClear: () => handleTextChange('') }, props))));
|
|
1794
1704
|
};
|
|
1795
1705
|
const QuickStartCatalogFilterSelect = (_a) => {
|
|
@@ -1804,7 +1714,7 @@ const QuickStartCatalogFilterSelect = (_a) => {
|
|
|
1804
1714
|
};
|
|
1805
1715
|
const QuickStartCatalogFilterCount = ({ quickStartsCount }) => {
|
|
1806
1716
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1807
|
-
return (React__namespace.createElement(reactCore.ToolbarItem, {
|
|
1717
|
+
return (React__namespace.createElement(reactCore.ToolbarItem, { align: { default: 'alignEnd' } }, getResource('{{count, number}} item', quickStartsCount).replace('{{count, number}}', quickStartsCount)));
|
|
1808
1718
|
};
|
|
1809
1719
|
const QuickStartCatalogFilterSearchWrapper = ({ onSearchInputChange = () => { } }) => {
|
|
1810
1720
|
const { useQueryParams, filter, setFilter } = React__namespace.useContext(QuickStartContext);
|
|
@@ -1894,7 +1804,7 @@ const QuickStartCatalogFilterCountWrapper = ({ quickStartsCount }) => React__nam
|
|
|
1894
1804
|
|
|
1895
1805
|
const QuickStartCatalogFilter = (_a) => {
|
|
1896
1806
|
var { quickStartsCount, onSearchInputChange = () => { }, onStatusChange = () => { } } = _a, props = tslib.__rest(_a, ["quickStartsCount", "onSearchInputChange", "onStatusChange"]);
|
|
1897
|
-
return (React__namespace.createElement(reactCore.Toolbar, Object.assign({
|
|
1807
|
+
return (React__namespace.createElement(reactCore.Toolbar, Object.assign({}, props),
|
|
1898
1808
|
React__namespace.createElement(reactCore.ToolbarContent, null,
|
|
1899
1809
|
React__namespace.createElement(QuickStartCatalogFilterSearchWrapper, { onSearchInputChange: onSearchInputChange }),
|
|
1900
1810
|
React__namespace.createElement(QuickStartCatalogFilterStatusWrapper, { onStatusChange: onStatusChange }),
|
|
@@ -1970,28 +1880,29 @@ const QuickStartCatalogPage = ({ quickStarts, showFilter, sortFnc = (q1, q2) =>
|
|
|
1970
1880
|
if (!allQuickStarts || allQuickStarts.length === 0) {
|
|
1971
1881
|
return React__namespace.createElement(EmptyBox, { label: getResource('Quick Starts') });
|
|
1972
1882
|
}
|
|
1973
|
-
return (React__namespace.createElement(
|
|
1974
|
-
showTitle && (React__namespace.createElement(
|
|
1975
|
-
React__namespace.createElement(
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
React__namespace.createElement(
|
|
1980
|
-
|
|
1981
|
-
|
|
1883
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
1884
|
+
(showTitle || showFilter) && (React__namespace.createElement(reactCore.PageSection, { hasBodyWrapper: false },
|
|
1885
|
+
showTitle && (React__namespace.createElement(React__namespace.Fragment, null,
|
|
1886
|
+
React__namespace.createElement(reactCore.Content, { component: "h1", "data-test": "page-title" }, title || getResource('Quick Starts')),
|
|
1887
|
+
hint && React__namespace.createElement("div", null, hint))),
|
|
1888
|
+
showTitle && React__namespace.createElement(reactCore.Divider, { component: "div" }),
|
|
1889
|
+
showFilter && (React__namespace.createElement(React__namespace.Fragment, null,
|
|
1890
|
+
React__namespace.createElement(QuickStartCatalogFilter, { quickStartsCount: filteredQuickStarts.length, onSearchInputChange: onSearchInputChange, onStatusChange: onStatusChange }),
|
|
1891
|
+
React__namespace.createElement(reactCore.Divider, { component: "div" }))))),
|
|
1892
|
+
React__namespace.createElement(reactCore.PageSection, { hasBodyWrapper: false }, filteredQuickStarts.length === 0 ? (React__namespace.createElement(QuickStartCatalogEmptyState, { clearFilters: clearFilters })) : (React__namespace.createElement(QuickStartCatalog, { quickStarts: filteredQuickStarts })))));
|
|
1982
1893
|
};
|
|
1983
1894
|
|
|
1984
|
-
const QuickStartCatalogHeader = ({ title, hint, }) => (React__namespace.createElement("div",
|
|
1985
|
-
React__namespace.createElement("h1",
|
|
1986
|
-
hint && React__namespace.createElement("div",
|
|
1895
|
+
const QuickStartCatalogHeader = ({ title, hint, }) => (React__namespace.createElement("div", null,
|
|
1896
|
+
React__namespace.createElement(reactCore.Title, { headingLevel: "h1", "data-pf-content": "true" }, title),
|
|
1897
|
+
hint && React__namespace.createElement("div", null, hint)));
|
|
1987
1898
|
|
|
1988
|
-
const QuickStartCatalogSection = ({ children }) => (React__namespace.createElement("div",
|
|
1899
|
+
const QuickStartCatalogSection = ({ children }) => (React__namespace.createElement("div", null, children));
|
|
1989
1900
|
|
|
1990
|
-
const QuickStartCatalogToolbar = ({ children }) => (React__namespace.createElement(reactCore.Toolbar,
|
|
1901
|
+
const QuickStartCatalogToolbar = ({ children }) => (React__namespace.createElement(reactCore.Toolbar, null, children));
|
|
1991
1902
|
|
|
1992
1903
|
const QuickStartCloseModal = ({ isOpen, onConfirm, onCancel, }) => {
|
|
1993
1904
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
1994
|
-
return (React__namespace.createElement(Modal, {
|
|
1905
|
+
return (React__namespace.createElement(Modal, { isOpen: isOpen, variant: deprecated.ModalVariant.small, showClose: false, "data-test": "leave-quickstart", title: getResource('Leave quick start?'), footer: React__namespace.createElement(reactCore.Flex, null,
|
|
1995
1906
|
React__namespace.createElement(reactCore.FlexItem, { align: { default: 'alignRight' } },
|
|
1996
1907
|
React__namespace.createElement(reactCore.Button, { variant: "secondary", "data-test": "cancel button", onClick: onCancel }, getResource('Cancel'))),
|
|
1997
1908
|
React__namespace.createElement(reactCore.FlexItem, null,
|
|
@@ -2007,29 +1918,28 @@ const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, is
|
|
|
2007
1918
|
titleRef.current.parentNode.focus();
|
|
2008
1919
|
}
|
|
2009
1920
|
}, [focusOnQuickStart, isActiveTask]);
|
|
2010
|
-
reactStyles.css('pfext-quick-start-task-header__title', {
|
|
2011
|
-
'pfext-quick-start-task-header__title-success': taskStatus === exports.QuickStartTaskStatus.SUCCESS,
|
|
2012
|
-
'pfext-quick-start-task-header__title-failed': taskStatus === (exports.QuickStartTaskStatus.FAILED || exports.QuickStartTaskStatus.VISITED),
|
|
2013
|
-
});
|
|
2014
|
-
// const notCompleted = taskStatus === QuickStartTaskStatus.VISITED;
|
|
2015
|
-
// const skippedReview = taskStatus === QuickStartTaskStatus.REVIEW;
|
|
2016
1921
|
const failedReview = taskStatus === exports.QuickStartTaskStatus.FAILED;
|
|
2017
|
-
// TODO: toned down when this is shown, investigate further when we should display it
|
|
2018
|
-
// related: https://github.com/patternfly/patternfly-quickstarts/issues/104
|
|
2019
1922
|
const tryAgain = failedReview && (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2020
1923
|
React__namespace.createElement("div", null),
|
|
2021
1924
|
React__namespace.createElement("div", { className: "pfext-quick-start-task-header__tryagain" }, "Try the steps again.")));
|
|
2022
1925
|
const content = (React__namespace.createElement("div", { ref: titleRef },
|
|
2023
|
-
React__namespace.createElement(reactCore.Title, { headingLevel: "h3" },
|
|
2024
|
-
React__namespace.createElement("span", {
|
|
2025
|
-
isActiveTask && subtitle && (React__namespace.createElement("span",
|
|
1926
|
+
React__namespace.createElement(reactCore.Title, { headingLevel: "h3", size: size },
|
|
1927
|
+
React__namespace.createElement("span", { className: "pfext-quick-start-task-header__title" }, title),
|
|
1928
|
+
isActiveTask && subtitle && (React__namespace.createElement("span", null,
|
|
2026
1929
|
' ',
|
|
2027
|
-
React__namespace.createElement(
|
|
1930
|
+
React__namespace.createElement("span", { "data-test-id": "quick-start-task-subtitle", className: "pfext-quick-start-task-header__subtitle" }, subtitle))),
|
|
2028
1931
|
tryAgain)));
|
|
2029
|
-
|
|
1932
|
+
let status = 'default';
|
|
1933
|
+
if (taskStatus === exports.QuickStartTaskStatus.FAILED) {
|
|
1934
|
+
status = 'error';
|
|
1935
|
+
}
|
|
1936
|
+
else if (taskStatus === exports.QuickStartTaskStatus.SUCCESS) {
|
|
1937
|
+
status = 'success';
|
|
1938
|
+
}
|
|
1939
|
+
return (React__namespace.createElement(reactCore.WizardNavItem, { content: content, stepIndex: taskIndex, onClick: () => onTaskSelect(taskIndex - 1), component: "button", isCurrent: isActiveTask, status: status }, children));
|
|
2030
1940
|
};
|
|
2031
1941
|
|
|
2032
|
-
const QuickStartTaskHeaderList = ({ tasks, allTaskStatuses, onTaskSelect, }) => tasks.length > 0 ? (React__namespace.createElement(
|
|
1942
|
+
const QuickStartTaskHeaderList = ({ tasks, allTaskStatuses, onTaskSelect, }) => (tasks === null || tasks === void 0 ? void 0 : tasks.length) > 0 ? (React__namespace.createElement("div", { className: "pf-v6-c-wizard__nav-list" }, tasks.map((task, index) => (React__namespace.createElement(QuickStartTaskHeader, { key: task.title, title: task.title, taskIndex: index + 1, size: "md", taskStatus: allTaskStatuses[index], onTaskSelect: onTaskSelect }))))) : null;
|
|
2033
1943
|
|
|
2034
1944
|
const QuickStartConclusion = ({ tasks, conclusion, allTaskStatuses, nextQuickStarts, onQuickStartChange, onTaskSelect, }) => {
|
|
2035
1945
|
const hasFailedTask = allTaskStatuses.includes(exports.QuickStartTaskStatus.FAILED);
|
|
@@ -2044,10 +1954,7 @@ const QuickStartConclusion = ({ tasks, conclusion, allTaskStatuses, nextQuickSta
|
|
|
2044
1954
|
nextQuickStarts.length > 0 &&
|
|
2045
1955
|
nextQuickStarts.map((nextQuickStart, index) => {
|
|
2046
1956
|
var _a;
|
|
2047
|
-
return (React__namespace.createElement(reactCore.Button, { variant: "link", onClick: () => onQuickStartChange(nextQuickStart.metadata.name), isInline: true, isBlock: true, key: index },
|
|
2048
|
-
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),
|
|
2049
|
-
' ',
|
|
2050
|
-
React__namespace.createElement(ArrowRightIcon__default['default'], { style: { marginLeft: 'var(--pf-t--global--spacer--xs)', verticalAlign: 'middle' } })));
|
|
1957
|
+
return (React__namespace.createElement(reactCore.Button, { variant: "link", onClick: () => onQuickStartChange(nextQuickStart.metadata.name), isInline: true, icon: React__namespace.createElement(ArrowRightIcon__default['default'], null), iconPosition: "end", isBlock: true, key: index, style: { marginTop: 'var(--pf-t--global--spacer--md' } }, 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)));
|
|
2051
1958
|
})));
|
|
2052
1959
|
};
|
|
2053
1960
|
|
|
@@ -2055,15 +1962,14 @@ const QuickStartIntroduction = ({ tasks, introduction, allTaskStatuses, prerequi
|
|
|
2055
1962
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
2056
1963
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
2057
1964
|
const [isPrereqsExpanded, setIsPrereqsExpanded] = React__namespace.useState(false);
|
|
2058
|
-
const prereqList = (prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (React__namespace.createElement(reactCore.ExpandableSection, { toggleText: getResource('View Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length), onToggle: () => setIsPrereqsExpanded(!isPrereqsExpanded)
|
|
2059
|
-
React__namespace.createElement(reactCore.List,
|
|
2060
|
-
React__namespace.createElement(
|
|
2061
|
-
|
|
2062
|
-
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
1965
|
+
const prereqList = (prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (React__namespace.createElement(reactCore.ExpandableSection, { toggleText: getResource('View Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length), onToggle: () => setIsPrereqsExpanded(!isPrereqsExpanded) },
|
|
1966
|
+
React__namespace.createElement(reactCore.List, null, prereqs.map((pr) => (React__namespace.createElement(reactCore.ListItem, { key: pr },
|
|
1967
|
+
React__namespace.createElement(QuickStartMarkdownView, { content: pr })))))));
|
|
1968
|
+
return (React__namespace.createElement(reactCore.Stack, { hasGutter: true },
|
|
2063
1969
|
React__namespace.createElement(QuickStartMarkdownView, { content: introduction }),
|
|
2064
1970
|
prereqList,
|
|
2065
|
-
React__namespace.createElement("p",
|
|
2066
|
-
getResource('In this quick start, you will complete {{count, number}} task', tasks.length).replace('{{count, number}}', tasks.length),
|
|
1971
|
+
React__namespace.createElement("p", null,
|
|
1972
|
+
getResource('In this quick start, you will complete {{count, number}} task', tasks === null || tasks === void 0 ? void 0 : tasks.length).replace('{{count, number}}', (tasks === null || tasks === void 0 ? void 0 : tasks.length) || 0),
|
|
2067
1973
|
":"),
|
|
2068
1974
|
React__namespace.createElement(QuickStartTaskHeaderList, { tasks: tasks, allTaskStatuses: allTaskStatuses, onTaskSelect: onTaskSelect })));
|
|
2069
1975
|
};
|
|
@@ -2081,12 +1987,9 @@ const getAlertVariant = (status) => {
|
|
|
2081
1987
|
const QuickStartTaskReview = ({ review, taskStatus, onTaskReview, }) => {
|
|
2082
1988
|
const { instructions, failedTaskHelp: taskHelp } = review;
|
|
2083
1989
|
const { getResource } = React__namespace.useContext(QuickStartContext);
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
});
|
|
2088
|
-
const title = React__namespace.createElement("span", { className: alertClassNames }, getResource('Check your work'));
|
|
2089
|
-
return (React__namespace.createElement(reactCore.Alert, { className: "pfext-quick-start-task-review-alert", variant: getAlertVariant(taskStatus), title: title, isInline: true, role: "alert" },
|
|
1990
|
+
return (React__namespace.createElement(reactCore.Alert, { variant: getAlertVariant(taskStatus), title: getResource('Check your work'), isInline: true, role: "alert", style: {
|
|
1991
|
+
marginBottom: 'var(--pf-t--global--spacer--md)',
|
|
1992
|
+
} },
|
|
2090
1993
|
React__namespace.createElement(QuickStartMarkdownView, { content: instructions }),
|
|
2091
1994
|
React__namespace.createElement("span", { className: "pfext-quick-start-task-review__actions" },
|
|
2092
1995
|
React__namespace.createElement(reactCore.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 === exports.QuickStartTaskStatus.SUCCESS, onChange: () => onTaskReview(exports.QuickStartTaskStatus.SUCCESS) }),
|
|
@@ -2096,7 +1999,7 @@ const QuickStartTaskReview = ({ review, taskStatus, onTaskReview, }) => {
|
|
|
2096
1999
|
|
|
2097
2000
|
const QuickStartTasks = ({ tasks, taskNumber, allTaskStatuses, onTaskReview, onTaskSelect, }) => {
|
|
2098
2001
|
const { getResource, alwaysShowTaskReview } = React__namespace.useContext(QuickStartContext);
|
|
2099
|
-
return (React__namespace.createElement("div", { className: "
|
|
2002
|
+
return (React__namespace.createElement("div", { className: "pf-v6-c-wizard__nav-list", style: { padding: '0 0 0 0' } },
|
|
2100
2003
|
React__namespace.createElement("ul", null, tasks
|
|
2101
2004
|
.filter((_, index) => allTaskStatuses[index] !== exports.QuickStartTaskStatus.INIT)
|
|
2102
2005
|
.map((task, index) => {
|
|
@@ -2108,7 +2011,7 @@ const QuickStartTasks = ({ tasks, taskNumber, allTaskStatuses, onTaskReview, onT
|
|
|
2108
2011
|
return (React__namespace.createElement(React__namespace.Fragment, { key: title },
|
|
2109
2012
|
React__namespace.createElement(QuickStartTaskHeader, { taskIndex: index + 1, title: title, size: "md", subtitle: getResource('{{index, number}} of {{tasks, number}}')
|
|
2110
2013
|
.replace('{{index, number}}', index + 1)
|
|
2111
|
-
.replace('{{tasks, number}}', tasks.length), taskStatus: taskStatus, isActiveTask: isActiveTask, onTaskSelect: onTaskSelect }, isActiveTask && (React__namespace.createElement(
|
|
2014
|
+
.replace('{{tasks, number}}', tasks.length), taskStatus: taskStatus, isActiveTask: isActiveTask, onTaskSelect: onTaskSelect }, isActiveTask && (React__namespace.createElement(reactCore.Stack, { hasGutter: true },
|
|
2112
2015
|
React__namespace.createElement(QuickStartMarkdownView, { content: description }),
|
|
2113
2016
|
shouldShowTaskReview && (React__namespace.createElement(QuickStartTaskReview, { review: review, taskStatus: taskStatus, onTaskReview: onTaskReview })))))));
|
|
2114
2017
|
}))));
|
|
@@ -2116,14 +2019,14 @@ const QuickStartTasks = ({ tasks, taskNumber, allTaskStatuses, onTaskReview, onT
|
|
|
2116
2019
|
|
|
2117
2020
|
const QuickStartContent = React__namespace.forwardRef(({ quickStart, nextQuickStarts = [], taskNumber, allTaskStatuses, onTaskSelect, onTaskReview, onQuickStartChange, }, ref) => {
|
|
2118
2021
|
const { spec: { introduction, tasks, conclusion, prerequisites }, } = quickStart;
|
|
2119
|
-
const totalTasks = tasks.length;
|
|
2120
|
-
return (React__namespace.createElement("div", { className: "pfext-quick-start-
|
|
2022
|
+
const totalTasks = tasks === null || tasks === void 0 ? void 0 : tasks.length;
|
|
2023
|
+
return (React__namespace.createElement("div", { className: "pfext-quick-start-task", ref: ref },
|
|
2121
2024
|
taskNumber === -1 && (React__namespace.createElement(QuickStartIntroduction, { tasks: tasks, allTaskStatuses: allTaskStatuses, introduction: introduction, prerequisites: prerequisites, onTaskSelect: onTaskSelect })),
|
|
2122
2025
|
taskNumber > -1 && taskNumber < totalTasks && (React__namespace.createElement(QuickStartTasks, { tasks: tasks, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskReview: onTaskReview, onTaskSelect: onTaskSelect })),
|
|
2123
2026
|
taskNumber === totalTasks && (React__namespace.createElement(QuickStartConclusion, { tasks: tasks, conclusion: conclusion, allTaskStatuses: allTaskStatuses, nextQuickStarts: nextQuickStarts, onQuickStartChange: onQuickStartChange, onTaskSelect: onTaskSelect }))));
|
|
2124
2027
|
});
|
|
2125
2028
|
|
|
2126
|
-
const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack,
|
|
2029
|
+
const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack, quickStartId, className, }) => {
|
|
2127
2030
|
const { restartQuickStart, getResource } = React__namespace.useContext(QuickStartContext);
|
|
2128
2031
|
const PrimaryButtonText = React__namespace.useMemo(() => ({
|
|
2129
2032
|
START: getResource('Start'),
|
|
@@ -2152,13 +2055,16 @@ const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack, foot
|
|
|
2152
2055
|
}
|
|
2153
2056
|
return PrimaryButtonText.CONTINUE;
|
|
2154
2057
|
}, [taskNumber, totalTasks, PrimaryButtonText, status]);
|
|
2155
|
-
const getPrimaryButton = React__namespace.useMemo(() => (React__namespace.createElement(reactCore.Button, { variant: "primary",
|
|
2058
|
+
const getPrimaryButton = React__namespace.useMemo(() => (React__namespace.createElement(reactCore.Button, { variant: "primary", onClick: onNext, "data-testid": `qs-drawer-${camelize(getPrimaryButtonText)}`, "data-test": `${getPrimaryButtonText} button` }, getPrimaryButtonText)), [getPrimaryButtonText, onNext]);
|
|
2156
2059
|
const getSecondaryButton = React__namespace.useMemo(() => taskNumber === -1 && status !== exports.QuickStartStatus.NOT_STARTED ? (React__namespace.createElement(reactCore.Button, { variant: "secondary", onClick: onRestart, "data-testid": "qs-drawer-restart" }, SecondaryButtonText.RESTART)) : (taskNumber > -1 && (React__namespace.createElement(reactCore.Button, { variant: "secondary", onClick: onBack, "data-testid": "qs-drawer-back" }, SecondaryButtonText.BACK))), [onRestart, onBack, SecondaryButtonText, status, taskNumber]);
|
|
2157
|
-
const getSideNoteAction = React__namespace.useMemo(() => taskNumber !== -1 && (React__namespace.createElement(reactCore.Button, { variant: "link",
|
|
2158
|
-
return (React__namespace.createElement("div", { className:
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2060
|
+
const getSideNoteAction = React__namespace.useMemo(() => taskNumber !== -1 && (React__namespace.createElement(reactCore.Button, { variant: "link", onClick: onRestart, "data-testid": "qs-drawer-side-note-action" }, SecondaryButtonText.RESTART)), [taskNumber, onRestart, SecondaryButtonText.RESTART]);
|
|
2061
|
+
return (React__namespace.createElement("div", { className: reactStyles.css('pfext-quick-start-footer', className) },
|
|
2062
|
+
React__namespace.createElement(reactCore.ActionList, null,
|
|
2063
|
+
React__namespace.createElement(reactCore.ActionListGroup, null,
|
|
2064
|
+
React__namespace.createElement(reactCore.ActionListItem, null, getPrimaryButton),
|
|
2065
|
+
React__namespace.createElement(reactCore.ActionListItem, null, getSecondaryButton)),
|
|
2066
|
+
React__namespace.createElement(reactCore.ActionListGroup, null,
|
|
2067
|
+
React__namespace.createElement(reactCore.ActionListItem, null, getSideNoteAction)))));
|
|
2162
2068
|
};
|
|
2163
2069
|
|
|
2164
2070
|
const QuickStartController = ({ quickStart, nextQuickStarts, contentRef, footerClass, }) => {
|
|
@@ -2197,7 +2103,7 @@ const QuickStartController = ({ quickStart, nextQuickStarts, contentRef, footerC
|
|
|
2197
2103
|
}, [name, setQuickStartTaskNumber]);
|
|
2198
2104
|
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2199
2105
|
React__namespace.createElement(QuickStartContent, { quickStart: quickStart, nextQuickStarts: nextQuickStarts, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskSelect: handleTaskSelect, onTaskReview: handleTaskStatusChange, onQuickStartChange: handleQuickStartChange, ref: contentRef }),
|
|
2200
|
-
React__namespace.createElement(QuickStartFooter, { status: status, taskNumber: taskNumber, totalTasks: totalTasks, onNext: handleNext, onBack: handleBack,
|
|
2106
|
+
React__namespace.createElement(QuickStartFooter, { status: status, taskNumber: taskNumber, totalTasks: totalTasks, onNext: handleNext, onBack: handleBack, className: footerClass, quickStartId: quickStart.metadata.name })));
|
|
2201
2107
|
};
|
|
2202
2108
|
|
|
2203
2109
|
const getElement = (appendTo) => {
|
|
@@ -2214,24 +2120,17 @@ const useScrollTopOnTaskNumberChange = (node, taskNumber) => {
|
|
|
2214
2120
|
}, [taskNumber, node]);
|
|
2215
2121
|
};
|
|
2216
2122
|
const QuickStartPanelContent = (_a) => {
|
|
2217
|
-
var { quickStarts = [], handleClose, activeQuickStartID, appendTo, isResizable = true, showClose = true,
|
|
2123
|
+
var { quickStarts = [], handleClose, activeQuickStartID, appendTo, isResizable = true, showClose = true, footerClass } = _a, props = tslib.__rest(_a, ["quickStarts", "handleClose", "activeQuickStartID", "appendTo", "isResizable", "showClose", "footerClass"]);
|
|
2218
2124
|
const titleRef = React__namespace.useRef(null);
|
|
2219
2125
|
const { getResource, activeQuickStartState, focusOnQuickStart } = React__namespace.useContext(QuickStartContext);
|
|
2220
2126
|
const [contentRef, setContentRef] = React__namespace.useState();
|
|
2221
|
-
const shadows = useScrollShadows(contentRef);
|
|
2222
2127
|
const quickStart = quickStarts.find((qs) => qs.metadata.name === activeQuickStartID);
|
|
2223
2128
|
const taskNumber = activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.taskNumber;
|
|
2224
2129
|
useScrollTopOnTaskNumberChange(contentRef, taskNumber);
|
|
2225
2130
|
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); });
|
|
2226
|
-
const headerClasses = reactStyles.css('pfext-quick-start-panel-content__header', {
|
|
2227
|
-
'pfext-quick-start-panel-content__header__shadow': shadows === Shadows.top || shadows === Shadows.both,
|
|
2228
|
-
'pfext-quick-start-panel-content__header--blue-white': headerVariant === 'blue-white',
|
|
2229
|
-
});
|
|
2230
|
-
const footerClass = reactStyles.css({
|
|
2231
|
-
'pfext-quick-start-panel-content__footer__shadow': shadows === Shadows.bottom || shadows === Shadows.both,
|
|
2232
|
-
});
|
|
2233
2131
|
const getStep = () => {
|
|
2234
|
-
|
|
2132
|
+
var _a;
|
|
2133
|
+
const tasks = ((_a = quickStart.spec.tasks) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
2235
2134
|
if (Number.parseInt(taskNumber) === -1) {
|
|
2236
2135
|
return 'intro';
|
|
2237
2136
|
}
|
|
@@ -2245,23 +2144,21 @@ const QuickStartPanelContent = (_a) => {
|
|
|
2245
2144
|
titleRef.current.focus();
|
|
2246
2145
|
}
|
|
2247
2146
|
}, [focusOnQuickStart, quickStart]);
|
|
2248
|
-
const content = quickStart ? (React__namespace.createElement(reactCore.DrawerPanelContent, Object.assign({ isResizable: isResizable,
|
|
2249
|
-
React__namespace.createElement("div", { className:
|
|
2147
|
+
const content = quickStart ? (React__namespace.createElement(reactCore.DrawerPanelContent, Object.assign({ isResizable: isResizable, "data-testid": `qs-drawer-${camelize(quickStart.spec.displayName)}`, "data-qs": `qs-step-${getStep()}`, "data-test": "quickstart drawer", style: { '--pf-v6-c-drawer__panel--PaddingBlockStart': '0' } }, props),
|
|
2148
|
+
React__namespace.createElement("div", { className: "pfext-quick-start-panel-content" },
|
|
2250
2149
|
React__namespace.createElement(reactCore.DrawerHead, null,
|
|
2251
|
-
React__namespace.createElement("div", {
|
|
2252
|
-
React__namespace.createElement(reactCore.Title, { headingLevel: "h2", size: "xl",
|
|
2253
|
-
React__namespace.createElement("span",
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
' ',
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
.replace('{{type}}', getResource('Type'))
|
|
2261
|
-
: getResource('Type')))),
|
|
2150
|
+
React__namespace.createElement("div", { tabIndex: -1, ref: titleRef },
|
|
2151
|
+
React__namespace.createElement(reactCore.Title, { headingLevel: "h2", size: "xl", style: { marginRight: 'var(--pf-t--global--spacer--md)' } },
|
|
2152
|
+
React__namespace.createElement("span", null, quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.displayName),
|
|
2153
|
+
' '),
|
|
2154
|
+
React__namespace.createElement("span", null, (quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
2155
|
+
? getResource('{{type}} • {{duration, number}} minutes', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
2156
|
+
.replace('{{duration, number}}', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
2157
|
+
.replace('{{type}}', getResource('Type'))
|
|
2158
|
+
: getResource('Type'))),
|
|
2262
2159
|
showClose && (React__namespace.createElement(reactCore.DrawerActions, null,
|
|
2263
2160
|
React__namespace.createElement(reactCore.DrawerCloseButton, { onClick: handleClose, className: "pfext-quick-start-panel-content__close-button", "data-testid": "qs-drawer-close" }))))),
|
|
2264
|
-
React__namespace.createElement(reactCore.DrawerPanelBody, {
|
|
2161
|
+
React__namespace.createElement(reactCore.DrawerPanelBody, { className: "pfext-quick-start-panel-content__body", "data-test": "content" },
|
|
2265
2162
|
React__namespace.createElement(QuickStartController, { quickStart: quickStart, nextQuickStarts: nextQuickStarts, footerClass: footerClass, contentRef: setContentRef })))) : null;
|
|
2266
2163
|
if (appendTo) {
|
|
2267
2164
|
return ReactDOM__namespace.createPortal(content, getElement(appendTo));
|
|
@@ -2301,7 +2198,7 @@ const QuickStartContainer = (_a) => {
|
|
|
2301
2198
|
};
|
|
2302
2199
|
const QuickStartDrawer = (_a) => {
|
|
2303
2200
|
var { quickStarts = [], children, appendTo, fullWidth, onCloseInProgress, onCloseNotInProgress } = _a, props = tslib.__rest(_a, ["quickStarts", "children", "appendTo", "fullWidth", "onCloseInProgress", "onCloseNotInProgress"]);
|
|
2304
|
-
const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], activeQuickStartState, allQuickStartStates, setAllQuickStartStates,
|
|
2201
|
+
const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], activeQuickStartState, allQuickStartStates, setAllQuickStartStates, } = React__namespace.useContext(QuickStartContext);
|
|
2305
2202
|
const combinedQuickStarts = allQuickStarts.concat(quickStarts);
|
|
2306
2203
|
React__namespace.useEffect(() => {
|
|
2307
2204
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -2360,10 +2257,10 @@ const QuickStartDrawer = (_a) => {
|
|
|
2360
2257
|
},
|
|
2361
2258
|
}
|
|
2362
2259
|
: {};
|
|
2363
|
-
const panelContent = (React__namespace.createElement(QuickStartPanelContent, Object.assign({ quickStarts: combinedQuickStarts, handleClose: handleClose, activeQuickStartID: activeQuickStartID, appendTo: appendTo, isResizable: !fullWidth
|
|
2260
|
+
const panelContent = (React__namespace.createElement(QuickStartPanelContent, Object.assign({ quickStarts: combinedQuickStarts, handleClose: handleClose, activeQuickStartID: activeQuickStartID, appendTo: appendTo, isResizable: !fullWidth }, fullWidthPanelStyle)));
|
|
2364
2261
|
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2365
2262
|
React__namespace.createElement(reactCore.Drawer, Object.assign({ isExpanded: !!activeQuickStartID, isInline: true }, props), children ? (React__namespace.createElement(reactCore.DrawerContent, Object.assign({ panelContent: panelContent }, fullWidthBodyStyle),
|
|
2366
|
-
React__namespace.createElement(reactCore.DrawerContentBody,
|
|
2263
|
+
React__namespace.createElement(reactCore.DrawerContentBody, null, children))) : (React__namespace.createElement("div", null, panelContent))),
|
|
2367
2264
|
React__namespace.createElement(QuickStartCloseModal, { isOpen: modalOpen, onConfirm: onModalConfirm, onCancel: onModalCancel })));
|
|
2368
2265
|
};
|
|
2369
2266
|
|
|
@@ -2425,17 +2322,17 @@ const HelpTopicPanelContent = (_a) => {
|
|
|
2425
2322
|
!!((_b = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _b === void 0 ? void 0 : _b.length) && React__namespace.createElement(reactCore.Divider, null),
|
|
2426
2323
|
paddingContainer(React__namespace.createElement(reactCore.Stack, { hasGutter: true }, (_c = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _c === void 0 ? void 0 : _c.map(({ href, text, newTab, isExternal }, index) => (React__namespace.createElement(reactCore.StackItem, { key: index },
|
|
2427
2324
|
React__namespace.createElement(reactCore.Button, { component: "a", href: href, target: newTab ? '_blank' : '', rel: "noopener noreferrer", variant: "link", "aria-label": `Open documentation in new window`, isInline: true, icon: isExternal ? React__namespace.createElement(ExternalLinkAltIcon__default['default'], null) : null, iconPosition: "right", style: { fontSize: 'inherit' } }, text || href))))))));
|
|
2428
|
-
const content = (React__namespace.createElement(reactCore.DrawerPanelContent, Object.assign({ isResizable: isResizable
|
|
2325
|
+
const content = (React__namespace.createElement(reactCore.DrawerPanelContent, Object.assign({ isResizable: isResizable }, props),
|
|
2429
2326
|
React__namespace.createElement("div", null,
|
|
2430
2327
|
React__namespace.createElement(reactCore.DrawerHead, null,
|
|
2431
|
-
React__namespace.createElement("div",
|
|
2328
|
+
React__namespace.createElement("div", null,
|
|
2432
2329
|
helpTopicOptions && (React__namespace.createElement(reactCore.Select, { isPlain: true, id: "help-topics-select", selected: activeHelpTopic, isOpen: isHelpTopicMenuOpen, onSelect: onSelectHelpTopic, onOpenChange: (isOpen) => setIsHelpTopicMenuOpen(isOpen), toggle: (toggleRef) => (React__namespace.createElement(reactCore.MenuToggle, { isFullWidth: true, ref: toggleRef, icon: React__namespace.createElement(BarsIcon__default['default'], null), onClick: toggleHelpTopicMenu, isExpanded: isHelpTopicMenuOpen }, activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.title)) },
|
|
2433
2330
|
React__namespace.createElement(reactCore.SelectList, null, helpTopicOptions))),
|
|
2434
|
-
React__namespace.createElement(reactCore.Title, { headingLevel: "h1", size: "xl",
|
|
2331
|
+
React__namespace.createElement(reactCore.Title, { headingLevel: "h1", size: "xl", style: { marginRight: 'var(--pf-t--global--spacer--md)' } }, activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.title)),
|
|
2435
2332
|
React__namespace.createElement(reactCore.DrawerActions, null,
|
|
2436
|
-
React__namespace.createElement(reactCore.DrawerCloseButton, { onClick: onClose,
|
|
2333
|
+
React__namespace.createElement(reactCore.DrawerCloseButton, { onClick: onClose, "data-testid": "qs-drawer-close" }))),
|
|
2437
2334
|
React__namespace.createElement(reactCore.Divider, null),
|
|
2438
|
-
React__namespace.createElement(reactCore.DrawerPanelBody, {
|
|
2335
|
+
React__namespace.createElement(reactCore.DrawerPanelBody, { "data-test": "content" }, panelBodyItems))));
|
|
2439
2336
|
return content;
|
|
2440
2337
|
};
|
|
2441
2338
|
|
|
@@ -2467,7 +2364,7 @@ const HelpTopicDrawer = (_a) => {
|
|
|
2467
2364
|
const panelContent = (React__namespace.createElement(HelpTopicPanelContent, { activeHelpTopic: activeHelpTopic, filteredHelpTopics: filteredHelpTopics, onClose: onClose }));
|
|
2468
2365
|
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2469
2366
|
React__namespace.createElement(reactCore.Drawer, Object.assign({ isExpanded: !!activeHelpTopic, isInline: true }, props), children ? (React__namespace.createElement(reactCore.DrawerContent, { panelContent: panelContent },
|
|
2470
|
-
React__namespace.createElement(reactCore.DrawerContentBody,
|
|
2367
|
+
React__namespace.createElement(reactCore.DrawerContentBody, null, children))) : (React__namespace.createElement("div", { className: "pf-v6-c-drawer__main" }, panelContent)))));
|
|
2471
2368
|
};
|
|
2472
2369
|
|
|
2473
2370
|
const useLocalStorage = (key, initialValue) => {
|