@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.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { createContext, useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { useIsomorphicLayoutEffect, Tooltip, Alert, CodeBlock, Accordion, AccordionItem, AccordionToggle, AccordionContent, Popover, PopoverPosition, Button, Icon, Flex, FlexItem, Title, Card, CardHeader, CardTitle, CardBody, Stack, Label, CardFooter, Gallery, ToolbarItem, SearchInput, Select, SelectList, SelectOption, MenuToggle, Badge, Toolbar, ToolbarContent, EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateActions, PageSection, Content, Divider, WizardNavItem, ExpandableSection, List, ListItem, Radio, ActionList, ActionListGroup, ActionListItem, DrawerPanelContent, DrawerHead, DrawerActions, DrawerCloseButton, DrawerPanelBody, Drawer, DrawerContent, DrawerContentBody, StackItem } 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
|
-
import { __rest } from 'tslib';
|
|
7
|
-
import '@patternfly/react-styles/css/components/Form/form';
|
|
8
6
|
import RocketIcon from '@patternfly/react-icons/dist/js/icons/rocket-icon';
|
|
7
|
+
import { __rest } from 'tslib';
|
|
8
|
+
import { Modal as Modal$1, ModalVariant } from '@patternfly/react-core/deprecated';
|
|
9
9
|
import * as ReactDOM from 'react-dom';
|
|
10
10
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
11
11
|
import CopyIcon from '@patternfly/react-icons/dist/js/icons/copy-icon';
|
|
@@ -17,8 +17,8 @@ import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-
|
|
|
17
17
|
import '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
|
|
18
18
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
19
19
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
20
|
-
import OutlinedClockIcon from '@patternfly/react-icons/dist/js/icons/outlined-clock-icon';
|
|
21
20
|
import OutlinedBookmarkIcon from '@patternfly/react-icons/dist/js/icons/outlined-bookmark-icon';
|
|
21
|
+
import OutlinedClockIcon from '@patternfly/react-icons/dist/js/icons/outlined-clock-icon';
|
|
22
22
|
import ArrowRightIcon from '@patternfly/react-icons/dist/js/icons/arrow-right-icon';
|
|
23
23
|
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
24
24
|
|
|
@@ -754,9 +754,7 @@ const useValuesForQuickStartContext = (value = {}) => {
|
|
|
754
754
|
setAllQuickStartStates((qs) => (Object.assign(Object.assign({}, qs), { [activeQuickStartID]: updatedQuickStart })));
|
|
755
755
|
}, [allQuickStartStates, activeQuickStartID, setAllQuickStartStates]);
|
|
756
756
|
const activeQuickStartState = (_b = allQuickStartStates === null || allQuickStartStates === void 0 ? void 0 : allQuickStartStates[activeQuickStartID]) !== null && _b !== void 0 ? _b : {};
|
|
757
|
-
const getQuickStartForId = useCallback((id) => allQuickStartStates[id], [
|
|
758
|
-
allQuickStartStates,
|
|
759
|
-
]);
|
|
757
|
+
const getQuickStartForId = useCallback((id) => allQuickStartStates[id], [allQuickStartStates]);
|
|
760
758
|
return {
|
|
761
759
|
allQuickStarts: quickStarts,
|
|
762
760
|
setAllQuickStarts: updateAllQuickStarts,
|
|
@@ -835,66 +833,6 @@ const CamelCaseWrap = ({ value, dataTest }) => {
|
|
|
835
833
|
return rendered;
|
|
836
834
|
};
|
|
837
835
|
|
|
838
|
-
class CatalogTile extends React.Component {
|
|
839
|
-
constructor(props) {
|
|
840
|
-
super(props);
|
|
841
|
-
this.handleClick = (e) => {
|
|
842
|
-
const { onClick, href } = this.props;
|
|
843
|
-
if (!href) {
|
|
844
|
-
e.preventDefault();
|
|
845
|
-
}
|
|
846
|
-
if (onClick) {
|
|
847
|
-
onClick(e);
|
|
848
|
-
}
|
|
849
|
-
};
|
|
850
|
-
this.renderBadges = (badges) => {
|
|
851
|
-
if (!badges || !badges.length) {
|
|
852
|
-
return null;
|
|
853
|
-
}
|
|
854
|
-
return (React.createElement("div", { className: "catalog-tile-pf-badge-container" }, badges.map((badge, index) => (React.createElement("span", { key: `badge-${index}` }, badge)))));
|
|
855
|
-
};
|
|
856
|
-
this.generatedId = getUniqueId('pf-catalog-tile');
|
|
857
|
-
}
|
|
858
|
-
render() {
|
|
859
|
-
const _a = this.props, { id, className, featured, onClick, href, icon, iconImg, iconAlt, iconClass, badges, title, vendor, description, footer,
|
|
860
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
861
|
-
ref, children } = _a, props = __rest(_a, ["id", "className", "featured", "onClick", "href", "icon", "iconImg", "iconAlt", "iconClass", "badges", "title", "vendor", "description", "footer", "ref", "children"]);
|
|
862
|
-
return (React.createElement(Card, Object.assign({ component: href ? 'a' : 'div', id: id || this.generatedId, href: href || '#', className: css('catalog-tile-pf', { featured }, className), variant: featured ? 'secondary' : 'default', isClickable: !!onClick }, props),
|
|
863
|
-
(badges.length > 0 || iconImg || iconClass || icon || onClick) && (React.createElement(CardHeader, { actions: { actions: badges.length > 0 && this.renderBadges(badges), hasNoOffset: true }, selectableActions: onClick && {
|
|
864
|
-
selectableActionId: id + '-input',
|
|
865
|
-
onClickAction: (e) => this.handleClick(e),
|
|
866
|
-
selectableActionAriaLabelledby: id
|
|
867
|
-
} },
|
|
868
|
-
iconImg && React.createElement("img", { className: "catalog-tile-pf-icon", src: iconImg, alt: iconAlt }),
|
|
869
|
-
!iconImg && (iconClass || icon) && React.createElement("span", { className: `catalog-tile-pf-icon ${iconClass}` }, icon))),
|
|
870
|
-
React.createElement(CardTitle, { className: "catalog-tile-pf-header" },
|
|
871
|
-
React.createElement("div", { className: "catalog-tile-pf-title" }, title),
|
|
872
|
-
vendor && React.createElement("div", { className: "catalog-tile-pf-subtitle" }, vendor)),
|
|
873
|
-
(description || children) && (React.createElement(CardBody, { className: "catalog-tile-pf-body" },
|
|
874
|
-
description && (React.createElement("div", { className: "catalog-tile-pf-description" },
|
|
875
|
-
React.createElement("span", { className: css({ 'has-footer': footer }) }, description))),
|
|
876
|
-
children)),
|
|
877
|
-
footer && React.createElement(CardFooter, { className: "catalog-tile-pf-footer" }, footer)));
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
CatalogTile.displayName = 'CatalogTile';
|
|
881
|
-
CatalogTile.defaultProps = {
|
|
882
|
-
id: null,
|
|
883
|
-
className: '',
|
|
884
|
-
featured: false,
|
|
885
|
-
onClick: null,
|
|
886
|
-
href: null,
|
|
887
|
-
iconImg: null,
|
|
888
|
-
iconAlt: '',
|
|
889
|
-
iconClass: '',
|
|
890
|
-
icon: null,
|
|
891
|
-
badges: [],
|
|
892
|
-
vendor: null,
|
|
893
|
-
description: null,
|
|
894
|
-
footer: null,
|
|
895
|
-
children: null
|
|
896
|
-
};
|
|
897
|
-
|
|
898
836
|
const Modal = (_a) => {
|
|
899
837
|
var { isFullScreen = false, className } = _a, props = __rest(_a, ["isFullScreen", "className"]);
|
|
900
838
|
return (React.createElement(Modal$1, Object.assign({}, props, { className: css('pfext-modal', className), appendTo: () => (isFullScreen ? document.body : document.querySelector('#modal-container')) })));
|
|
@@ -1028,44 +966,6 @@ var Shadows;
|
|
|
1028
966
|
Shadows["top"] = "top";
|
|
1029
967
|
Shadows["bottom"] = "bottom";
|
|
1030
968
|
})(Shadows || (Shadows = {}));
|
|
1031
|
-
const useScrollShadows = (node) => {
|
|
1032
|
-
const [shadows, setShadows] = React.useState(Shadows.none);
|
|
1033
|
-
const computeShadows = React.useCallback(() => {
|
|
1034
|
-
if (node) {
|
|
1035
|
-
const { scrollTop, clientHeight, scrollHeight } = node;
|
|
1036
|
-
const top = scrollTop !== 0;
|
|
1037
|
-
const bottom = scrollTop + clientHeight < scrollHeight;
|
|
1038
|
-
if (top && bottom) {
|
|
1039
|
-
setShadows(Shadows.both);
|
|
1040
|
-
}
|
|
1041
|
-
else if (top) {
|
|
1042
|
-
setShadows(Shadows.top);
|
|
1043
|
-
}
|
|
1044
|
-
else if (bottom) {
|
|
1045
|
-
setShadows(Shadows.bottom);
|
|
1046
|
-
}
|
|
1047
|
-
else {
|
|
1048
|
-
setShadows(Shadows.none);
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
}, [node]);
|
|
1052
|
-
// recompute when the scroll container changes in size
|
|
1053
|
-
useResizeObserver(computeShadows, node);
|
|
1054
|
-
React.useEffect(() => {
|
|
1055
|
-
if (node) {
|
|
1056
|
-
// compute initial shadows
|
|
1057
|
-
computeShadows();
|
|
1058
|
-
// listen for scroll events
|
|
1059
|
-
node.addEventListener('scroll', computeShadows);
|
|
1060
|
-
}
|
|
1061
|
-
return () => {
|
|
1062
|
-
if (node) {
|
|
1063
|
-
node.removeEventListener('scroll', computeShadows);
|
|
1064
|
-
}
|
|
1065
|
-
};
|
|
1066
|
-
}, [node, computeShadows]);
|
|
1067
|
-
return shadows;
|
|
1068
|
-
};
|
|
1069
969
|
|
|
1070
970
|
const useBoundingClientRect = (targetElement) => {
|
|
1071
971
|
const [clientRect, setClientRect] = React.useState(() => targetElement ? targetElement.getBoundingClientRect() : null);
|
|
@@ -1238,6 +1138,7 @@ const useInlineCopyClipboardShowdownExtension = () => {
|
|
|
1238
1138
|
}), [getResource]);
|
|
1239
1139
|
};
|
|
1240
1140
|
|
|
1141
|
+
/* eslint-disable max-len */
|
|
1241
1142
|
const useMultilineCopyClipboardShowdownExtension = () => {
|
|
1242
1143
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1243
1144
|
return React.useMemo(() => ({
|
|
@@ -1258,10 +1159,7 @@ const useMultilineCopyClipboardShowdownExtension = () => {
|
|
|
1258
1159
|
</div>
|
|
1259
1160
|
</div>
|
|
1260
1161
|
<div class="pf-v6-c-code-block__content">
|
|
1261
|
-
<pre class="pf-v6-c-code-block__pre pfext-code-block__pre">
|
|
1262
|
-
<code class="pf-v6-c-code-block__code"
|
|
1263
|
-
${MARKDOWN_SNIPPET_ID}="${groupId}">${group.trim()}</code>
|
|
1264
|
-
</pre>
|
|
1162
|
+
<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>
|
|
1265
1163
|
</div>
|
|
1266
1164
|
</div>`;
|
|
1267
1165
|
},
|
|
@@ -1282,16 +1180,40 @@ const markdownConvert = (markdown, extensions) => {
|
|
|
1282
1180
|
}
|
|
1283
1181
|
DOMPurify.addHook('beforeSanitizeElements', function (node) {
|
|
1284
1182
|
// nodeType 1 = element type
|
|
1183
|
+
var _a;
|
|
1285
1184
|
// transform anchor tags
|
|
1286
1185
|
if (node.nodeType === 1 && node.nodeName.toLowerCase() === 'a') {
|
|
1287
1186
|
node.setAttribute('rel', 'noopener noreferrer');
|
|
1288
1187
|
return node;
|
|
1289
1188
|
}
|
|
1290
|
-
// add PF
|
|
1291
|
-
if (node.nodeType === 1
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1189
|
+
// add PF content classes
|
|
1190
|
+
if (node.nodeType === 1) {
|
|
1191
|
+
const contentElements = [
|
|
1192
|
+
'ul',
|
|
1193
|
+
'ol',
|
|
1194
|
+
'p',
|
|
1195
|
+
'li',
|
|
1196
|
+
'hr',
|
|
1197
|
+
'h1',
|
|
1198
|
+
'h2',
|
|
1199
|
+
'h3',
|
|
1200
|
+
'h4',
|
|
1201
|
+
'h5',
|
|
1202
|
+
'h6',
|
|
1203
|
+
'blockquote',
|
|
1204
|
+
'pre',
|
|
1205
|
+
'dl',
|
|
1206
|
+
'dt',
|
|
1207
|
+
'dd',
|
|
1208
|
+
'table',
|
|
1209
|
+
];
|
|
1210
|
+
if (contentElements.includes(node.nodeName.toLowerCase())) {
|
|
1211
|
+
// don't overwrite elements already being styled by PatternFly
|
|
1212
|
+
if (!((_a = node.getAttribute('class')) === null || _a === void 0 ? void 0 : _a.includes('pf-v6-c-'))) {
|
|
1213
|
+
node.setAttribute('class', `pf-v6-c-content--${node.nodeName.toLowerCase()}`);
|
|
1214
|
+
return node;
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1295
1217
|
}
|
|
1296
1218
|
});
|
|
1297
1219
|
// Add a hook to make all links open a new window
|
|
@@ -1359,7 +1281,7 @@ const RenderExtension = ({ renderExtension, selector, markup, docContext, }) =>
|
|
|
1359
1281
|
};
|
|
1360
1282
|
const InlineMarkdownView = ({ markup, isEmpty, renderExtension, className, }) => {
|
|
1361
1283
|
const id = React.useMemo(() => uniqueId('markdown'), []);
|
|
1362
|
-
return (React.createElement("div", { className: css(
|
|
1284
|
+
return (React.createElement("div", { className: css({ 'is-empty': isEmpty }, className), id: id },
|
|
1363
1285
|
React.createElement("div", { dangerouslySetInnerHTML: { __html: markup } }),
|
|
1364
1286
|
renderExtension && (React.createElement(RenderExtension, { renderExtension: renderExtension, selector: `#${id}`, markup: markup }))));
|
|
1365
1287
|
};
|
|
@@ -1431,7 +1353,6 @@ const SELECTOR_ID = `[\\w-]+`;
|
|
|
1431
1353
|
// [linkLabel]{{action id}}
|
|
1432
1354
|
const HIGHLIGHT_REGEXP = new RegExp(`\\[(${LINK_LABEL})]{{(${HIGHLIGHT_ACTIONS.join('|')}) (${SELECTOR_ID})}}`, 'g');
|
|
1433
1355
|
|
|
1434
|
-
const removeParagraphWrap = (markdown) => markdown.replace(/^<p>|<\/p>$/g, '');
|
|
1435
1356
|
const QuickStartMarkdownView = ({ content, exactHeight, className, }) => {
|
|
1436
1357
|
const { markdown } = React.useContext(QuickStartContext);
|
|
1437
1358
|
const inlineCopyClipboardShowdownExtension = useInlineCopyClipboardShowdownExtension();
|
|
@@ -1483,7 +1404,7 @@ var AdmonitionType;
|
|
|
1483
1404
|
})(AdmonitionType || (AdmonitionType = {}));
|
|
1484
1405
|
const admonitionToAlertVariantMap = {
|
|
1485
1406
|
[AdmonitionType.NOTE]: { variant: 'info' },
|
|
1486
|
-
[AdmonitionType.TIP]: { variant: '
|
|
1407
|
+
[AdmonitionType.TIP]: { variant: 'custom', customIcon: React.createElement(LightbulbIcon, null) },
|
|
1487
1408
|
[AdmonitionType.IMPORTANT]: { variant: 'danger' },
|
|
1488
1409
|
[AdmonitionType.CAUTION]: { variant: 'warning', customIcon: React.createElement(FireIcon, null) },
|
|
1489
1410
|
[AdmonitionType.WARNING]: { variant: 'warning' },
|
|
@@ -1499,9 +1420,8 @@ React.useMemo(() => ({
|
|
|
1499
1420
|
}
|
|
1500
1421
|
admonitionType = admonitionType.toUpperCase();
|
|
1501
1422
|
const { variant, customIcon } = admonitionToAlertVariantMap[admonitionType];
|
|
1502
|
-
const style = admonitionType === AdmonitionType.CAUTION ? { backgroundColor: '#ec7a0915' } : {};
|
|
1503
1423
|
const mdContent = React.createElement(QuickStartMarkdownView, { content: content });
|
|
1504
|
-
const pfAlert = (React.createElement(Alert, { variant: variant, customIcon
|
|
1424
|
+
const pfAlert = (React.createElement(Alert, Object.assign({ variant: variant }, (customIcon && { customIcon }), { isInline: true, title: admonitionType, className: "pfext-markdown-admonition" }), mdContent));
|
|
1505
1425
|
return removeTemplateWhitespace(renderToStaticMarkup(pfAlert));
|
|
1506
1426
|
},
|
|
1507
1427
|
}), []);
|
|
@@ -1610,42 +1530,39 @@ const StatusIcon = ({ status }) => (React.createElement(Status, { status: status
|
|
|
1610
1530
|
const QuickStartTileDescription = ({ description, prerequisites, }) => {
|
|
1611
1531
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1612
1532
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
1533
|
+
const buttonRef = React.useRef(null);
|
|
1613
1534
|
return (React.createElement(React.Fragment, null,
|
|
1614
|
-
React.createElement(QuickStartMarkdownView, { content: description
|
|
1615
|
-
(prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (React.createElement(
|
|
1616
|
-
React.createElement(
|
|
1535
|
+
React.createElement(QuickStartMarkdownView, { content: description }),
|
|
1536
|
+
(prereqs === null || prereqs === void 0 ? void 0 : prereqs.length) > 0 && (React.createElement(Flex, { spaceItems: { default: 'spaceItemsSm' } },
|
|
1537
|
+
React.createElement("h5", null,
|
|
1617
1538
|
getResource('Prerequisites ({{totalPrereqs}})').replace('{{totalPrereqs}}', prereqs.length),
|
|
1618
1539
|
' '),
|
|
1619
|
-
React.createElement(
|
|
1620
|
-
|
|
1540
|
+
React.createElement(Button, { variant: "link", isInline: true, "data-testid": "qs-card-prereqs", ref: buttonRef, onClick: (e) => {
|
|
1541
|
+
e.preventDefault();
|
|
1542
|
+
e.stopPropagation();
|
|
1543
|
+
}, "aria-label": getResource('Show prerequisites') },
|
|
1544
|
+
React.createElement(InfoCircleIcon, null)),
|
|
1545
|
+
React.createElement(Popover, { "aria-label": getResource('Prerequisites'), headerContent: getResource('Prerequisites'), triggerRef: buttonRef, bodyContent: React.createElement("div", null,
|
|
1546
|
+
React.createElement("ul", { "aria-label": getResource('Prerequisites') }, prereqs.map((prerequisite, index) => (
|
|
1621
1547
|
// eslint-disable-next-line react/no-array-index-key
|
|
1622
|
-
React.createElement(
|
|
1623
|
-
React.createElement(QuickStartMarkdownView, { content: prerequisite })))))) }
|
|
1624
|
-
React.createElement(Button, { variant: "link", isInline: true, className: "pfext-quick-start-tile-prerequisites__icon", "data-testid": "qs-card-prereqs", onClick: (e) => {
|
|
1625
|
-
e.preventDefault();
|
|
1626
|
-
e.stopPropagation();
|
|
1627
|
-
}, "aria-label": getResource('Show prerequisites') },
|
|
1628
|
-
React.createElement(InfoCircleIcon, null)))))));
|
|
1548
|
+
React.createElement("li", { key: index },
|
|
1549
|
+
React.createElement(QuickStartMarkdownView, { content: prerequisite })))))) })))));
|
|
1629
1550
|
};
|
|
1630
1551
|
|
|
1631
|
-
const QuickStartTileFooter = ({ quickStartId, status, totalTasks, }) => {
|
|
1552
|
+
const QuickStartTileFooter = ({ quickStartId, status, totalTasks, onClickContinue, }) => {
|
|
1632
1553
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1633
1554
|
const { activeQuickStartID, startQuickStart, restartQuickStart } = React.useContext(QuickStartContext);
|
|
1634
|
-
const start = React.useCallback((
|
|
1635
|
-
e.preventDefault();
|
|
1636
|
-
e.stopPropagation();
|
|
1555
|
+
const start = React.useCallback(() => {
|
|
1637
1556
|
startQuickStart(quickStartId, totalTasks);
|
|
1638
1557
|
}, [quickStartId, startQuickStart, totalTasks]);
|
|
1639
|
-
const restart = React.useCallback((
|
|
1640
|
-
e.preventDefault();
|
|
1641
|
-
e.stopPropagation();
|
|
1558
|
+
const restart = React.useCallback(() => {
|
|
1642
1559
|
restartQuickStart(quickStartId, totalTasks);
|
|
1643
1560
|
}, [quickStartId, restartQuickStart, totalTasks]);
|
|
1644
1561
|
return (React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
|
|
1645
1562
|
status === QuickStartStatus.NOT_STARTED && (React.createElement(FlexItem, null,
|
|
1646
1563
|
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')))),
|
|
1647
1564
|
status === QuickStartStatus.IN_PROGRESS && activeQuickStartID !== quickStartId && (React.createElement(FlexItem, null,
|
|
1648
|
-
React.createElement(Button, { variant: "link", isInline: true, "data-testid": "qs-card-inProgress-resume", id: `${quickStartId}-continue`, "aria-labelledby": `${quickStartId}-continue ${quickStartId}` }, getResource('Continue')))),
|
|
1565
|
+
React.createElement(Button, { variant: "link", onClick: onClickContinue, isInline: true, "data-testid": "qs-card-inProgress-resume", id: `${quickStartId}-continue`, "aria-labelledby": `${quickStartId}-continue ${quickStartId}` }, getResource('Continue')))),
|
|
1649
1566
|
status === QuickStartStatus.COMPLETE && (React.createElement(FlexItem, null,
|
|
1650
1567
|
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')))),
|
|
1651
1568
|
status === QuickStartStatus.IN_PROGRESS && (React.createElement(FlexItem, null,
|
|
@@ -1659,42 +1576,43 @@ const QuickStartTileFooterExternal = ({ link, quickStartId, }) => {
|
|
|
1659
1576
|
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))));
|
|
1660
1577
|
};
|
|
1661
1578
|
|
|
1662
|
-
const
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1579
|
+
const QuickStartTileHeader = ({ name, quickStartId, onSelect, }) => {
|
|
1580
|
+
return (React.createElement(Flex, { flexWrap: { default: 'nowrap' } },
|
|
1581
|
+
React.createElement(Title, { headingLevel: "h3", "data-test": "title", id: quickStartId },
|
|
1582
|
+
React.createElement(Button, { variant: "link", isInline: true, onClick: onSelect },
|
|
1583
|
+
React.createElement(QuickStartMarkdownView, { content: name })))));
|
|
1666
1584
|
};
|
|
1667
|
-
|
|
1668
|
-
|
|
1585
|
+
|
|
1586
|
+
const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, action, }) => {
|
|
1587
|
+
const { metadata: { name: id }, spec: { icon, tasks, displayName, description, durationMinutes, prerequisites, link, type }, } = quickStart;
|
|
1588
|
+
const { setActiveQuickStart, footer, getResource } = React.useContext(QuickStartContext);
|
|
1589
|
+
const statusColorMap = {
|
|
1590
|
+
[QuickStartStatus.COMPLETE]: 'green',
|
|
1591
|
+
[QuickStartStatus.IN_PROGRESS]: 'purple',
|
|
1592
|
+
[QuickStartStatus.NOT_STARTED]: 'grey',
|
|
1593
|
+
};
|
|
1669
1594
|
const statusLocaleMap = {
|
|
1670
1595
|
[QuickStartStatus.COMPLETE]: getResource('Complete'),
|
|
1671
1596
|
[QuickStartStatus.IN_PROGRESS]: getResource('In progress'),
|
|
1672
1597
|
[QuickStartStatus.NOT_STARTED]: getResource('Not started'),
|
|
1673
1598
|
};
|
|
1674
|
-
const ActionIcon = (action === null || action === void 0 ? void 0 : action.icon) || OutlinedBookmarkIcon;
|
|
1675
|
-
return (React.createElement("div", { className: "pfext-quick-start-tile-header" },
|
|
1676
|
-
React.createElement(Flex, { flexWrap: { default: 'nowrap' } },
|
|
1677
|
-
React.createElement(Title, { headingLevel: "h3", "data-test": "title", id: quickStartId },
|
|
1678
|
-
React.createElement(QuickStartMarkdownView, { content: name })),
|
|
1679
|
-
action && (React.createElement(Button, Object.assign({ "aria-label": action['aria-label'], icon: React.createElement(ActionIcon, null), variant: "plain", onClick: action.onClick }, action.buttonProps)))),
|
|
1680
|
-
React.createElement("div", { className: "pfext-quick-start-tile-header__status" },
|
|
1681
|
-
type && (React.createElement(Label, { className: "pfext-quick-start-tile-header--margin", color: type.color }, type.text)),
|
|
1682
|
-
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))),
|
|
1683
|
-
status !== QuickStartStatus.NOT_STARTED && (React.createElement(Label, { variant: "outline", color: statusColorMap[status], icon: React.createElement(StatusIcon, { status: status }), "data-test": "status" }, statusLocaleMap[status])))));
|
|
1684
|
-
};
|
|
1685
|
-
|
|
1686
|
-
const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, action, }) => {
|
|
1687
|
-
const { metadata: { name: id }, spec: { icon, tasks, displayName, description, durationMinutes, prerequisites, link, type }, } = quickStart;
|
|
1688
|
-
const { setActiveQuickStart, footer } = React.useContext(QuickStartContext);
|
|
1689
|
-
const ref = React.useRef(null);
|
|
1690
1599
|
let quickStartIcon;
|
|
1691
1600
|
if (typeof icon === 'object') {
|
|
1692
|
-
quickStartIcon = React.createElement(Icon, { size: "
|
|
1601
|
+
quickStartIcon = React.createElement(Icon, { size: "2xl" }, icon);
|
|
1693
1602
|
}
|
|
1694
1603
|
else {
|
|
1695
|
-
quickStartIcon = (React.createElement(Icon, { size: "
|
|
1696
|
-
React.createElement(FallbackImg, { className: "pfext-catalog-item-icon__img
|
|
1604
|
+
quickStartIcon = (React.createElement(Icon, { size: "2xl" },
|
|
1605
|
+
React.createElement(FallbackImg, { src: icon, alt: "", className: "pfext-catalog-item-icon__img", fallback: React.createElement(RocketIcon, null) })));
|
|
1697
1606
|
}
|
|
1607
|
+
const onSelect = () => {
|
|
1608
|
+
if (!link) {
|
|
1609
|
+
setActiveQuickStart(id, tasks === null || tasks === void 0 ? void 0 : tasks.length);
|
|
1610
|
+
}
|
|
1611
|
+
else {
|
|
1612
|
+
window.open(link.href, '_blank', 'noopener,noreferrer');
|
|
1613
|
+
}
|
|
1614
|
+
onClick();
|
|
1615
|
+
};
|
|
1698
1616
|
const footerComponent = React.useMemo(() => {
|
|
1699
1617
|
if (footer && footer.show === false) {
|
|
1700
1618
|
return null;
|
|
@@ -1702,52 +1620,44 @@ const QuickStartTile = ({ quickStart, status, isActive, onClick = () => { }, act
|
|
|
1702
1620
|
if (link) {
|
|
1703
1621
|
return React.createElement(QuickStartTileFooterExternal, { link: link, quickStartId: id });
|
|
1704
1622
|
}
|
|
1705
|
-
return React.createElement(QuickStartTileFooter, { quickStartId: id, status: status, totalTasks: tasks === null || tasks === void 0 ? void 0 : tasks.length });
|
|
1623
|
+
return (React.createElement(QuickStartTileFooter, { quickStartId: id, status: status, totalTasks: tasks === null || tasks === void 0 ? void 0 : tasks.length, onClickContinue: onSelect }));
|
|
1706
1624
|
}, [footer, id, link, status, tasks === null || tasks === void 0 ? void 0 : tasks.length]);
|
|
1707
|
-
const
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
setActiveQuickStart(id, tasks === null || tasks === void 0 ? void 0 : tasks.length);
|
|
1729
|
-
onClick();
|
|
1730
|
-
}
|
|
1731
|
-
} }, linkProps, { "data-test": `tile ${id}`, description: React.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }), footer: footerComponent, tabIndex: 0,
|
|
1732
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1733
|
-
// @ts-ignore-next-line
|
|
1734
|
-
isSelectableRaised: true }))));
|
|
1625
|
+
const ActionIcon = (action === null || action === void 0 ? void 0 : action.icon) || OutlinedBookmarkIcon;
|
|
1626
|
+
const additionalAction = action ? (React.createElement(Button, Object.assign({ "aria-label": action['aria-label'], icon: React.createElement(ActionIcon, null), variant: "plain", onClick: action.onClick }, action.buttonProps))) : undefined;
|
|
1627
|
+
return (React.createElement(Card, Object.assign({ id: `${id}-catalog-tile`, style: { height: '100%' }, "data-testid": `qs-card-${camelize(displayName)}` }, (isActive && {
|
|
1628
|
+
isClickable: true,
|
|
1629
|
+
isSelectable: true,
|
|
1630
|
+
isSelected: true,
|
|
1631
|
+
isClicked: true,
|
|
1632
|
+
})),
|
|
1633
|
+
React.createElement(CardHeader, Object.assign({}, (action && {
|
|
1634
|
+
actions: { actions: additionalAction },
|
|
1635
|
+
})), quickStartIcon),
|
|
1636
|
+
React.createElement(CardTitle, null,
|
|
1637
|
+
React.createElement(QuickStartTileHeader, { name: displayName, onSelect: onSelect, quickStartId: id })),
|
|
1638
|
+
React.createElement(CardBody, null,
|
|
1639
|
+
React.createElement(Stack, { hasGutter: true },
|
|
1640
|
+
React.createElement(Flex, { spaceItems: { default: 'spaceItemsSm' } },
|
|
1641
|
+
type && React.createElement(Label, { color: type.color }, type.text),
|
|
1642
|
+
durationMinutes && (React.createElement(Label, { variant: "outline", "data-test": "duration", icon: React.createElement(OutlinedClockIcon, null) }, getResource('{{duration, number}} minutes', durationMinutes).replace('{{duration, number}}', durationMinutes))),
|
|
1643
|
+
status !== QuickStartStatus.NOT_STARTED && (React.createElement(Label, { variant: "outline", color: statusColorMap[status], icon: React.createElement(StatusIcon, { status: status }), "data-test": "status" }, statusLocaleMap[status]))),
|
|
1644
|
+
React.createElement(QuickStartTileDescription, { description: description, prerequisites: prerequisites }))),
|
|
1645
|
+
React.createElement(CardFooter, null, footerComponent)));
|
|
1735
1646
|
};
|
|
1736
1647
|
|
|
1737
1648
|
const QuickStartCatalog = ({ quickStarts }) => {
|
|
1738
1649
|
const { activeQuickStartID, allQuickStartStates } = React.useContext(QuickStartContext);
|
|
1739
|
-
return (React.createElement("div",
|
|
1740
|
-
React.createElement(Gallery, {
|
|
1650
|
+
return (React.createElement("div", null,
|
|
1651
|
+
React.createElement(Gallery, { hasGutter: true }, quickStarts.map((quickStart, index) => {
|
|
1741
1652
|
const { metadata: { name: id }, } = quickStart;
|
|
1742
|
-
return (React.createElement(
|
|
1743
|
-
React.createElement(QuickStartTile, { quickStart: quickStart, isActive: id === activeQuickStartID, status: getQuickStartStatus(allQuickStartStates, id) })));
|
|
1653
|
+
return (React.createElement(QuickStartTile, { key: index, quickStart: quickStart, isActive: id === activeQuickStartID, status: getQuickStartStatus(allQuickStartStates, id) }));
|
|
1744
1654
|
}))));
|
|
1745
1655
|
};
|
|
1746
1656
|
|
|
1747
1657
|
const QuickStartCatalogFilterSearch = (_a) => {
|
|
1748
1658
|
var { searchInputText, handleTextChange } = _a, props = __rest(_a, ["searchInputText", "handleTextChange"]);
|
|
1749
1659
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1750
|
-
return (React.createElement(ToolbarItem,
|
|
1660
|
+
return (React.createElement(ToolbarItem, null,
|
|
1751
1661
|
React.createElement(SearchInput, Object.assign({ placeholder: getResource('Filter by keyword...'), value: searchInputText, onChange: (_ev, value) => handleTextChange(value), onClear: () => handleTextChange('') }, props))));
|
|
1752
1662
|
};
|
|
1753
1663
|
const QuickStartCatalogFilterSelect = (_a) => {
|
|
@@ -1762,7 +1672,7 @@ const QuickStartCatalogFilterSelect = (_a) => {
|
|
|
1762
1672
|
};
|
|
1763
1673
|
const QuickStartCatalogFilterCount = ({ quickStartsCount }) => {
|
|
1764
1674
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1765
|
-
return (React.createElement(ToolbarItem, {
|
|
1675
|
+
return (React.createElement(ToolbarItem, { align: { default: 'alignEnd' } }, getResource('{{count, number}} item', quickStartsCount).replace('{{count, number}}', quickStartsCount)));
|
|
1766
1676
|
};
|
|
1767
1677
|
const QuickStartCatalogFilterSearchWrapper = ({ onSearchInputChange = () => { } }) => {
|
|
1768
1678
|
const { useQueryParams, filter, setFilter } = React.useContext(QuickStartContext);
|
|
@@ -1852,7 +1762,7 @@ const QuickStartCatalogFilterCountWrapper = ({ quickStartsCount }) => React.crea
|
|
|
1852
1762
|
|
|
1853
1763
|
const QuickStartCatalogFilter = (_a) => {
|
|
1854
1764
|
var { quickStartsCount, onSearchInputChange = () => { }, onStatusChange = () => { } } = _a, props = __rest(_a, ["quickStartsCount", "onSearchInputChange", "onStatusChange"]);
|
|
1855
|
-
return (React.createElement(Toolbar, Object.assign({
|
|
1765
|
+
return (React.createElement(Toolbar, Object.assign({}, props),
|
|
1856
1766
|
React.createElement(ToolbarContent, null,
|
|
1857
1767
|
React.createElement(QuickStartCatalogFilterSearchWrapper, { onSearchInputChange: onSearchInputChange }),
|
|
1858
1768
|
React.createElement(QuickStartCatalogFilterStatusWrapper, { onStatusChange: onStatusChange }),
|
|
@@ -1928,28 +1838,29 @@ const QuickStartCatalogPage = ({ quickStarts, showFilter, sortFnc = (q1, q2) =>
|
|
|
1928
1838
|
if (!allQuickStarts || allQuickStarts.length === 0) {
|
|
1929
1839
|
return React.createElement(EmptyBox, { label: getResource('Quick Starts') });
|
|
1930
1840
|
}
|
|
1931
|
-
return (React.createElement(
|
|
1932
|
-
showTitle && (React.createElement(
|
|
1933
|
-
React.createElement(
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
React.createElement(
|
|
1938
|
-
|
|
1939
|
-
|
|
1841
|
+
return (React.createElement(React.Fragment, null,
|
|
1842
|
+
(showTitle || showFilter) && (React.createElement(PageSection, { hasBodyWrapper: false },
|
|
1843
|
+
showTitle && (React.createElement(React.Fragment, null,
|
|
1844
|
+
React.createElement(Content, { component: "h1", "data-test": "page-title" }, title || getResource('Quick Starts')),
|
|
1845
|
+
hint && React.createElement("div", null, hint))),
|
|
1846
|
+
showTitle && React.createElement(Divider, { component: "div" }),
|
|
1847
|
+
showFilter && (React.createElement(React.Fragment, null,
|
|
1848
|
+
React.createElement(QuickStartCatalogFilter, { quickStartsCount: filteredQuickStarts.length, onSearchInputChange: onSearchInputChange, onStatusChange: onStatusChange }),
|
|
1849
|
+
React.createElement(Divider, { component: "div" }))))),
|
|
1850
|
+
React.createElement(PageSection, { hasBodyWrapper: false }, filteredQuickStarts.length === 0 ? (React.createElement(QuickStartCatalogEmptyState, { clearFilters: clearFilters })) : (React.createElement(QuickStartCatalog, { quickStarts: filteredQuickStarts })))));
|
|
1940
1851
|
};
|
|
1941
1852
|
|
|
1942
|
-
const QuickStartCatalogHeader = ({ title, hint, }) => (React.createElement("div",
|
|
1943
|
-
React.createElement("h1",
|
|
1944
|
-
hint && React.createElement("div",
|
|
1853
|
+
const QuickStartCatalogHeader = ({ title, hint, }) => (React.createElement("div", null,
|
|
1854
|
+
React.createElement(Title, { headingLevel: "h1", "data-pf-content": "true" }, title),
|
|
1855
|
+
hint && React.createElement("div", null, hint)));
|
|
1945
1856
|
|
|
1946
|
-
const QuickStartCatalogSection = ({ children }) => (React.createElement("div",
|
|
1857
|
+
const QuickStartCatalogSection = ({ children }) => (React.createElement("div", null, children));
|
|
1947
1858
|
|
|
1948
|
-
const QuickStartCatalogToolbar = ({ children }) => (React.createElement(Toolbar,
|
|
1859
|
+
const QuickStartCatalogToolbar = ({ children }) => (React.createElement(Toolbar, null, children));
|
|
1949
1860
|
|
|
1950
1861
|
const QuickStartCloseModal = ({ isOpen, onConfirm, onCancel, }) => {
|
|
1951
1862
|
const { getResource } = React.useContext(QuickStartContext);
|
|
1952
|
-
return (React.createElement(Modal, {
|
|
1863
|
+
return (React.createElement(Modal, { isOpen: isOpen, variant: ModalVariant.small, showClose: false, "data-test": "leave-quickstart", title: getResource('Leave quick start?'), footer: React.createElement(Flex, null,
|
|
1953
1864
|
React.createElement(FlexItem, { align: { default: 'alignRight' } },
|
|
1954
1865
|
React.createElement(Button, { variant: "secondary", "data-test": "cancel button", onClick: onCancel }, getResource('Cancel'))),
|
|
1955
1866
|
React.createElement(FlexItem, null,
|
|
@@ -1965,29 +1876,28 @@ const QuickStartTaskHeader = ({ title, taskIndex, subtitle, taskStatus, size, is
|
|
|
1965
1876
|
titleRef.current.parentNode.focus();
|
|
1966
1877
|
}
|
|
1967
1878
|
}, [focusOnQuickStart, isActiveTask]);
|
|
1968
|
-
css('pfext-quick-start-task-header__title', {
|
|
1969
|
-
'pfext-quick-start-task-header__title-success': taskStatus === QuickStartTaskStatus.SUCCESS,
|
|
1970
|
-
'pfext-quick-start-task-header__title-failed': taskStatus === (QuickStartTaskStatus.FAILED || QuickStartTaskStatus.VISITED),
|
|
1971
|
-
});
|
|
1972
|
-
// const notCompleted = taskStatus === QuickStartTaskStatus.VISITED;
|
|
1973
|
-
// const skippedReview = taskStatus === QuickStartTaskStatus.REVIEW;
|
|
1974
1879
|
const failedReview = taskStatus === QuickStartTaskStatus.FAILED;
|
|
1975
|
-
// TODO: toned down when this is shown, investigate further when we should display it
|
|
1976
|
-
// related: https://github.com/patternfly/patternfly-quickstarts/issues/104
|
|
1977
1880
|
const tryAgain = failedReview && (React.createElement(React.Fragment, null,
|
|
1978
1881
|
React.createElement("div", null),
|
|
1979
1882
|
React.createElement("div", { className: "pfext-quick-start-task-header__tryagain" }, "Try the steps again.")));
|
|
1980
1883
|
const content = (React.createElement("div", { ref: titleRef },
|
|
1981
|
-
React.createElement(Title, { headingLevel: "h3" },
|
|
1982
|
-
React.createElement("span", {
|
|
1983
|
-
isActiveTask && subtitle && (React.createElement("span",
|
|
1884
|
+
React.createElement(Title, { headingLevel: "h3", size: size },
|
|
1885
|
+
React.createElement("span", { className: "pfext-quick-start-task-header__title" }, title),
|
|
1886
|
+
isActiveTask && subtitle && (React.createElement("span", null,
|
|
1984
1887
|
' ',
|
|
1985
|
-
React.createElement(
|
|
1888
|
+
React.createElement("span", { "data-test-id": "quick-start-task-subtitle", className: "pfext-quick-start-task-header__subtitle" }, subtitle))),
|
|
1986
1889
|
tryAgain)));
|
|
1987
|
-
|
|
1890
|
+
let status = 'default';
|
|
1891
|
+
if (taskStatus === QuickStartTaskStatus.FAILED) {
|
|
1892
|
+
status = 'error';
|
|
1893
|
+
}
|
|
1894
|
+
else if (taskStatus === QuickStartTaskStatus.SUCCESS) {
|
|
1895
|
+
status = 'success';
|
|
1896
|
+
}
|
|
1897
|
+
return (React.createElement(WizardNavItem, { content: content, stepIndex: taskIndex, onClick: () => onTaskSelect(taskIndex - 1), component: "button", isCurrent: isActiveTask, status: status }, children));
|
|
1988
1898
|
};
|
|
1989
1899
|
|
|
1990
|
-
const QuickStartTaskHeaderList = ({ tasks, allTaskStatuses, onTaskSelect, }) => tasks.length > 0 ? (React.createElement(
|
|
1900
|
+
const QuickStartTaskHeaderList = ({ tasks, allTaskStatuses, onTaskSelect, }) => (tasks === null || tasks === void 0 ? void 0 : tasks.length) > 0 ? (React.createElement("div", { className: "pf-v6-c-wizard__nav-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;
|
|
1991
1901
|
|
|
1992
1902
|
const QuickStartConclusion = ({ tasks, conclusion, allTaskStatuses, nextQuickStarts, onQuickStartChange, onTaskSelect, }) => {
|
|
1993
1903
|
const hasFailedTask = allTaskStatuses.includes(QuickStartTaskStatus.FAILED);
|
|
@@ -2002,10 +1912,7 @@ const QuickStartConclusion = ({ tasks, conclusion, allTaskStatuses, nextQuickSta
|
|
|
2002
1912
|
nextQuickStarts.length > 0 &&
|
|
2003
1913
|
nextQuickStarts.map((nextQuickStart, index) => {
|
|
2004
1914
|
var _a;
|
|
2005
|
-
return (React.createElement(Button, { variant: "link", onClick: () => onQuickStartChange(nextQuickStart.metadata.name), isInline: true, isBlock: true, key: index },
|
|
2006
|
-
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),
|
|
2007
|
-
' ',
|
|
2008
|
-
React.createElement(ArrowRightIcon, { style: { marginLeft: 'var(--pf-t--global--spacer--xs)', verticalAlign: 'middle' } })));
|
|
1915
|
+
return (React.createElement(Button, { variant: "link", onClick: () => onQuickStartChange(nextQuickStart.metadata.name), isInline: true, icon: React.createElement(ArrowRightIcon, 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)));
|
|
2009
1916
|
})));
|
|
2010
1917
|
};
|
|
2011
1918
|
|
|
@@ -2013,15 +1920,14 @@ const QuickStartIntroduction = ({ tasks, introduction, allTaskStatuses, prerequi
|
|
|
2013
1920
|
const { getResource } = React.useContext(QuickStartContext);
|
|
2014
1921
|
const prereqs = prerequisites === null || prerequisites === void 0 ? void 0 : prerequisites.filter((p) => p);
|
|
2015
1922
|
const [isPrereqsExpanded, setIsPrereqsExpanded] = React.useState(false);
|
|
2016
|
-
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)
|
|
2017
|
-
React.createElement(List,
|
|
2018
|
-
React.createElement(
|
|
2019
|
-
|
|
2020
|
-
return (React.createElement(React.Fragment, null,
|
|
1923
|
+
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) },
|
|
1924
|
+
React.createElement(List, null, prereqs.map((pr) => (React.createElement(ListItem, { key: pr },
|
|
1925
|
+
React.createElement(QuickStartMarkdownView, { content: pr })))))));
|
|
1926
|
+
return (React.createElement(Stack, { hasGutter: true },
|
|
2021
1927
|
React.createElement(QuickStartMarkdownView, { content: introduction }),
|
|
2022
1928
|
prereqList,
|
|
2023
|
-
React.createElement("p",
|
|
2024
|
-
getResource('In this quick start, you will complete {{count, number}} task', tasks.length).replace('{{count, number}}', tasks.length),
|
|
1929
|
+
React.createElement("p", null,
|
|
1930
|
+
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),
|
|
2025
1931
|
":"),
|
|
2026
1932
|
React.createElement(QuickStartTaskHeaderList, { tasks: tasks, allTaskStatuses: allTaskStatuses, onTaskSelect: onTaskSelect })));
|
|
2027
1933
|
};
|
|
@@ -2039,12 +1945,9 @@ const getAlertVariant = (status) => {
|
|
|
2039
1945
|
const QuickStartTaskReview = ({ review, taskStatus, onTaskReview, }) => {
|
|
2040
1946
|
const { instructions, failedTaskHelp: taskHelp } = review;
|
|
2041
1947
|
const { getResource } = React.useContext(QuickStartContext);
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
});
|
|
2046
|
-
const title = React.createElement("span", { className: alertClassNames }, getResource('Check your work'));
|
|
2047
|
-
return (React.createElement(Alert, { className: "pfext-quick-start-task-review-alert", variant: getAlertVariant(taskStatus), title: title, isInline: true, role: "alert" },
|
|
1948
|
+
return (React.createElement(Alert, { variant: getAlertVariant(taskStatus), title: getResource('Check your work'), isInline: true, role: "alert", style: {
|
|
1949
|
+
marginBottom: 'var(--pf-t--global--spacer--md)',
|
|
1950
|
+
} },
|
|
2048
1951
|
React.createElement(QuickStartMarkdownView, { content: instructions }),
|
|
2049
1952
|
React.createElement("span", { className: "pfext-quick-start-task-review__actions" },
|
|
2050
1953
|
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) }),
|
|
@@ -2054,7 +1957,7 @@ const QuickStartTaskReview = ({ review, taskStatus, onTaskReview, }) => {
|
|
|
2054
1957
|
|
|
2055
1958
|
const QuickStartTasks = ({ tasks, taskNumber, allTaskStatuses, onTaskReview, onTaskSelect, }) => {
|
|
2056
1959
|
const { getResource, alwaysShowTaskReview } = React.useContext(QuickStartContext);
|
|
2057
|
-
return (React.createElement("div", { className: "
|
|
1960
|
+
return (React.createElement("div", { className: "pf-v6-c-wizard__nav-list", style: { padding: '0 0 0 0' } },
|
|
2058
1961
|
React.createElement("ul", null, tasks
|
|
2059
1962
|
.filter((_, index) => allTaskStatuses[index] !== QuickStartTaskStatus.INIT)
|
|
2060
1963
|
.map((task, index) => {
|
|
@@ -2066,7 +1969,7 @@ const QuickStartTasks = ({ tasks, taskNumber, allTaskStatuses, onTaskReview, onT
|
|
|
2066
1969
|
return (React.createElement(React.Fragment, { key: title },
|
|
2067
1970
|
React.createElement(QuickStartTaskHeader, { taskIndex: index + 1, title: title, size: "md", subtitle: getResource('{{index, number}} of {{tasks, number}}')
|
|
2068
1971
|
.replace('{{index, number}}', index + 1)
|
|
2069
|
-
.replace('{{tasks, number}}', tasks.length), taskStatus: taskStatus, isActiveTask: isActiveTask, onTaskSelect: onTaskSelect }, isActiveTask && (React.createElement(
|
|
1972
|
+
.replace('{{tasks, number}}', tasks.length), taskStatus: taskStatus, isActiveTask: isActiveTask, onTaskSelect: onTaskSelect }, isActiveTask && (React.createElement(Stack, { hasGutter: true },
|
|
2070
1973
|
React.createElement(QuickStartMarkdownView, { content: description }),
|
|
2071
1974
|
shouldShowTaskReview && (React.createElement(QuickStartTaskReview, { review: review, taskStatus: taskStatus, onTaskReview: onTaskReview })))))));
|
|
2072
1975
|
}))));
|
|
@@ -2074,14 +1977,14 @@ const QuickStartTasks = ({ tasks, taskNumber, allTaskStatuses, onTaskReview, onT
|
|
|
2074
1977
|
|
|
2075
1978
|
const QuickStartContent = React.forwardRef(({ quickStart, nextQuickStarts = [], taskNumber, allTaskStatuses, onTaskSelect, onTaskReview, onQuickStartChange, }, ref) => {
|
|
2076
1979
|
const { spec: { introduction, tasks, conclusion, prerequisites }, } = quickStart;
|
|
2077
|
-
const totalTasks = tasks.length;
|
|
2078
|
-
return (React.createElement("div", { className: "pfext-quick-start-
|
|
1980
|
+
const totalTasks = tasks === null || tasks === void 0 ? void 0 : tasks.length;
|
|
1981
|
+
return (React.createElement("div", { className: "pfext-quick-start-task", ref: ref },
|
|
2079
1982
|
taskNumber === -1 && (React.createElement(QuickStartIntroduction, { tasks: tasks, allTaskStatuses: allTaskStatuses, introduction: introduction, prerequisites: prerequisites, onTaskSelect: onTaskSelect })),
|
|
2080
1983
|
taskNumber > -1 && taskNumber < totalTasks && (React.createElement(QuickStartTasks, { tasks: tasks, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskReview: onTaskReview, onTaskSelect: onTaskSelect })),
|
|
2081
1984
|
taskNumber === totalTasks && (React.createElement(QuickStartConclusion, { tasks: tasks, conclusion: conclusion, allTaskStatuses: allTaskStatuses, nextQuickStarts: nextQuickStarts, onQuickStartChange: onQuickStartChange, onTaskSelect: onTaskSelect }))));
|
|
2082
1985
|
});
|
|
2083
1986
|
|
|
2084
|
-
const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack,
|
|
1987
|
+
const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack, quickStartId, className, }) => {
|
|
2085
1988
|
const { restartQuickStart, getResource } = React.useContext(QuickStartContext);
|
|
2086
1989
|
const PrimaryButtonText = React.useMemo(() => ({
|
|
2087
1990
|
START: getResource('Start'),
|
|
@@ -2110,13 +2013,16 @@ const QuickStartFooter = ({ status, taskNumber, totalTasks, onNext, onBack, foot
|
|
|
2110
2013
|
}
|
|
2111
2014
|
return PrimaryButtonText.CONTINUE;
|
|
2112
2015
|
}, [taskNumber, totalTasks, PrimaryButtonText, status]);
|
|
2113
|
-
const getPrimaryButton = React.useMemo(() => (React.createElement(Button, { variant: "primary",
|
|
2016
|
+
const getPrimaryButton = React.useMemo(() => (React.createElement(Button, { variant: "primary", onClick: onNext, "data-testid": `qs-drawer-${camelize(getPrimaryButtonText)}`, "data-test": `${getPrimaryButtonText} button` }, getPrimaryButtonText)), [getPrimaryButtonText, onNext]);
|
|
2114
2017
|
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]);
|
|
2115
|
-
const getSideNoteAction = React.useMemo(() => taskNumber !== -1 && (React.createElement(Button, { variant: "link",
|
|
2116
|
-
return (React.createElement("div", { className:
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2018
|
+
const getSideNoteAction = React.useMemo(() => taskNumber !== -1 && (React.createElement(Button, { variant: "link", onClick: onRestart, "data-testid": "qs-drawer-side-note-action" }, SecondaryButtonText.RESTART)), [taskNumber, onRestart, SecondaryButtonText.RESTART]);
|
|
2019
|
+
return (React.createElement("div", { className: css('pfext-quick-start-footer', className) },
|
|
2020
|
+
React.createElement(ActionList, null,
|
|
2021
|
+
React.createElement(ActionListGroup, null,
|
|
2022
|
+
React.createElement(ActionListItem, null, getPrimaryButton),
|
|
2023
|
+
React.createElement(ActionListItem, null, getSecondaryButton)),
|
|
2024
|
+
React.createElement(ActionListGroup, null,
|
|
2025
|
+
React.createElement(ActionListItem, null, getSideNoteAction)))));
|
|
2120
2026
|
};
|
|
2121
2027
|
|
|
2122
2028
|
const QuickStartController = ({ quickStart, nextQuickStarts, contentRef, footerClass, }) => {
|
|
@@ -2155,7 +2061,7 @@ const QuickStartController = ({ quickStart, nextQuickStarts, contentRef, footerC
|
|
|
2155
2061
|
}, [name, setQuickStartTaskNumber]);
|
|
2156
2062
|
return (React.createElement(React.Fragment, null,
|
|
2157
2063
|
React.createElement(QuickStartContent, { quickStart: quickStart, nextQuickStarts: nextQuickStarts, taskNumber: taskNumber, allTaskStatuses: allTaskStatuses, onTaskSelect: handleTaskSelect, onTaskReview: handleTaskStatusChange, onQuickStartChange: handleQuickStartChange, ref: contentRef }),
|
|
2158
|
-
React.createElement(QuickStartFooter, { status: status, taskNumber: taskNumber, totalTasks: totalTasks, onNext: handleNext, onBack: handleBack,
|
|
2064
|
+
React.createElement(QuickStartFooter, { status: status, taskNumber: taskNumber, totalTasks: totalTasks, onNext: handleNext, onBack: handleBack, className: footerClass, quickStartId: quickStart.metadata.name })));
|
|
2159
2065
|
};
|
|
2160
2066
|
|
|
2161
2067
|
const getElement = (appendTo) => {
|
|
@@ -2172,24 +2078,17 @@ const useScrollTopOnTaskNumberChange = (node, taskNumber) => {
|
|
|
2172
2078
|
}, [taskNumber, node]);
|
|
2173
2079
|
};
|
|
2174
2080
|
const QuickStartPanelContent = (_a) => {
|
|
2175
|
-
var { quickStarts = [], handleClose, activeQuickStartID, appendTo, isResizable = true, showClose = true,
|
|
2081
|
+
var { quickStarts = [], handleClose, activeQuickStartID, appendTo, isResizable = true, showClose = true, footerClass } = _a, props = __rest(_a, ["quickStarts", "handleClose", "activeQuickStartID", "appendTo", "isResizable", "showClose", "footerClass"]);
|
|
2176
2082
|
const titleRef = React.useRef(null);
|
|
2177
2083
|
const { getResource, activeQuickStartState, focusOnQuickStart } = React.useContext(QuickStartContext);
|
|
2178
2084
|
const [contentRef, setContentRef] = React.useState();
|
|
2179
|
-
const shadows = useScrollShadows(contentRef);
|
|
2180
2085
|
const quickStart = quickStarts.find((qs) => qs.metadata.name === activeQuickStartID);
|
|
2181
2086
|
const taskNumber = activeQuickStartState === null || activeQuickStartState === void 0 ? void 0 : activeQuickStartState.taskNumber;
|
|
2182
2087
|
useScrollTopOnTaskNumberChange(contentRef, taskNumber);
|
|
2183
2088
|
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); });
|
|
2184
|
-
const headerClasses = css('pfext-quick-start-panel-content__header', {
|
|
2185
|
-
'pfext-quick-start-panel-content__header__shadow': shadows === Shadows.top || shadows === Shadows.both,
|
|
2186
|
-
'pfext-quick-start-panel-content__header--blue-white': headerVariant === 'blue-white',
|
|
2187
|
-
});
|
|
2188
|
-
const footerClass = css({
|
|
2189
|
-
'pfext-quick-start-panel-content__footer__shadow': shadows === Shadows.bottom || shadows === Shadows.both,
|
|
2190
|
-
});
|
|
2191
2089
|
const getStep = () => {
|
|
2192
|
-
|
|
2090
|
+
var _a;
|
|
2091
|
+
const tasks = ((_a = quickStart.spec.tasks) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
2193
2092
|
if (Number.parseInt(taskNumber) === -1) {
|
|
2194
2093
|
return 'intro';
|
|
2195
2094
|
}
|
|
@@ -2203,23 +2102,21 @@ const QuickStartPanelContent = (_a) => {
|
|
|
2203
2102
|
titleRef.current.focus();
|
|
2204
2103
|
}
|
|
2205
2104
|
}, [focusOnQuickStart, quickStart]);
|
|
2206
|
-
const content = quickStart ? (React.createElement(DrawerPanelContent, Object.assign({ isResizable: isResizable,
|
|
2207
|
-
React.createElement("div", { className:
|
|
2105
|
+
const content = quickStart ? (React.createElement(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),
|
|
2106
|
+
React.createElement("div", { className: "pfext-quick-start-panel-content" },
|
|
2208
2107
|
React.createElement(DrawerHead, null,
|
|
2209
|
-
React.createElement("div", {
|
|
2210
|
-
React.createElement(Title, { headingLevel: "h2", size: "xl",
|
|
2211
|
-
React.createElement("span",
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
' ',
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
.replace('{{type}}', getResource('Type'))
|
|
2219
|
-
: getResource('Type')))),
|
|
2108
|
+
React.createElement("div", { tabIndex: -1, ref: titleRef },
|
|
2109
|
+
React.createElement(Title, { headingLevel: "h2", size: "xl", style: { marginRight: 'var(--pf-t--global--spacer--md)' } },
|
|
2110
|
+
React.createElement("span", null, quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.displayName),
|
|
2111
|
+
' '),
|
|
2112
|
+
React.createElement("span", null, (quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
2113
|
+
? getResource('{{type}} • {{duration, number}} minutes', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
2114
|
+
.replace('{{duration, number}}', quickStart === null || quickStart === void 0 ? void 0 : quickStart.spec.durationMinutes)
|
|
2115
|
+
.replace('{{type}}', getResource('Type'))
|
|
2116
|
+
: getResource('Type'))),
|
|
2220
2117
|
showClose && (React.createElement(DrawerActions, null,
|
|
2221
2118
|
React.createElement(DrawerCloseButton, { onClick: handleClose, className: "pfext-quick-start-panel-content__close-button", "data-testid": "qs-drawer-close" }))))),
|
|
2222
|
-
React.createElement(DrawerPanelBody, {
|
|
2119
|
+
React.createElement(DrawerPanelBody, { className: "pfext-quick-start-panel-content__body", "data-test": "content" },
|
|
2223
2120
|
React.createElement(QuickStartController, { quickStart: quickStart, nextQuickStarts: nextQuickStarts, footerClass: footerClass, contentRef: setContentRef })))) : null;
|
|
2224
2121
|
if (appendTo) {
|
|
2225
2122
|
return ReactDOM.createPortal(content, getElement(appendTo));
|
|
@@ -2259,7 +2156,7 @@ const QuickStartContainer = (_a) => {
|
|
|
2259
2156
|
};
|
|
2260
2157
|
const QuickStartDrawer = (_a) => {
|
|
2261
2158
|
var { quickStarts = [], children, appendTo, fullWidth, onCloseInProgress, onCloseNotInProgress } = _a, props = __rest(_a, ["quickStarts", "children", "appendTo", "fullWidth", "onCloseInProgress", "onCloseNotInProgress"]);
|
|
2262
|
-
const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], activeQuickStartState, allQuickStartStates, setAllQuickStartStates,
|
|
2159
|
+
const { activeQuickStartID, setActiveQuickStart, allQuickStarts = [], activeQuickStartState, allQuickStartStates, setAllQuickStartStates, } = React.useContext(QuickStartContext);
|
|
2263
2160
|
const combinedQuickStarts = allQuickStarts.concat(quickStarts);
|
|
2264
2161
|
React.useEffect(() => {
|
|
2265
2162
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -2318,10 +2215,10 @@ const QuickStartDrawer = (_a) => {
|
|
|
2318
2215
|
},
|
|
2319
2216
|
}
|
|
2320
2217
|
: {};
|
|
2321
|
-
const panelContent = (React.createElement(QuickStartPanelContent, Object.assign({ quickStarts: combinedQuickStarts, handleClose: handleClose, activeQuickStartID: activeQuickStartID, appendTo: appendTo, isResizable: !fullWidth
|
|
2218
|
+
const panelContent = (React.createElement(QuickStartPanelContent, Object.assign({ quickStarts: combinedQuickStarts, handleClose: handleClose, activeQuickStartID: activeQuickStartID, appendTo: appendTo, isResizable: !fullWidth }, fullWidthPanelStyle)));
|
|
2322
2219
|
return (React.createElement(React.Fragment, null,
|
|
2323
2220
|
React.createElement(Drawer, Object.assign({ isExpanded: !!activeQuickStartID, isInline: true }, props), children ? (React.createElement(DrawerContent, Object.assign({ panelContent: panelContent }, fullWidthBodyStyle),
|
|
2324
|
-
React.createElement(DrawerContentBody,
|
|
2221
|
+
React.createElement(DrawerContentBody, null, children))) : (React.createElement("div", null, panelContent))),
|
|
2325
2222
|
React.createElement(QuickStartCloseModal, { isOpen: modalOpen, onConfirm: onModalConfirm, onCancel: onModalCancel })));
|
|
2326
2223
|
};
|
|
2327
2224
|
|
|
@@ -2383,17 +2280,17 @@ const HelpTopicPanelContent = (_a) => {
|
|
|
2383
2280
|
!!((_b = activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.links) === null || _b === void 0 ? void 0 : _b.length) && React.createElement(Divider, null),
|
|
2384
2281
|
paddingContainer(React.createElement(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.createElement(StackItem, { key: index },
|
|
2385
2282
|
React.createElement(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.createElement(ExternalLinkAltIcon, null) : null, iconPosition: "right", style: { fontSize: 'inherit' } }, text || href))))))));
|
|
2386
|
-
const content = (React.createElement(DrawerPanelContent, Object.assign({ isResizable: isResizable
|
|
2283
|
+
const content = (React.createElement(DrawerPanelContent, Object.assign({ isResizable: isResizable }, props),
|
|
2387
2284
|
React.createElement("div", null,
|
|
2388
2285
|
React.createElement(DrawerHead, null,
|
|
2389
|
-
React.createElement("div",
|
|
2286
|
+
React.createElement("div", null,
|
|
2390
2287
|
helpTopicOptions && (React.createElement(Select, { isPlain: true, id: "help-topics-select", selected: activeHelpTopic, isOpen: isHelpTopicMenuOpen, onSelect: onSelectHelpTopic, onOpenChange: (isOpen) => setIsHelpTopicMenuOpen(isOpen), toggle: (toggleRef) => (React.createElement(MenuToggle, { isFullWidth: true, ref: toggleRef, icon: React.createElement(BarsIcon, null), onClick: toggleHelpTopicMenu, isExpanded: isHelpTopicMenuOpen }, activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.title)) },
|
|
2391
2288
|
React.createElement(SelectList, null, helpTopicOptions))),
|
|
2392
|
-
React.createElement(Title, { headingLevel: "h1", size: "xl",
|
|
2289
|
+
React.createElement(Title, { headingLevel: "h1", size: "xl", style: { marginRight: 'var(--pf-t--global--spacer--md)' } }, activeHelpTopic === null || activeHelpTopic === void 0 ? void 0 : activeHelpTopic.title)),
|
|
2393
2290
|
React.createElement(DrawerActions, null,
|
|
2394
|
-
React.createElement(DrawerCloseButton, { onClick: onClose,
|
|
2291
|
+
React.createElement(DrawerCloseButton, { onClick: onClose, "data-testid": "qs-drawer-close" }))),
|
|
2395
2292
|
React.createElement(Divider, null),
|
|
2396
|
-
React.createElement(DrawerPanelBody, {
|
|
2293
|
+
React.createElement(DrawerPanelBody, { "data-test": "content" }, panelBodyItems))));
|
|
2397
2294
|
return content;
|
|
2398
2295
|
};
|
|
2399
2296
|
|
|
@@ -2425,7 +2322,7 @@ const HelpTopicDrawer = (_a) => {
|
|
|
2425
2322
|
const panelContent = (React.createElement(HelpTopicPanelContent, { activeHelpTopic: activeHelpTopic, filteredHelpTopics: filteredHelpTopics, onClose: onClose }));
|
|
2426
2323
|
return (React.createElement(React.Fragment, null,
|
|
2427
2324
|
React.createElement(Drawer, Object.assign({ isExpanded: !!activeHelpTopic, isInline: true }, props), children ? (React.createElement(DrawerContent, { panelContent: panelContent },
|
|
2428
|
-
React.createElement(DrawerContentBody,
|
|
2325
|
+
React.createElement(DrawerContentBody, null, children))) : (React.createElement("div", { className: "pf-v6-c-drawer__main" }, panelContent)))));
|
|
2429
2326
|
};
|
|
2430
2327
|
|
|
2431
2328
|
const useLocalStorage = (key, initialValue) => {
|