@configuratorware/configurator-frontendgui 1.54.2 → 1.54.3
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 -2
- package/App/Reducers/ImageGallery/Actions.js +1 -7
- package/App/Services/DesignerService.js +7 -4
- package/package.json +4 -4
- package/src/App/Reducers/DesignArea/Selectors.js +2 -7
- package/src/App/Reducers/ImageGallery/Actions.js +0 -5
- package/src/App/Reducers/ImageGallery/__tests__/Actions.test.js +0 -10
- package/src/App/Reducers/ImageGallery/__tests__/Reducer.test.js +0 -14
- package/src/App/Services/DesignerService.js +1 -0
|
@@ -1058,8 +1058,8 @@ var getVectorizeForDesignProductionMethods = exports.getVectorizeForDesignProduc
|
|
|
1058
1058
|
var _getSelectedDesignAre3 = getSelectedDesignAreaProperties(state),
|
|
1059
1059
|
designProductionMethod = _getSelectedDesignAre3.designProductionMethod;
|
|
1060
1060
|
var newProductionMethod = getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier);
|
|
1061
|
-
var currentVectorsRequired = !!(0, _get["default"])(designProductionMethod, 'options.vectorsRequired')
|
|
1062
|
-
var newVectorsRequired = !!(0, _get["default"])(newProductionMethod, 'options.vectorsRequired')
|
|
1061
|
+
var currentVectorsRequired = !!(0, _get["default"])(designProductionMethod, 'options.vectorsRequired');
|
|
1062
|
+
var newVectorsRequired = !!(0, _get["default"])(newProductionMethod, 'options.vectorsRequired');
|
|
1063
1063
|
return {
|
|
1064
1064
|
currentVectorsRequired: currentVectorsRequired,
|
|
1065
1065
|
newVectorsRequired: newVectorsRequired
|
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.uploadImage = exports.updateUploadDelayed = exports.updateImage = exports.setSelectedImageData = exports.setSelectedImageByIdentifier = exports.
|
|
7
|
+
exports.uploadImage = exports.updateUploadDelayed = exports.updateImage = exports.setSelectedImageData = exports.setSelectedImageByIdentifier = exports.setModeToEdit = exports.setModeToAdd = exports.selectTags = exports.selectTag = exports.receiveGalleryTags = exports.getGalleryUrlForTags = exports.fetchTags = exports.fetchGallery = exports.editImage = exports.dismissError = exports.commitChanges = exports.addImagesFromDesignArea = exports.addGalleryImageToUserImages = exports.WN_UPLOAD_IMAGE = exports.WN_LOAD_TAGS = exports.WN_LOAD_IMAGES = exports.URL_UPLOAD = exports.URL_TAGS = exports.URL_GALLERY = exports.UPDATE_UPLOAD_DELAYED = exports.UPDATE_IMAGE = exports.SET_SELECTED_IMAGE = exports.SET_MODE = exports.SELECT_GALLERY_TAGS = exports.SELECT_GALLERY_TAG = exports.RECEIVE_IMAGE_UPLOAD_DATA = exports.RECEIVE_GALLERY_TAGS = exports.RECEIVE_GALLERY = exports.ImageGalleryModes = exports.DISMISS_ERROR = exports.COMMIT_CHANGES = exports.ADD_IMAGES_FROM_DESIGN_AREA = exports.ADD_GALLERY_IMAGE_TO_USER_IMAGES = void 0;
|
|
8
8
|
var _Actions = require("../Actions");
|
|
9
9
|
var _Actions2 = require("../UI/Actions");
|
|
10
10
|
var _Selectors = require("./Selectors");
|
|
@@ -81,12 +81,6 @@ var selectTags = exports.selectTags = function selectTags(tags) {
|
|
|
81
81
|
return dispatch(fetchGallery(tags));
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
|
-
var setSelectedImage = exports.setSelectedImage = function setSelectedImage(fileName) {
|
|
85
|
-
return {
|
|
86
|
-
type: SET_SELECTED_IMAGE,
|
|
87
|
-
fileName: fileName
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
84
|
var setSelectedImageByIdentifier = exports.setSelectedImageByIdentifier = function setSelectedImageByIdentifier(identifier) {
|
|
91
85
|
return {
|
|
92
86
|
type: SET_SELECTED_IMAGE,
|
|
@@ -233,12 +233,15 @@ var DesignerService = exports["default"] = /*#__PURE__*/function () {
|
|
|
233
233
|
return _regenerator().w(function (_context5) {
|
|
234
234
|
while (1) switch (_context5.n) {
|
|
235
235
|
case 0:
|
|
236
|
+
_context5.n = 1;
|
|
237
|
+
return _ServiceLocator.Services.store.dispatch((0, _Actions.setSelectedImageByIdentifier)(null));
|
|
238
|
+
case 1:
|
|
236
239
|
timeout = setTimeout(function () {
|
|
237
240
|
_ServiceLocator.Services.store.dispatch((0, _Actions.updateUploadDelayed)(true));
|
|
238
241
|
}, 10000);
|
|
239
|
-
_context5.n =
|
|
242
|
+
_context5.n = 2;
|
|
240
243
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.uploadImage)(file));
|
|
241
|
-
case
|
|
244
|
+
case 2:
|
|
242
245
|
response = _context5.v;
|
|
243
246
|
clearTimeout(timeout);
|
|
244
247
|
url = (0, _get["default"])(response, 'data.preview.url');
|
|
@@ -247,11 +250,11 @@ var DesignerService = exports["default"] = /*#__PURE__*/function () {
|
|
|
247
250
|
_ServiceLocator.Services.ui.alertMessage((0, _i18n.t)(term));
|
|
248
251
|
}
|
|
249
252
|
if (url) {
|
|
250
|
-
_context5.n =
|
|
253
|
+
_context5.n = 3;
|
|
251
254
|
break;
|
|
252
255
|
}
|
|
253
256
|
throw new Error('Preview image url is not specified!');
|
|
254
|
-
case
|
|
257
|
+
case 3:
|
|
255
258
|
_ServiceLocator.Services.store.dispatch((0, _Actions.updateUploadDelayed)(false));
|
|
256
259
|
return _context5.a(2, url.startsWith('http') ? url : "".concat((0, _configuration.getConf)('network.host')).concat(url));
|
|
257
260
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configuratorware/configurator-frontendgui",
|
|
3
|
-
"version": "1.54.
|
|
3
|
+
"version": "1.54.3",
|
|
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.54.
|
|
9
|
+
"@configuratorware/scripts": "1.54.3",
|
|
10
10
|
"@material-ui/core": "^4.12.4",
|
|
11
11
|
"@material-ui/icons": "^4.11.3",
|
|
12
12
|
"@material-ui/lab": "^4.0.0-alpha.61",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"react-router-dom": "^5.3.4",
|
|
37
37
|
"react-swipeable": "^5.5.1",
|
|
38
38
|
"react-zoom-pan-pinch": "^2.1.3",
|
|
39
|
-
"redhotmagma-graphics-editor": "1.54.
|
|
40
|
-
"redhotmagma-visualization": "1.54.
|
|
39
|
+
"redhotmagma-graphics-editor": "1.54.3",
|
|
40
|
+
"redhotmagma-visualization": "1.54.3",
|
|
41
41
|
"redux": "^4.1.0",
|
|
42
42
|
"redux-logger": "^3.0.6",
|
|
43
43
|
"redux-persist": "^5.10.0",
|
|
@@ -919,13 +919,8 @@ export const getVectorizeForDesignProductionMethods = (state, designProductionMe
|
|
|
919
919
|
state,
|
|
920
920
|
designProductionMethodIdentifier
|
|
921
921
|
);
|
|
922
|
-
const currentVectorsRequired =
|
|
923
|
-
|
|
924
|
-
isVectorizedLogoMandatory(designProductionMethod);
|
|
925
|
-
const newVectorsRequired =
|
|
926
|
-
!!get(newProductionMethod, 'options.vectorsRequired') &&
|
|
927
|
-
isVectorizedLogoMandatory(newProductionMethod);
|
|
928
|
-
|
|
922
|
+
const currentVectorsRequired = !!get(designProductionMethod, 'options.vectorsRequired');
|
|
923
|
+
const newVectorsRequired = !!get(newProductionMethod, 'options.vectorsRequired');
|
|
929
924
|
return {
|
|
930
925
|
currentVectorsRequired,
|
|
931
926
|
newVectorsRequired,
|
|
@@ -72,11 +72,6 @@ export const selectTags = tags => dispatch => {
|
|
|
72
72
|
return dispatch(fetchGallery(tags));
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
export const setSelectedImage = fileName => ({
|
|
76
|
-
type: SET_SELECTED_IMAGE,
|
|
77
|
-
fileName,
|
|
78
|
-
});
|
|
79
|
-
|
|
80
75
|
export const setSelectedImageByIdentifier = identifier => ({
|
|
81
76
|
type: SET_SELECTED_IMAGE,
|
|
82
77
|
identifier,
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
uploadImage,
|
|
12
12
|
addImagesFromDesignArea,
|
|
13
13
|
addGalleryImageToUserImages,
|
|
14
|
-
setSelectedImage,
|
|
15
14
|
setSelectedImageByIdentifier,
|
|
16
15
|
SELECT_GALLERY_TAGS,
|
|
17
16
|
URL_GALLERY,
|
|
@@ -301,15 +300,6 @@ describe('Reducers/ImageGallery/Actions', () => {
|
|
|
301
300
|
});
|
|
302
301
|
});
|
|
303
302
|
|
|
304
|
-
it('setSelectedImage creates the correct action', () => {
|
|
305
|
-
const correctAction = {
|
|
306
|
-
type: SET_SELECTED_IMAGE,
|
|
307
|
-
fileName: 'test_file_name.jpg',
|
|
308
|
-
};
|
|
309
|
-
const result = setSelectedImage('test_file_name.jpg');
|
|
310
|
-
expect(result).toEqual(correctAction);
|
|
311
|
-
});
|
|
312
|
-
|
|
313
303
|
it('setSelectedImageByIdentifier creates the correct action', () => {
|
|
314
304
|
const correctAction = {
|
|
315
305
|
type: SET_SELECTED_IMAGE,
|
|
@@ -301,20 +301,6 @@ describe('Reducers/ImageGallery/Reducer', () => {
|
|
|
301
301
|
expect(result).toEqual(expectedResult);
|
|
302
302
|
});
|
|
303
303
|
|
|
304
|
-
it('SET_SELECTED_IMAGE with fileName selects the correct image', () => {
|
|
305
|
-
const stateWithUserImages = {
|
|
306
|
-
...initialState,
|
|
307
|
-
userImages: [{ fileName: 'file_1.jpg' }, { fileName: 'file_2.jpg' }, { fileName: 'file_3.jpg' }],
|
|
308
|
-
};
|
|
309
|
-
const action = {
|
|
310
|
-
type: SET_SELECTED_IMAGE,
|
|
311
|
-
fileName: 'file_2.jpg',
|
|
312
|
-
};
|
|
313
|
-
expect(imageGalleryReducer(stateWithUserImages, action).selectedImage).toBe(
|
|
314
|
-
stateWithUserImages.userImages[1]
|
|
315
|
-
);
|
|
316
|
-
});
|
|
317
|
-
|
|
318
304
|
it('SET_SELECTED_IMAGE with identifier selects the correct image', () => {
|
|
319
305
|
const stateWithUserImages = {
|
|
320
306
|
...initialState,
|
|
@@ -172,6 +172,7 @@ export default class DesignerService {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
async uploadFile(file) {
|
|
175
|
+
await Services.store.dispatch(setSelectedImageByIdentifier(null));
|
|
175
176
|
const timeout = setTimeout(() => {
|
|
176
177
|
Services.store.dispatch(updateUploadDelayed(true));
|
|
177
178
|
}, 10000);
|