@patternfly/quickstarts 6.0.0-alpha.2 → 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 +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 +20 -66
- package/dist/patternfly-nested.css +2036 -2119
- package/dist/quickstarts-base.css +40 -420
- package/dist/quickstarts-full.es.js +715 -804
- 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
|
@@ -1,104 +1,27 @@
|
|
|
1
|
-
import './QuickStartTileHeader.scss';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
import { Button,
|
|
4
|
-
import OutlinedClockIcon from '@patternfly/react-icons/dist/js/icons/outlined-clock-icon';
|
|
5
|
-
import OutlinedBookmarkIcon from '@patternfly/react-icons/dist/js/icons/outlined-bookmark-icon';
|
|
6
|
-
import { StatusIcon } from '@console/shared';
|
|
7
|
-
import { QuickStartContext, QuickStartContextValues } from '../utils/quick-start-context';
|
|
8
|
-
import { QuickStartStatus, QuickStartType } from '../utils/quick-start-types';
|
|
2
|
+
import { Button, Flex, Title } from '@patternfly/react-core';
|
|
9
3
|
import QuickStartMarkdownView from '../QuickStartMarkdownView';
|
|
10
4
|
|
|
11
|
-
export interface QuickstartAction {
|
|
12
|
-
/** Screen reader aria label. */
|
|
13
|
-
'aria-label': string;
|
|
14
|
-
/** Icon to be rendered as a plain button, by default Bookmark outlined will be used. */
|
|
15
|
-
icon?: React.ComponentType<unknown>;
|
|
16
|
-
/** Callback with synthetic event parameter. */
|
|
17
|
-
onClick?: (e: React.SyntheticEvent) => void;
|
|
18
|
-
/** Additional button props to be rendered as extra props. */
|
|
19
|
-
buttonProps?: ButtonProps;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
5
|
interface QuickStartTileHeaderProps {
|
|
23
|
-
status: string;
|
|
24
|
-
duration: number;
|
|
25
6
|
name: string;
|
|
26
|
-
type?: QuickStartType;
|
|
27
7
|
quickStartId?: string;
|
|
28
|
-
|
|
8
|
+
onSelect: (e: React.FormEvent<HTMLInputElement> | React.MouseEvent<Element, MouseEvent>) => void;
|
|
29
9
|
}
|
|
30
10
|
|
|
31
|
-
const statusColorMap = {
|
|
32
|
-
[QuickStartStatus.COMPLETE]: 'green',
|
|
33
|
-
[QuickStartStatus.IN_PROGRESS]: 'purple',
|
|
34
|
-
[QuickStartStatus.NOT_STARTED]: 'grey',
|
|
35
|
-
};
|
|
36
|
-
|
|
37
11
|
const QuickStartTileHeader: React.FC<QuickStartTileHeaderProps> = ({
|
|
38
|
-
status,
|
|
39
|
-
duration,
|
|
40
12
|
name,
|
|
41
|
-
type,
|
|
42
13
|
quickStartId,
|
|
43
|
-
|
|
14
|
+
onSelect,
|
|
44
15
|
}) => {
|
|
45
|
-
const { getResource } = React.useContext<QuickStartContextValues>(QuickStartContext);
|
|
46
|
-
|
|
47
|
-
const statusLocaleMap = {
|
|
48
|
-
[QuickStartStatus.COMPLETE]: getResource('Complete'),
|
|
49
|
-
[QuickStartStatus.IN_PROGRESS]: getResource('In progress'),
|
|
50
|
-
[QuickStartStatus.NOT_STARTED]: getResource('Not started'),
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const ActionIcon = action?.icon || OutlinedBookmarkIcon;
|
|
54
16
|
|
|
55
17
|
return (
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
<
|
|
18
|
+
<Flex flexWrap={{ default: 'nowrap' }}>
|
|
19
|
+
<Title headingLevel="h3" data-test="title" id={quickStartId}>
|
|
20
|
+
<Button variant="link" isInline onClick={onSelect}>
|
|
59
21
|
<QuickStartMarkdownView content={name} />
|
|
60
|
-
</
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
aria-label={action['aria-label']}
|
|
64
|
-
icon={<ActionIcon />}
|
|
65
|
-
variant="plain"
|
|
66
|
-
onClick={action.onClick}
|
|
67
|
-
{...action.buttonProps}
|
|
68
|
-
/>
|
|
69
|
-
)}
|
|
70
|
-
</Flex>
|
|
71
|
-
<div className="pfext-quick-start-tile-header__status">
|
|
72
|
-
{type && (
|
|
73
|
-
<Label className="pfext-quick-start-tile-header--margin" color={type.color}>
|
|
74
|
-
{type.text}
|
|
75
|
-
</Label>
|
|
76
|
-
)}
|
|
77
|
-
{duration && (
|
|
78
|
-
<Label
|
|
79
|
-
variant="outline"
|
|
80
|
-
data-test="duration"
|
|
81
|
-
icon={<OutlinedClockIcon />}
|
|
82
|
-
className="pfext-quick-start-tile-header--margin"
|
|
83
|
-
>
|
|
84
|
-
{getResource('{{duration, number}} minutes', duration).replace(
|
|
85
|
-
'{{duration, number}}',
|
|
86
|
-
duration,
|
|
87
|
-
)}
|
|
88
|
-
</Label>
|
|
89
|
-
)}
|
|
90
|
-
{status !== QuickStartStatus.NOT_STARTED && (
|
|
91
|
-
<Label
|
|
92
|
-
variant="outline"
|
|
93
|
-
color={statusColorMap[status]}
|
|
94
|
-
icon={<StatusIcon status={status} />}
|
|
95
|
-
data-test="status"
|
|
96
|
-
>
|
|
97
|
-
{statusLocaleMap[status]}
|
|
98
|
-
</Label>
|
|
99
|
-
)}
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
22
|
+
</Button>
|
|
23
|
+
</Title>
|
|
24
|
+
</Flex>
|
|
102
25
|
);
|
|
103
26
|
};
|
|
104
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';
|
package/src/catalog/index.ts
CHANGED
|
@@ -4,6 +4,6 @@ export { default as QuickStartTile } from './QuickStartTile';
|
|
|
4
4
|
export { default as QuickStartTileDescription } from './QuickStartTileDescription';
|
|
5
5
|
export { default as QuickStartTileFooter } from './QuickStartTileFooter';
|
|
6
6
|
export { default as QuickStartTileFooterExternal } from './QuickStartTileFooterExternal';
|
|
7
|
-
export { default as QuickStartTileHeader
|
|
7
|
+
export { default as QuickStartTileHeader } from './QuickStartTileHeader';
|
|
8
8
|
export * from './Toolbar/QuickStartCatalogFilterItems';
|
|
9
9
|
export * from './Catalog';
|
|
@@ -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
|
}
|