@patternfly/quickstarts 6.3.0-prerelease.2 → 6.3.0-prerelease.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 +2 -2
- package/dist/ConsoleInternal/components/utils/camel-case-wrap.d.ts +1 -1
- package/dist/ConsoleInternal/components/utils/status-box.d.ts +3 -3
- package/dist/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.d.ts +3 -3
- package/dist/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.d.ts +2 -2
- package/dist/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.d.ts +2 -2
- package/dist/ConsoleShared/src/components/modal/Modal.d.ts +3 -3
- package/dist/ConsoleShared/src/components/popper/Portal.d.ts +3 -3
- package/dist/ConsoleShared/src/components/popper/SimplePopper.d.ts +3 -3
- package/dist/ConsoleShared/src/components/spotlight/InteractiveSpotlight.d.ts +3 -2
- package/dist/ConsoleShared/src/components/spotlight/Spotlight.d.ts +2 -2
- package/dist/ConsoleShared/src/components/spotlight/StaticSpotlight.d.ts +3 -2
- package/dist/ConsoleShared/src/components/status/GenericStatus.d.ts +4 -4
- package/dist/ConsoleShared/src/components/status/NotStartedIcon.d.ts +1 -2
- package/dist/ConsoleShared/src/components/status/PopoverStatus.d.ts +4 -4
- package/dist/ConsoleShared/src/components/status/Status.d.ts +3 -3
- package/dist/ConsoleShared/src/components/status/StatusIconAndText.d.ts +3 -3
- package/dist/ConsoleShared/src/components/status/icons.d.ts +4 -4
- package/dist/ConsoleShared/src/components/status/statuses.d.ts +4 -4
- package/dist/ConsoleShared/src/components/utils/FallbackImg.d.ts +3 -3
- package/dist/ConsoleShared/src/utils/useCombineRefs.d.ts +2 -2
- package/dist/HelpTopicDrawer.d.ts +3 -3
- package/dist/HelpTopicPanelContent.d.ts +2 -2
- package/dist/QuickStartCatalogPage.d.ts +3 -3
- package/dist/QuickStartCloseModal.d.ts +2 -2
- package/dist/QuickStartContainer.d.ts +2 -2
- package/dist/QuickStartController.d.ts +2 -2
- package/dist/QuickStartDrawer.d.ts +2 -2
- package/dist/QuickStartDrawerContent.d.ts +2 -2
- package/dist/QuickStartMarkdownView.d.ts +2 -2
- package/dist/QuickStartPanelContent.d.ts +2 -2
- package/dist/catalog/Catalog/QuickStartCatalogHeader.d.ts +2 -2
- package/dist/catalog/Catalog/QuickStartCatalogSection.d.ts +2 -2
- package/dist/catalog/Catalog/QuickStartCatalogToolbar.d.ts +2 -2
- package/dist/catalog/QuickStartCatalog.d.ts +2 -2
- package/dist/catalog/QuickStartTile.d.ts +2 -2
- package/dist/catalog/QuickStartTileDescription.d.ts +2 -2
- package/dist/catalog/QuickStartTileFooter.d.ts +2 -2
- package/dist/catalog/QuickStartTileFooterExternal.d.ts +2 -2
- package/dist/catalog/QuickStartTileHeader.d.ts +2 -2
- package/dist/catalog/Toolbar/QuickStartCatalogFilter.d.ts +2 -2
- package/dist/catalog/Toolbar/QuickStartCatalogFilterItems.d.ts +7 -7
- package/dist/controller/QuickStartConclusion.d.ts +2 -2
- package/dist/controller/QuickStartContent.d.ts +2 -2
- package/dist/controller/QuickStartFooter.d.ts +2 -2
- package/dist/controller/QuickStartIntroduction.d.ts +2 -2
- package/dist/controller/QuickStartTaskHeader.d.ts +2 -2
- package/dist/controller/QuickStartTaskHeaderList.d.ts +2 -2
- package/dist/controller/QuickStartTaskReview.d.ts +2 -2
- package/dist/controller/QuickStartTasks.d.ts +2 -2
- package/dist/index.es.js +299 -459
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +310 -472
- package/dist/index.js.map +1 -1
- package/dist/quickstarts-base.css +61 -0
- package/dist/quickstarts-full.es.js +1693 -511
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts.css +61 -0
- package/dist/quickstarts.min.css +1 -1
- package/dist/utils/help-topic-context.d.ts +2 -2
- package/dist/utils/quick-start-context.d.ts +3 -3
- package/package.json +3 -4
- package/src/ConsoleInternal/components/markdown-view.tsx +20 -18
- package/src/ConsoleInternal/components/utils/camel-case-wrap.tsx +3 -3
- package/src/ConsoleInternal/components/utils/status-box.tsx +4 -4
- package/src/ConsoleShared/src/components/markdown-extensions/MarkdownCopyClipboard.tsx +8 -15
- package/src/ConsoleShared/src/components/markdown-extensions/__tests__/MarkdownCopyClipboard.spec.tsx +0 -1
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-extension.tsx +2 -2
- package/src/ConsoleShared/src/components/markdown-extensions/accordion-render-extension.tsx +4 -4
- package/src/ConsoleShared/src/components/markdown-extensions/admonition-extension.tsx +2 -2
- package/src/ConsoleShared/src/components/markdown-extensions/code-extension.tsx +2 -2
- package/src/ConsoleShared/src/components/markdown-extensions/inline-clipboard-extension.tsx +3 -3
- package/src/ConsoleShared/src/components/markdown-extensions/multiline-clipboard-extension.tsx +3 -3
- package/src/ConsoleShared/src/components/markdown-highlight-extension/MarkdownHighlightExtension.tsx +5 -5
- package/src/ConsoleShared/src/components/modal/Modal.tsx +3 -3
- package/src/ConsoleShared/src/components/popper/Portal.tsx +5 -5
- package/src/ConsoleShared/src/components/popper/SimplePopper.tsx +15 -15
- package/src/ConsoleShared/src/components/spotlight/InteractiveSpotlight.tsx +6 -5
- package/src/ConsoleShared/src/components/spotlight/Spotlight.tsx +3 -3
- package/src/ConsoleShared/src/components/spotlight/StaticSpotlight.tsx +4 -3
- package/src/ConsoleShared/src/components/spotlight/spotlight.scss +63 -0
- package/src/ConsoleShared/src/components/status/GenericStatus.tsx +5 -5
- package/src/ConsoleShared/src/components/status/NotStartedIcon.tsx +0 -1
- package/src/ConsoleShared/src/components/status/PopoverStatus.tsx +4 -4
- package/src/ConsoleShared/src/components/status/Status.tsx +3 -11
- package/src/ConsoleShared/src/components/status/StatusIconAndText.tsx +6 -6
- package/src/ConsoleShared/src/components/status/icons.tsx +4 -8
- package/src/ConsoleShared/src/components/status/statuses.tsx +4 -5
- package/src/ConsoleShared/src/components/utils/FallbackImg.tsx +4 -4
- package/src/ConsoleShared/src/hooks/scroll.ts +4 -4
- package/src/ConsoleShared/src/hooks/useBoundingClientRect.ts +3 -3
- package/src/ConsoleShared/src/hooks/useForceRender.ts +2 -2
- package/src/ConsoleShared/src/hooks/useResizeObserver.ts +3 -6
- package/src/ConsoleShared/src/hooks/useScrollShadows.ts +4 -4
- package/src/ConsoleShared/src/utils/useCombineRefs.ts +4 -4
- package/src/HelpTopicDrawer.tsx +6 -6
- package/src/HelpTopicPanelContent.tsx +4 -4
- package/src/QuickStartCatalogPage.tsx +9 -9
- package/src/QuickStartCloseModal.tsx +3 -7
- package/src/QuickStartContainer.tsx +4 -4
- package/src/QuickStartController.tsx +11 -11
- package/src/QuickStartDrawer.tsx +6 -6
- package/src/QuickStartDrawerContent.tsx +3 -3
- package/src/QuickStartMarkdownView.tsx +3 -3
- package/src/QuickStartPanelContent.tsx +8 -8
- package/src/catalog/Catalog/QuickStartCatalogHeader.tsx +2 -2
- package/src/catalog/Catalog/QuickStartCatalogSection.tsx +2 -2
- package/src/catalog/Catalog/QuickStartCatalogToolbar.tsx +2 -2
- package/src/catalog/QuickStartCatalog.tsx +3 -3
- package/src/catalog/QuickStartTile.tsx +4 -4
- package/src/catalog/QuickStartTileDescription.tsx +4 -4
- package/src/catalog/QuickStartTileFooter.tsx +6 -6
- package/src/catalog/QuickStartTileFooterExternal.tsx +2 -5
- package/src/catalog/QuickStartTileHeader.tsx +2 -6
- package/src/catalog/Toolbar/QuickStartCatalogFilter.tsx +2 -2
- package/src/catalog/Toolbar/QuickStartCatalogFilterItems.tsx +16 -16
- package/src/catalog/__tests__/QuickStartCatalog.spec.tsx +0 -1
- package/src/catalog/__tests__/QuickStartTile.spec.tsx +0 -1
- package/src/catalog/__tests__/QuickStartTileDescription.spec.tsx +1 -2
- package/src/controller/QuickStartConclusion.tsx +3 -3
- package/src/controller/QuickStartContent.tsx +2 -2
- package/src/controller/QuickStartFooter.tsx +10 -11
- package/src/controller/QuickStartIntroduction.tsx +4 -4
- package/src/controller/QuickStartTaskHeader.tsx +5 -5
- package/src/controller/QuickStartTaskHeaderList.tsx +2 -2
- package/src/controller/QuickStartTaskReview.tsx +4 -4
- package/src/controller/QuickStartTasks.tsx +5 -5
- package/src/controller/__tests__/QuickStartConclusion.spec.tsx +3 -3
- package/src/controller/__tests__/QuickStartContent.spec.tsx +2 -2
- package/src/controller/__tests__/QuickStartTaskHeader.spec.tsx +2 -2
- package/src/controller/__tests__/QuickStartTaskReview.spec.tsx +2 -2
- package/src/utils/help-topic-context.tsx +7 -10
- package/src/utils/quick-start-context.tsx +11 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, useContext } from 'react';
|
|
2
2
|
import { Button } from '@patternfly/react-core';
|
|
3
3
|
import ArrowRightIcon from '@patternfly/react-icons/dist/js/icons/arrow-right-icon';
|
|
4
4
|
import QuickStartMarkdownView from '../QuickStartMarkdownView';
|
|
@@ -15,7 +15,7 @@ interface QuickStartConclusionProps {
|
|
|
15
15
|
onTaskSelect: (selectedTaskNumber: number) => void;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const QuickStartConclusion:
|
|
18
|
+
const QuickStartConclusion: FC<QuickStartConclusionProps> = ({
|
|
19
19
|
tasks,
|
|
20
20
|
conclusion,
|
|
21
21
|
allTaskStatuses,
|
|
@@ -24,7 +24,7 @@ const QuickStartConclusion: React.FC<QuickStartConclusionProps> = ({
|
|
|
24
24
|
onTaskSelect,
|
|
25
25
|
}) => {
|
|
26
26
|
const hasFailedTask = allTaskStatuses.includes(QuickStartTaskStatus.FAILED);
|
|
27
|
-
const { getResource } =
|
|
27
|
+
const { getResource } = useContext<QuickStartContextValues>(QuickStartContext);
|
|
28
28
|
return (
|
|
29
29
|
<>
|
|
30
30
|
<TaskHeaderList tasks={tasks} allTaskStatuses={allTaskStatuses} onTaskSelect={onTaskSelect} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
2
|
import { QuickStart, QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
3
3
|
import QuickStartConclusion from './QuickStartConclusion';
|
|
4
4
|
import QuickStartIntroduction from './QuickStartIntroduction';
|
|
@@ -14,7 +14,7 @@ interface QuickStartContentProps {
|
|
|
14
14
|
}
|
|
15
15
|
import './QuickStartContent.scss';
|
|
16
16
|
|
|
17
|
-
const QuickStartContent =
|
|
17
|
+
const QuickStartContent = forwardRef<HTMLDivElement, QuickStartContentProps>(
|
|
18
18
|
(
|
|
19
19
|
{
|
|
20
20
|
quickStart,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, useCallback, useContext, useMemo } from 'react';
|
|
2
2
|
import { Button } from '@patternfly/react-core';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
@@ -17,7 +17,7 @@ export interface QuickStartFooterProps {
|
|
|
17
17
|
className?: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const QuickStartFooter:
|
|
20
|
+
const QuickStartFooter: FC<QuickStartFooterProps> = ({
|
|
21
21
|
status,
|
|
22
22
|
taskNumber,
|
|
23
23
|
totalTasks,
|
|
@@ -26,10 +26,9 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
26
26
|
quickStartId,
|
|
27
27
|
className,
|
|
28
28
|
}) => {
|
|
29
|
-
const { restartQuickStart, getResource } =
|
|
30
|
-
React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
29
|
+
const { restartQuickStart, getResource } = useContext<QuickStartContextValues>(QuickStartContext);
|
|
31
30
|
|
|
32
|
-
const PrimaryButtonText =
|
|
31
|
+
const PrimaryButtonText = useMemo(
|
|
33
32
|
() => ({
|
|
34
33
|
START: getResource('Start'),
|
|
35
34
|
CONTINUE: getResource('Continue'),
|
|
@@ -39,7 +38,7 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
39
38
|
[getResource],
|
|
40
39
|
);
|
|
41
40
|
|
|
42
|
-
const SecondaryButtonText =
|
|
41
|
+
const SecondaryButtonText = useMemo(
|
|
43
42
|
() => ({
|
|
44
43
|
BACK: getResource('Back'),
|
|
45
44
|
RESTART: getResource('Restart'),
|
|
@@ -47,7 +46,7 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
47
46
|
[getResource],
|
|
48
47
|
);
|
|
49
48
|
|
|
50
|
-
const onRestart =
|
|
49
|
+
const onRestart = useCallback(
|
|
51
50
|
(e: React.SyntheticEvent) => {
|
|
52
51
|
e.preventDefault();
|
|
53
52
|
e.stopPropagation();
|
|
@@ -56,7 +55,7 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
56
55
|
[quickStartId, restartQuickStart, totalTasks],
|
|
57
56
|
);
|
|
58
57
|
|
|
59
|
-
const getPrimaryButtonText =
|
|
58
|
+
const getPrimaryButtonText = useMemo(() => {
|
|
60
59
|
if (status === QuickStartStatus.NOT_STARTED) {
|
|
61
60
|
return PrimaryButtonText.START;
|
|
62
61
|
}
|
|
@@ -72,7 +71,7 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
72
71
|
return PrimaryButtonText.CONTINUE;
|
|
73
72
|
}, [taskNumber, totalTasks, PrimaryButtonText, status]);
|
|
74
73
|
|
|
75
|
-
const getPrimaryButton =
|
|
74
|
+
const getPrimaryButton = useMemo(
|
|
76
75
|
() => (
|
|
77
76
|
<Button
|
|
78
77
|
variant="primary"
|
|
@@ -87,7 +86,7 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
87
86
|
[getPrimaryButtonText, onNext],
|
|
88
87
|
);
|
|
89
88
|
|
|
90
|
-
const getSecondaryButton =
|
|
89
|
+
const getSecondaryButton = useMemo(
|
|
91
90
|
() =>
|
|
92
91
|
taskNumber === -1 && status !== QuickStartStatus.NOT_STARTED ? (
|
|
93
92
|
<Button variant="secondary" onClick={onRestart} data-testid="qs-drawer-restart">
|
|
@@ -103,7 +102,7 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
103
102
|
[onRestart, onBack, SecondaryButtonText, status, taskNumber],
|
|
104
103
|
);
|
|
105
104
|
|
|
106
|
-
const getSideNoteAction =
|
|
105
|
+
const getSideNoteAction = useMemo(
|
|
107
106
|
() =>
|
|
108
107
|
taskNumber !== -1 && (
|
|
109
108
|
<Button variant="link" onClick={onRestart} data-testid="qs-drawer-side-note-action">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, useContext, useState } from 'react';
|
|
2
2
|
import { ExpandableSection, List, ListItem, Stack } from '@patternfly/react-core';
|
|
3
3
|
import QuickStartMarkdownView from '../QuickStartMarkdownView';
|
|
4
4
|
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
@@ -13,16 +13,16 @@ interface QuickStartIntroductionProps {
|
|
|
13
13
|
onTaskSelect: (selectedTaskNumber: number) => void;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const QuickStartIntroduction:
|
|
16
|
+
const QuickStartIntroduction: FC<QuickStartIntroductionProps> = ({
|
|
17
17
|
tasks,
|
|
18
18
|
introduction,
|
|
19
19
|
allTaskStatuses,
|
|
20
20
|
prerequisites,
|
|
21
21
|
onTaskSelect,
|
|
22
22
|
}) => {
|
|
23
|
-
const { getResource } =
|
|
23
|
+
const { getResource } = useContext<QuickStartContextValues>(QuickStartContext);
|
|
24
24
|
const prereqs = prerequisites?.filter((p) => p);
|
|
25
|
-
const [isPrereqsExpanded, setIsPrereqsExpanded] =
|
|
25
|
+
const [isPrereqsExpanded, setIsPrereqsExpanded] = useState(false);
|
|
26
26
|
const prereqList = prereqs?.length > 0 && (
|
|
27
27
|
<ExpandableSection
|
|
28
28
|
toggleText={getResource('View Prerequisites ({{totalPrereqs}})').replace(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, useContext, useEffect, useRef } from 'react';
|
|
2
2
|
import { Title, WizardNavItem } from '@patternfly/react-core';
|
|
3
3
|
import { QuickStartContext } from '../utils/quick-start-context';
|
|
4
4
|
import { QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
@@ -16,7 +16,7 @@ interface QuickStartTaskHeaderProps {
|
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const QuickStartTaskHeader:
|
|
19
|
+
const QuickStartTaskHeader: FC<QuickStartTaskHeaderProps> = ({
|
|
20
20
|
title,
|
|
21
21
|
taskIndex,
|
|
22
22
|
subtitle,
|
|
@@ -26,10 +26,10 @@ const QuickStartTaskHeader: React.FC<QuickStartTaskHeaderProps> = ({
|
|
|
26
26
|
onTaskSelect,
|
|
27
27
|
children,
|
|
28
28
|
}) => {
|
|
29
|
-
const titleRef =
|
|
30
|
-
const { focusOnQuickStart } =
|
|
29
|
+
const titleRef = useRef(null);
|
|
30
|
+
const { focusOnQuickStart } = useContext(QuickStartContext);
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
useEffect(() => {
|
|
33
33
|
if (focusOnQuickStart && isActiveTask) {
|
|
34
34
|
// Focus the WizardNavItem button element that contains the title
|
|
35
35
|
titleRef.current.parentNode.focus();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { QuickStartTask, QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
3
3
|
import TaskHeader from './QuickStartTaskHeader';
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ interface QuickStartTaskHeaderListProps {
|
|
|
8
8
|
onTaskSelect: (selectedTaskNumber: number) => void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const QuickStartTaskHeaderList:
|
|
11
|
+
const QuickStartTaskHeaderList: FC<QuickStartTaskHeaderListProps> = ({
|
|
12
12
|
tasks,
|
|
13
13
|
allTaskStatuses,
|
|
14
14
|
onTaskSelect,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSSProperties, FC, useContext } from 'react';
|
|
2
2
|
import { Alert, Radio } from '@patternfly/react-core';
|
|
3
3
|
import QuickStartMarkdownView from '../QuickStartMarkdownView';
|
|
4
4
|
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
@@ -24,13 +24,13 @@ const getAlertVariant = (status) => {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const QuickStartTaskReview:
|
|
27
|
+
const QuickStartTaskReview: FC<QuickStartTaskReviewProps> = ({
|
|
28
28
|
review,
|
|
29
29
|
taskStatus,
|
|
30
30
|
onTaskReview,
|
|
31
31
|
}) => {
|
|
32
32
|
const { instructions, failedTaskHelp: taskHelp } = review;
|
|
33
|
-
const { getResource } =
|
|
33
|
+
const { getResource } = useContext<QuickStartContextValues>(QuickStartContext);
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
36
|
<Alert
|
|
@@ -41,7 +41,7 @@ const QuickStartTaskReview: React.FC<QuickStartTaskReviewProps> = ({
|
|
|
41
41
|
style={
|
|
42
42
|
{
|
|
43
43
|
marginBottom: 'var(--pf-t--global--spacer--md)',
|
|
44
|
-
} as
|
|
44
|
+
} as CSSProperties
|
|
45
45
|
}
|
|
46
46
|
>
|
|
47
47
|
<QuickStartMarkdownView content={instructions} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, Fragment, useContext } from 'react';
|
|
2
2
|
import QuickStartMarkdownView from '../QuickStartMarkdownView';
|
|
3
3
|
import { QUICKSTART_TASKS_INITIAL_STATES } from '../utils/const';
|
|
4
4
|
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
@@ -15,7 +15,7 @@ interface QuickStartTaskProps {
|
|
|
15
15
|
onTaskSelect: (activeQuickStartId) => void;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const QuickStartTasks:
|
|
18
|
+
const QuickStartTasks: FC<QuickStartTaskProps> = ({
|
|
19
19
|
tasks,
|
|
20
20
|
taskNumber,
|
|
21
21
|
allTaskStatuses,
|
|
@@ -23,7 +23,7 @@ const QuickStartTasks: React.FC<QuickStartTaskProps> = ({
|
|
|
23
23
|
onTaskSelect,
|
|
24
24
|
}) => {
|
|
25
25
|
const { getResource, alwaysShowTaskReview } =
|
|
26
|
-
|
|
26
|
+
useContext<QuickStartContextValues>(QuickStartContext);
|
|
27
27
|
return (
|
|
28
28
|
<div className="pf-v6-c-wizard pf-v6-c-wizard__nav-list" style={{ padding: '0 0 0 0' }}>
|
|
29
29
|
<ul>
|
|
@@ -37,7 +37,7 @@ const QuickStartTasks: React.FC<QuickStartTaskProps> = ({
|
|
|
37
37
|
(!QUICKSTART_TASKS_INITIAL_STATES.includes(taskStatus) || alwaysShowTaskReview) &&
|
|
38
38
|
review;
|
|
39
39
|
return (
|
|
40
|
-
<
|
|
40
|
+
<Fragment key={title}>
|
|
41
41
|
<TaskHeader
|
|
42
42
|
taskIndex={index + 1}
|
|
43
43
|
title={title}
|
|
@@ -62,7 +62,7 @@ const QuickStartTasks: React.FC<QuickStartTaskProps> = ({
|
|
|
62
62
|
</Stack>
|
|
63
63
|
)}
|
|
64
64
|
</TaskHeader>
|
|
65
|
-
</
|
|
65
|
+
</Fragment>
|
|
66
66
|
);
|
|
67
67
|
})}
|
|
68
68
|
</ul>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
2
|
import { Button } from '@patternfly/react-core';
|
|
3
3
|
import { ShallowWrapper, shallow } from 'enzyme';
|
|
4
4
|
import { allQuickStarts } from '../../data/quick-start-test-data';
|
|
@@ -17,7 +17,7 @@ jest.mock('react', () => {
|
|
|
17
17
|
|
|
18
18
|
const i18nNS = 'quickstart';
|
|
19
19
|
|
|
20
|
-
type QuickStartConclusionProps =
|
|
20
|
+
type QuickStartConclusionProps = ComponentProps<typeof QuickStartConclusion>;
|
|
21
21
|
let wrapper: ShallowWrapper<QuickStartConclusionProps>;
|
|
22
22
|
const props: QuickStartConclusionProps = {
|
|
23
23
|
tasks: getQuickStartByName('explore-pipelines', allQuickStarts).spec.tasks,
|
|
@@ -31,7 +31,7 @@ const props: QuickStartConclusionProps = {
|
|
|
31
31
|
onQuickStartChange: jest.fn(),
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
xdescribe('QuickStartConclusion', () => {
|
|
35
35
|
beforeEach(() => {
|
|
36
36
|
spyOn(React, 'useContext').and.returnValue({
|
|
37
37
|
activeQuickStartID: '',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
2
|
import { ShallowWrapper, shallow } from 'enzyme';
|
|
3
3
|
import { allQuickStarts } from '../../data/quick-start-test-data';
|
|
4
4
|
import { QuickStartTaskStatus } from '../../utils/quick-start-types';
|
|
@@ -8,7 +8,7 @@ import QuickStartContent from '../QuickStartContent';
|
|
|
8
8
|
import QuickStartIntroduction from '../QuickStartIntroduction';
|
|
9
9
|
import QuickStartTasks from '../QuickStartTasks';
|
|
10
10
|
|
|
11
|
-
type QuickStartContentProps =
|
|
11
|
+
type QuickStartContentProps = ComponentProps<typeof QuickStartContent>;
|
|
12
12
|
|
|
13
13
|
let wrapper: ShallowWrapper<QuickStartContentProps>;
|
|
14
14
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
2
|
import { Title, WizardNavItem } from '@patternfly/react-core';
|
|
3
3
|
import { ShallowWrapper, shallow } from 'enzyme';
|
|
4
4
|
import { QuickStartTaskStatus } from '../../utils/quick-start-types';
|
|
5
5
|
import QuickStartTaskHeader from '../QuickStartTaskHeader';
|
|
6
6
|
|
|
7
|
-
type QuickStartTaskHeaderProps =
|
|
7
|
+
type QuickStartTaskHeaderProps = ComponentProps<typeof QuickStartTaskHeader>;
|
|
8
8
|
let wrapper: ShallowWrapper<QuickStartTaskHeaderProps>;
|
|
9
9
|
const props: QuickStartTaskHeaderProps = {
|
|
10
10
|
title: 'title',
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { Alert } from '@patternfly/react-core';
|
|
3
2
|
import { ShallowWrapper, shallow } from 'enzyme';
|
|
4
3
|
import { allQuickStarts } from '../../data/quick-start-test-data';
|
|
@@ -6,8 +5,9 @@ import QuickStartMarkdownView from '../../QuickStartMarkdownView';
|
|
|
6
5
|
import { QuickStartTaskStatus } from '../../utils/quick-start-types';
|
|
7
6
|
import { getQuickStartByName } from '../../utils/quick-start-utils';
|
|
8
7
|
import QuickStartTaskReview from '../QuickStartTaskReview';
|
|
8
|
+
import { ComponentProps } from 'react';
|
|
9
9
|
|
|
10
|
-
type QuickStartTaskReviewProps =
|
|
10
|
+
type QuickStartTaskReviewProps = ComponentProps<typeof QuickStartTaskReview>;
|
|
11
11
|
let wrapper: ShallowWrapper<QuickStartTaskReviewProps>;
|
|
12
12
|
const props: QuickStartTaskReviewProps = {
|
|
13
13
|
review: getQuickStartByName('explore-serverless', allQuickStarts).spec.tasks[0].review,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createContext, useCallback, useState } from 'react';
|
|
2
2
|
import { HelpTopic } from './help-topic-types';
|
|
3
3
|
|
|
4
4
|
export interface HelpTopicContextValues {
|
|
@@ -22,8 +22,7 @@ export const HelpTopicContextDefaults = {
|
|
|
22
22
|
loading: false,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export const HelpTopicContext =
|
|
26
|
-
React.createContext<HelpTopicContextValues>(HelpTopicContextDefaults);
|
|
25
|
+
export const HelpTopicContext = createContext<HelpTopicContextValues>(HelpTopicContextDefaults);
|
|
27
26
|
|
|
28
27
|
export const useValuesForHelpTopicContext = (
|
|
29
28
|
value: HelpTopicContextValues = {},
|
|
@@ -33,16 +32,14 @@ export const useValuesForHelpTopicContext = (
|
|
|
33
32
|
...value,
|
|
34
33
|
};
|
|
35
34
|
|
|
36
|
-
const [loading, setLoading] =
|
|
35
|
+
const [loading, setLoading] = useState(combinedValue.loading);
|
|
37
36
|
|
|
38
37
|
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
39
|
-
const [helpTopics, setHelpTopics] =
|
|
38
|
+
const [helpTopics, setHelpTopics] = useState<HelpTopic[]>(combinedValue.helpTopics || []);
|
|
40
39
|
|
|
41
|
-
const [activeHelpTopic, setActiveHelpTopic] =
|
|
42
|
-
combinedValue.activeHelpTopic || null,
|
|
43
|
-
);
|
|
40
|
+
const [activeHelpTopic, setActiveHelpTopic] = useState(combinedValue.activeHelpTopic || null);
|
|
44
41
|
|
|
45
|
-
const setActiveHelpTopicByName =
|
|
42
|
+
const setActiveHelpTopicByName = useCallback(
|
|
46
43
|
(helpTopicName: string) => {
|
|
47
44
|
const topic = helpTopics.find((t) => t.name === helpTopicName);
|
|
48
45
|
if (!helpTopicName) {
|
|
@@ -54,7 +51,7 @@ export const useValuesForHelpTopicContext = (
|
|
|
54
51
|
[helpTopics],
|
|
55
52
|
);
|
|
56
53
|
|
|
57
|
-
const [filteredHelpTopics, setFilteredHelpTopics] =
|
|
54
|
+
const [filteredHelpTopics, setFilteredHelpTopics] = useState(
|
|
58
55
|
combinedValue.filteredHelpTopics || [],
|
|
59
56
|
);
|
|
60
57
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createContext, FC, useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { removeQueryArgument, setQueryArgument } from '../ConsoleInternal/components/utils/router';
|
|
3
3
|
import en from '../locales/en/quickstart.json';
|
|
4
4
|
import {
|
|
@@ -138,12 +138,12 @@ export const useValuesForQuickStartContext = (
|
|
|
138
138
|
useLegacyHeaderColors,
|
|
139
139
|
markdown,
|
|
140
140
|
} = combinedValue;
|
|
141
|
-
const [quickStarts, setQuickStarts] =
|
|
142
|
-
const [resourceBundle, setResourceBundle] =
|
|
141
|
+
const [quickStarts, setQuickStarts] = useState(combinedValue.allQuickStarts || []);
|
|
142
|
+
const [resourceBundle, setResourceBundle] = useState({
|
|
143
143
|
...en,
|
|
144
144
|
...combinedValue.resourceBundle,
|
|
145
145
|
});
|
|
146
|
-
const [language, setLanguage] =
|
|
146
|
+
const [language, setLanguage] = useState(combinedValue.language);
|
|
147
147
|
const changeResourceBundle = (bundle: any, lng?: string) => {
|
|
148
148
|
lng && setLanguage(lng);
|
|
149
149
|
setResourceBundle({
|
|
@@ -156,8 +156,8 @@ export const useValuesForQuickStartContext = (
|
|
|
156
156
|
getResource(resource, count !== undefined ? { count } : null, resourceBundle, language),
|
|
157
157
|
[resourceBundle, language],
|
|
158
158
|
);
|
|
159
|
-
const [loading, setLoading] =
|
|
160
|
-
const [alwaysShowTaskReview, setAlwaysShowTaskReview] =
|
|
159
|
+
const [loading, setLoading] = useState(combinedValue.loading);
|
|
160
|
+
const [alwaysShowTaskReview, setAlwaysShowTaskReview] = useState(
|
|
161
161
|
combinedValue.alwaysShowTaskReview,
|
|
162
162
|
);
|
|
163
163
|
|
|
@@ -167,7 +167,7 @@ export const useValuesForQuickStartContext = (
|
|
|
167
167
|
initialSearchParams.get(QUICKSTART_STATUS_FILTER_KEY)?.split(',') || [];
|
|
168
168
|
|
|
169
169
|
const quickStartStatusCount = getQuickStartStatusCount(allQuickStartStates, allQuickStarts);
|
|
170
|
-
const [statusTypes, setStatusTypes] =
|
|
170
|
+
const [statusTypes, setStatusTypes] = useState({
|
|
171
171
|
[QuickStartStatus.COMPLETE]: findResource('Complete ({{statusCount, number}})').replace(
|
|
172
172
|
'{{statusCount, number}}',
|
|
173
173
|
quickStartStatusCount[QuickStartStatus.COMPLETE],
|
|
@@ -181,9 +181,9 @@ export const useValuesForQuickStartContext = (
|
|
|
181
181
|
quickStartStatusCount[QuickStartStatus.NOT_STARTED],
|
|
182
182
|
),
|
|
183
183
|
});
|
|
184
|
-
const [statusFilters, setStatusFilters] =
|
|
184
|
+
const [statusFilters, setStatusFilters] = useState<string[]>(initialStatusFilters);
|
|
185
185
|
|
|
186
|
-
const [filterKeyword, setFilterKeyword] =
|
|
186
|
+
const [filterKeyword, setFilterKeyword] = useState(initialSearchQuery);
|
|
187
187
|
|
|
188
188
|
const setFilter = (type: 'keyword' | 'status', val: any) => {
|
|
189
189
|
if (type === 'keyword') {
|
|
@@ -193,7 +193,7 @@ export const useValuesForQuickStartContext = (
|
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
useEffect(() => {
|
|
197
197
|
const updatedQuickStartStatusCount = getQuickStartStatusCount(allQuickStartStates, quickStarts);
|
|
198
198
|
setStatusTypes({
|
|
199
199
|
[QuickStartStatus.COMPLETE]: findResource('Complete ({{statusCount, number}})').replace(
|
|
@@ -462,7 +462,7 @@ export const useValuesForQuickStartContext = (
|
|
|
462
462
|
};
|
|
463
463
|
};
|
|
464
464
|
|
|
465
|
-
export const QuickStartContextProvider:
|
|
465
|
+
export const QuickStartContextProvider: FC<{
|
|
466
466
|
children: React.ReactNode;
|
|
467
467
|
value: QuickStartContextValues;
|
|
468
468
|
}> = ({ children, value }) => (
|