@shopgate/pwa-ui-shared 7.32.0-beta.5 → 7.32.0-beta.7
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/Card/index.js
CHANGED
|
@@ -1,40 +1,19 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const useStyles = makeStyles()(theme => ({
|
|
6
|
-
root: {
|
|
7
|
-
boxShadow: '0 4px 8px rgba(0,0,0,0.16)',
|
|
8
|
-
margin: '5px 5px 10px',
|
|
9
|
-
borderRadius: 10,
|
|
10
|
-
background: theme.palette.background.surface,
|
|
11
|
-
overflow: 'hidden',
|
|
12
|
-
position: 'relative'
|
|
13
|
-
}
|
|
14
|
-
}));
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { logger } from '@shopgate/engage/core/helpers';
|
|
3
|
+
import { Card } from '@shopgate/engage/components';
|
|
15
4
|
|
|
16
5
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @param {Object} props The component
|
|
6
|
+
* @deprecated Use `import { Card } from '@shopgate/engage/components'` instead.
|
|
7
|
+
* @param {Object} props The component props.
|
|
19
8
|
* @returns {JSX}
|
|
20
9
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
cx
|
|
29
|
-
} = useStyles();
|
|
30
|
-
return /*#__PURE__*/_jsx("div", {
|
|
31
|
-
className: cx('ui-shared__card', classes.root, className),
|
|
32
|
-
id: id,
|
|
33
|
-
children: children
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const DeprecatedCard = props => {
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
logger.warn('===== Card deprecated =====\n' + 'The Card component ' + '(@shopgate/pwa-ui-shared/Card) is deprecated.\n' + 'Please use: import { Card } from \'@shopgate/engage/components\'.\n' + '===================================');
|
|
14
|
+
}, []);
|
|
15
|
+
return /*#__PURE__*/_jsx(Card, {
|
|
16
|
+
...props
|
|
34
17
|
});
|
|
35
18
|
};
|
|
36
|
-
|
|
37
|
-
className: '',
|
|
38
|
-
id: null
|
|
39
|
-
};
|
|
40
|
-
export default Card;
|
|
19
|
+
export default DeprecatedCard;
|
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItem from '@shopgate/pwa-common/components/List/components/Item';
|
|
4
3
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const useStyles = makeStyles()(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
marginBottom: theme.spacing(0.5),
|
|
5
|
+
const useStyles = makeStyles()({
|
|
6
|
+
item: {
|
|
7
|
+
display: 'block',
|
|
10
8
|
position: 'relative'
|
|
9
|
+
},
|
|
10
|
+
unselected: {
|
|
11
|
+
zIndex: 1
|
|
12
|
+
},
|
|
13
|
+
selected: {
|
|
14
|
+
zIndex: 2
|
|
11
15
|
}
|
|
12
|
-
})
|
|
16
|
+
});
|
|
13
17
|
|
|
14
18
|
/**
|
|
15
|
-
* The
|
|
16
|
-
* @
|
|
17
|
-
* @return {JSX}
|
|
19
|
+
* The ListItem component.
|
|
20
|
+
* @returns {JSX}
|
|
18
21
|
*/
|
|
19
|
-
const
|
|
22
|
+
const ListItem = ({
|
|
20
23
|
children,
|
|
21
24
|
className,
|
|
22
|
-
isSelected
|
|
25
|
+
isSelected,
|
|
26
|
+
role
|
|
23
27
|
}) => {
|
|
24
28
|
const {
|
|
25
29
|
classes,
|
|
26
30
|
cx
|
|
27
31
|
} = useStyles();
|
|
28
|
-
if (!Children.count(children)) {
|
|
32
|
+
if (!React.Children.count(children)) {
|
|
29
33
|
return null;
|
|
30
34
|
}
|
|
31
|
-
return /*#__PURE__*/_jsx(
|
|
32
|
-
className: cx(classes.
|
|
33
|
-
|
|
35
|
+
return /*#__PURE__*/_jsx("li", {
|
|
36
|
+
className: cx(classes.item, className, 'common__list__list-item', isSelected ? classes.selected : classes.unselected),
|
|
37
|
+
"data-test-id": "listItem",
|
|
38
|
+
role: role,
|
|
34
39
|
children: children
|
|
35
40
|
});
|
|
36
41
|
};
|
|
37
|
-
|
|
38
|
-
children: null,
|
|
42
|
+
ListItem.defaultProps = {
|
|
39
43
|
className: null,
|
|
40
|
-
|
|
44
|
+
children: null,
|
|
45
|
+
isSelected: false,
|
|
46
|
+
role: null
|
|
41
47
|
};
|
|
42
|
-
export default
|
|
48
|
+
export default ListItem;
|
|
@@ -33,7 +33,8 @@ const PipelineErrorDialog = ({
|
|
|
33
33
|
params,
|
|
34
34
|
message
|
|
35
35
|
}) => {
|
|
36
|
-
|
|
36
|
+
// May be opened directly in developer detail mode (e.g. via long-pressing an error toast).
|
|
37
|
+
const [devMode, setDevMode] = useState(!!params.openWithDetails);
|
|
37
38
|
const tapTimeoutRef = useRef(null);
|
|
38
39
|
const tapCounterRef = useRef(0);
|
|
39
40
|
const handleTapTimeout = useCallback(() => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { mount } from 'enzyme';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import '@testing-library/jest-dom';
|
|
3
5
|
import PipelineErrorDialog from "./index";
|
|
4
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
7
|
jest.mock('@shopgate/engage/a11y/components');
|
|
@@ -51,6 +53,20 @@ describe('<PipelineErrorDialog />', () => {
|
|
|
51
53
|
clickElement.simulate('click');
|
|
52
54
|
expect(wrapper.text()).not.toContain(devMarker);
|
|
53
55
|
});
|
|
56
|
+
it('should open directly in developer detail mode when params.openWithDetails is set', () => {
|
|
57
|
+
render(/*#__PURE__*/_jsx(PipelineErrorDialog, {
|
|
58
|
+
actions: [],
|
|
59
|
+
params: {
|
|
60
|
+
...defaultParams,
|
|
61
|
+
openWithDetails: true
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
// Developer detail view is shown immediately, without any tapping.
|
|
66
|
+
expect(screen.getByText('Pipeline:')).toBeInTheDocument();
|
|
67
|
+
expect(screen.getByText('Code:')).toBeInTheDocument();
|
|
68
|
+
expect(screen.getByText(/fakePipeline/)).toBeInTheDocument();
|
|
69
|
+
});
|
|
54
70
|
it('should not switch modes if tapped too slow', () => {
|
|
55
71
|
jest.useFakeTimers();
|
|
56
72
|
const wrapper = mount(/*#__PURE__*/_jsx(PipelineErrorDialog, {
|
package/RatingStars/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-ui-shared",
|
|
3
|
-
"version": "7.32.0-beta.
|
|
3
|
+
"version": "7.32.0-beta.7",
|
|
4
4
|
"description": "Shopgate's shared UI components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@shopgate/pwa-ui-ios": "7.32.0-beta.
|
|
9
|
-
"@shopgate/pwa-ui-material": "7.32.0-beta.
|
|
8
|
+
"@shopgate/pwa-ui-ios": "7.32.0-beta.7",
|
|
9
|
+
"@shopgate/pwa-ui-material": "7.32.0-beta.7"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@shopgate/pwa-common": "7.32.0-beta.
|
|
13
|
-
"@shopgate/pwa-common-commerce": "7.32.0-beta.
|
|
12
|
+
"@shopgate/pwa-common": "7.32.0-beta.7",
|
|
13
|
+
"@shopgate/pwa-common-commerce": "7.32.0-beta.7",
|
|
14
14
|
"classnames": "2.5.1",
|
|
15
15
|
"react": "^17.0.2"
|
|
16
16
|
},
|