@configuratorware/configurator-frontendgui 1.49.9 → 1.50.0
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/App/Error/ProductionErrorPage/index.js +5 -1
- package/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +2 -1
- package/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +2 -1
- package/App/Modules/Creator/Components/Incompatibility/index.js +1 -2
- package/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +8 -31
- package/App/Modules/Creator/Components/Option/index.js +18 -14
- package/App/Modules/Creator/Components/OptionAmount/index.js +11 -7
- package/App/Modules/Creator/Components/ProductPart/index.js +20 -25
- package/App/Modules/Creator/Components/ProductPartsList/index.js +0 -2
- package/App/Modules/Creator/Layouts/DefaultLayout.js +8 -9
- package/App/Modules/Designer/Components/AddGalleryImage/index.js +5 -2
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +0 -2
- package/App/Modules/Designer/Components/Dialog/index.js +1 -3
- package/App/Modules/Designer/Components/ImageControlbox/index.js +1 -3
- package/App/Reducers/Reducer.js +8 -2
- package/App/Screens/Configurator/Components/Confirm/index.js +1 -5
- package/App/Screens/Configurator/Components/Error/index.js +0 -3
- package/App/Screens/Configurator/Components/FullScreenView/index.js +2 -5
- package/App/Screens/Configurator/Components/FullScreenView/index.test.js +1 -1
- package/App/Screens/Configurator/Components/PreviewPortal/index.js +23 -28
- package/App/Screens/Configurator/Components/Thumbnail/index.js +9 -6
- package/App/Screens/Configurator/ThemeProvider.js +7 -4
- package/App/Shared/Components/AccessibleButton/AccessibleButton.js +40 -0
- package/App/Shared/Components/AlertDialog/index.js +0 -3
- package/App/Shared/Components/AmountPrice/index.js +29 -20
- package/App/Shared/Components/Analytics/AnalyticsWrapper.js +7 -1
- package/App/Shared/Components/AutoFocusDialogContentContainer/AutoFocusDialogContentContainer.js +71 -0
- package/App/Shared/Components/BulkNames/index.js +9 -6
- package/App/Shared/Components/LoadConfiguration/index.js +0 -2
- package/App/Shared/Components/PdfDownload/index.js +0 -2
- package/App/Shared/Components/SaveConfiguration/index.js +3 -4
- package/App/Shared/Components/SendEmail/index.js +0 -2
- package/App/Shared/Components/ToolbarList/index.js +18 -16
- package/App/Shared/Hooks/useDialogId.js +19 -0
- package/Shared/Components/CustomDialog.js +77 -56
- package/package.json +4 -4
- package/public/invoke.js +1 -1
- package/public/translations/de_DE.json +2 -1
- package/public/translations/en_GB.json +2 -1
- package/scripts/utils/fileSystem.js +6 -1
- package/src/App/Error/ProductionErrorPage/index.js +27 -24
- package/src/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +1 -1
- package/src/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +1 -1
- package/src/App/Modules/Creator/Components/Incompatibility/index.js +1 -2
- package/src/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +10 -27
- package/src/App/Modules/Creator/Components/Option/__snapshots__/index.test.js.snap +142 -90
- package/src/App/Modules/Creator/Components/Option/index.js +30 -14
- package/src/App/Modules/Creator/Components/OptionAmount/__snapshots__/index.test.js.snap +31 -18
- package/src/App/Modules/Creator/Components/OptionAmount/index.js +7 -2
- package/src/App/Modules/Creator/Components/ProductPart/__snapshots__/index.test.js.snap +32 -24
- package/src/App/Modules/Creator/Components/ProductPart/index.js +20 -27
- package/src/App/Modules/Creator/Components/ProductPartsList/index.js +0 -2
- package/src/App/Modules/Creator/Layouts/DefaultLayout.js +12 -13
- package/src/App/Modules/Designer/Components/AddGalleryImage/__snapshots__/index.test.jsx.snap +1 -0
- package/src/App/Modules/Designer/Components/AddGalleryImage/index.js +4 -1
- package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +0 -2
- package/src/App/Modules/Designer/Components/Dialog/index.js +1 -1
- package/src/App/Modules/Designer/Components/ImageControlbox/index.js +0 -2
- package/src/App/Reducers/Reducer.js +7 -0
- package/src/App/Screens/Configurator/Components/Confirm/index.js +1 -3
- package/src/App/Screens/Configurator/Components/Error/index.js +2 -11
- package/src/App/Screens/Configurator/Components/FullScreenView/__snapshots__/index.test.jsx.snap +3 -4
- package/src/App/Screens/Configurator/Components/FullScreenView/index.js +17 -17
- package/src/App/Screens/Configurator/Components/FullScreenView/index.test.jsx +1 -1
- package/src/App/Screens/Configurator/Components/PreviewPortal/index.js +23 -32
- package/src/App/Screens/Configurator/Components/Thumbnail/__snapshots__/index.test.jsx.snap +32 -8
- package/src/App/Screens/Configurator/Components/Thumbnail/index.js +8 -5
- package/src/App/Screens/Configurator/ThemeProvider.js +6 -3
- package/src/App/Shared/Components/AccessibleButton/AccessibleButton.js +29 -0
- package/src/App/Shared/Components/AlertDialog/index.js +1 -6
- package/src/App/Shared/Components/AmountPrice/__snapshots__/index.test.jsx.snap +15 -15
- package/src/App/Shared/Components/AmountPrice/index.js +31 -21
- package/src/App/Shared/Components/Analytics/AnalyticsWrapper.js +6 -0
- package/src/App/Shared/Components/AutoFocusDialogContentContainer/AutoFocusDialogContentContainer.jsx +52 -0
- package/src/App/Shared/Components/BulkNames/index.js +11 -6
- package/src/App/Shared/Components/LoadConfiguration/index.js +0 -2
- package/src/App/Shared/Components/PdfDownload/index.js +0 -2
- package/src/App/Shared/Components/SaveConfiguration/index.js +6 -4
- package/src/App/Shared/Components/SendEmail/index.js +0 -2
- package/src/App/Shared/Components/ToolbarList/__snapshots__/ToolbarList.test.js.snap +44 -20
- package/src/App/Shared/Components/ToolbarList/index.js +30 -27
- package/src/App/Shared/Hooks/useDialogId.js +11 -0
- package/src/Shared/Components/CustomDialog.js +60 -43
- package/App/Modules/Creator/Components/LoginForm/Styles.scss +0 -9
- package/App/Modules/Creator/Components/LoginForm/index.js +0 -91
- package/App/Modules/Creator/Components/SavedConfiguration/Styles.scss +0 -19
- package/App/Modules/Creator/Components/SavedConfiguration/index.js +0 -50
- package/App/Modules/Creator/Components/ShareConfiguration/Styles.scss +0 -23
- package/App/Modules/Creator/Components/ShareConfiguration/index.js +0 -165
- package/App/Modules/Creator/Components/StockInformation/index.js +0 -62
- package/App/Modules/Creator/Components/StoreConfigurationForm/Styles.scss +0 -5
- package/App/Modules/Creator/Components/StoreConfigurationForm/index.js +0 -86
- package/App/Modules/Creator/Components/ValidationResult/Styles.scss +0 -45
- package/App/Modules/Creator/Components/ValidationResult/index.js +0 -119
- package/App/Modules/Creator/Components/index.js +0 -57
- package/src/App/Modules/Creator/Components/LoginForm/Styles.scss +0 -9
- package/src/App/Modules/Creator/Components/LoginForm/index.js +0 -69
- package/src/App/Modules/Creator/Components/SavedConfiguration/Styles.scss +0 -19
- package/src/App/Modules/Creator/Components/SavedConfiguration/index.js +0 -37
- package/src/App/Modules/Creator/Components/ShareConfiguration/Styles.scss +0 -23
- package/src/App/Modules/Creator/Components/ShareConfiguration/index.js +0 -161
- package/src/App/Modules/Creator/Components/StockInformation/index.js +0 -39
- package/src/App/Modules/Creator/Components/StoreConfigurationForm/Styles.scss +0 -5
- package/src/App/Modules/Creator/Components/StoreConfigurationForm/index.js +0 -73
- package/src/App/Modules/Creator/Components/ValidationResult/Styles.scss +0 -45
- package/src/App/Modules/Creator/Components/ValidationResult/index.js +0 -89
- package/src/App/Modules/Creator/Components/index.js +0 -51
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import isFunction from 'lodash/isFunction';
|
|
5
4
|
import Icon from '@material-ui/core/Icon';
|
|
6
5
|
import { withStyles } from '@material-ui/core/styles';
|
|
7
6
|
import withWidth from '@material-ui/core/withWidth';
|
|
8
|
-
import Typography from '@material-ui/core/Typography';
|
|
9
7
|
import Button from '@material-ui/core/Button';
|
|
10
8
|
import Grid from '@material-ui/core/Grid';
|
|
11
9
|
import { withAlignTarget } from 'redhotmagma-visualization/AlignTargetProvider';
|
|
12
10
|
import { t } from 'Framework/i18n';
|
|
13
11
|
import AnalyticsWrapper from 'App/Shared/Components/Analytics/AnalyticsWrapper';
|
|
14
12
|
import Thumbnails from '../../Containers/Thumbnail';
|
|
13
|
+
import Dialog from '@material-ui/core/Dialog';
|
|
14
|
+
import { CustomDialogHeader } from '../../../../../Shared/Components/CustomDialog';
|
|
15
|
+
import { withAnalyticsTarget } from '../../../../Shared/Components/Analytics/AnalyticsWrapper';
|
|
15
16
|
|
|
16
17
|
const styles = theme => ({
|
|
17
18
|
fullscreenPortal: {
|
|
@@ -122,26 +123,20 @@ class PreviewPortal extends React.Component {
|
|
|
122
123
|
}
|
|
123
124
|
};
|
|
124
125
|
|
|
125
|
-
|
|
126
|
-
const { hasMoreItems, closePreviewMode, classes, children, width
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
: classes.fullscreenPortal;
|
|
126
|
+
render() {
|
|
127
|
+
const { hasMoreItems, closePreviewMode, classes, children, width } = this.props;
|
|
128
|
+
|
|
129
|
+
const dialogTitleId = 'product-preview-dialog-title';
|
|
130
130
|
|
|
131
131
|
return (
|
|
132
|
-
<
|
|
132
|
+
<Dialog fullScreen open aria-labelledby={dialogTitleId} onClose={closePreviewMode}>
|
|
133
133
|
<div className={classes.fullScreenTitle}>
|
|
134
134
|
{width === 'xs' && (
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<Icon className="previewClose" onClick={closePreviewMode}>
|
|
141
|
-
close
|
|
142
|
-
</Icon>
|
|
143
|
-
</AnalyticsWrapper>
|
|
144
|
-
</React.Fragment>
|
|
135
|
+
<CustomDialogHeader
|
|
136
|
+
dialogTitle={t('configurator.previewTitle')}
|
|
137
|
+
dialogTitleId={dialogTitleId}
|
|
138
|
+
onClose={withAnalyticsTarget(closePreviewMode, 'preview_close')}
|
|
139
|
+
/>
|
|
145
140
|
)}
|
|
146
141
|
</div>
|
|
147
142
|
<div
|
|
@@ -154,13 +149,13 @@ class PreviewPortal extends React.Component {
|
|
|
154
149
|
</div>
|
|
155
150
|
{hasMoreItems && <Thumbnails previewOpen={true} />}
|
|
156
151
|
{width !== 'xs' && (
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
>
|
|
152
|
+
<Grid
|
|
153
|
+
container
|
|
154
|
+
className={classes.CloseEditorRoot}
|
|
155
|
+
alignItems="center"
|
|
156
|
+
justifyContent="center"
|
|
157
|
+
>
|
|
158
|
+
<AnalyticsWrapper targetId="preview_close">
|
|
164
159
|
<Button
|
|
165
160
|
variant="text"
|
|
166
161
|
onClick={closePreviewMode}
|
|
@@ -176,16 +171,12 @@ class PreviewPortal extends React.Component {
|
|
|
176
171
|
</Icon>
|
|
177
172
|
<b>{t('configurator.previewClose')}</b>
|
|
178
173
|
</Button>
|
|
179
|
-
</
|
|
180
|
-
</
|
|
174
|
+
</AnalyticsWrapper>
|
|
175
|
+
</Grid>
|
|
181
176
|
)}
|
|
182
|
-
</
|
|
177
|
+
</Dialog>
|
|
183
178
|
);
|
|
184
179
|
}
|
|
185
|
-
|
|
186
|
-
render() {
|
|
187
|
-
return ReactDOM.createPortal(this.renderPreview(), document.getElementById('frame'));
|
|
188
|
-
}
|
|
189
180
|
}
|
|
190
181
|
|
|
191
182
|
export default withWidth()(withStyles(styles, { name: 'Portal' })(withAlignTarget(PreviewPortal)));
|
|
@@ -6,7 +6,10 @@ exports[`renders dots correctly 1`] = `
|
|
|
6
6
|
class="Thumbnail-dots-7"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
|
-
|
|
9
|
+
aria-disabled="false"
|
|
10
|
+
class="MuiButtonBase-root AccessibleButton-root-12 Thumbnail-dotContainer-9 "
|
|
11
|
+
role="button"
|
|
12
|
+
tabindex="0"
|
|
10
13
|
>
|
|
11
14
|
<div
|
|
12
15
|
class="MuiTypography-root Thumbnail-inactiveDotMode-10 MuiTypography-body1"
|
|
@@ -15,7 +18,10 @@ exports[`renders dots correctly 1`] = `
|
|
|
15
18
|
</div>
|
|
16
19
|
</div>
|
|
17
20
|
<div
|
|
18
|
-
|
|
21
|
+
aria-disabled="false"
|
|
22
|
+
class="MuiButtonBase-root AccessibleButton-root-12 Thumbnail-dotContainer-9 "
|
|
23
|
+
role="button"
|
|
24
|
+
tabindex="0"
|
|
19
25
|
>
|
|
20
26
|
<div
|
|
21
27
|
class="MuiTypography-root Thumbnail-inactiveDotMode-10 MuiTypography-body1"
|
|
@@ -24,7 +30,10 @@ exports[`renders dots correctly 1`] = `
|
|
|
24
30
|
</div>
|
|
25
31
|
</div>
|
|
26
32
|
<div
|
|
27
|
-
|
|
33
|
+
aria-disabled="false"
|
|
34
|
+
class="MuiButtonBase-root AccessibleButton-root-12 Thumbnail-dotContainer-9 "
|
|
35
|
+
role="button"
|
|
36
|
+
tabindex="0"
|
|
28
37
|
>
|
|
29
38
|
<div
|
|
30
39
|
class="MuiTypography-root Thumbnail-inactiveDotMode-10 MuiTypography-body1"
|
|
@@ -33,7 +42,10 @@ exports[`renders dots correctly 1`] = `
|
|
|
33
42
|
</div>
|
|
34
43
|
</div>
|
|
35
44
|
<div
|
|
36
|
-
|
|
45
|
+
aria-disabled="false"
|
|
46
|
+
class="MuiButtonBase-root AccessibleButton-root-12 Thumbnail-dotContainer-9 "
|
|
47
|
+
role="button"
|
|
48
|
+
tabindex="0"
|
|
37
49
|
>
|
|
38
50
|
<div
|
|
39
51
|
class="MuiTypography-root Thumbnail-inactiveDotMode-10 MuiTypography-body1"
|
|
@@ -67,7 +79,10 @@ exports[`renders images correctly 1`] = `
|
|
|
67
79
|
style="justify-content:initial"
|
|
68
80
|
>
|
|
69
81
|
<div
|
|
70
|
-
|
|
82
|
+
aria-disabled="false"
|
|
83
|
+
class="MuiButtonBase-root AccessibleButton-root-12 Thumbnail-thumbnailImageContainer-8"
|
|
84
|
+
role="button"
|
|
85
|
+
tabindex="0"
|
|
71
86
|
value="frontside"
|
|
72
87
|
>
|
|
73
88
|
<img
|
|
@@ -77,7 +92,10 @@ exports[`renders images correctly 1`] = `
|
|
|
77
92
|
/>
|
|
78
93
|
</div>
|
|
79
94
|
<div
|
|
80
|
-
|
|
95
|
+
aria-disabled="false"
|
|
96
|
+
class="MuiButtonBase-root AccessibleButton-root-12 Thumbnail-thumbnailImageContainer-8"
|
|
97
|
+
role="button"
|
|
98
|
+
tabindex="0"
|
|
81
99
|
value="backside"
|
|
82
100
|
>
|
|
83
101
|
<img
|
|
@@ -87,7 +105,10 @@ exports[`renders images correctly 1`] = `
|
|
|
87
105
|
/>
|
|
88
106
|
</div>
|
|
89
107
|
<div
|
|
90
|
-
|
|
108
|
+
aria-disabled="false"
|
|
109
|
+
class="MuiButtonBase-root AccessibleButton-root-12 Thumbnail-thumbnailImageContainer-8"
|
|
110
|
+
role="button"
|
|
111
|
+
tabindex="0"
|
|
91
112
|
value="leftside"
|
|
92
113
|
>
|
|
93
114
|
<img
|
|
@@ -97,7 +118,10 @@ exports[`renders images correctly 1`] = `
|
|
|
97
118
|
/>
|
|
98
119
|
</div>
|
|
99
120
|
<div
|
|
100
|
-
|
|
121
|
+
aria-disabled="false"
|
|
122
|
+
class="MuiButtonBase-root AccessibleButton-root-12 Thumbnail-thumbnailImageContainer-8"
|
|
123
|
+
role="button"
|
|
124
|
+
tabindex="0"
|
|
101
125
|
value="rightside"
|
|
102
126
|
>
|
|
103
127
|
<img
|
|
@@ -8,6 +8,7 @@ import Icon from '@material-ui/core/Icon';
|
|
|
8
8
|
import { withResizeDetectWrapper } from 'Shared/HOCs/ResizeDetect/ResizeDetect';
|
|
9
9
|
import Typography from '@material-ui/core/Typography';
|
|
10
10
|
import withWidth, { isWidthDown } from '@material-ui/core/withWidth';
|
|
11
|
+
import AccessibleButton from '../../../../Shared/Components/AccessibleButton/AccessibleButton';
|
|
11
12
|
|
|
12
13
|
export const styles = theme => ({
|
|
13
14
|
thumbnailCarouselWrapper: {
|
|
@@ -247,9 +248,11 @@ class Thumbnail extends React.Component {
|
|
|
247
248
|
<div className={classes.dots}>
|
|
248
249
|
{items &&
|
|
249
250
|
items.map((thumbnail, index) => (
|
|
250
|
-
<
|
|
251
|
+
<AccessibleButton
|
|
252
|
+
component="div"
|
|
251
253
|
className={`${classes.dotContainer} ${isSmallScreen ? 'wrap-container' : ''}`}
|
|
252
254
|
key={thumbnail.identifier}
|
|
255
|
+
onClick={() => onThumbnailClick(thumbnail.identifier)}
|
|
253
256
|
>
|
|
254
257
|
<Typography
|
|
255
258
|
component="div"
|
|
@@ -258,11 +261,10 @@ class Thumbnail extends React.Component {
|
|
|
258
261
|
? classes.activeDotMode
|
|
259
262
|
: classes.inactiveDotMode
|
|
260
263
|
}
|
|
261
|
-
onClick={() => onThumbnailClick(thumbnail.identifier)}
|
|
262
264
|
>
|
|
263
265
|
{index + 1}
|
|
264
266
|
</Typography>
|
|
265
|
-
</
|
|
267
|
+
</AccessibleButton>
|
|
266
268
|
))}
|
|
267
269
|
</div>
|
|
268
270
|
);
|
|
@@ -293,7 +295,8 @@ class Thumbnail extends React.Component {
|
|
|
293
295
|
>
|
|
294
296
|
{items &&
|
|
295
297
|
items.map(thumbnail => (
|
|
296
|
-
<
|
|
298
|
+
<AccessibleButton
|
|
299
|
+
component="div"
|
|
297
300
|
className={classes.thumbnailImageContainer}
|
|
298
301
|
key={thumbnail.identifier}
|
|
299
302
|
onClick={() => onThumbnailClick(thumbnail.identifier)}
|
|
@@ -309,7 +312,7 @@ class Thumbnail extends React.Component {
|
|
|
309
312
|
: classes.inactiveThumbnail
|
|
310
313
|
}
|
|
311
314
|
/>
|
|
312
|
-
</
|
|
315
|
+
</AccessibleButton>
|
|
313
316
|
))}
|
|
314
317
|
</div>
|
|
315
318
|
</Scrollbars>
|
|
@@ -97,6 +97,10 @@ const defaultTheme = {
|
|
|
97
97
|
outlined: {
|
|
98
98
|
color: darkTextColor,
|
|
99
99
|
},
|
|
100
|
+
root: {
|
|
101
|
+
textAlign: 'left',
|
|
102
|
+
textTransform: 'none',
|
|
103
|
+
},
|
|
100
104
|
},
|
|
101
105
|
MuiIcon: {
|
|
102
106
|
root: {
|
|
@@ -185,12 +189,11 @@ const defaultTheme = {
|
|
|
185
189
|
},
|
|
186
190
|
},
|
|
187
191
|
productPart: {
|
|
188
|
-
captionPaddingTop: '
|
|
192
|
+
captionPaddingTop: '4px',
|
|
189
193
|
itemSize: '110px',
|
|
190
194
|
selectedItemSize: '118px',
|
|
191
|
-
lineHeight: '
|
|
195
|
+
lineHeight: '1em',
|
|
192
196
|
markerThickness: '8px',
|
|
193
|
-
spaceBetweenItemAndMarker: '8px',
|
|
194
197
|
},
|
|
195
198
|
productPartsList: {
|
|
196
199
|
marginLeft: 10,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
3
|
+
import ButtonBase from '@material-ui/core/ButtonBase';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
|
|
6
|
+
const AccessibleButtonBase = ({ notAccessible, ...props }) => (
|
|
7
|
+
<ButtonBase tabIndex={notAccessible ? -1 : 0} focusRipple disableTouchRipple {...props} />
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
AccessibleButtonBase.propTypes = {
|
|
11
|
+
notAccessible: PropTypes.bool,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
AccessibleButtonBase.defaultProps = {
|
|
15
|
+
notAccessible: false,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default withStyles(
|
|
19
|
+
() => ({
|
|
20
|
+
root: {
|
|
21
|
+
justifyContent: 'left',
|
|
22
|
+
textAlign: 'left',
|
|
23
|
+
'& .MuiTouchRipple-root .MuiTouchRipple-child': {
|
|
24
|
+
borderRadius: '8px',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
{ name: 'AccessibleButton' }
|
|
29
|
+
)(AccessibleButtonBase);
|
|
@@ -48,16 +48,11 @@ class AlertDialog extends React.Component {
|
|
|
48
48
|
className={classes.dialogWrapper}
|
|
49
49
|
open={true}
|
|
50
50
|
onClose={this.handleClose}
|
|
51
|
-
aria-labelledby="alert-dialog-title"
|
|
52
|
-
aria-describedby="alert-dialog-description"
|
|
53
51
|
onCancel={this.handleClose}
|
|
54
52
|
dialogTitle={title}
|
|
55
53
|
>
|
|
56
54
|
<DialogContent>
|
|
57
|
-
<DialogContentText
|
|
58
|
-
id="alert-dialog-description"
|
|
59
|
-
dangerouslySetInnerHTML={{ __html: message }}
|
|
60
|
-
/>
|
|
55
|
+
<DialogContentText dangerouslySetInnerHTML={{ __html: message }} />
|
|
61
56
|
</DialogContent>
|
|
62
57
|
<DialogActions>
|
|
63
58
|
<MainButton
|
|
@@ -32,13 +32,13 @@ exports[`renders a boxed component with the boxed prop 1`] = `
|
|
|
32
32
|
<div
|
|
33
33
|
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-6 MuiGrid-grid-md-7 MuiGrid-grid-lg-7"
|
|
34
34
|
>
|
|
35
|
-
<
|
|
36
|
-
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-
|
|
35
|
+
<p
|
|
36
|
+
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-body2"
|
|
37
37
|
>
|
|
38
38
|
<b>
|
|
39
39
|
500,00 €
|
|
40
40
|
</b>
|
|
41
|
-
</
|
|
41
|
+
</p>
|
|
42
42
|
<span
|
|
43
43
|
class="MuiTypography-root AmountPrice-AmountPriceTypographyVat-13 MuiTypography-caption"
|
|
44
44
|
>
|
|
@@ -113,13 +113,13 @@ exports[`renders correctly 1`] = `
|
|
|
113
113
|
<div
|
|
114
114
|
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-6 MuiGrid-grid-md-7 MuiGrid-grid-lg-7"
|
|
115
115
|
>
|
|
116
|
-
<
|
|
117
|
-
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-
|
|
116
|
+
<p
|
|
117
|
+
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-body2"
|
|
118
118
|
>
|
|
119
119
|
<b>
|
|
120
120
|
500,00 €
|
|
121
121
|
</b>
|
|
122
|
-
</
|
|
122
|
+
</p>
|
|
123
123
|
<span
|
|
124
124
|
class="MuiTypography-root AmountPrice-AmountPriceTypographyVat-13 MuiTypography-caption"
|
|
125
125
|
>
|
|
@@ -194,13 +194,13 @@ exports[`renders receiveOfferForm 1`] = `
|
|
|
194
194
|
<div
|
|
195
195
|
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-6 MuiGrid-grid-md-7 MuiGrid-grid-lg-7"
|
|
196
196
|
>
|
|
197
|
-
<
|
|
198
|
-
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-
|
|
197
|
+
<p
|
|
198
|
+
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-body2"
|
|
199
199
|
>
|
|
200
200
|
<b>
|
|
201
201
|
500,00 €
|
|
202
202
|
</b>
|
|
203
|
-
</
|
|
203
|
+
</p>
|
|
204
204
|
<span
|
|
205
205
|
class="MuiTypography-root AmountPrice-AmountPriceTypographyVat-13 MuiTypography-caption"
|
|
206
206
|
>
|
|
@@ -282,13 +282,13 @@ exports[`renders the ConfigurationModeSwitchComponent (if it is provided) 1`] =
|
|
|
282
282
|
<div
|
|
283
283
|
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-6 MuiGrid-grid-md-7 MuiGrid-grid-lg-7"
|
|
284
284
|
>
|
|
285
|
-
<
|
|
286
|
-
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-
|
|
285
|
+
<p
|
|
286
|
+
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-body2"
|
|
287
287
|
>
|
|
288
288
|
<b>
|
|
289
289
|
500,00 €
|
|
290
290
|
</b>
|
|
291
|
-
</
|
|
291
|
+
</p>
|
|
292
292
|
<span
|
|
293
293
|
class="MuiTypography-root AmountPrice-AmountPriceTypographyVat-13 MuiTypography-caption"
|
|
294
294
|
>
|
|
@@ -370,13 +370,13 @@ exports[`renders without callToAction 1`] = `
|
|
|
370
370
|
<div
|
|
371
371
|
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-6 MuiGrid-grid-md-7 MuiGrid-grid-lg-7"
|
|
372
372
|
>
|
|
373
|
-
<
|
|
374
|
-
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-
|
|
373
|
+
<p
|
|
374
|
+
class="MuiTypography-root AmountPrice-AmountPriceTypography-12 MuiTypography-body2"
|
|
375
375
|
>
|
|
376
376
|
<b>
|
|
377
377
|
500,00 €
|
|
378
378
|
</b>
|
|
379
|
-
</
|
|
379
|
+
</p>
|
|
380
380
|
<span
|
|
381
381
|
class="MuiTypography-root AmountPrice-AmountPriceTypographyVat-13 MuiTypography-caption"
|
|
382
382
|
>
|
|
@@ -33,6 +33,9 @@ import { debounce } from '@material-ui/core/utils';
|
|
|
33
33
|
import AcceptPrivacy from '../AcceptPrivacy';
|
|
34
34
|
import ConfigurationOverview from '../ConfigurationOverview';
|
|
35
35
|
import { isMobileDevice } from 'Framework/Helpers/isMobileDevice';
|
|
36
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
37
|
+
import AutoFocusDialogContentContainer from '../AutoFocusDialogContentContainer/AutoFocusDialogContentContainer';
|
|
38
|
+
|
|
36
39
|
const styles = theme => ({
|
|
37
40
|
contentPositioning: {
|
|
38
41
|
paddingLeft: 32,
|
|
@@ -177,6 +180,7 @@ const styles = theme => ({
|
|
|
177
180
|
AmountPriceTypography: {
|
|
178
181
|
textAlign: 'end',
|
|
179
182
|
lineHeight: 1.2,
|
|
183
|
+
fontSize: '1.5rem',
|
|
180
184
|
[theme.breakpoints.down('xs')]: {
|
|
181
185
|
padding: '3px 0',
|
|
182
186
|
textAlign: 'start',
|
|
@@ -203,10 +207,10 @@ const styles = theme => ({
|
|
|
203
207
|
},
|
|
204
208
|
closeIcon: {
|
|
205
209
|
position: 'absolute',
|
|
206
|
-
right:
|
|
207
|
-
top:
|
|
210
|
+
right: 16,
|
|
211
|
+
top: 16,
|
|
208
212
|
[theme.breakpoints.down('xs')]: {
|
|
209
|
-
right:
|
|
213
|
+
right: 0,
|
|
210
214
|
},
|
|
211
215
|
'&:hover': {
|
|
212
216
|
cursor: 'pointer',
|
|
@@ -561,10 +565,11 @@ class AmountPrice extends React.Component {
|
|
|
561
565
|
|
|
562
566
|
const { ConfigurationOverviewComponent, userConfiguration, width, classes } = this.props;
|
|
563
567
|
|
|
568
|
+
const dialogTitleId = 'configuration-overview-dialog-title';
|
|
569
|
+
|
|
564
570
|
return (
|
|
565
571
|
<Dialog
|
|
566
|
-
aria-labelledby=
|
|
567
|
-
aria-describedby="alert-dialog-description"
|
|
572
|
+
aria-labelledby={dialogTitleId}
|
|
568
573
|
classes={{
|
|
569
574
|
paper: classes.dialogWrapper,
|
|
570
575
|
container: width === 'md' || width === 'xs' ? classes.dialogPositioning : '',
|
|
@@ -579,12 +584,12 @@ class AmountPrice extends React.Component {
|
|
|
579
584
|
>
|
|
580
585
|
<LoadingOverlay show={this.props.addToCartPopUpLoader} />
|
|
581
586
|
<DialogTitle classes={{ root: classes.dialogTitleRoot }}>
|
|
582
|
-
<Typography variant="body1">
|
|
587
|
+
<Typography variant="body1" id={dialogTitleId}>
|
|
583
588
|
<b>{t('amountPrice.configurationOverview')}</b>
|
|
584
589
|
</Typography>
|
|
585
|
-
<
|
|
586
|
-
close
|
|
587
|
-
</
|
|
590
|
+
<IconButton className={classes.closeIcon} onClick={this.handleClose.bind(this)}>
|
|
591
|
+
<Icon>close</Icon>
|
|
592
|
+
</IconButton>
|
|
588
593
|
</DialogTitle>
|
|
589
594
|
<RootRef rootRef={this.dialogContentRef}>
|
|
590
595
|
<DialogContent classes={{ root: classes.contentPositioning }}>
|
|
@@ -597,11 +602,12 @@ class AmountPrice extends React.Component {
|
|
|
597
602
|
);
|
|
598
603
|
}
|
|
599
604
|
|
|
600
|
-
renderDialogTitle() {
|
|
605
|
+
renderDialogTitle(options) {
|
|
606
|
+
const { dialogTitleId } = options;
|
|
601
607
|
return this.props.renderDialogTitle ? (
|
|
602
|
-
this.props.renderDialogTitle(this.props)
|
|
608
|
+
this.props.renderDialogTitle(this.props, options)
|
|
603
609
|
) : (
|
|
604
|
-
<Typography variant="body1">
|
|
610
|
+
<Typography variant="body1" id={dialogTitleId}>
|
|
605
611
|
<b>
|
|
606
612
|
{t(
|
|
607
613
|
this.props.showReceiveOfferForm
|
|
@@ -663,10 +669,11 @@ class AmountPrice extends React.Component {
|
|
|
663
669
|
});
|
|
664
670
|
}
|
|
665
671
|
|
|
672
|
+
const dialogTitleId = 'price-overview-dialog-title';
|
|
673
|
+
|
|
666
674
|
return (
|
|
667
675
|
<Dialog
|
|
668
|
-
aria-labelledby=
|
|
669
|
-
aria-describedby="alert-dialog-description"
|
|
676
|
+
aria-labelledby={dialogTitleId}
|
|
670
677
|
classes={{
|
|
671
678
|
paper: classes.dialogWrapper,
|
|
672
679
|
container: width === 'md' || width === 'xs' ? classes.dialogPositioning : '',
|
|
@@ -682,13 +689,16 @@ class AmountPrice extends React.Component {
|
|
|
682
689
|
>
|
|
683
690
|
<LoadingOverlay show={this.props.addToCartPopUpLoader} />
|
|
684
691
|
<DialogTitle classes={{ root: classes.dialogTitleRoot }}>
|
|
685
|
-
{this.renderDialogTitle()}
|
|
686
|
-
<
|
|
687
|
-
close
|
|
688
|
-
</
|
|
692
|
+
{this.renderDialogTitle({ dialogTitleId })}
|
|
693
|
+
<IconButton onClick={this.handleClose.bind(this)} className={classes.closeIcon}>
|
|
694
|
+
<Icon>close</Icon>
|
|
695
|
+
</IconButton>
|
|
689
696
|
</DialogTitle>
|
|
690
697
|
<RootRef rootRef={this.dialogContentRef}>
|
|
691
|
-
<
|
|
698
|
+
<AutoFocusDialogContentContainer
|
|
699
|
+
Component={DialogContent}
|
|
700
|
+
classes={{ root: classes.contentPositioning }}
|
|
701
|
+
>
|
|
692
702
|
{this.state.hasErrorReceiveOfferForm && (
|
|
693
703
|
<Typography color="error" variant="body2">
|
|
694
704
|
{t('receiveOfferForm.checkInputsInForm')}
|
|
@@ -763,7 +773,7 @@ class AmountPrice extends React.Component {
|
|
|
763
773
|
}
|
|
764
774
|
showReceiveOfferForm={showReceiveOfferForm}
|
|
765
775
|
/>
|
|
766
|
-
</
|
|
776
|
+
</AutoFocusDialogContentContainer>
|
|
767
777
|
</RootRef>
|
|
768
778
|
<DialogActionsWrapper onTouchMove={this.handleTouchMove}>
|
|
769
779
|
<AddToCartComponent
|
|
@@ -848,7 +858,7 @@ class AmountPrice extends React.Component {
|
|
|
848
858
|
{!hidePrices && (
|
|
849
859
|
<Grid item xs={12} sm={6} md={7} lg={7}>
|
|
850
860
|
<Typography
|
|
851
|
-
variant="
|
|
861
|
+
variant="body2"
|
|
852
862
|
classes={{
|
|
853
863
|
root: classes.AmountPriceTypography,
|
|
854
864
|
}}
|
|
@@ -19,4 +19,10 @@ const AnalyticsWrapper = ({ targetId, data, children }) => {
|
|
|
19
19
|
}
|
|
20
20
|
return React.cloneElement(children, { ...props, ...events });
|
|
21
21
|
};
|
|
22
|
+
|
|
23
|
+
export const withAnalyticsTarget = (fn, targetId, data) => (...args) => {
|
|
24
|
+
Services.analytics.triggerEvent(EventTypes[targetId], data);
|
|
25
|
+
return fn(...args);
|
|
26
|
+
};
|
|
27
|
+
|
|
22
28
|
export default AnalyticsWrapper;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import PropsTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
const AutoFocusDialogContentContainer = props => {
|
|
5
|
+
const { Component, open, children, ...otherProps } = props;
|
|
6
|
+
const [contentRef, setContentRef] = useState(null);
|
|
7
|
+
const [focusedOnce, setFocusedOnce] = useState(false);
|
|
8
|
+
const focusFirstInteractiveElement = useCallback(element => {
|
|
9
|
+
setContentRef(element);
|
|
10
|
+
}, []);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
open && setFocusedOnce(false);
|
|
13
|
+
}, [open]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!contentRef) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const focusableElements = contentRef.querySelectorAll(
|
|
19
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
if (
|
|
23
|
+
!focusedOnce &&
|
|
24
|
+
focusableElements.length > 0 &&
|
|
25
|
+
![...focusableElements].some(element => element === document.activeElement)
|
|
26
|
+
) {
|
|
27
|
+
const timeout = setTimeout(() => {
|
|
28
|
+
const firstElement = focusableElements[0];
|
|
29
|
+
firstElement.focus();
|
|
30
|
+
setFocusedOnce(true);
|
|
31
|
+
}, 100);
|
|
32
|
+
return () => clearTimeout(timeout);
|
|
33
|
+
}
|
|
34
|
+
}, [children, focusedOnce, contentRef, focusFirstInteractiveElement]);
|
|
35
|
+
return (
|
|
36
|
+
<Component ref={focusFirstInteractiveElement} {...otherProps}>
|
|
37
|
+
{children}
|
|
38
|
+
</Component>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
AutoFocusDialogContentContainer.propTypes = {
|
|
43
|
+
Component: PropsTypes.elementType,
|
|
44
|
+
open: PropsTypes.bool,
|
|
45
|
+
children: PropsTypes.node,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
AutoFocusDialogContentContainer.defaultProps = {
|
|
49
|
+
Component: 'div',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default AutoFocusDialogContentContainer;
|
|
@@ -35,8 +35,8 @@ const styles = theme => ({
|
|
|
35
35
|
},
|
|
36
36
|
CloseIcon: {
|
|
37
37
|
position: 'absolute',
|
|
38
|
-
right:
|
|
39
|
-
top:
|
|
38
|
+
right: 16,
|
|
39
|
+
top: 16,
|
|
40
40
|
|
|
41
41
|
'&:hover': {
|
|
42
42
|
cursor: 'pointer',
|
|
@@ -114,6 +114,7 @@ class BulkNames extends React.Component {
|
|
|
114
114
|
handleText: PropTypes.func,
|
|
115
115
|
addTextField: PropTypes.func,
|
|
116
116
|
};
|
|
117
|
+
|
|
117
118
|
render() {
|
|
118
119
|
const {
|
|
119
120
|
classes,
|
|
@@ -132,6 +133,9 @@ class BulkNames extends React.Component {
|
|
|
132
133
|
saveConfigurationBulkNames,
|
|
133
134
|
size,
|
|
134
135
|
} = this.props;
|
|
136
|
+
|
|
137
|
+
const dialogTitleId = 'bulk-names-edit-dialog-title';
|
|
138
|
+
|
|
135
139
|
return (
|
|
136
140
|
<Dialog
|
|
137
141
|
open={showBulkNameForm}
|
|
@@ -140,14 +144,15 @@ class BulkNames extends React.Component {
|
|
|
140
144
|
fullWidth
|
|
141
145
|
fullScreen={width === 'sm' || width === 'xs'}
|
|
142
146
|
scroll="paper"
|
|
147
|
+
aria-labelledby={dialogTitleId}
|
|
143
148
|
>
|
|
144
149
|
<DialogTitle className={classes.dialogTitleRoot}>
|
|
145
|
-
<Typography className={classes.TypographyCaption} variant="body1">
|
|
150
|
+
<Typography className={classes.TypographyCaption} variant="body1" id={dialogTitleId}>
|
|
146
151
|
<b>{t('bulkNames.bulkNamesEdit')}</b>
|
|
147
152
|
</Typography>
|
|
148
|
-
<
|
|
149
|
-
close
|
|
150
|
-
</
|
|
153
|
+
<IconButton className={classes.CloseIcon} onClick={onClose}>
|
|
154
|
+
<Icon>close</Icon>
|
|
155
|
+
</IconButton>
|
|
151
156
|
</DialogTitle>
|
|
152
157
|
<DialogContent className={classes.dialogContentRoot}>
|
|
153
158
|
<Grid container>
|
|
@@ -98,8 +98,6 @@ class LoadConfiguration extends React.Component {
|
|
|
98
98
|
<CustomDialog
|
|
99
99
|
open={show}
|
|
100
100
|
onClose={onClose}
|
|
101
|
-
aria-labelledby="alert-dialog-title"
|
|
102
|
-
aria-describedby="alert-dialog-description"
|
|
103
101
|
dialogTitle={t('loadConfiguration.dialogTitle')}
|
|
104
102
|
onCancel={onClose}
|
|
105
103
|
>
|