@configuratorware/configurator-admingui 1.29.2 → 1.30.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.
@@ -120,7 +120,8 @@ var MaskEditorField = (0, _withStyles["default"])(styles)((0, _withFileUpload.wi
120
120
  uploadFile = _ref2.uploadFile,
121
121
  uploadStatus = _ref2.uploadStatus,
122
122
  resetUploadStatus = _ref2.resetUploadStatus,
123
- classes = _ref2.classes;
123
+ classes = _ref2.classes,
124
+ designAreaId = _ref2.designAreaId;
124
125
  var disabled = !ratio || !freeFormUrl;
125
126
  var initialValue = (0, _react.useMemo)(function () {
126
127
  return (0, _size["default"])(value) > 0 ? value : defaultValue;
@@ -203,9 +204,9 @@ var MaskEditorField = (0, _withStyles["default"])(styles)((0, _withFileUpload.wi
203
204
  return function (maskType) {
204
205
  var _maskTypes$none$maskT;
205
206
 
206
- return showDialog && (_maskTypes$none$maskT = {}, _defineProperty(_maskTypes$none$maskT, _maskTypes.maskTypes.none, false), _defineProperty(_maskTypes$none$maskT, _maskTypes.maskTypes.circle, _circle["default"]), _defineProperty(_maskTypes$none$maskT, _maskTypes.maskTypes.freeForm, dataUrl || "".concat(freeFormUrl, "?v=").concat(Math.random())), _maskTypes$none$maskT)[maskType];
207
+ return showDialog && (_maskTypes$none$maskT = {}, _defineProperty(_maskTypes$none$maskT, _maskTypes.maskTypes.none, false), _defineProperty(_maskTypes$none$maskT, _maskTypes.maskTypes.circle, _circle["default"]), _defineProperty(_maskTypes$none$maskT, _maskTypes.maskTypes.freeForm, initialValue.maskDataUrl || dataUrl || "".concat(freeFormUrl, "?v=").concat(Math.random())), _maskTypes$none$maskT)[maskType];
207
208
  };
208
- }, [freeFormUrl, dataUrl, showDialog]);
209
+ }, [freeFormUrl, dataUrl, showDialog, initialValue]);
209
210
  var getMaskDataRef = (0, _react.useRef)(function () {});
210
211
 
211
212
  var onOkClick = /*#__PURE__*/function () {
@@ -216,7 +217,7 @@ var MaskEditorField = (0, _withStyles["default"])(styles)((0, _withFileUpload.wi
216
217
  case 0:
217
218
  _context.prev = 0;
218
219
 
219
- if (!freeFormFile) {
220
+ if (!(freeFormFile && designAreaId)) {
220
221
  _context.next = 4;
221
222
  break;
222
223
  }
@@ -227,7 +228,9 @@ var MaskEditorField = (0, _withStyles["default"])(styles)((0, _withFileUpload.wi
227
228
  case 4:
228
229
  onChange(maskType === _maskTypes.maskTypes.none ? null : {
229
230
  maskType: maskType,
230
- maskData: getMaskDataRef.current()
231
+ maskData: getMaskDataRef.current(),
232
+ maskFile: freeFormFile ? freeFormFile : initialValue.maskFile,
233
+ maskDataUrl: dataUrl ? dataUrl : initialValue.maskDataUrl
231
234
  });
232
235
  toggleDialog(false);
233
236
  _context.next = 11;
@@ -59,7 +59,8 @@ var getDerivedMaskEditorPropsForDesignArea = function getDerivedMaskEditorPropsF
59
59
  return _objectSpread({
60
60
  ratio: isFinite(width) && isFinite(height) && width / height,
61
61
  uploadUrl: designAreaId && "design_areas/".concat(designAreaId, "/upload_mask"),
62
- freeFormUrl: (0, _getFreeFormUrl.getFreeFormUrl)(itemIdentifier, designAreaIdentifier)
62
+ freeFormUrl: (0, _getFreeFormUrl.getFreeFormUrl)(itemIdentifier, designAreaIdentifier),
63
+ designAreaId: designAreaId
63
64
  }, ownProps);
64
65
  };
65
66
 
@@ -738,79 +738,81 @@ var FormProductionMethods = /*#__PURE__*/function (_React$Component) {
738
738
  key: channel.identifier
739
739
  }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
740
740
  className: classes.TypographyFontWeight
741
- }, channel.identifier + '/' + channel.currency.symbol + '(' + channel.currency.iso + ')'), (calculationType.prices || []).filter(function (price) {
742
- return parseInt(price.channel) === channel.id;
743
- }).map(function (price, priceIndex) {
744
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
745
- key: priceIndex
746
- }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
747
- container: true
748
- }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
749
- item: true,
750
- xs: 3
751
- }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
752
- label: (0, _i18n.t)('colorAmountFrom'),
753
- onChange: function onChange(e) {
754
- _this3.onChangeCalculationTypesPrices(calculationType.identifier, 'colorAmountFrom', priceIndex, e.target.value);
755
- },
756
- value: price.colorAmountFrom || '',
757
- type: "number",
758
- InputProps: {
759
- classes: {
760
- inputType: classes.inputText
741
+ }, channel.identifier + '/' + channel.currency.symbol + '(' + channel.currency.iso + ')'), (calculationType.prices || []).map(function (price, priceIndex) {
742
+ if (parseInt(price.channel) === channel.id) {
743
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
744
+ key: priceIndex
745
+ }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
746
+ container: true
747
+ }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
748
+ item: true,
749
+ xs: 3
750
+ }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
751
+ label: (0, _i18n.t)('colorAmountFrom'),
752
+ onChange: function onChange(e) {
753
+ _this3.onChangeCalculationTypesPrices(calculationType.identifier, 'colorAmountFrom', priceIndex, e.target.value);
754
+ },
755
+ value: price.colorAmountFrom || '',
756
+ type: "number",
757
+ InputProps: {
758
+ classes: {
759
+ inputType: classes.inputText
760
+ }
761
761
  }
762
- }
763
- })), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
764
- item: true,
765
- xs: 3
766
- }, /*#__PURE__*/_react["default"].createElement(_LocalizedPriceTextField.LocalizedPriceTextField, {
767
- label: (0, _i18n.t)('Price'),
768
- onChange: function onChange(name, value) {
769
- _this3.onChangeCalculationTypesPrices(calculationType.identifier, 'price', priceIndex, value);
770
- },
771
- value: price.price,
772
- inputProps: {
773
- style: {
774
- height: '2em'
762
+ })), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
763
+ item: true,
764
+ xs: 3
765
+ }, /*#__PURE__*/_react["default"].createElement(_LocalizedPriceTextField.LocalizedPriceTextField, {
766
+ label: (0, _i18n.t)('Price'),
767
+ onChange: function onChange(name, value) {
768
+ _this3.onChangeCalculationTypesPrices(calculationType.identifier, 'price', priceIndex, value);
769
+ },
770
+ value: price.price,
771
+ inputProps: {
772
+ style: {
773
+ height: '2em'
774
+ }
775
775
  }
776
- }
777
- })), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
778
- item: true,
779
- xs: 3
780
- }, /*#__PURE__*/_react["default"].createElement(_LocalizedPriceTextField.LocalizedPriceTextField, {
781
- label: (0, _i18n.t)('PriceNet'),
782
- onChange: function onChange(name, value) {
783
- _this3.onChangeCalculationTypesPrices(calculationType.identifier, 'priceNet', priceIndex, value);
784
- },
785
- value: price.priceNet,
786
- inputProps: {
787
- style: {
788
- height: '2em'
776
+ })), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
777
+ item: true,
778
+ xs: 3
779
+ }, /*#__PURE__*/_react["default"].createElement(_LocalizedPriceTextField.LocalizedPriceTextField, {
780
+ label: (0, _i18n.t)('PriceNet'),
781
+ onChange: function onChange(name, value) {
782
+ _this3.onChangeCalculationTypesPrices(calculationType.identifier, 'priceNet', priceIndex, value);
783
+ },
784
+ value: price.priceNet,
785
+ inputProps: {
786
+ style: {
787
+ height: '2em'
788
+ }
789
789
  }
790
- }
791
- })), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
792
- item: true,
793
- xs: 3,
794
- className: classes.gridFormatting
795
- }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
796
- label: (0, _i18n.t)('AmountFrom'),
797
- onChange: function onChange(e) {
798
- _this3.onChangeCalculationTypesPrices(calculationType.identifier, 'amountFrom', priceIndex, e.target.value);
799
- },
800
- value: price.amountFrom || '',
801
- type: "number",
802
- InputProps: {
803
- classes: {
804
- inputType: classes.inputText
790
+ })), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
791
+ item: true,
792
+ xs: 3,
793
+ className: classes.gridFormatting
794
+ }, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
795
+ label: (0, _i18n.t)('AmountFrom'),
796
+ onChange: function onChange(e) {
797
+ _this3.onChangeCalculationTypesPrices(calculationType.identifier, 'amountFrom', priceIndex, e.target.value);
798
+ },
799
+ value: price.amountFrom || '',
800
+ type: "number",
801
+ InputProps: {
802
+ classes: {
803
+ inputType: classes.inputText
804
+ }
805
805
  }
806
- }
807
- }), /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
808
- label: (0, _i18n.t)('Remove'),
809
- onClick: function onClick() {
810
- return _this3.onRemovePrices(price, calculationType.identifier);
811
- },
812
- id: "remove"
813
- }, /*#__PURE__*/_react["default"].createElement(_DeleteIcon["default"], null)))), /*#__PURE__*/_react["default"].createElement("div", null, _this3.getPriceError(calculationIndex, priceIndex)));
806
+ }), /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
807
+ label: (0, _i18n.t)('Remove'),
808
+ onClick: function onClick() {
809
+ return _this3.onRemovePrices(price, calculationType.identifier);
810
+ },
811
+ id: "remove"
812
+ }, /*#__PURE__*/_react["default"].createElement(_DeleteIcon["default"], null)))), /*#__PURE__*/_react["default"].createElement("div", null, _this3.getPriceError(calculationIndex, priceIndex)));
813
+ }
814
+
815
+ ;
814
816
  }), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
815
817
  container: true
816
818
  }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
@@ -5,10 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = exports.setProductionMethodIsDefault = exports.setItem = exports.DESIGNAREA_SET_PRODUCTION_METHOD_ISDEFAULT = exports.SET_ITEM = exports.REDUCER_NAME = exports.DATA_KEY = exports.LIST_URL = exports.LIST_KEY = void 0;
7
7
 
8
+ var _Api = _interopRequireDefault(require("../../../../../App/Api"));
9
+
10
+ var _get = _interopRequireDefault(require("lodash/get"));
11
+
8
12
  var _Actions = require("../../../../../App/Reducers/Api/Actions");
9
13
 
10
14
  var _Actions2 = require("../../../../../App/Reducers/Entity/Actions");
11
15
 
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
+
12
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
13
19
 
14
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -92,7 +98,37 @@ var createEntity = function createEntity() {
92
98
  };
93
99
 
94
100
  var postData = function postData() {
95
- return DesignAreaActions.postData(true);
101
+ return function (dispatch, getState) {
102
+ var _getState4 = getState(),
103
+ designAreasData = _getState4.designAreasData; // to save uploaded images
104
+
105
+
106
+ return dispatch(DesignAreaActions.postData(true)).then(function (res) {
107
+ var files = designAreasData.data.designProductionMethods.value.map(function (dp) {
108
+ return (0, _get["default"])(dp, 'mask.maskFile', null);
109
+ }).filter(function (dp) {
110
+ return dp;
111
+ });
112
+ var designAreaFile = designAreasData.data.mask.value.maskFile;
113
+ designAreaFile && files.push(designAreaFile);
114
+ files.map(function (file) {
115
+ var data = new FormData();
116
+ data.append('mask', file);
117
+
118
+ try {
119
+ var result = _Api["default"].request({
120
+ method: 'POST',
121
+ url: "design_areas/".concat(res.data.id, "/upload_mask"),
122
+ data: data
123
+ });
124
+
125
+ return result;
126
+ } catch (e) {
127
+ throw e;
128
+ }
129
+ });
130
+ });
131
+ };
96
132
  };
97
133
 
98
134
  var mergedActions = _objectSpread(_objectSpread({}, DesignAreaActions), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configuratorware/configurator-admingui",
3
- "version": "1.29.2",
3
+ "version": "1.30.0",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "dependencies": {
@@ -29,7 +29,7 @@
29
29
  "react-redux-i18n": "^1.9.3",
30
30
  "react-router": "^3.2.6",
31
31
  "react-sortable-hoc": "^1.11.0",
32
- "redhotmagma-visualization": "1.29.2",
32
+ "redhotmagma-visualization": "1.30.0",
33
33
  "redux": "^4.1.0",
34
34
  "redux-logger": "^3.0.6",
35
35
  "redux-persist": "^5.10.0",
@@ -68,6 +68,7 @@ export const MaskEditorField = withStyles(styles)(
68
68
  uploadStatus,
69
69
  resetUploadStatus,
70
70
  classes,
71
+ designAreaId,
71
72
  }) => {
72
73
  const disabled = !ratio || !freeFormUrl;
73
74
 
@@ -133,16 +134,17 @@ export const MaskEditorField = withStyles(styles)(
133
134
  {
134
135
  [maskTypes.none]: false,
135
136
  [maskTypes.circle]: circleMask,
136
- [maskTypes.freeForm]: dataUrl || `${freeFormUrl}?v=${Math.random()}`,
137
+ [maskTypes.freeForm]:
138
+ initialValue.maskDataUrl || dataUrl || `${freeFormUrl}?v=${Math.random()}`,
137
139
  }[maskType],
138
- [freeFormUrl, dataUrl, showDialog]
140
+ [freeFormUrl, dataUrl, showDialog, initialValue]
139
141
  );
140
142
 
141
143
  const getMaskDataRef = useRef(() => {});
142
144
 
143
145
  const onOkClick = async () => {
144
146
  try {
145
- if (freeFormFile) {
147
+ if (freeFormFile && designAreaId) {
146
148
  await uploadFile('mask', freeFormFile);
147
149
  }
148
150
  onChange(
@@ -151,6 +153,8 @@ export const MaskEditorField = withStyles(styles)(
151
153
  : {
152
154
  maskType,
153
155
  maskData: getMaskDataRef.current(),
156
+ maskFile: freeFormFile ? freeFormFile : initialValue.maskFile,
157
+ maskDataUrl: dataUrl ? dataUrl : initialValue.maskDataUrl,
154
158
  }
155
159
  );
156
160
  toggleDialog(false);
@@ -31,6 +31,7 @@ const getDerivedMaskEditorPropsForDesignArea = (
31
31
  ratio: isFinite(width) && isFinite(height) && width / height,
32
32
  uploadUrl: designAreaId && `design_areas/${designAreaId}/upload_mask`,
33
33
  freeFormUrl: getFreeFormUrl(itemIdentifier, designAreaIdentifier),
34
+ designAreaId: designAreaId,
34
35
  ...ownProps,
35
36
  });
36
37
 
@@ -566,110 +566,114 @@ class FormProductionMethods extends React.Component {
566
566
  ')'}
567
567
  </Typography>
568
568
  {(calculationType.prices || [])
569
- .filter(price => parseInt(price.channel) === channel.id)
570
- .map((price, priceIndex) => (
571
- <React.Fragment key={priceIndex}>
572
- <Grid container>
573
- <Grid item xs={3}>
574
- <TextField
575
- label={t('colorAmountFrom')}
576
- onChange={e => {
577
- this.onChangeCalculationTypesPrices(
578
- calculationType.identifier,
579
- 'colorAmountFrom',
580
- priceIndex,
581
- e.target.value
582
- );
583
- }}
584
- value={price.colorAmountFrom || ''}
585
- type="number"
586
- InputProps={{
587
- classes: {
588
- inputType: classes.inputText,
589
- },
590
- }}
591
- />
592
- </Grid>
593
- <Grid item xs={3}>
594
- <LocalizedPriceTextField
595
- label={t('Price')}
596
- onChange={(name, value) => {
597
- this.onChangeCalculationTypesPrices(
598
- calculationType.identifier,
599
- 'price',
600
- priceIndex,
601
- value
602
- );
603
- }}
604
- value={price.price}
605
- inputProps={{
606
- style: {
607
- height: '2em',
608
- },
609
- }}
610
- />
611
- </Grid>
612
- <Grid item xs={3}>
613
- <LocalizedPriceTextField
614
- label={t('PriceNet')}
615
- onChange={(name, value) => {
616
- this.onChangeCalculationTypesPrices(
617
- calculationType.identifier,
618
- 'priceNet',
619
- priceIndex,
620
- value
621
- );
622
- }}
623
- value={price.priceNet}
624
- inputProps={{
625
- style: {
626
- height: '2em',
627
- },
628
- }}
629
- />
630
- </Grid>
631
- <Grid
632
- item
633
- xs={3}
634
- className={classes.gridFormatting}
635
- >
636
- <TextField
637
- label={t('AmountFrom')}
638
- onChange={e => {
639
- this.onChangeCalculationTypesPrices(
640
- calculationType.identifier,
641
- 'amountFrom',
642
- priceIndex,
643
- e.target.value
644
- );
645
- }}
646
- value={price.amountFrom || ''}
647
- type="number"
648
- InputProps={{
649
- classes: {
650
- inputType: classes.inputText,
651
- },
652
- }}
653
- />
654
- <IconButton
655
- label={t('Remove')}
656
- onClick={() =>
657
- this.onRemovePrices(
658
- price,
659
- calculationType.identifier
660
- )
661
- }
662
- id="remove"
663
- >
664
- <DeleteIcon />
665
- </IconButton>
666
- </Grid>
667
- </Grid>
668
- <div>
669
- {this.getPriceError(calculationIndex, priceIndex)}
670
- </div>
671
- </React.Fragment>
672
- ))}
569
+ .map((price, priceIndex) => {
570
+ if (parseInt(price.channel) === channel.id) {
571
+ return (
572
+ <React.Fragment key={priceIndex}>
573
+ <Grid container>
574
+ <Grid item xs={3}>
575
+ <TextField
576
+ label={t('colorAmountFrom')}
577
+ onChange={e => {
578
+ this.onChangeCalculationTypesPrices(
579
+ calculationType.identifier,
580
+ 'colorAmountFrom',
581
+ priceIndex,
582
+ e.target.value
583
+ );
584
+ }}
585
+ value={price.colorAmountFrom || ''}
586
+ type="number"
587
+ InputProps={{
588
+ classes: {
589
+ inputType: classes.inputText,
590
+ },
591
+ }}
592
+ />
593
+ </Grid>
594
+ <Grid item xs={3}>
595
+ <LocalizedPriceTextField
596
+ label={t('Price')}
597
+ onChange={(name, value) => {
598
+ this.onChangeCalculationTypesPrices(
599
+ calculationType.identifier,
600
+ 'price',
601
+ priceIndex,
602
+ value
603
+ );
604
+ }}
605
+ value={price.price}
606
+ inputProps={{
607
+ style: {
608
+ height: '2em',
609
+ },
610
+ }}
611
+ />
612
+ </Grid>
613
+ <Grid item xs={3}>
614
+ <LocalizedPriceTextField
615
+ label={t('PriceNet')}
616
+ onChange={(name, value) => {
617
+ this.onChangeCalculationTypesPrices(
618
+ calculationType.identifier,
619
+ 'priceNet',
620
+ priceIndex,
621
+ value
622
+ );
623
+ }}
624
+ value={price.priceNet}
625
+ inputProps={{
626
+ style: {
627
+ height: '2em',
628
+ },
629
+ }}
630
+ />
631
+ </Grid>
632
+ <Grid
633
+ item
634
+ xs={3}
635
+ className={classes.gridFormatting}
636
+ >
637
+ <TextField
638
+ label={t('AmountFrom')}
639
+ onChange={e => {
640
+ this.onChangeCalculationTypesPrices(
641
+ calculationType.identifier,
642
+ 'amountFrom',
643
+ priceIndex,
644
+ e.target.value
645
+ );
646
+ }}
647
+ value={price.amountFrom || ''}
648
+ type="number"
649
+ InputProps={{
650
+ classes: {
651
+ inputType: classes.inputText,
652
+ },
653
+ }}
654
+ />
655
+ <IconButton
656
+ label={t('Remove')}
657
+ onClick={() =>
658
+ this.onRemovePrices(
659
+ price,
660
+ calculationType.identifier
661
+ )
662
+ }
663
+ id="remove"
664
+ >
665
+ <DeleteIcon />
666
+ </IconButton>
667
+ </Grid>
668
+ </Grid>
669
+ <div>
670
+ {this.getPriceError(calculationIndex, priceIndex)}
671
+ </div>
672
+ </React.Fragment>
673
+ );
674
+ };
675
+ })
676
+ }
673
677
  <Grid container>
674
678
  <Grid item xs={12}>
675
679
  <div className="action-buttons">
@@ -5,6 +5,8 @@ export const REDUCER_NAME = 'designAreasData';
5
5
  export const SET_ITEM = 'DESIGNAREA_SET_ITEM';
6
6
  export const DESIGNAREA_SET_PRODUCTION_METHOD_ISDEFAULT = 'DESIGNAREA_SET_PRODUCTION_METHOD_ISDEFAULT';
7
7
 
8
+ import Api from '../../../../../App/Api';
9
+ import get from 'lodash/get';
8
10
  import { invalidateSource } from '../../../../../App/Reducers/Api/Actions';
9
11
 
10
12
  import { generateDefaultActions, releaseUnsavedEntity } from '../../../../../App/Reducers/Entity/Actions';
@@ -47,7 +49,31 @@ const createEntity = () => (dispatch, getState) => {
47
49
  return p;
48
50
  };
49
51
 
50
- const postData = () => DesignAreaActions.postData(true);
52
+ const postData = () => (dispatch, getState) => {
53
+ const { designAreasData } = getState();
54
+ // to save uploaded images
55
+ return dispatch(DesignAreaActions.postData(true)).then(res => {
56
+ const files = designAreasData.data.designProductionMethods.value
57
+ .map(dp => get(dp, 'mask.maskFile', null))
58
+ .filter(dp => dp);
59
+ const designAreaFile = designAreasData.data.mask.value.maskFile;
60
+ designAreaFile && files.push(designAreaFile);
61
+ files.map(file => {
62
+ const data = new FormData();
63
+ data.append('mask', file);
64
+ try {
65
+ const result = Api.request({
66
+ method: 'POST',
67
+ url: `design_areas/${res.data.id}/upload_mask`,
68
+ data,
69
+ });
70
+ return result;
71
+ } catch (e) {
72
+ throw e;
73
+ }
74
+ });
75
+ });
76
+ };
51
77
 
52
78
  const mergedActions = {
53
79
  ...DesignAreaActions,