ordering-ui-admin-external 1.45.30 → 1.45.32

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.
@@ -61,6 +61,7 @@ var BatchImageFormUI = function BatchImageFormUI(props) {
61
61
  var validfiles = [];
62
62
  if (files && files.length > 0) {
63
63
  Object.values(files).forEach(function (f) {
64
+ var _ref;
64
65
  var type = f.type.split('/')[0];
65
66
  if (type !== 'image') {
66
67
  setAlertState({
@@ -70,10 +71,11 @@ var BatchImageFormUI = function BatchImageFormUI(props) {
70
71
  invalidfileNames.push(f === null || f === void 0 ? void 0 : f.name);
71
72
  return;
72
73
  }
73
- if ((0, _utils.bytesConverter)(f.size) > 2048) {
74
+ if ((_ref = (0, _utils.bytesConverter)(f.size) > (props === null || props === void 0 ? void 0 : props.maxLimitImage)) !== null && _ref !== void 0 ? _ref : 2048) {
75
+ var _props$maxLimitImage;
74
76
  setAlertState({
75
77
  open: true,
76
- content: [t('IMAGE_MAXIMUM_SIZE', 'The maximum image size is 2 megabytes')]
78
+ content: [t('IMAGE_MAXIMUM_SIZE_MESSAGE', 'The maximum image size is _amount_ megabytes').replace('_amount_', ((_props$maxLimitImage = props === null || props === void 0 ? void 0 : props.maxLimitImage) !== null && _props$maxLimitImage !== void 0 ? _props$maxLimitImage : 2048) / 1024)]
77
79
  });
78
80
  invalidfileNames.push(f === null || f === void 0 ? void 0 : f.name);
79
81
  return;
@@ -466,7 +466,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
466
466
  fees: fees,
467
467
  setFees: setFees,
468
468
  categoryState: categoryState,
469
- handleUpdateCategoryState: handleUpdateCategoryState
469
+ handleUpdateCategoryState: handleUpdateCategoryState,
470
+ maxLimitImage: props === null || props === void 0 ? void 0 : props.maxLimitImage
470
471
  }), openSidebar === 'business_details' && /*#__PURE__*/_react.default.createElement(_BusinessDetails.BusinessDetails, {
471
472
  open: openSidebar === 'business_details',
472
473
  businessId: (selectedBusiness === null || selectedBusiness === void 0 ? void 0 : selectedBusiness.id) || (businessState === null || businessState === void 0 || (_businessState$busine18 = businessState.business) === null || _businessState$busine18 === void 0 ? void 0 : _businessState$busine18.id),
@@ -180,7 +180,8 @@ var ProductDetailsUI = function ProductDetailsUI(props) {
180
180
  setTaxes: setTaxes,
181
181
  fees: fees,
182
182
  setFees: setFees,
183
- cleanFormState: cleanFormState
183
+ cleanFormState: cleanFormState,
184
+ maxLimitImage: props === null || props === void 0 ? void 0 : props.maxLimitImage
184
185
  }), showOption === 'service_details' && /*#__PURE__*/_react.default.createElement(_ServiceDetail.ServiceDetail, {
185
186
  product: productState === null || productState === void 0 ? void 0 : productState.product,
186
187
  formState: formState,
@@ -80,7 +80,7 @@ var ProductDetatilsInformation = exports.ProductDetatilsInformation = function P
80
80
  };
81
81
  var handleFiles = function handleFiles(files) {
82
82
  if (files.length === 1) {
83
- var _files$;
83
+ var _ref, _files$;
84
84
  var type = files[0].type.split('/')[0];
85
85
  if (type !== 'image') {
86
86
  setAlertState({
@@ -89,10 +89,11 @@ var ProductDetatilsInformation = exports.ProductDetatilsInformation = function P
89
89
  });
90
90
  return;
91
91
  }
92
- if ((0, _utils.bytesConverter)((_files$ = files[0]) === null || _files$ === void 0 ? void 0 : _files$.size) > 2048) {
92
+ if ((_ref = (0, _utils.bytesConverter)((_files$ = files[0]) === null || _files$ === void 0 ? void 0 : _files$.size) > (props === null || props === void 0 ? void 0 : props.maxLimitImage)) !== null && _ref !== void 0 ? _ref : 2048) {
93
+ var _props$maxLimitImage;
93
94
  setAlertState({
94
95
  open: true,
95
- content: [t('IMAGE_MAXIMUM_SIZE', 'The maximum image size is 2 megabytes')]
96
+ content: [t('IMAGE_MAXIMUM_SIZE_MESSAGE', 'The maximum image size is _amount_ megabytes').replace('_amount_', ((_props$maxLimitImage = props === null || props === void 0 ? void 0 : props.maxLimitImage) !== null && _props$maxLimitImage !== void 0 ? _props$maxLimitImage : 2048) / 1024)]
96
97
  });
97
98
  return;
98
99
  }
@@ -97,7 +97,8 @@ var ProductMainDetails = exports.ProductMainDetails = function ProductMainDetail
97
97
  handleChangeRibbon: handleChangeRibbon,
98
98
  handleChangeInput: handleChangeInput,
99
99
  handleChangeFormState: handleChangeFormState,
100
- handleButtonUpdateClick: handleUpdateClick
100
+ handleButtonUpdateClick: handleUpdateClick,
101
+ maxLimitImage: props === null || props === void 0 ? void 0 : props.maxLimitImage
101
102
  }), selectedOption === 'advanced' && /*#__PURE__*/_react.default.createElement(_ProductDetailsAdvanced.ProductDetailsAdvanced, {
102
103
  product: product,
103
104
  business: business,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-admin-external",
3
- "version": "1.45.30",
3
+ "version": "1.45.32",
4
4
  "description": "Ordering UI Admin Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -83,7 +83,7 @@
83
83
  "lodash": "^4.17.20",
84
84
  "moment": "^2.29.1",
85
85
  "moment-range": "^4.0.2",
86
- "ordering-components-admin-external": "1.43.76",
86
+ "ordering-components-admin-external": "1.43.77",
87
87
  "polished": "^3.6.7",
88
88
  "prop-types": "^15.7.2",
89
89
  "react-big-calendar": "^1.4.2",
@@ -67,10 +67,10 @@ const BatchImageFormUI = (props) => {
67
67
  invalidfileNames.push(f?.name)
68
68
  return
69
69
  }
70
- if (bytesConverter(f.size) > 2048) {
70
+ if (bytesConverter(f.size) > props?.maxLimitImage ?? 2048) {
71
71
  setAlertState({
72
72
  open: true,
73
- content: [t('IMAGE_MAXIMUM_SIZE', 'The maximum image size is 2 megabytes')]
73
+ content: [t('IMAGE_MAXIMUM_SIZE_MESSAGE', 'The maximum image size is _amount_ megabytes').replace('_amount_', (props?.maxLimitImage ?? 2048) / 1024)]
74
74
  })
75
75
  invalidfileNames.push(f?.name)
76
76
  return
@@ -513,6 +513,7 @@ const BusinessProductsListingUI = (props) => {
513
513
  setFees={setFees}
514
514
  categoryState={categoryState}
515
515
  handleUpdateCategoryState={handleUpdateCategoryState}
516
+ maxLimitImage={props?.maxLimitImage}
516
517
  />
517
518
  )}
518
519
  {openSidebar === 'business_details' && (
@@ -165,6 +165,7 @@ const ProductDetailsUI = (props) => {
165
165
  fees={fees}
166
166
  setFees={setFees}
167
167
  cleanFormState={cleanFormState}
168
+ maxLimitImage={props?.maxLimitImage}
168
169
  />
169
170
  )}
170
171
  {showOption === 'service_details' && (
@@ -66,10 +66,10 @@ export const ProductDetatilsInformation = (props) => {
66
66
  return
67
67
  }
68
68
 
69
- if (bytesConverter(files[0]?.size) > 2048) {
69
+ if (bytesConverter(files[0]?.size) > props?.maxLimitImage ?? 2048) {
70
70
  setAlertState({
71
71
  open: true,
72
- content: [t('IMAGE_MAXIMUM_SIZE', 'The maximum image size is 2 megabytes')]
72
+ content: [t('IMAGE_MAXIMUM_SIZE_MESSAGE', 'The maximum image size is _amount_ megabytes').replace('_amount_', (props?.maxLimitImage ?? 2048) / 1024)]
73
73
  })
74
74
  return
75
75
  }
@@ -88,6 +88,7 @@ export const ProductMainDetails = (props) => {
88
88
  handleChangeInput={handleChangeInput}
89
89
  handleChangeFormState={handleChangeFormState}
90
90
  handleButtonUpdateClick={handleUpdateClick}
91
+ maxLimitImage={props?.maxLimitImage}
91
92
  />
92
93
  )}
93
94
  {selectedOption === 'advanced' && (