@configuratorware/configurator-frontendgui 1.36.2 → 1.37.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/Reducers/DesignArea/Selectors.js +2 -0
- package/App/Services/InteractionService.js +10 -6
- package/App/Shared/Components/AmountPrice/index.js +2 -1
- package/App/Shared/Components/PriceList/index.js +8 -2
- package/App/Utils/createMessageInterface.js +3 -1
- package/App/configuration.js +6 -0
- package/package.json +4 -4
- package/public/configuration.js +137 -0
- package/src/App/Reducers/DesignArea/Selectors.js +1 -0
- package/src/App/Services/InteractionService.js +5 -1
- package/src/App/Shared/Components/AmountPrice/index.js +2 -1
- package/src/App/Shared/Components/PriceList/__snapshots__/index.test.js.snap +4 -4
- package/src/App/Shared/Components/PriceList/index.js +4 -1
- package/src/App/Utils/createMessageInterface.js +2 -0
- package/src/App/configuration.js +4 -0
|
@@ -493,6 +493,8 @@ function getSelectedDesignProductionMethodForDesignArea(state, designArea) {
|
|
|
493
493
|
|
|
494
494
|
return (0, _find2["default"])(designProductionMethods, {
|
|
495
495
|
identifier: designProductionMethodIdentifier
|
|
496
|
+
}) || (0, _find2["default"])(designProductionMethods, {
|
|
497
|
+
isDefault: true
|
|
496
498
|
}) || (0, _first["default"])(designProductionMethods);
|
|
497
499
|
}
|
|
498
500
|
|
|
@@ -522,28 +522,32 @@ var InteractionService = /*#__PURE__*/function (_AbstractInteractionS) {
|
|
|
522
522
|
});
|
|
523
523
|
|
|
524
524
|
case 21:
|
|
525
|
-
|
|
525
|
+
this.postMessageToContainer({
|
|
526
|
+
method: _createMessageInterface.METHOD_REQUEST_OFFER_FORM_SENT,
|
|
527
|
+
code: configuration.code
|
|
528
|
+
});
|
|
529
|
+
_context8.next = 28;
|
|
526
530
|
break;
|
|
527
531
|
|
|
528
|
-
case
|
|
529
|
-
_context8.prev =
|
|
532
|
+
case 24:
|
|
533
|
+
_context8.prev = 24;
|
|
530
534
|
_context8.t1 = _context8["catch"](18);
|
|
531
535
|
|
|
532
536
|
_ServiceLocator.Services.ui.reportError((0, _i18n.t)('receiveOfferForm.sentError'));
|
|
533
537
|
|
|
534
538
|
return _context8.abrupt("return", false);
|
|
535
539
|
|
|
536
|
-
case
|
|
540
|
+
case 28:
|
|
537
541
|
_ServiceLocator.Services.ui.reportError((0, _i18n.t)('receiveOfferForm.sentOk'));
|
|
538
542
|
|
|
539
543
|
return _context8.abrupt("return", true);
|
|
540
544
|
|
|
541
|
-
case
|
|
545
|
+
case 30:
|
|
542
546
|
case "end":
|
|
543
547
|
return _context8.stop();
|
|
544
548
|
}
|
|
545
549
|
}
|
|
546
|
-
}, _callee8,
|
|
550
|
+
}, _callee8, this, [[2, 9, 13, 16], [18, 24]]);
|
|
547
551
|
}));
|
|
548
552
|
|
|
549
553
|
function sendReceiveOfferRequest(_x2) {
|
|
@@ -204,7 +204,8 @@ var styles = function styles(theme) {
|
|
|
204
204
|
}), _defineProperty(_MuiDialogActions, "marginRight", 8), _MuiDialogActions),
|
|
205
205
|
'& .MuiDialogTitle-root, .MuiDialogActions-root': (_MuiDialogTitleRo = {
|
|
206
206
|
paddingLeft: 32,
|
|
207
|
-
paddingRight:
|
|
207
|
+
paddingRight: 20,
|
|
208
|
+
marginRight: 4
|
|
208
209
|
}, _defineProperty(_MuiDialogTitleRo, theme.breakpoints.down('xs'), {
|
|
209
210
|
paddingLeft: 0,
|
|
210
211
|
paddingRight: 0
|
|
@@ -114,7 +114,10 @@ var styles = function styles(theme) {
|
|
|
114
114
|
flex: 0,
|
|
115
115
|
justifyContent: 'flex-end',
|
|
116
116
|
display: 'flex'
|
|
117
|
-
})
|
|
117
|
+
}),
|
|
118
|
+
container: {
|
|
119
|
+
marginBottom: 'auto'
|
|
120
|
+
}
|
|
118
121
|
};
|
|
119
122
|
};
|
|
120
123
|
|
|
@@ -154,7 +157,10 @@ var PriceList = /*#__PURE__*/function (_React$Component) {
|
|
|
154
157
|
hidePrices = _this$props.hidePrices;
|
|
155
158
|
return /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
156
159
|
container: true,
|
|
157
|
-
spacing: 2
|
|
160
|
+
spacing: 2,
|
|
161
|
+
classes: {
|
|
162
|
+
root: classes.container
|
|
163
|
+
}
|
|
158
164
|
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
159
165
|
item: true,
|
|
160
166
|
xs: 12
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = createMessageInterface;
|
|
7
|
-
exports.LISTENER_SAVE_CONFIGURATION = exports.LISTENER_SWITCH_OPTIONS = exports.METHOD_CONFIGURATION_SAVED_REMOTELY = exports.METHOD_CONFIGURATION_SAVED = exports.METHOD_ADD_TO_CART = void 0;
|
|
7
|
+
exports.LISTENER_SAVE_CONFIGURATION = exports.LISTENER_SWITCH_OPTIONS = exports.METHOD_CONFIGURATION_SAVED_REMOTELY = exports.METHOD_REQUEST_OFFER_FORM_SENT = exports.METHOD_CONFIGURATION_SAVED = exports.METHOD_ADD_TO_CART = void 0;
|
|
8
8
|
|
|
9
9
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
10
10
|
|
|
@@ -14,6 +14,8 @@ var METHOD_ADD_TO_CART = 'addtocart';
|
|
|
14
14
|
exports.METHOD_ADD_TO_CART = METHOD_ADD_TO_CART;
|
|
15
15
|
var METHOD_CONFIGURATION_SAVED = 'configurationsaved';
|
|
16
16
|
exports.METHOD_CONFIGURATION_SAVED = METHOD_CONFIGURATION_SAVED;
|
|
17
|
+
var METHOD_REQUEST_OFFER_FORM_SENT = 'requestoffer_form_sent';
|
|
18
|
+
exports.METHOD_REQUEST_OFFER_FORM_SENT = METHOD_REQUEST_OFFER_FORM_SENT;
|
|
17
19
|
var METHOD_CONFIGURATION_SAVED_REMOTELY = 'configurationsaved_remotely';
|
|
18
20
|
exports.METHOD_CONFIGURATION_SAVED_REMOTELY = METHOD_CONFIGURATION_SAVED_REMOTELY;
|
|
19
21
|
var LISTENER_SWITCH_OPTIONS = 'switch_options';
|
package/App/configuration.js
CHANGED
|
@@ -238,6 +238,12 @@ function preventLeavingPage() {
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
function init() {
|
|
241
|
+
var externalConfig = window.externalConfiguration;
|
|
242
|
+
|
|
243
|
+
if (externalConfig) {
|
|
244
|
+
applicationConfiguration = _lodash["default"].merge(applicationConfiguration, externalConfig);
|
|
245
|
+
}
|
|
246
|
+
|
|
241
247
|
applicationConfiguration = _lodash["default"].merge(applicationConfiguration, getQueryParams());
|
|
242
248
|
|
|
243
249
|
_Api["default"].init(applicationConfiguration.network);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configuratorware/configurator-frontendgui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/polyfill": "^7.12.1",
|
|
9
|
-
"@configuratorware/scripts": "1.
|
|
9
|
+
"@configuratorware/scripts": "1.37.0",
|
|
10
10
|
"@hot-loader/react-dom": "^17.0.1",
|
|
11
11
|
"@material-ui/core": "^4.12.2",
|
|
12
12
|
"@material-ui/icons": "^4.11.2",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"react-router-dom": "^5.2.0",
|
|
40
40
|
"react-swipeable": "^5.5.1",
|
|
41
41
|
"react-zoom-pan-pinch": "^2.1.3",
|
|
42
|
-
"redhotmagma-graphics-editor": "1.
|
|
43
|
-
"redhotmagma-visualization": "1.
|
|
42
|
+
"redhotmagma-graphics-editor": "1.37.0",
|
|
43
|
+
"redhotmagma-visualization": "1.37.0",
|
|
44
44
|
"redux": "^4.1.0",
|
|
45
45
|
"redux-logger": "^3.0.6",
|
|
46
46
|
"redux-persist": "^5.10.0",
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
|
|
2
|
+
const externalConfiguration = {
|
|
3
|
+
// the default language code (format: de-DE, en-GB, etc.), use false to select the browser language
|
|
4
|
+
//language: false,
|
|
5
|
+
|
|
6
|
+
// the available locales
|
|
7
|
+
//locales: [{ code: 'de_DE', preferred: true }, { code: 'en_GB' }],
|
|
8
|
+
|
|
9
|
+
// show custom title input before saving the configuration
|
|
10
|
+
//editCustomTitleBeforeSave: false, // default: false
|
|
11
|
+
|
|
12
|
+
// set true to load available variants before loading the configuration
|
|
13
|
+
//loadVariantsFirst: false, // default: false
|
|
14
|
+
|
|
15
|
+
// set true to load
|
|
16
|
+
//loadInspirations: false, // default: false
|
|
17
|
+
|
|
18
|
+
// set true to open the first optionclassification instead of the "start here" text
|
|
19
|
+
//showInitialOptionclassification: false, // default: false
|
|
20
|
+
|
|
21
|
+
// show the "start here" animation
|
|
22
|
+
//showStartHere: true,
|
|
23
|
+
|
|
24
|
+
// show the "add to cart" button by default
|
|
25
|
+
//showAddToCartButton: true,
|
|
26
|
+
|
|
27
|
+
// set true to run server-side validation before addToCart
|
|
28
|
+
//validateBeforeCTA: true,
|
|
29
|
+
|
|
30
|
+
// set false to decide by screen orientation, or can be fixed 'left' or 'bottom'
|
|
31
|
+
//dock: false,
|
|
32
|
+
|
|
33
|
+
// set true to display the selected option for each optionclassification
|
|
34
|
+
//displaySwitchedOptions: false, // default: false
|
|
35
|
+
|
|
36
|
+
// set true to check the optionclassification immediately after selected
|
|
37
|
+
//checkOptionclassificationOnSelect: false,
|
|
38
|
+
|
|
39
|
+
// which method is used for addToCart? default: postMessage
|
|
40
|
+
// when it is set to 'functionCall' it calls window.parent.addToCart(configuration.code)
|
|
41
|
+
//addToCartMethod: 'postMessage',
|
|
42
|
+
|
|
43
|
+
// use carousel for optionclassification list
|
|
44
|
+
//optionclassificationCarousel: true,
|
|
45
|
+
|
|
46
|
+
// set true to disable beforeunload warning
|
|
47
|
+
//disableBeforeunloadWarning: false,
|
|
48
|
+
|
|
49
|
+
// set true to hide optionlist when user clicks somewhere else
|
|
50
|
+
//hideOptionListOnAwayClick: true,
|
|
51
|
+
|
|
52
|
+
// set true to force the option details dialog shown with an image
|
|
53
|
+
//optionDetailsWithImage: false,
|
|
54
|
+
|
|
55
|
+
// set true to disable optionlist moving
|
|
56
|
+
//fixedOptionlist: false,
|
|
57
|
+
|
|
58
|
+
//set true to show accept design checkbox approval
|
|
59
|
+
//displayAcceptDesign: true,
|
|
60
|
+
|
|
61
|
+
// available tools in the toolbar
|
|
62
|
+
/*availableTools: {
|
|
63
|
+
fastConfiguration: false,
|
|
64
|
+
save: false,
|
|
65
|
+
load: false,
|
|
66
|
+
share: false,
|
|
67
|
+
print: false,
|
|
68
|
+
},*/
|
|
69
|
+
|
|
70
|
+
// relative position of the option list dialog
|
|
71
|
+
// [
|
|
72
|
+
// [<dialogSideH{left|center|right}>, <relToSideH{left|center|right}>],
|
|
73
|
+
// [<dialogSideV{top|center|bottom}>, <relToSideV{top|center|bottom}>]
|
|
74
|
+
// ]
|
|
75
|
+
/*optionlistDialogPositioning: {
|
|
76
|
+
left: [
|
|
77
|
+
['left', 'right'],
|
|
78
|
+
['top', 'top'],
|
|
79
|
+
],
|
|
80
|
+
bottom: [
|
|
81
|
+
['center', 'center'],
|
|
82
|
+
['bottom', 'top'],
|
|
83
|
+
],
|
|
84
|
+
},*/
|
|
85
|
+
|
|
86
|
+
// override this to set a default item identifier to load if not defined in the route
|
|
87
|
+
//defaultLoadIdentifier: false,
|
|
88
|
+
|
|
89
|
+
// should the option list be fixed to the left side, or it can open up above the selected option classification
|
|
90
|
+
//optionListFixedToLeft: true,
|
|
91
|
+
|
|
92
|
+
// the components used in the Screen (override any component in custom project)
|
|
93
|
+
//components: {},
|
|
94
|
+
|
|
95
|
+
// the containers used in the Screen (override any container in custom project)
|
|
96
|
+
//containers: {},
|
|
97
|
+
|
|
98
|
+
// load the available configuration modes (might be set to false in older configurators)
|
|
99
|
+
//loadConfigurationModes: true,
|
|
100
|
+
|
|
101
|
+
// if set to false only the amount for the currently selected variant can be selected
|
|
102
|
+
// when switching the variant the selected amount is transferred to the newly selected variant
|
|
103
|
+
//restrictAmountselectionToSelectedVariant: false,
|
|
104
|
+
|
|
105
|
+
//displayColorAmountWarnings: true,
|
|
106
|
+
|
|
107
|
+
//displayEditorRulers: true,
|
|
108
|
+
|
|
109
|
+
/*visualization: {
|
|
110
|
+
designAreaHighlightBackgroundColor: 'transparent',
|
|
111
|
+
options: {
|
|
112
|
+
// when zoom = 1 use NearestFilter (for sharper product image)
|
|
113
|
+
sharperFullView: false,
|
|
114
|
+
// upscale or downscale the product image to fit 2048 x 2048
|
|
115
|
+
// Warning! not recommended, use better image resources instead
|
|
116
|
+
optimizeProductImage: false,
|
|
117
|
+
},
|
|
118
|
+
},*/
|
|
119
|
+
|
|
120
|
+
/*designer: {
|
|
121
|
+
dpi: 300, // the default canvas dpi as project specific option
|
|
122
|
+
maxColorAmount: 10, // the default max number of colors in the colorizing feature
|
|
123
|
+
allowedImageUploadFormats: 'jpg,jpeg,svg,png,pdf,bmp,tif,tiff,eps,ai,gif', // the image formats users can upload to designareas / designer items
|
|
124
|
+
},*/
|
|
125
|
+
|
|
126
|
+
//vectorizeImageQuality: 45000,
|
|
127
|
+
|
|
128
|
+
//renderPreviewImagesForCheckout: true,
|
|
129
|
+
|
|
130
|
+
// automatically show the vectorization preview in colorizing step
|
|
131
|
+
//autoPreviewVectorization: true,
|
|
132
|
+
|
|
133
|
+
// switch to the previously selected view when selecting a component that has no view specified
|
|
134
|
+
//switchViewOnComponentSelection: true,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
window.externalConfiguration = externalConfiguration;
|
|
@@ -238,6 +238,7 @@ export function getSelectedDesignProductionMethodForDesignArea(state, designArea
|
|
|
238
238
|
const { designProductionMethodIdentifier } = designAreaData || {};
|
|
239
239
|
return (
|
|
240
240
|
find(designProductionMethods, { identifier: designProductionMethodIdentifier }) ||
|
|
241
|
+
find(designProductionMethods, { isDefault: true }) ||
|
|
241
242
|
first(designProductionMethods)
|
|
242
243
|
);
|
|
243
244
|
}
|
|
@@ -5,7 +5,7 @@ import Api from '../../Framework/Api';
|
|
|
5
5
|
import { t } from 'Framework/i18n';
|
|
6
6
|
import { getConfiguration } from '../Reducers/Configurator/Selectors';
|
|
7
7
|
import { EventTypes } from '../Constant';
|
|
8
|
-
import { METHOD_CONFIGURATION_SAVED } from '../Utils/createMessageInterface';
|
|
8
|
+
import { METHOD_CONFIGURATION_SAVED, METHOD_REQUEST_OFFER_FORM_SENT } from '../Utils/createMessageInterface';
|
|
9
9
|
|
|
10
10
|
export default class InteractionService extends AbstractInteractionService {
|
|
11
11
|
constructor() {
|
|
@@ -227,6 +227,10 @@ export default class InteractionService extends AbstractInteractionService {
|
|
|
227
227
|
|
|
228
228
|
try {
|
|
229
229
|
await Api.request({ url: 'receiveoffers/request', method: 'post', data: data });
|
|
230
|
+
this.postMessageToContainer({
|
|
231
|
+
method: METHOD_REQUEST_OFFER_FORM_SENT,
|
|
232
|
+
code: configuration.code,
|
|
233
|
+
});
|
|
230
234
|
} catch (error) {
|
|
231
235
|
Services.ui.reportError(t('receiveOfferForm.sentError'));
|
|
232
236
|
|
|
@@ -116,7 +116,8 @@ const styles = theme => ({
|
|
|
116
116
|
},
|
|
117
117
|
'& .MuiDialogTitle-root, .MuiDialogActions-root': {
|
|
118
118
|
paddingLeft: 32,
|
|
119
|
-
paddingRight:
|
|
119
|
+
paddingRight: 20,
|
|
120
|
+
marginRight: 4,
|
|
120
121
|
[theme.breakpoints.down('xs')]: {
|
|
121
122
|
paddingLeft: 0,
|
|
122
123
|
paddingRight: 0,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`renders correctly 1`] = `
|
|
4
4
|
<div
|
|
5
|
-
class="MuiGrid-root MuiGrid-container MuiGrid-spacing-xs-2"
|
|
5
|
+
class="MuiGrid-root PriceList-container-10 MuiGrid-container MuiGrid-spacing-xs-2"
|
|
6
6
|
>
|
|
7
7
|
<div
|
|
8
8
|
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12"
|
|
@@ -33,13 +33,13 @@ exports[`renders correctly 1`] = `
|
|
|
33
33
|
>
|
|
34
34
|
<span
|
|
35
35
|
aria-disabled="false"
|
|
36
|
-
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-
|
|
36
|
+
class="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-11 MuiCheckbox-root PriceList-MuiCheckboxRoot-2 MuiCheckbox-colorPrimary MuiIconButton-colorPrimary"
|
|
37
37
|
>
|
|
38
38
|
<span
|
|
39
39
|
class="MuiIconButton-label"
|
|
40
40
|
>
|
|
41
41
|
<input
|
|
42
|
-
class="PrivateSwitchBase-input-
|
|
42
|
+
class="PrivateSwitchBase-input-14"
|
|
43
43
|
data-indeterminate="false"
|
|
44
44
|
tabindex="-1"
|
|
45
45
|
type="checkbox"
|
|
@@ -76,7 +76,7 @@ exports[`renders correctly 1`] = `
|
|
|
76
76
|
|
|
77
77
|
exports[`renders correctly with default props 1`] = `
|
|
78
78
|
<div
|
|
79
|
-
class="MuiGrid-root MuiGrid-container MuiGrid-spacing-xs-2"
|
|
79
|
+
class="MuiGrid-root PriceList-container-10 MuiGrid-container MuiGrid-spacing-xs-2"
|
|
80
80
|
>
|
|
81
81
|
<div
|
|
82
82
|
class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12"
|
|
@@ -74,6 +74,9 @@ const styles = theme => ({
|
|
|
74
74
|
display: 'flex',
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
|
+
container: {
|
|
78
|
+
marginBottom: 'auto',
|
|
79
|
+
},
|
|
77
80
|
});
|
|
78
81
|
|
|
79
82
|
class PriceList extends React.Component {
|
|
@@ -102,7 +105,7 @@ class PriceList extends React.Component {
|
|
|
102
105
|
render() {
|
|
103
106
|
const { list, productTitle, classes, amount, hidePrices } = this.props;
|
|
104
107
|
return (
|
|
105
|
-
<Grid container spacing={2}>
|
|
108
|
+
<Grid container spacing={2} classes={{ root: classes.container }}>
|
|
106
109
|
<Grid item xs={12}>
|
|
107
110
|
{amount > 0 && list && list.length <= 0 && (
|
|
108
111
|
<List dense={false}>
|
|
@@ -4,6 +4,8 @@ export const METHOD_ADD_TO_CART = 'addtocart';
|
|
|
4
4
|
|
|
5
5
|
export const METHOD_CONFIGURATION_SAVED = 'configurationsaved';
|
|
6
6
|
|
|
7
|
+
export const METHOD_REQUEST_OFFER_FORM_SENT = 'requestoffer_form_sent';
|
|
8
|
+
|
|
7
9
|
export const METHOD_CONFIGURATION_SAVED_REMOTELY = 'configurationsaved_remotely';
|
|
8
10
|
|
|
9
11
|
export const LISTENER_SWITCH_OPTIONS = 'switch_options';
|
package/src/App/configuration.js
CHANGED
|
@@ -255,6 +255,10 @@ function preventLeavingPage() {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
export function init() {
|
|
258
|
+
const externalConfig = window.externalConfiguration;
|
|
259
|
+
if (externalConfig) {
|
|
260
|
+
applicationConfiguration = _.merge(applicationConfiguration, externalConfig);
|
|
261
|
+
}
|
|
258
262
|
applicationConfiguration = _.merge(applicationConfiguration, getQueryParams());
|
|
259
263
|
|
|
260
264
|
Api.init(applicationConfiguration.network);
|