@configuratorware/configurator-frontendgui 1.36.0-beta.0 → 1.36.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/Modules/Creator/Components/Option/index.js +7 -1
- package/App/Modules/Creator/Components/Optiondetail/index.js +17 -14
- package/App/Modules/Creator/CreatorScreen.js +1 -4
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +20 -4
- package/App/Modules/Designer/DesignerScreen.js +1 -4
- package/App/Reducers/Configurator/Reducer.js +1 -1
- package/App/Reducers/DesignArea/Selectors.js +31 -13
- package/App/Shared/Components/AmountPrice/index.js +18 -6
- package/Framework/Components/Carousel/index.js +17 -20
- package/package.json +23 -16
- package/src/App/Modules/Creator/Components/Option/index.js +8 -1
- package/src/App/Modules/Creator/Components/Optiondetail/__snapshots__/index.test.js.snap +75 -69
- package/src/App/Modules/Creator/Components/Optiondetail/index.js +50 -45
- package/src/App/Modules/Creator/CreatorScreen.js +0 -2
- package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +20 -5
- package/src/App/Modules/Designer/DesignerScreen.js +0 -2
- package/src/App/Reducers/Configurator/Reducer.js +4 -1
- package/src/App/Reducers/DesignArea/Selectors.js +15 -0
- package/src/App/Reducers/DesignArea/__tests__/Selectors.test.js +5 -0
- package/src/App/Services/__tests__/DesignDataService.test.js +81 -0
- package/src/App/Shared/Components/AmountPrice/index.js +32 -21
- package/src/Framework/Components/Carousel/index.js +16 -17
- package/Shared/Components/Swipeable.js +0 -57
- package/src/Shared/Components/Swipeable.js +0 -10
|
@@ -5,28 +5,30 @@ exports[`Screens/Components/ImageEditDialog/MessageBox renders as a modal screen
|
|
|
5
5
|
<div
|
|
6
6
|
class="MuiDialogContent-root Optiondetail-detailDialogContentRoot-14"
|
|
7
7
|
>
|
|
8
|
-
<div
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<div
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
<div>
|
|
9
|
+
<div
|
|
10
|
+
class="Optiondetail-detailContainer-4"
|
|
11
|
+
>
|
|
12
|
+
<div>
|
|
13
|
+
<div
|
|
14
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
15
|
+
>
|
|
16
|
+
<p>
|
|
17
|
+
Das sind schwarze Reissverschlüsse
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
<div
|
|
21
|
+
class="MuiTypography-root Optiondetail-priceFormatted-6 MuiTypography-body2"
|
|
22
|
+
>
|
|
23
|
+
0,00 €
|
|
24
|
+
</div>
|
|
25
|
+
<div
|
|
26
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
27
|
+
>
|
|
28
|
+
<p>
|
|
29
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
32
34
|
</div>
|
|
@@ -60,28 +62,30 @@ exports[`Screens/Components/ImageEditDialog/MessageBox renders as full screen on
|
|
|
60
62
|
<div
|
|
61
63
|
class="MuiDialogContent-root Optiondetail-detailDialogContentRoot-14"
|
|
62
64
|
>
|
|
63
|
-
<div
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<div
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
65
|
+
<div>
|
|
66
|
+
<div
|
|
67
|
+
class="Optiondetail-detailContainer-4"
|
|
68
|
+
>
|
|
69
|
+
<div>
|
|
70
|
+
<div
|
|
71
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
72
|
+
>
|
|
73
|
+
<p>
|
|
74
|
+
Das sind schwarze Reissverschlüsse
|
|
75
|
+
</p>
|
|
76
|
+
</div>
|
|
77
|
+
<div
|
|
78
|
+
class="MuiTypography-root Optiondetail-priceFormatted-6 MuiTypography-body2"
|
|
79
|
+
>
|
|
80
|
+
0,00 €
|
|
81
|
+
</div>
|
|
82
|
+
<div
|
|
83
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
84
|
+
>
|
|
85
|
+
<p>
|
|
86
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
87
|
+
</p>
|
|
88
|
+
</div>
|
|
85
89
|
</div>
|
|
86
90
|
</div>
|
|
87
91
|
</div>
|
|
@@ -115,36 +119,38 @@ exports[`Screens/Components/ImageEditDialog/MessageBox renders with previous and
|
|
|
115
119
|
<div
|
|
116
120
|
class="MuiDialogContent-root Optiondetail-detailDialogContentRoot-14"
|
|
117
121
|
>
|
|
118
|
-
<div
|
|
119
|
-
class="Optiondetail-detailContainerWithNav-3"
|
|
120
|
-
>
|
|
122
|
+
<div>
|
|
121
123
|
<div
|
|
122
|
-
class="Optiondetail-
|
|
123
|
-
|
|
124
|
-
<div>
|
|
125
|
-
<div
|
|
126
|
-
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
127
|
-
>
|
|
128
|
-
<p>
|
|
129
|
-
Das sind schwarze Reissverschlüsse
|
|
130
|
-
</p>
|
|
131
|
-
</div>
|
|
124
|
+
class="Optiondetail-detailContainerWithNav-3"
|
|
125
|
+
>
|
|
132
126
|
<div
|
|
133
|
-
class="
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
class="Optiondetail-detailNav-1 prev"
|
|
128
|
+
/>
|
|
129
|
+
<div>
|
|
130
|
+
<div
|
|
131
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
132
|
+
>
|
|
133
|
+
<p>
|
|
134
|
+
Das sind schwarze Reissverschlüsse
|
|
135
|
+
</p>
|
|
136
|
+
</div>
|
|
137
|
+
<div
|
|
138
|
+
class="MuiTypography-root Optiondetail-priceFormatted-6 MuiTypography-body2"
|
|
139
|
+
>
|
|
140
|
+
0,00 €
|
|
141
|
+
</div>
|
|
142
|
+
<div
|
|
143
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
144
|
+
>
|
|
145
|
+
<p>
|
|
146
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
147
|
+
</p>
|
|
148
|
+
</div>
|
|
136
149
|
</div>
|
|
137
150
|
<div
|
|
138
|
-
class="
|
|
139
|
-
|
|
140
|
-
<p>
|
|
141
|
-
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
142
|
-
</p>
|
|
143
|
-
</div>
|
|
151
|
+
class="Optiondetail-detailNav-1 next"
|
|
152
|
+
/>
|
|
144
153
|
</div>
|
|
145
|
-
<div
|
|
146
|
-
class="Optiondetail-detailNav-1 next"
|
|
147
|
-
/>
|
|
148
154
|
</div>
|
|
149
155
|
</div>
|
|
150
156
|
<div
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
+
import { Swipeable } from 'react-swipeable';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import Button from '@material-ui/core/Button';
|
|
5
6
|
import DialogContent from '@material-ui/core/DialogContent';
|
|
@@ -16,7 +17,6 @@ import OptionlistitemAmount from '../OptionAmount';
|
|
|
16
17
|
import getImageUrl from '../../../../Utils/getImageUrl';
|
|
17
18
|
import Markdown from '../../../../../Framework/Components/Markdown';
|
|
18
19
|
import ZoomImage from './ZoomImage';
|
|
19
|
-
import { LEFT, RIGHT, Swipeable } from '../../../../../Shared/Components/Swipeable';
|
|
20
20
|
|
|
21
21
|
const styles = theme => ({
|
|
22
22
|
detailNav: {
|
|
@@ -189,11 +189,14 @@ class Optiondetail extends React.Component {
|
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
-
swiped = e => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
swiped = (e, deltaX, deltaY) => {
|
|
193
|
+
// use only horizontal swiping
|
|
194
|
+
if (Math.abs(deltaX) >= Math.abs(deltaY)) {
|
|
195
|
+
if (deltaX > 0) {
|
|
196
|
+
this.next();
|
|
197
|
+
} else {
|
|
198
|
+
this.prev();
|
|
199
|
+
}
|
|
197
200
|
}
|
|
198
201
|
};
|
|
199
202
|
|
|
@@ -348,53 +351,55 @@ class Optiondetail extends React.Component {
|
|
|
348
351
|
</div>
|
|
349
352
|
) : (
|
|
350
353
|
<Swipeable
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}}
|
|
356
|
-
ref={this.setDetailsContainerRef}
|
|
357
|
-
className={showNav ? classes.detailContainerWithNav : classes.detailContainer}
|
|
354
|
+
disabled={!showNav}
|
|
355
|
+
trackMouse={true}
|
|
356
|
+
onSwiped={this.swiped}
|
|
357
|
+
delta={Optiondetail.swipeDelta}
|
|
358
358
|
>
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
<div
|
|
360
|
+
ref={this.setDetailsContainerRef}
|
|
361
|
+
className={showNav ? classes.detailContainerWithNav : classes.detailContainer}
|
|
362
|
+
>
|
|
363
|
+
{showNav && (
|
|
364
|
+
<div className={clsx(classes.detailNav, 'prev')} onClick={this.prev} />
|
|
365
|
+
)}
|
|
362
366
|
|
|
363
|
-
|
|
364
|
-
<div
|
|
365
|
-
className={clsx({
|
|
366
|
-
[classes.detailsWithImageContainer]: !showFullScreenModal,
|
|
367
|
-
})}
|
|
368
|
-
>
|
|
367
|
+
{detailImage ? (
|
|
369
368
|
<div
|
|
370
|
-
className={
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
: classes.imageContainer
|
|
374
|
-
}
|
|
375
|
-
onClick={this.state.hasZoom ? this.toggleZoomImage : null}
|
|
369
|
+
className={clsx({
|
|
370
|
+
[classes.detailsWithImageContainer]: !showFullScreenModal,
|
|
371
|
+
})}
|
|
376
372
|
>
|
|
377
|
-
<
|
|
378
|
-
ref={this.setDetailsImageRef}
|
|
379
|
-
onLoad={this.handleImageLoaded}
|
|
373
|
+
<div
|
|
380
374
|
className={
|
|
381
|
-
this.state.
|
|
382
|
-
? classes.
|
|
383
|
-
: classes.
|
|
375
|
+
this.state.hasZoom
|
|
376
|
+
? classes.imageContainerWithZoom
|
|
377
|
+
: classes.imageContainer
|
|
384
378
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
379
|
+
onClick={this.state.hasZoom ? this.toggleZoomImage : null}
|
|
380
|
+
>
|
|
381
|
+
<img
|
|
382
|
+
ref={this.setDetailsImageRef}
|
|
383
|
+
onLoad={this.handleImageLoaded}
|
|
384
|
+
className={
|
|
385
|
+
this.state.zoomImage && ['xs', 'sm'].includes(width)
|
|
386
|
+
? classes.imageHidden
|
|
387
|
+
: classes.image
|
|
388
|
+
}
|
|
389
|
+
src={getImageUrl(detailImage)}
|
|
390
|
+
alt={details.title}
|
|
391
|
+
/>
|
|
392
|
+
</div>
|
|
393
|
+
{detailsContent}
|
|
388
394
|
</div>
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
detailsContent
|
|
393
|
-
)}
|
|
395
|
+
) : (
|
|
396
|
+
detailsContent
|
|
397
|
+
)}
|
|
394
398
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
399
|
+
{showNav && (
|
|
400
|
+
<div className={clsx(classes.detailNav, 'next')} onClick={this.next} />
|
|
401
|
+
)}
|
|
402
|
+
</div>
|
|
398
403
|
</Swipeable>
|
|
399
404
|
)}
|
|
400
405
|
</DialogContent>
|
package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js
CHANGED
|
@@ -10,11 +10,12 @@ import TextControlbox from '../TextControlbox';
|
|
|
10
10
|
import ImageControlbox from '../ImageControlbox';
|
|
11
11
|
import { CustomFontOverlay } from './CustomFontOverlay';
|
|
12
12
|
import { createFontItemProps, findCurrentFontItem } from './fontItemUtils';
|
|
13
|
-
import { isPlaceholderContent } from 'App/Reducers/DesignArea/Selectors';
|
|
13
|
+
import { isPlaceholderContent, isOneLineText } from 'App/Reducers/DesignArea/Selectors';
|
|
14
14
|
import isMobileDevice from 'Framework/Helpers/isMobileDevice';
|
|
15
15
|
import { hasBackgroundColor } from 'App/Reducers/DesignData/Selectors';
|
|
16
16
|
import { t } from 'Framework/i18n';
|
|
17
17
|
import { isOriginalVector } from '../../Utils/Transformers';
|
|
18
|
+
import { useSelector } from 'react-redux';
|
|
18
19
|
|
|
19
20
|
const styles = theme => ({
|
|
20
21
|
root: {
|
|
@@ -132,11 +133,13 @@ const DesignerSelectionToolbox = props => {
|
|
|
132
133
|
defaultFont,
|
|
133
134
|
loadFonts,
|
|
134
135
|
initialColor,
|
|
136
|
+
autoFocusEditor,
|
|
135
137
|
} = props;
|
|
136
138
|
|
|
137
139
|
const rteRef = useRef(null);
|
|
138
140
|
const editorRef = useRef(null);
|
|
139
141
|
const [showCustomFontOverlay, toggleCustomFontOverlay] = useState(false);
|
|
142
|
+
const disableLinebreaks = useSelector(state => isOneLineText(state));
|
|
140
143
|
|
|
141
144
|
return (
|
|
142
145
|
<div className={classes.root}>
|
|
@@ -271,6 +274,12 @@ const DesignerSelectionToolbox = props => {
|
|
|
271
274
|
canvas.selectedObject.content = '';
|
|
272
275
|
}
|
|
273
276
|
},
|
|
277
|
+
onBlur: () => {
|
|
278
|
+
const regex = /<\/span>/;
|
|
279
|
+
if (selectedObject.content.search(regex) === -1) {
|
|
280
|
+
canvas.selectedObject.remove();
|
|
281
|
+
}
|
|
282
|
+
},
|
|
274
283
|
};
|
|
275
284
|
|
|
276
285
|
if (selectedObject.isBulkName) {
|
|
@@ -285,10 +294,14 @@ const DesignerSelectionToolbox = props => {
|
|
|
285
294
|
|
|
286
295
|
return renderTextEditor({
|
|
287
296
|
...textToolsRenderObj,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
disableLinebreaks,
|
|
298
|
+
autoFocusWhenMounted:
|
|
299
|
+
autoFocusEditor ||
|
|
300
|
+
!(
|
|
301
|
+
isPlaceholderContent(
|
|
302
|
+
selectedObject.content
|
|
303
|
+
) || isMobileDevice()
|
|
304
|
+
),
|
|
292
305
|
textEditorElementProps,
|
|
293
306
|
onChangeHTML: (...args) => {
|
|
294
307
|
// call the original function first with all the args
|
|
@@ -390,6 +403,7 @@ DesignerSelectionToolbox.propTypes = {
|
|
|
390
403
|
addCustomFont: PropTypes.func,
|
|
391
404
|
defaultFont: PropTypes.object,
|
|
392
405
|
initialColor: PropTypes.object,
|
|
406
|
+
autoFocusEditor: PropTypes.bool,
|
|
393
407
|
};
|
|
394
408
|
|
|
395
409
|
DesignerSelectionToolbox.defaultProps = {
|
|
@@ -402,6 +416,7 @@ DesignerSelectionToolbox.defaultProps = {
|
|
|
402
416
|
width: '',
|
|
403
417
|
isActiveBulkName: false,
|
|
404
418
|
isPortraitMode: false,
|
|
419
|
+
autoFocusEditor: false,
|
|
405
420
|
};
|
|
406
421
|
|
|
407
422
|
export default withWidth()(
|
|
@@ -628,5 +628,8 @@ export default function configuratorReducer(prevState = initialState, action = {
|
|
|
628
628
|
}
|
|
629
629
|
|
|
630
630
|
function filterOptionsWithDetails(options) {
|
|
631
|
-
return _.filter(
|
|
631
|
+
return _.filter(
|
|
632
|
+
options,
|
|
633
|
+
option => !!(option.abstract || option.description || option.detailImageExists === true)
|
|
634
|
+
);
|
|
632
635
|
}
|
|
@@ -125,11 +125,14 @@ export const getDesignAreaIdentifierToOpen = state => {
|
|
|
125
125
|
} = state;
|
|
126
126
|
const previousEditedDesignAreaIdentifier = getPreviousEditedDesignAreaIdentifier(state);
|
|
127
127
|
const firstEditedDesignAreafromDesignData = getFirstEditedDesignAreafromDesignData(state);
|
|
128
|
+
const designAreaFromSelectedDesignView = getDesignAreaFromSelectedDesignView(state);
|
|
128
129
|
const defaultDesignAreaFromProductionMethod = getDefaultDesignAreaIdentifierFromProductionMethod(state);
|
|
130
|
+
|
|
129
131
|
return (
|
|
130
132
|
identifier ||
|
|
131
133
|
previousEditedDesignAreaIdentifier ||
|
|
132
134
|
firstEditedDesignAreafromDesignData ||
|
|
135
|
+
designAreaFromSelectedDesignView ||
|
|
133
136
|
defaultDesignAreaFromProductionMethod ||
|
|
134
137
|
null
|
|
135
138
|
);
|
|
@@ -672,6 +675,14 @@ export const getDesignViewListForDesignAreas = (state, designAreas) => {
|
|
|
672
675
|
return designViewList;
|
|
673
676
|
};
|
|
674
677
|
|
|
678
|
+
export const getDesignAreaFromSelectedDesignView = state => {
|
|
679
|
+
const {
|
|
680
|
+
designArea: { filteredDesignAreas },
|
|
681
|
+
designView: { selectedDesignView },
|
|
682
|
+
} = state;
|
|
683
|
+
return find(filteredDesignAreas, ['designView.identifier', selectedDesignView.identifier])?.identifier;
|
|
684
|
+
};
|
|
685
|
+
|
|
675
686
|
export const getDefaultDesignAreaIdentifierFromProductionMethod = state => {
|
|
676
687
|
//return the first designArea with isDefault: true due to api call accepts multiple productionmethods to be default
|
|
677
688
|
const {
|
|
@@ -905,3 +916,7 @@ export const getImagesByDesignArea = (state, designAreaIdentifier) => {
|
|
|
905
916
|
const designData = getDesignDataByDesignAreaIdentifier(state, designAreaIdentifier);
|
|
906
917
|
return get(designData, 'canvasData.objects', []).filter(({ type }) => type === 'Image');
|
|
907
918
|
};
|
|
919
|
+
|
|
920
|
+
export function isOneLineText(state) {
|
|
921
|
+
return get(getSelectedDesignProductionMethod(state), 'oneLineText', false);
|
|
922
|
+
}
|
|
@@ -262,6 +262,11 @@ describe('Reducers/DesignArea/Selectors', () => {
|
|
|
262
262
|
selectedDesignArea: { identifier: 'a_2' },
|
|
263
263
|
previousEditedDesignArea: {},
|
|
264
264
|
},
|
|
265
|
+
designView: {
|
|
266
|
+
selectedDesignView: {
|
|
267
|
+
identifier: '01_side',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
265
270
|
configurator: {
|
|
266
271
|
configuration: {
|
|
267
272
|
designdata: {
|
|
@@ -600,6 +600,9 @@ describe('Services/DesignDataService', () => {
|
|
|
600
600
|
selectedDesignArea: {},
|
|
601
601
|
previousEditedDesignArea: {},
|
|
602
602
|
},
|
|
603
|
+
designView: {
|
|
604
|
+
selectedDesignView: {},
|
|
605
|
+
},
|
|
603
606
|
};
|
|
604
607
|
dispatch = jest.fn();
|
|
605
608
|
})();
|
|
@@ -624,6 +627,75 @@ describe('Services/DesignDataService', () => {
|
|
|
624
627
|
expect(srv.selectFirstDesignArea).toHaveBeenCalled();
|
|
625
628
|
}
|
|
626
629
|
);
|
|
630
|
+
test(
|
|
631
|
+
'[INTEGRATION] openDesignAreaEditor calls the ui.show action to show the designer, and calls the ' +
|
|
632
|
+
'designArea from designView because a designView is selected',
|
|
633
|
+
() => {
|
|
634
|
+
const mockStoreSrv = new (class StoreService {
|
|
635
|
+
static serviceName = 'StoreService';
|
|
636
|
+
state = {
|
|
637
|
+
configurator: {
|
|
638
|
+
configuration: {
|
|
639
|
+
designData: {},
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
designArea: {
|
|
643
|
+
selectedDesignArea: {},
|
|
644
|
+
previousEditedDesignArea: {},
|
|
645
|
+
filteredDesignAreas: [
|
|
646
|
+
{
|
|
647
|
+
identifier: 'back',
|
|
648
|
+
designView: {
|
|
649
|
+
identifier: '03_back',
|
|
650
|
+
},
|
|
651
|
+
designProductionMethods: [],
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
identifier: 'front',
|
|
655
|
+
designView: {
|
|
656
|
+
identifier: '02_front',
|
|
657
|
+
},
|
|
658
|
+
designProductionMethods: [],
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
identifier: 'side',
|
|
662
|
+
designView: {
|
|
663
|
+
identifier: '01_side',
|
|
664
|
+
},
|
|
665
|
+
designProductionMethods: [],
|
|
666
|
+
},
|
|
667
|
+
],
|
|
668
|
+
},
|
|
669
|
+
designView: {
|
|
670
|
+
selectedDesignView: {
|
|
671
|
+
identifier: '01_side',
|
|
672
|
+
},
|
|
673
|
+
},
|
|
674
|
+
};
|
|
675
|
+
dispatch = jest.fn();
|
|
676
|
+
})();
|
|
677
|
+
ServiceLocator.provide(mockStoreSrv);
|
|
678
|
+
const mockUISrv = new (class UIService {
|
|
679
|
+
static serviceName = 'UIService';
|
|
680
|
+
show = jest.fn();
|
|
681
|
+
})();
|
|
682
|
+
ServiceLocator.provide(mockUISrv);
|
|
683
|
+
const mockVisualizationSrv = new (class VisualizationService {
|
|
684
|
+
static serviceName = 'VisualizationService';
|
|
685
|
+
enableUserMovement = jest.fn();
|
|
686
|
+
disableUserMovement = jest.fn();
|
|
687
|
+
freeUserMovement = jest.fn();
|
|
688
|
+
getActiveDesignArea = jest.fn();
|
|
689
|
+
})();
|
|
690
|
+
ServiceLocator.provide(mockVisualizationSrv);
|
|
691
|
+
|
|
692
|
+
const srv = new DesignDataService();
|
|
693
|
+
srv.selectDesignArea = jest.fn();
|
|
694
|
+
srv.openDesignAreaEditor();
|
|
695
|
+
expect(mockUISrv.show).toHaveBeenCalledWith('designer');
|
|
696
|
+
expect(srv.selectDesignArea).toHaveBeenCalledWith('side');
|
|
697
|
+
}
|
|
698
|
+
);
|
|
627
699
|
test(
|
|
628
700
|
'[INTEGRATION] openDesignAreaEditor calls the ui.show action to show the designer, and calls the ' +
|
|
629
701
|
'designArea from designData with objects to open',
|
|
@@ -659,6 +731,9 @@ describe('Services/DesignDataService', () => {
|
|
|
659
731
|
selectedDesignArea: {},
|
|
660
732
|
previousEditedDesignArea: {},
|
|
661
733
|
},
|
|
734
|
+
designView: {
|
|
735
|
+
selectedDesignView: {},
|
|
736
|
+
},
|
|
662
737
|
};
|
|
663
738
|
dispatch = jest.fn();
|
|
664
739
|
})();
|
|
@@ -701,6 +776,9 @@ describe('Services/DesignDataService', () => {
|
|
|
701
776
|
identifier: 'area-51',
|
|
702
777
|
},
|
|
703
778
|
},
|
|
779
|
+
designView: {
|
|
780
|
+
selectedDesignView: {},
|
|
781
|
+
},
|
|
704
782
|
};
|
|
705
783
|
dispatch = jest.fn();
|
|
706
784
|
})();
|
|
@@ -739,6 +817,9 @@ describe('Services/DesignDataService', () => {
|
|
|
739
817
|
},
|
|
740
818
|
previousEditedDesignArea: {},
|
|
741
819
|
},
|
|
820
|
+
designView: {
|
|
821
|
+
selectedDesignView: {},
|
|
822
|
+
},
|
|
742
823
|
configurator: {
|
|
743
824
|
configuration: {
|
|
744
825
|
designdata: {
|