@patternfly/quickstarts 6.0.0-alpha.1 → 6.0.0-alpha.3
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 +18 -1
- package/dist/catalog/QuickStartTileDescription.d.ts +0 -1
- package/dist/catalog/QuickStartTileFooter.d.ts +1 -0
- package/dist/catalog/QuickStartTileHeader.d.ts +1 -5
- package/dist/catalog/Toolbar/QuickStartCatalogFilter.d.ts +0 -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 +196 -288
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +197 -288
- 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 +20 -66
- package/dist/patternfly-nested.css +2036 -2119
- package/dist/quickstarts-base.css +38 -415
- package/dist/quickstarts-full.es.js +1417 -847
- package/dist/quickstarts-full.es.js.map +1 -1
- package/dist/quickstarts-standalone.css +41 -376
- package/dist/quickstarts-standalone.min.css +3 -3
- package/dist/quickstarts-vendor.css +6 -11
- package/dist/quickstarts.css +44 -426
- package/dist/quickstarts.min.css +1 -1
- package/dist/utils/quick-start-context.d.ts +2 -0
- package/dist/utils/quick-start-types.d.ts +1 -1
- package/package.json +13 -15
- 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 +2 -2
- package/src/QuickStartDrawer.tsx +2 -7
- package/src/QuickStartPanelContent.scss +7 -39
- package/src/QuickStartPanelContent.tsx +23 -47
- 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 +135 -62
- package/src/catalog/QuickStartTileDescription.tsx +28 -42
- package/src/catalog/QuickStartTileFooter.tsx +13 -19
- package/src/catalog/QuickStartTileHeader.tsx +8 -58
- 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/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 +25 -62
- 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 +12 -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 -12
- 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
|
@@ -1,77 +1,27 @@
|
|
|
1
|
-
import './QuickStartTileHeader.scss';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import OutlinedClockIcon from '@patternfly/react-icons/dist/js/icons/outlined-clock-icon';
|
|
5
|
-
import { StatusIcon } from '@console/shared';
|
|
6
|
-
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
7
|
-
import { QuickStartStatus, QuickStartType } from '../utils/quick-start-types';
|
|
2
|
+
import { Button, Flex, Title } from '@patternfly/react-core';
|
|
8
3
|
import QuickStartMarkdownView from '../QuickStartMarkdownView';
|
|
9
4
|
|
|
10
5
|
interface QuickStartTileHeaderProps {
|
|
11
|
-
status: string;
|
|
12
|
-
duration: number;
|
|
13
6
|
name: string;
|
|
14
|
-
type?: QuickStartType;
|
|
15
7
|
quickStartId?: string;
|
|
8
|
+
onSelect: (e: React.FormEvent<HTMLInputElement> | React.MouseEvent<Element, MouseEvent>) => void;
|
|
16
9
|
}
|
|
17
10
|
|
|
18
|
-
const statusColorMap = {
|
|
19
|
-
[QuickStartStatus.COMPLETE]: 'green',
|
|
20
|
-
[QuickStartStatus.IN_PROGRESS]: 'purple',
|
|
21
|
-
[QuickStartStatus.NOT_STARTED]: 'grey',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
11
|
const QuickStartTileHeader: React.FC<QuickStartTileHeaderProps> = ({
|
|
25
|
-
status,
|
|
26
|
-
duration,
|
|
27
12
|
name,
|
|
28
|
-
type,
|
|
29
13
|
quickStartId,
|
|
14
|
+
onSelect,
|
|
30
15
|
}) => {
|
|
31
|
-
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
32
|
-
|
|
33
|
-
const statusLocaleMap = {
|
|
34
|
-
[QuickStartStatus.COMPLETE]: getResource('Complete'),
|
|
35
|
-
[QuickStartStatus.IN_PROGRESS]: getResource('In progress'),
|
|
36
|
-
[QuickStartStatus.NOT_STARTED]: getResource('Not started'),
|
|
37
|
-
};
|
|
38
16
|
|
|
39
17
|
return (
|
|
40
|
-
<
|
|
18
|
+
<Flex flexWrap={{ default: 'nowrap' }}>
|
|
41
19
|
<Title headingLevel="h3" data-test="title" id={quickStartId}>
|
|
42
|
-
<
|
|
20
|
+
<Button variant="link" isInline onClick={onSelect}>
|
|
21
|
+
<QuickStartMarkdownView content={name} />
|
|
22
|
+
</Button>
|
|
43
23
|
</Title>
|
|
44
|
-
|
|
45
|
-
{type && (
|
|
46
|
-
<Label className="pfext-quick-start-tile-header--margin" color={type.color}>
|
|
47
|
-
{type.text}
|
|
48
|
-
</Label>
|
|
49
|
-
)}
|
|
50
|
-
{duration && (
|
|
51
|
-
<Label
|
|
52
|
-
variant="outline"
|
|
53
|
-
data-test="duration"
|
|
54
|
-
icon={<OutlinedClockIcon />}
|
|
55
|
-
className="pfext-quick-start-tile-header--margin"
|
|
56
|
-
>
|
|
57
|
-
{getResource('{{duration, number}} minutes', duration).replace(
|
|
58
|
-
'{{duration, number}}',
|
|
59
|
-
duration,
|
|
60
|
-
)}
|
|
61
|
-
</Label>
|
|
62
|
-
)}
|
|
63
|
-
{status !== QuickStartStatus.NOT_STARTED && (
|
|
64
|
-
<Label
|
|
65
|
-
variant="outline"
|
|
66
|
-
color={statusColorMap[status]}
|
|
67
|
-
icon={<StatusIcon status={status} />}
|
|
68
|
-
data-test="status"
|
|
69
|
-
>
|
|
70
|
-
{statusLocaleMap[status]}
|
|
71
|
-
</Label>
|
|
72
|
-
)}
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
24
|
+
</Flex>
|
|
75
25
|
);
|
|
76
26
|
};
|
|
77
27
|
|
|
@@ -6,8 +6,6 @@ import {
|
|
|
6
6
|
QuickStartCatalogFilterStatusWrapper,
|
|
7
7
|
} from './QuickStartCatalogFilterItems';
|
|
8
8
|
|
|
9
|
-
import './QuickStartCatalogFilter.scss';
|
|
10
|
-
|
|
11
9
|
interface QuickStartCatalogFilterProps extends Omit<ToolbarProps, 'ref'> {
|
|
12
10
|
quickStartsCount: number;
|
|
13
11
|
onSearchInputChange: any;
|
|
@@ -20,13 +18,13 @@ const QuickStartCatalogFilter: React.FC<QuickStartCatalogFilterProps> = ({
|
|
|
20
18
|
onStatusChange = () => {},
|
|
21
19
|
...props
|
|
22
20
|
}) => (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
<Toolbar {...props}>
|
|
22
|
+
<ToolbarContent>
|
|
23
|
+
<QuickStartCatalogFilterSearchWrapper onSearchInputChange={onSearchInputChange} />
|
|
24
|
+
<QuickStartCatalogFilterStatusWrapper onStatusChange={onStatusChange} />
|
|
25
|
+
<QuickStartCatalogFilterCountWrapper quickStartsCount={quickStartsCount} />
|
|
26
|
+
</ToolbarContent>
|
|
27
|
+
</Toolbar>
|
|
28
|
+
);
|
|
31
29
|
|
|
32
30
|
export default QuickStartCatalogFilter;
|
|
@@ -17,7 +17,7 @@ import { QuickStartContext, QuickStartContextValues } from '../../utils/quick-st
|
|
|
17
17
|
export const QuickStartCatalogFilterSearch = ({ searchInputText, handleTextChange, ...props }) => {
|
|
18
18
|
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
19
19
|
return (
|
|
20
|
-
<ToolbarItem
|
|
20
|
+
<ToolbarItem>
|
|
21
21
|
<SearchInput
|
|
22
22
|
placeholder={getResource('Filter by keyword...')}
|
|
23
23
|
value={searchInputText}
|
|
@@ -71,10 +71,7 @@ export const QuickStartCatalogFilterSelect = ({
|
|
|
71
71
|
export const QuickStartCatalogFilterCount = ({ quickStartsCount }) => {
|
|
72
72
|
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
73
73
|
return (
|
|
74
|
-
<ToolbarItem
|
|
75
|
-
className="pfext-quick-start-catalog-filter__count"
|
|
76
|
-
align={{ default: 'alignEnd' }}
|
|
77
|
-
>
|
|
74
|
+
<ToolbarItem align={{ default: 'alignEnd' }}>
|
|
78
75
|
{getResource('{{count, number}} item', quickStartsCount).replace(
|
|
79
76
|
'{{count, number}}',
|
|
80
77
|
quickStartsCount,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Gallery,
|
|
2
|
+
import { Gallery, Card } from '@patternfly/react-core';
|
|
3
3
|
import { shallow } from 'enzyme';
|
|
4
4
|
import { EmptyBox } from '@console/internal/components/utils';
|
|
5
5
|
import { getQuickStarts } from '../../data/test-utils';
|
|
@@ -25,10 +25,10 @@ describe('QuickStartCatalog', () => {
|
|
|
25
25
|
const QuickStartCatalogWrapper = shallow(<QuickStartCatalog {...QuickStartCatalogProps} />);
|
|
26
26
|
expect(QuickStartCatalogWrapper.find(Gallery).exists()).toBeTruthy();
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
xit('should load galleryItems equal to the number of QS', () => {
|
|
29
29
|
const QuickStartCatalogProps = { quickStarts: getQuickStarts(), onClick: jest.fn() };
|
|
30
30
|
const QuickStartCatalogWrapper = shallow(<QuickStartCatalog {...QuickStartCatalogProps} />);
|
|
31
|
-
const galleryItems = QuickStartCatalogWrapper.find(
|
|
31
|
+
const galleryItems = QuickStartCatalogWrapper.find(Card);
|
|
32
32
|
expect(galleryItems.exists()).toBeTruthy();
|
|
33
33
|
expect(galleryItems.length).toEqual(getQuickStarts().length);
|
|
34
34
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Card } from '@patternfly/react-core';
|
|
3
3
|
import { shallow } from 'enzyme';
|
|
4
4
|
import { getQuickStarts } from '../../data/test-utils';
|
|
5
5
|
import { QuickStartStatus } from '../../utils/quick-start-types';
|
|
@@ -17,9 +17,9 @@ describe('QuickStartTile', () => {
|
|
|
17
17
|
isActive={false}
|
|
18
18
|
/>,
|
|
19
19
|
);
|
|
20
|
-
const catalogTile = wrapper.find(
|
|
20
|
+
const catalogTile = wrapper.find(Card);
|
|
21
21
|
expect(catalogTile.exists()).toBeTruthy();
|
|
22
|
-
expect(catalogTile.prop('
|
|
22
|
+
expect(catalogTile.prop('isSelected')).toBe(false);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
it('should load proper catalog tile with featured property', () => {
|
|
@@ -31,8 +31,8 @@ describe('QuickStartTile', () => {
|
|
|
31
31
|
isActive
|
|
32
32
|
/>,
|
|
33
33
|
);
|
|
34
|
-
const catalogTile = wrapper.find(
|
|
34
|
+
const catalogTile = wrapper.find(Card);
|
|
35
35
|
expect(catalogTile.exists()).toBeTruthy();
|
|
36
|
-
expect(catalogTile.prop('
|
|
36
|
+
expect(catalogTile.prop('isSelected')).toBe(true);
|
|
37
37
|
});
|
|
38
38
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Popover
|
|
2
|
+
import { Popover } from '@patternfly/react-core';
|
|
3
3
|
import { shallow } from 'enzyme';
|
|
4
4
|
import { getQuickStarts } from '../../data/test-utils';
|
|
5
5
|
import QuickStartTileDescription from '../QuickStartTileDescription';
|
|
@@ -45,16 +45,16 @@ const QuickStartConclusion: React.FC<QuickStartConclusionProps> = ({
|
|
|
45
45
|
variant="link"
|
|
46
46
|
onClick={() => onQuickStartChange(nextQuickStart.metadata.name)}
|
|
47
47
|
isInline
|
|
48
|
+
icon={<ArrowRightIcon />}
|
|
49
|
+
iconPosition="end"
|
|
48
50
|
isBlock
|
|
49
51
|
key={index}
|
|
52
|
+
style={{ marginTop: 'var(--pf-t--global--spacer--md' }}
|
|
50
53
|
>
|
|
51
54
|
{getResource('Start {{nextQSDisplayName}} quick start').replace(
|
|
52
55
|
'{{nextQSDisplayName}}',
|
|
53
56
|
nextQuickStart?.spec?.displayName,
|
|
54
|
-
)}
|
|
55
|
-
<ArrowRightIcon
|
|
56
|
-
style={{ marginLeft: 'var(--pf-t--global--spacer--xs)', verticalAlign: 'middle' }}
|
|
57
|
-
/>
|
|
57
|
+
)}
|
|
58
58
|
</Button>
|
|
59
59
|
))}
|
|
60
60
|
</>
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
.pfext-quick-start-
|
|
1
|
+
.pfext-quick-start-task {
|
|
2
2
|
flex: 1 1 0;
|
|
3
3
|
overflow: auto;
|
|
4
|
-
padding: var(--pf-t--global--spacer--lg);
|
|
5
|
-
font-size: 16px;
|
|
6
4
|
|
|
7
|
-
.pf-v6-c-
|
|
8
|
-
|
|
9
|
-
font-size: 13px;
|
|
10
|
-
}
|
|
5
|
+
.pf-v6-c-code-block, .pf-v6-c-alert, .pf-v6-c-accordion {
|
|
6
|
+
margin-block-end: var(--pf-v6-c-content--MarginBlockEnd);
|
|
11
7
|
}
|
|
12
8
|
}
|
|
@@ -3,9 +3,6 @@ import { QuickStart, QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
|
3
3
|
import QuickStartConclusion from './QuickStartConclusion';
|
|
4
4
|
import QuickStartIntroduction from './QuickStartIntroduction';
|
|
5
5
|
import QuickStartTasks from './QuickStartTasks';
|
|
6
|
-
|
|
7
|
-
import './QuickStartContent.scss';
|
|
8
|
-
|
|
9
6
|
interface QuickStartContentProps {
|
|
10
7
|
quickStart: QuickStart;
|
|
11
8
|
nextQuickStarts?: QuickStart[];
|
|
@@ -15,6 +12,7 @@ interface QuickStartContentProps {
|
|
|
15
12
|
onTaskReview: (taskStatus: QuickStartTaskStatus) => void;
|
|
16
13
|
onQuickStartChange?: (quickStartId: string) => void;
|
|
17
14
|
}
|
|
15
|
+
import './QuickStartContent.scss';
|
|
18
16
|
|
|
19
17
|
const QuickStartContent = React.forwardRef<HTMLDivElement, QuickStartContentProps>(
|
|
20
18
|
(
|
|
@@ -32,10 +30,10 @@ const QuickStartContent = React.forwardRef<HTMLDivElement, QuickStartContentProp
|
|
|
32
30
|
const {
|
|
33
31
|
spec: { introduction, tasks, conclusion, prerequisites },
|
|
34
32
|
} = quickStart;
|
|
35
|
-
const totalTasks = tasks
|
|
33
|
+
const totalTasks = tasks?.length;
|
|
36
34
|
|
|
37
35
|
return (
|
|
38
|
-
<div className="pfext-quick-start-
|
|
36
|
+
<div className="pfext-quick-start-task" ref={ref}>
|
|
39
37
|
{taskNumber === -1 && (
|
|
40
38
|
<QuickStartIntroduction
|
|
41
39
|
tasks={tasks}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
1
|
.pfext-quick-start-footer {
|
|
2
|
-
|
|
3
|
-
flex: 0 0 auto;
|
|
4
|
-
padding: var(--pf-t--global--spacer--md) var(--pf-t--global--spacer--lg);
|
|
5
|
-
|
|
6
|
-
&__actionbtn {
|
|
7
|
-
margin-right: var(--pf-t--global--spacer--md);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&__restartbtn {
|
|
11
|
-
float: right;
|
|
12
|
-
}
|
|
2
|
+
padding-top: var(--pf-t--global--spacer--md);
|
|
13
3
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button } from '@patternfly/react-core';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
3
4
|
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
4
5
|
import { QuickStartStatus } from '../utils/quick-start-types';
|
|
5
6
|
import { camelize } from '../utils/quick-start-utils';
|
|
6
|
-
|
|
7
|
+
import { ActionList, ActionListItem, ActionListGroup } from '@patternfly/react-core';
|
|
7
8
|
import './QuickStartFooter.scss';
|
|
8
9
|
|
|
9
10
|
export interface QuickStartFooterProps {
|
|
10
11
|
status: QuickStartStatus;
|
|
11
|
-
footerClass: string;
|
|
12
12
|
taskNumber: number;
|
|
13
13
|
totalTasks: number;
|
|
14
14
|
onNext: () => void;
|
|
15
15
|
onBack: () => void;
|
|
16
16
|
quickStartId: string;
|
|
17
|
+
className?: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
@@ -22,24 +23,29 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
22
23
|
totalTasks,
|
|
23
24
|
onNext,
|
|
24
25
|
onBack,
|
|
25
|
-
footerClass,
|
|
26
26
|
quickStartId,
|
|
27
|
+
className,
|
|
27
28
|
}) => {
|
|
28
|
-
const { restartQuickStart, getResource } =
|
|
29
|
-
QuickStartContext
|
|
30
|
-
);
|
|
29
|
+
const { restartQuickStart, getResource } =
|
|
30
|
+
React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
31
31
|
|
|
32
|
-
const PrimaryButtonText = React.useMemo(
|
|
32
|
+
const PrimaryButtonText = React.useMemo(
|
|
33
|
+
() => ({
|
|
33
34
|
START: getResource('Start'),
|
|
34
35
|
CONTINUE: getResource('Continue'),
|
|
35
36
|
NEXT: getResource('Next'),
|
|
36
37
|
CLOSE: getResource('Close'),
|
|
37
|
-
}),
|
|
38
|
+
}),
|
|
39
|
+
[getResource],
|
|
40
|
+
);
|
|
38
41
|
|
|
39
|
-
const SecondaryButtonText = React.useMemo(
|
|
42
|
+
const SecondaryButtonText = React.useMemo(
|
|
43
|
+
() => ({
|
|
40
44
|
BACK: getResource('Back'),
|
|
41
45
|
RESTART: getResource('Restart'),
|
|
42
|
-
}),
|
|
46
|
+
}),
|
|
47
|
+
[getResource],
|
|
48
|
+
);
|
|
43
49
|
|
|
44
50
|
const onRestart = React.useCallback(
|
|
45
51
|
(e: React.SyntheticEvent) => {
|
|
@@ -70,7 +76,6 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
70
76
|
() => (
|
|
71
77
|
<Button
|
|
72
78
|
variant="primary"
|
|
73
|
-
className="pfext-quick-start-footer__actionbtn"
|
|
74
79
|
onClick={onNext}
|
|
75
80
|
data-testid={`qs-drawer-${camelize(getPrimaryButtonText)}`}
|
|
76
81
|
data-test={`${getPrimaryButtonText} button`}
|
|
@@ -100,12 +105,7 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
100
105
|
const getSideNoteAction = React.useMemo(
|
|
101
106
|
() =>
|
|
102
107
|
taskNumber !== -1 && (
|
|
103
|
-
<Button
|
|
104
|
-
variant="link"
|
|
105
|
-
className="pfext-quick-start-footer__restartbtn"
|
|
106
|
-
onClick={onRestart}
|
|
107
|
-
data-testid="qs-drawer-side-note-action"
|
|
108
|
-
>
|
|
108
|
+
<Button variant="link" onClick={onRestart} data-testid="qs-drawer-side-note-action">
|
|
109
109
|
{SecondaryButtonText.RESTART}
|
|
110
110
|
</Button>
|
|
111
111
|
),
|
|
@@ -113,10 +113,16 @@ const QuickStartFooter: React.FC<QuickStartFooterProps> = ({
|
|
|
113
113
|
);
|
|
114
114
|
|
|
115
115
|
return (
|
|
116
|
-
<div className={
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
<div className={css('pfext-quick-start-footer', className)}>
|
|
117
|
+
<ActionList>
|
|
118
|
+
<ActionListGroup>
|
|
119
|
+
<ActionListItem>{getPrimaryButton}</ActionListItem>
|
|
120
|
+
<ActionListItem>{getSecondaryButton}</ActionListItem>
|
|
121
|
+
</ActionListGroup>
|
|
122
|
+
<ActionListGroup>
|
|
123
|
+
<ActionListItem>{getSideNoteAction}</ActionListItem>
|
|
124
|
+
</ActionListGroup>
|
|
125
|
+
</ActionList>
|
|
120
126
|
</div>
|
|
121
127
|
);
|
|
122
128
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ExpandableSection, List, ListItem } from '@patternfly/react-core';
|
|
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';
|
|
5
5
|
import { QuickStartTask, QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
6
6
|
import TaskHeaderList from './QuickStartTaskHeaderList';
|
|
7
7
|
|
|
8
|
-
import './QuickStartIntroduction.scss';
|
|
9
|
-
|
|
10
8
|
interface QuickStartIntroductionProps {
|
|
11
9
|
introduction: string;
|
|
12
10
|
tasks: QuickStartTask[];
|
|
@@ -32,32 +30,29 @@ const QuickStartIntroduction: React.FC<QuickStartIntroductionProps> = ({
|
|
|
32
30
|
prereqs.length,
|
|
33
31
|
)}
|
|
34
32
|
onToggle={() => setIsPrereqsExpanded(!isPrereqsExpanded)}
|
|
35
|
-
className="pfext-quick-start-intro__prereq"
|
|
36
33
|
>
|
|
37
|
-
<List
|
|
34
|
+
<List>
|
|
38
35
|
{prereqs.map((pr) => (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</ListItem>
|
|
44
|
-
))}
|
|
36
|
+
<ListItem key={pr}>
|
|
37
|
+
<QuickStartMarkdownView content={pr} />
|
|
38
|
+
</ListItem>
|
|
39
|
+
))}
|
|
45
40
|
</List>
|
|
46
41
|
</ExpandableSection>
|
|
47
42
|
);
|
|
48
43
|
return (
|
|
49
|
-
|
|
44
|
+
<Stack hasGutter>
|
|
50
45
|
<QuickStartMarkdownView content={introduction} />
|
|
51
46
|
{prereqList}
|
|
52
|
-
<p
|
|
47
|
+
<p>
|
|
53
48
|
{getResource(
|
|
54
49
|
'In this quick start, you will complete {{count, number}} task',
|
|
55
|
-
tasks
|
|
56
|
-
).replace('{{count, number}}', tasks
|
|
50
|
+
tasks?.length,
|
|
51
|
+
).replace('{{count, number}}', tasks?.length || 0)}
|
|
57
52
|
:
|
|
58
53
|
</p>
|
|
59
54
|
<TaskHeaderList tasks={tasks} allTaskStatuses={allTaskStatuses} onTaskSelect={onTaskSelect} />
|
|
60
|
-
|
|
55
|
+
</Stack>
|
|
61
56
|
);
|
|
62
57
|
};
|
|
63
58
|
|
|
@@ -1,58 +1,36 @@
|
|
|
1
|
+
button.pf-v6-c-wizard__nav-link {
|
|
2
|
+
margin-bottom: var(--pf-t--global--spacer--md);
|
|
3
|
+
}
|
|
4
|
+
button.pf-v6-c-wizard__nav-link.pf-m-current {
|
|
5
|
+
--pf-v6-c-wizard__nav-link-main--BackgroundColor: transparent;
|
|
6
|
+
}
|
|
7
|
+
button.pf-v6-c-wizard__nav-link::before {
|
|
8
|
+
background-color: var(--pf-v6-c-wizard__nav-link--m-current--before--BackgroundColor);
|
|
9
|
+
color: var(--pf-v6-c-wizard__nav-link--m-current--before--Color);
|
|
10
|
+
min-width: var(--pf-v6-c-wizard__nav-link--before--Width);
|
|
11
|
+
}
|
|
12
|
+
|
|
1
13
|
.pfext-quick-start-task-header {
|
|
2
|
-
margin-bottom: var(--pf-t--global--spacer--sm);
|
|
3
|
-
display: grid;
|
|
4
|
-
grid-template-columns: min-content auto;
|
|
5
|
-
font-size: var(--pf-t--global--font--size--body--default);
|
|
6
14
|
button::before {
|
|
7
15
|
content: none;
|
|
8
16
|
}
|
|
9
17
|
|
|
10
18
|
&__title {
|
|
11
|
-
|
|
12
|
-
|
|
19
|
+
font-family: var(--pf-t--global--font--family--body);
|
|
20
|
+
font-weight: var(---pf-t--global--font--weight--body--bold);
|
|
21
|
+
font-size: var(--pf-t--global--font--size--body--lg);
|
|
13
22
|
}
|
|
14
23
|
|
|
15
24
|
&__subtitle {
|
|
16
|
-
font-size: var(--pf-t--global--font--size--body--
|
|
17
|
-
color: var(--pf-t--global--text--color--subtle)
|
|
25
|
+
font-size: var(--pf-t--global--font--size--body--default);
|
|
26
|
+
color: var(--pf-t--global--text--color--subtle);
|
|
27
|
+
font-weight: var(--pf-t--global--font--weight--body)
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
&__tryagain {
|
|
21
31
|
display: block;
|
|
22
32
|
font-size: var(--pf-t--global--font--size--body--default);
|
|
23
|
-
color: var(--pf-t--global--text--color--subtle)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
&__title-success {
|
|
27
|
-
color: var(--pf-t--global--text--color--status--success--default) !important;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&__title-failed {
|
|
31
|
-
color: var(--pf-t--global--text--color--status--danger--default) !important;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&__task-icon {
|
|
35
|
-
&-init {
|
|
36
|
-
background-color: var(--pf-t--global--color--brand--default);
|
|
37
|
-
border-radius: var(--pf-t--global--border--radius--large);
|
|
38
|
-
color: var(--pf-t--global--text--color--on-brand--default);
|
|
39
|
-
display: inline-flex;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
height: 1.5em;
|
|
42
|
-
width: 1.5em;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&-success,
|
|
46
|
-
&-failed {
|
|
47
|
-
vertical-align: middle !important;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&-success {
|
|
51
|
-
color: var(--pf-t--global--text--color--status--success--default) !important;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&-failed {
|
|
55
|
-
color: var(--pf-t--global--text--color--status--danger--default) !important;
|
|
56
|
-
}
|
|
33
|
+
color: var(--pf-t--global--text--color--subtle);
|
|
34
|
+
font-weight: var(--pf-t--global--font--weight--body);
|
|
57
35
|
}
|
|
58
36
|
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
|
|
5
|
-
import { css } from '@patternfly/react-styles';
|
|
6
|
-
import { markdownConvert } from '../ConsoleInternal/components/markdown-view';
|
|
7
|
-
import { removeParagraphWrap } from '../QuickStartMarkdownView';
|
|
8
|
-
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
2
|
+
import { Title, WizardNavItem } from '@patternfly/react-core';
|
|
3
|
+
import { QuickStartContext } from '../utils/quick-start-context';
|
|
9
4
|
import { QuickStartTaskStatus } from '../utils/quick-start-types';
|
|
10
5
|
|
|
11
6
|
import './QuickStartTaskHeader.scss';
|
|
@@ -21,40 +16,6 @@ interface QuickStartTaskHeaderProps {
|
|
|
21
16
|
children?: React.ReactNode;
|
|
22
17
|
}
|
|
23
18
|
|
|
24
|
-
const TaskIcon: React.FC<{
|
|
25
|
-
taskIndex: number;
|
|
26
|
-
taskStatus: QuickStartTaskStatus;
|
|
27
|
-
}> = ({ taskIndex, taskStatus }) => {
|
|
28
|
-
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
29
|
-
const success = taskStatus === QuickStartTaskStatus.SUCCESS;
|
|
30
|
-
const failed = taskStatus === QuickStartTaskStatus.FAILED;
|
|
31
|
-
|
|
32
|
-
const classNames = css('pfext-icon-and-text__icon', {
|
|
33
|
-
'pfext-quick-start-task-header__task-icon-init': !failed && !success,
|
|
34
|
-
});
|
|
35
|
-
let content: React.ReactNode;
|
|
36
|
-
|
|
37
|
-
if (success) {
|
|
38
|
-
content = (
|
|
39
|
-
<Icon size="md">
|
|
40
|
-
<CheckCircleIcon className="pfext-quick-start-task-header__task-icon-success" />{' '}
|
|
41
|
-
</Icon>
|
|
42
|
-
);
|
|
43
|
-
} else if (failed) {
|
|
44
|
-
content = (
|
|
45
|
-
<Icon size="md">
|
|
46
|
-
<ExclamationCircleIcon className="pfext-quick-start-task-header__task-icon-failed" />
|
|
47
|
-
</Icon>
|
|
48
|
-
);
|
|
49
|
-
} else {
|
|
50
|
-
content = getResource('{{taskIndex, number}}', taskIndex).replace(
|
|
51
|
-
'{{taskIndex, number}}',
|
|
52
|
-
taskIndex,
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
return <span className={classNames}>{content}</span>;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
19
|
const QuickStartTaskHeader: React.FC<QuickStartTaskHeaderProps> = ({
|
|
59
20
|
title,
|
|
60
21
|
taskIndex,
|
|
@@ -66,23 +27,16 @@ const QuickStartTaskHeader: React.FC<QuickStartTaskHeaderProps> = ({
|
|
|
66
27
|
children,
|
|
67
28
|
}) => {
|
|
68
29
|
const titleRef = React.useRef(null);
|
|
30
|
+
const { focusOnQuickStart } = React.useContext(QuickStartContext);
|
|
31
|
+
|
|
69
32
|
React.useEffect(() => {
|
|
70
|
-
if (isActiveTask) {
|
|
33
|
+
if (focusOnQuickStart && isActiveTask) {
|
|
71
34
|
// Focus the WizardNavItem button element that contains the title
|
|
72
35
|
titleRef.current.parentNode.focus();
|
|
73
36
|
}
|
|
74
|
-
}, [isActiveTask]);
|
|
75
|
-
const classNames = css('pfext-quick-start-task-header__title', {
|
|
76
|
-
'pfext-quick-start-task-header__title-success': taskStatus === QuickStartTaskStatus.SUCCESS,
|
|
77
|
-
'pfext-quick-start-task-header__title-failed':
|
|
78
|
-
taskStatus === (QuickStartTaskStatus.FAILED || QuickStartTaskStatus.VISITED),
|
|
79
|
-
});
|
|
80
|
-
// const notCompleted = taskStatus === QuickStartTaskStatus.VISITED;
|
|
81
|
-
// const skippedReview = taskStatus === QuickStartTaskStatus.REVIEW;
|
|
37
|
+
}, [focusOnQuickStart, isActiveTask]);
|
|
82
38
|
const failedReview = taskStatus === QuickStartTaskStatus.FAILED;
|
|
83
39
|
|
|
84
|
-
// TODO: toned down when this is shown, investigate further when we should display it
|
|
85
|
-
// related: https://github.com/patternfly/patternfly-quickstarts/issues/104
|
|
86
40
|
const tryAgain = failedReview && (
|
|
87
41
|
<>
|
|
88
42
|
<div />
|
|
@@ -92,23 +46,31 @@ const QuickStartTaskHeader: React.FC<QuickStartTaskHeaderProps> = ({
|
|
|
92
46
|
|
|
93
47
|
const content = (
|
|
94
48
|
<div ref={titleRef}>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
49
|
+
<Title headingLevel="h3" size={size}>
|
|
50
|
+
<span className="pfext-quick-start-task-header__title">{title}</span>
|
|
51
|
+
{isActiveTask && subtitle && (
|
|
52
|
+
<span>
|
|
53
|
+
{' '}
|
|
98
54
|
<span
|
|
99
55
|
data-test-id="quick-start-task-subtitle"
|
|
56
|
+
className="pfext-quick-start-task-header__subtitle"
|
|
100
57
|
>
|
|
101
|
-
{
|
|
102
|
-
<Text component={TextVariants.small}>
|
|
103
|
-
{subtitle}
|
|
104
|
-
</Text>
|
|
58
|
+
{subtitle}
|
|
105
59
|
</span>
|
|
106
|
-
|
|
60
|
+
</span>
|
|
61
|
+
)}
|
|
107
62
|
{tryAgain}
|
|
108
|
-
|
|
109
|
-
</div>
|
|
63
|
+
</Title>
|
|
64
|
+
</div>
|
|
110
65
|
);
|
|
111
66
|
|
|
67
|
+
let status: 'default' | 'error' | 'success' = 'default';
|
|
68
|
+
if (taskStatus === QuickStartTaskStatus.FAILED) {
|
|
69
|
+
status = 'error';
|
|
70
|
+
} else if (taskStatus === QuickStartTaskStatus.SUCCESS) {
|
|
71
|
+
status = 'success';
|
|
72
|
+
}
|
|
73
|
+
|
|
112
74
|
return (
|
|
113
75
|
<WizardNavItem
|
|
114
76
|
content={content}
|
|
@@ -116,6 +78,7 @@ const QuickStartTaskHeader: React.FC<QuickStartTaskHeaderProps> = ({
|
|
|
116
78
|
onClick={() => onTaskSelect(taskIndex - 1)}
|
|
117
79
|
component="button"
|
|
118
80
|
isCurrent={isActiveTask}
|
|
81
|
+
status={status}
|
|
119
82
|
>
|
|
120
83
|
{children}
|
|
121
84
|
</WizardNavItem>
|