@configuratorware/configurator-frontendgui 1.36.0-beta.0 → 1.36.1
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/Components/FullScreenView/FullScreenView.js +1 -1
- package/App/Modules/Designer/Containers/ImageEditDialog.js +1 -1
- package/App/Modules/Designer/DesignerScreen.js +1 -4
- package/App/Modules/Visualization/CreatorAlignTarget.js +1 -1
- package/App/Modules/Visualization/DesignerAlignTarget.js +1 -1
- package/App/Reducers/Configurator/Reducer.js +1 -1
- package/App/Reducers/DesignArea/Selectors.js +31 -13
- package/App/Screens/Configurator/Components/FullScreenView/index.js +2 -2
- package/App/Screens/Configurator/Components/LandscapeInformation/index.js +1 -1
- package/App/Screens/Configurator/Screen.js +1 -1
- 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/Components/FullScreenView/FullScreenView.js +1 -1
- package/src/App/Modules/Designer/Containers/ImageEditDialog.js +1 -1
- package/src/App/Modules/Designer/DesignerScreen.js +0 -2
- package/src/App/Modules/Visualization/CreatorAlignTarget.js +1 -1
- package/src/App/Modules/Visualization/DesignerAlignTarget.js +1 -1
- 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/Screens/Configurator/Components/FullScreenView/index.js +2 -2
- package/src/App/Screens/Configurator/Components/LandscapeInformation/index.js +1 -1
- package/src/App/Screens/Configurator/Screen.js +1 -1
- 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
|
@@ -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: {
|
|
@@ -339,6 +339,8 @@ class AmountPrice extends React.Component {
|
|
|
339
339
|
receiveOfferFormComponentRef = React.createRef();
|
|
340
340
|
dialogContentRef = React.createRef();
|
|
341
341
|
priceListRef = React.createRef();
|
|
342
|
+
acceptDesignRef = React.createRef();
|
|
343
|
+
acceptDataPrivacyRef = React.createRef();
|
|
342
344
|
|
|
343
345
|
handleChange = event => {
|
|
344
346
|
this.setState({
|
|
@@ -349,10 +351,9 @@ class AmountPrice extends React.Component {
|
|
|
349
351
|
});
|
|
350
352
|
};
|
|
351
353
|
|
|
352
|
-
verifyRequestErrors =
|
|
354
|
+
verifyRequestErrors = hasFormValidationErrors => {
|
|
353
355
|
const { bulkNameErrors, displayAcceptDesign } = this.props;
|
|
354
356
|
const designApproved = this.state.approval.value;
|
|
355
|
-
|
|
356
357
|
if (bulkNameErrors && bulkNameErrors.length > 0) {
|
|
357
358
|
this.setState({ showErrors: true });
|
|
358
359
|
this.setState({ bulkNameErrors });
|
|
@@ -365,6 +366,9 @@ class AmountPrice extends React.Component {
|
|
|
365
366
|
error: true,
|
|
366
367
|
},
|
|
367
368
|
});
|
|
369
|
+
!hasFormValidationErrors &&
|
|
370
|
+
this.acceptDesignRef.current &&
|
|
371
|
+
this.acceptDesignRef.current.scrollIntoView();
|
|
368
372
|
}
|
|
369
373
|
if (!this.dataPrivacyApproved()) {
|
|
370
374
|
this.setState({
|
|
@@ -373,6 +377,9 @@ class AmountPrice extends React.Component {
|
|
|
373
377
|
error: true,
|
|
374
378
|
},
|
|
375
379
|
});
|
|
380
|
+
!hasFormValidationErrors &&
|
|
381
|
+
this.acceptDataPrivacyRef.current &&
|
|
382
|
+
this.acceptDataPrivacyRef.current.scrollIntoView();
|
|
376
383
|
}
|
|
377
384
|
};
|
|
378
385
|
|
|
@@ -449,7 +456,7 @@ class AmountPrice extends React.Component {
|
|
|
449
456
|
this.setState({ hasErrorReceiveOfferForm: false });
|
|
450
457
|
}
|
|
451
458
|
} else {
|
|
452
|
-
this.verifyRequestErrors();
|
|
459
|
+
this.verifyRequestErrors(formValidation.hasError);
|
|
453
460
|
}
|
|
454
461
|
};
|
|
455
462
|
|
|
@@ -574,28 +581,32 @@ class AmountPrice extends React.Component {
|
|
|
574
581
|
amount={amount}
|
|
575
582
|
acceptDesignComponent={
|
|
576
583
|
showCallToAction ? (
|
|
577
|
-
<
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
584
|
+
<div ref={this.acceptDesignRef}>
|
|
585
|
+
<AcceptDesignComponent
|
|
586
|
+
termsAndConditionsLink={termsAndConditionsLink}
|
|
587
|
+
displayAcceptDesign={displayAcceptDesign}
|
|
588
|
+
handleChangeCheckboxApproval={this.handleChange}
|
|
589
|
+
approval={approval}
|
|
590
|
+
closeProductOverviewDialog={this.handleClose}
|
|
591
|
+
notice={notice}
|
|
592
|
+
noteLabel={t('amountPrice.notice')}
|
|
593
|
+
handleChange={this.handleBasketNoticeChange}
|
|
594
|
+
/>
|
|
595
|
+
</div>
|
|
587
596
|
) : null
|
|
588
597
|
}
|
|
589
598
|
acceptDataPrivacyComponent={
|
|
590
599
|
showReceiveOfferForm && dataPrivacyLink ? (
|
|
591
|
-
<
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
600
|
+
<div ref={this.acceptDataPrivacyRef}>
|
|
601
|
+
<AcceptPrivacyComponent
|
|
602
|
+
dataPrivacyLink={dataPrivacyLink}
|
|
603
|
+
displayAcceptDesign={true}
|
|
604
|
+
handleChangeCheckboxApproval={this.handleChange}
|
|
605
|
+
approval={dataPrivacyAccepted}
|
|
606
|
+
closeProductOverviewDialog={this.handleClose}
|
|
607
|
+
displayNote={false}
|
|
608
|
+
/>
|
|
609
|
+
</div>
|
|
599
610
|
) : null
|
|
600
611
|
}
|
|
601
612
|
notificationComponent={mergedNotifications.map(
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Swipeable } from 'react-swipeable';
|
|
2
3
|
import _ from 'lodash';
|
|
3
4
|
|
|
4
5
|
import './Styles.scss';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import clsx from 'clsx';
|
|
7
8
|
import { withStyles } from '@material-ui/core/styles';
|
|
8
|
-
import { DOWN, LEFT, RIGHT, Swipeable, UP } from '../../../Shared/Components/Swipeable';
|
|
9
9
|
|
|
10
10
|
const styles = theme => ({
|
|
11
11
|
carousel: {
|
|
@@ -37,12 +37,10 @@ class Carousel extends React.Component {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
componentDidMount() {
|
|
40
|
+
this.init();
|
|
40
41
|
const { carousel } = this.refs;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const wheelEventName = 'onwheel' in carousel ? 'wheel' : 'mousewheel';
|
|
44
|
-
carousel.addEventListener(wheelEventName, this.scrolled);
|
|
45
|
-
}
|
|
42
|
+
const wheelEventName = 'onwheel' in carousel ? 'wheel' : 'mousewheel';
|
|
43
|
+
carousel.addEventListener(wheelEventName, this.scrolled);
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
componentDidUpdate() {
|
|
@@ -142,16 +140,19 @@ class Carousel extends React.Component {
|
|
|
142
140
|
};
|
|
143
141
|
|
|
144
142
|
swiped = e => {
|
|
145
|
-
if
|
|
146
|
-
|
|
143
|
+
// if it's vertical deltaY should be the bigger
|
|
144
|
+
if (this.props.vertical && Math.abs(e.deltaY) >= Math.abs(e.deltaX)) {
|
|
145
|
+
if (e.deltaY > 0) {
|
|
147
146
|
this.next();
|
|
148
|
-
} else
|
|
147
|
+
} else {
|
|
149
148
|
this.prev();
|
|
150
149
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
150
|
+
}
|
|
151
|
+
// if it's not vertical deltaX should be the bigger
|
|
152
|
+
else if (!this.props.vertical && Math.abs(e.deltaX) >= Math.abs(e.deltaY)) {
|
|
153
|
+
if (e.deltaX > 0) {
|
|
153
154
|
this.next();
|
|
154
|
-
} else
|
|
155
|
+
} else {
|
|
155
156
|
this.prev();
|
|
156
157
|
}
|
|
157
158
|
}
|
|
@@ -198,11 +199,9 @@ class Carousel extends React.Component {
|
|
|
198
199
|
)}
|
|
199
200
|
<Swipeable
|
|
200
201
|
className={'carousel-frame'}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
onSwiped: this.swiped,
|
|
205
|
-
}}
|
|
202
|
+
trackMouse={true}
|
|
203
|
+
onSwiping={this.swiping}
|
|
204
|
+
onSwiped={this.swiped}
|
|
206
205
|
>
|
|
207
206
|
<div
|
|
208
207
|
className="carousel-slider"
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "UP", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _reactSwipeable.UP;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "DOWN", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _reactSwipeable.DOWN;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "LEFT", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _reactSwipeable.LEFT;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "RIGHT", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _reactSwipeable.RIGHT;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
exports.Swipeable = void 0;
|
|
31
|
-
|
|
32
|
-
var _react = _interopRequireDefault(require("react"));
|
|
33
|
-
|
|
34
|
-
var _reactSwipeable = require("react-swipeable");
|
|
35
|
-
|
|
36
|
-
var _excluded = ["options"];
|
|
37
|
-
|
|
38
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
39
|
-
|
|
40
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
41
|
-
|
|
42
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
43
|
-
|
|
44
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
45
|
-
|
|
46
|
-
// eslint-disable-next-line react/prop-types,react/display-name
|
|
47
|
-
var Swipeable = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
48
|
-
var options = _ref.options,
|
|
49
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
-
|
|
51
|
-
var handlers = (0, _reactSwipeable.useSwipeable)(options);
|
|
52
|
-
return /*#__PURE__*/_react["default"].createElement("div", _extends({}, handlers, props, {
|
|
53
|
-
ref: ref
|
|
54
|
-
}));
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
exports.Swipeable = Swipeable;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSwipeable, UP, DOWN, LEFT, RIGHT } from 'react-swipeable';
|
|
3
|
-
|
|
4
|
-
export { UP, DOWN, LEFT, RIGHT };
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line react/prop-types,react/display-name
|
|
7
|
-
export const Swipeable = React.forwardRef(({ options, ...props }, ref) => {
|
|
8
|
-
const handlers = useSwipeable(options);
|
|
9
|
-
return <div {...handlers} {...props} ref={ref} />;
|
|
10
|
-
});
|