@crystaldesign/diva-backoffice 26.10.0-beta.8 → 26.10.0-beta.9

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.
@@ -41896,6 +41896,7 @@ styleInject(css_248z$t);
41896
41896
  * @param props.acceptedFileTypes - Comma-separated list of accepted file types
41897
41897
  * @param props.queryParams - Query parameters for the upload request
41898
41898
  * @param props.endpoint - Endpoint URL for the upload request
41899
+ * @param props.catalogId - Catalog ID; when set, a jobId in the upload response is treated as an async import job and polled for its result
41899
41900
  * @param props.onUploadComplete - Callback when upload completes
41900
41901
  * @param props.formRef - Reference to the form component
41901
41902
  * @param props.onClose - Callback to close the modal
@@ -41916,6 +41917,7 @@ function useUploadModal(_ref) {
41916
41917
  acceptedFileTypes = _ref.acceptedFileTypes,
41917
41918
  queryParams = _ref.queryParams,
41918
41919
  endpoint = _ref.endpoint,
41920
+ catalogId = _ref.catalogId,
41919
41921
  onUploadComplete = _ref.onUploadComplete,
41920
41922
  formRef = _ref.formRef,
41921
41923
  onClose = _ref.onClose,
@@ -41957,22 +41959,126 @@ function useUploadModal(_ref) {
41957
41959
  }])),
41958
41960
  _useState10 = _slicedToArray(_useState9, 1),
41959
41961
  fields = _useState10[0];
41962
+ var MAX_POLL_DURATION_MS = 5 * 60 * 1000;
41963
+ var POLL_INTERVAL_MS = 5000;
41964
+
41965
+ // Increments on every new upload, on modal close and on unmount - a running upload/poll only applies
41966
+ // state while its captured id is still current, so closing the modal cancels it.
41967
+ var opIdRef = useRef(0);
41968
+ useEffect(function () {
41969
+ return function () {
41970
+ opIdRef.current += 1;
41971
+ };
41972
+ }, []);
41973
+ var pollImportJob = /*#__PURE__*/function () {
41974
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(jobId, catalogsBaseUrl, isCurrent) {
41975
+ var pollStart, statusResponse, job, _result$errors$add, _result$errors$update, _result$errors$remove, _result$errors$restor, result, hasPartialErrors, _formRef$current;
41976
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
41977
+ while (1) switch (_context.prev = _context.next) {
41978
+ case 0:
41979
+ pollStart = Date.now();
41980
+ case 1:
41981
+ _context.next = 4;
41982
+ return new Promise(function (resolve) {
41983
+ return setTimeout(resolve, POLL_INTERVAL_MS);
41984
+ });
41985
+ case 4:
41986
+ if (isCurrent()) {
41987
+ _context.next = 6;
41988
+ break;
41989
+ }
41990
+ return _context.abrupt("return");
41991
+ case 6:
41992
+ if (!(Date.now() - pollStart > MAX_POLL_DURATION_MS)) {
41993
+ _context.next = 10;
41994
+ break;
41995
+ }
41996
+ setError(t('backoffice.idmEnricher.import.uploadfailed'));
41997
+ setProgress(0);
41998
+ return _context.abrupt("return");
41999
+ case 10:
42000
+ _context.next = 12;
42001
+ return fetch("".concat(catalogsBaseUrl, "/import-jobs/").concat(jobId), {
42002
+ headers: {
42003
+ Authorization: "Bearer ".concat(authToken)
42004
+ }
42005
+ });
42006
+ case 12:
42007
+ statusResponse = _context.sent;
42008
+ if (isCurrent()) {
42009
+ _context.next = 15;
42010
+ break;
42011
+ }
42012
+ return _context.abrupt("return");
42013
+ case 15:
42014
+ if (statusResponse.ok) {
42015
+ _context.next = 19;
42016
+ break;
42017
+ }
42018
+ setError(t('backoffice.idmEnricher.import.uploadfailed'));
42019
+ setProgress(0);
42020
+ return _context.abrupt("return");
42021
+ case 19:
42022
+ _context.next = 21;
42023
+ return statusResponse.json();
42024
+ case 21:
42025
+ job = _context.sent;
42026
+ if (!(job.status === 'Completed')) {
42027
+ _context.next = 27;
42028
+ break;
42029
+ }
42030
+ result = job.result || {};
42031
+ hasPartialErrors = result.errors && (((_result$errors$add = result.errors.add) === null || _result$errors$add === void 0 ? void 0 : _result$errors$add.length) || ((_result$errors$update = result.errors.update) === null || _result$errors$update === void 0 ? void 0 : _result$errors$update.length) || ((_result$errors$remove = result.errors.remove) === null || _result$errors$remove === void 0 ? void 0 : _result$errors$remove.length) || ((_result$errors$restor = result.errors.restore) === null || _result$errors$restor === void 0 ? void 0 : _result$errors$restor.length));
42032
+ if (hasPartialErrors) {
42033
+ setError(result.errors);
42034
+ } else {
42035
+ onUploadComplete === null || onUploadComplete === void 0 || onUploadComplete(result);
42036
+ (_formRef$current = formRef.current) === null || _formRef$current === void 0 || _formRef$current.reset();
42037
+ setCurrentFile(undefined);
42038
+ }
42039
+ return _context.abrupt("return");
42040
+ case 27:
42041
+ if (!(job.status === 'Failed')) {
42042
+ _context.next = 31;
42043
+ break;
42044
+ }
42045
+ setError(job.errorMessage || t('backoffice.idmEnricher.import.uploadfailed'));
42046
+ setProgress(0);
42047
+ return _context.abrupt("return");
42048
+ case 31:
42049
+ _context.next = 1;
42050
+ break;
42051
+ case 33:
42052
+ case "end":
42053
+ return _context.stop();
42054
+ }
42055
+ }, _callee);
42056
+ }));
42057
+ return function pollImportJob(_x, _x2, _x3) {
42058
+ return _ref2.apply(this, arguments);
42059
+ };
42060
+ }();
41960
42061
  var onModalClose = function onModalClose() {
41961
- var _formRef$current;
42062
+ var _formRef$current2;
42063
+ opIdRef.current += 1;
41962
42064
  setLoading(false);
41963
42065
  setProgress(0);
41964
42066
  setError(undefined);
41965
42067
  setCurrentFile(undefined);
41966
- (_formRef$current = formRef.current) === null || _formRef$current === void 0 || _formRef$current.reset();
42068
+ (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.reset();
41967
42069
  onClose();
41968
42070
  };
41969
42071
  var onSave = /*#__PURE__*/function () {
41970
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(values) {
42072
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(values) {
41971
42073
  var _formData$get;
41972
- var formData, requestQueryParams, uploadUrl, startTime, fileSize, estimatedUploadTimeMs, progressInterval, updateProgressBasedOnTime, response, _responseData$errors$, _responseData$errors$2, _responseData$errors$3, _responseData$errors$4, responseData, hasPartialErrors, _formRef$current2, errorBody, errorMessage, errorResponse;
41973
- return _regeneratorRuntime.wrap(function _callee$(_context) {
41974
- while (1) switch (_context.prev = _context.next) {
42074
+ var opId, isCurrent, formData, requestQueryParams, uploadUrl, startTime, fileSize, estimatedUploadTimeMs, progressInterval, updateProgressBasedOnTime, response, responseData, catalogsBaseUrl, _responseData$errors$, _responseData$errors$2, _responseData$errors$3, _responseData$errors$4, hasPartialErrors, _formRef$current3, errorBody, errorMessage, errorResponse;
42075
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
42076
+ while (1) switch (_context2.prev = _context2.next) {
41975
42077
  case 0:
42078
+ opId = ++opIdRef.current;
42079
+ isCurrent = function isCurrent() {
42080
+ return opIdRef.current === opId;
42081
+ };
41976
42082
  setLoading(true);
41977
42083
  setError(undefined);
41978
42084
  setProgress(0);
@@ -41988,10 +42094,10 @@ function useUploadModal(_ref) {
41988
42094
  formData.append(field.name, values[field.name]);
41989
42095
  }
41990
42096
  });
41991
- Object.entries(queryParams || {}).forEach(function (_ref3) {
41992
- var _ref4 = _slicedToArray(_ref3, 2),
41993
- key = _ref4[0],
41994
- value = _ref4[1];
42097
+ Object.entries(queryParams || {}).forEach(function (_ref4) {
42098
+ var _ref5 = _slicedToArray(_ref4, 2),
42099
+ key = _ref5[0],
42100
+ value = _ref5[1];
41995
42101
  requestQueryParams.append(key, value);
41996
42102
  });
41997
42103
  uploadUrl = "".concat(endpoint, "?").concat(requestQueryParams.toString());
@@ -42004,8 +42110,8 @@ function useUploadModal(_ref) {
42004
42110
  setProgress(Math.round(progressPercent));
42005
42111
  };
42006
42112
  progressInterval = setInterval(updateProgressBasedOnTime, 100);
42007
- _context.prev = 13;
42008
- _context.next = 16;
42113
+ _context2.prev = 15;
42114
+ _context2.next = 18;
42009
42115
  return fetch(uploadUrl, {
42010
42116
  method: 'POST',
42011
42117
  headers: {
@@ -42013,45 +42119,69 @@ function useUploadModal(_ref) {
42013
42119
  },
42014
42120
  body: formData
42015
42121
  });
42016
- case 16:
42017
- response = _context.sent;
42122
+ case 18:
42123
+ response = _context2.sent;
42018
42124
  clearInterval(progressInterval);
42019
42125
  setProgress(100);
42020
42126
 
42021
42127
  // Add delay to show 100% progress before updating state
42022
- _context.next = 21;
42128
+ _context2.next = 23;
42023
42129
  return new Promise(function (resolve) {
42024
42130
  return setTimeout(resolve, 300);
42025
42131
  });
42026
- case 21:
42132
+ case 23:
42133
+ if (isCurrent()) {
42134
+ _context2.next = 25;
42135
+ break;
42136
+ }
42137
+ return _context2.abrupt("return");
42138
+ case 25:
42027
42139
  if (!response.ok) {
42028
- _context.next = 29;
42140
+ _context2.next = 41;
42029
42141
  break;
42030
42142
  }
42031
- _context.next = 24;
42143
+ _context2.next = 28;
42032
42144
  return response.json()["catch"](function () {
42033
42145
  return {};
42034
42146
  });
42035
- case 24:
42036
- responseData = _context.sent;
42147
+ case 28:
42148
+ responseData = _context2.sent;
42149
+ if (isCurrent()) {
42150
+ _context2.next = 31;
42151
+ break;
42152
+ }
42153
+ return _context2.abrupt("return");
42154
+ case 31:
42155
+ if (!(catalogId && responseData.jobId)) {
42156
+ _context2.next = 37;
42157
+ break;
42158
+ }
42159
+ catalogsBaseUrl = endpoint.slice(0, endpoint.indexOf("/catalogs/".concat(catalogId)) + "/catalogs/".concat(catalogId).length);
42160
+ _context2.next = 35;
42161
+ return pollImportJob(responseData.jobId, catalogsBaseUrl, isCurrent);
42162
+ case 35:
42163
+ _context2.next = 39;
42164
+ break;
42165
+ case 37:
42037
42166
  // Check for partial errors in successful responses
42038
42167
  hasPartialErrors = responseData.errors && (((_responseData$errors$ = responseData.errors.add) === null || _responseData$errors$ === void 0 ? void 0 : _responseData$errors$.length) || ((_responseData$errors$2 = responseData.errors.update) === null || _responseData$errors$2 === void 0 ? void 0 : _responseData$errors$2.length) || ((_responseData$errors$3 = responseData.errors.remove) === null || _responseData$errors$3 === void 0 ? void 0 : _responseData$errors$3.length) || ((_responseData$errors$4 = responseData.errors.restore) === null || _responseData$errors$4 === void 0 ? void 0 : _responseData$errors$4.length));
42039
42168
  if (hasPartialErrors) {
42040
42169
  setError(responseData.errors);
42041
42170
  } else {
42042
42171
  onUploadComplete === null || onUploadComplete === void 0 || onUploadComplete(responseData);
42043
- (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 || _formRef$current2.reset();
42172
+ (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 || _formRef$current3.reset();
42044
42173
  setCurrentFile(undefined);
42045
42174
  }
42046
- _context.next = 36;
42175
+ case 39:
42176
+ _context2.next = 48;
42047
42177
  break;
42048
- case 29:
42049
- _context.next = 31;
42178
+ case 41:
42179
+ _context2.next = 43;
42050
42180
  return response.text()["catch"](function () {
42051
42181
  return '';
42052
42182
  });
42053
- case 31:
42054
- errorBody = _context.sent;
42183
+ case 43:
42184
+ errorBody = _context2.sent;
42055
42185
  errorMessage = errorBody || response.statusText || t('backoffice.idmEnricher.import.uploadfailed');
42056
42186
  try {
42057
42187
  // The body is either a JSON object ({ error } / { message }) or a bare JSON string (e.g. XSD validation errors)
@@ -42062,26 +42192,31 @@ function useUploadModal(_ref) {
42062
42192
  }
42063
42193
  setError(errorMessage);
42064
42194
  setProgress(0);
42065
- case 36:
42066
- _context.next = 42;
42195
+ case 48:
42196
+ _context2.next = 53;
42067
42197
  break;
42068
- case 38:
42069
- _context.prev = 38;
42070
- _context.t0 = _context["catch"](13);
42071
- setError(_context.t0 instanceof Error ? _context.t0.message : t('backoffice.idmEnricher.import.uploadfailed'));
42072
- setProgress(0);
42073
- case 42:
42074
- _context.prev = 42;
42075
- setLoading(false);
42076
- return _context.finish(42);
42077
- case 45:
42198
+ case 50:
42199
+ _context2.prev = 50;
42200
+ _context2.t0 = _context2["catch"](15);
42201
+ if (isCurrent()) {
42202
+ setError(_context2.t0 instanceof Error ? _context2.t0.message : t('backoffice.idmEnricher.import.uploadfailed'));
42203
+ setProgress(0);
42204
+ }
42205
+ case 53:
42206
+ _context2.prev = 53;
42207
+ clearInterval(progressInterval);
42208
+ if (isCurrent()) {
42209
+ setLoading(false);
42210
+ }
42211
+ return _context2.finish(53);
42212
+ case 57:
42078
42213
  case "end":
42079
- return _context.stop();
42214
+ return _context2.stop();
42080
42215
  }
42081
- }, _callee, null, [[13, 38, 42, 45]]);
42216
+ }, _callee2, null, [[15, 50, 53, 57]]);
42082
42217
  }));
42083
- return function onSave(_x) {
42084
- return _ref2.apply(this, arguments);
42218
+ return function onSave(_x4) {
42219
+ return _ref3.apply(this, arguments);
42085
42220
  };
42086
42221
  }();
42087
42222
  return {
@@ -42243,6 +42378,7 @@ function UploadModal(_ref) {
42243
42378
  acceptedFileTypes = _ref.acceptedFileTypes,
42244
42379
  queryParams = _ref.queryParams,
42245
42380
  endpoint = _ref.endpoint,
42381
+ catalogId = _ref.catalogId,
42246
42382
  onUploadComplete = _ref.onUploadComplete,
42247
42383
  modalTitle = _ref.modalTitle,
42248
42384
  isOpen = _ref.isOpen,
@@ -42257,6 +42393,7 @@ function UploadModal(_ref) {
42257
42393
  acceptedFileTypes: acceptedFileTypes,
42258
42394
  queryParams: queryParams,
42259
42395
  endpoint: endpoint,
42396
+ catalogId: catalogId,
42260
42397
  onUploadComplete: onUploadComplete,
42261
42398
  formRef: formRef,
42262
42399
  onClose: onClose,
@@ -42280,6 +42417,7 @@ function UploadModal(_ref) {
42280
42417
  },
42281
42418
  closable: !loading,
42282
42419
  maskClosable: !loading,
42420
+ keyboard: !loading,
42283
42421
  destroyOnClose: true,
42284
42422
  width: 600,
42285
42423
  footer: null,
@@ -45223,6 +45361,7 @@ var TableItems = observer(function () {
45223
45361
  buttonText: t('backoffice.idmEnricher.importexcel.label'),
45224
45362
  modalTitle: t('backoffice.idmEnricher.importexcel.label'),
45225
45363
  endpoint: "".concat(apiConfig.idmService, "/catalogs/").concat(catalogId, "/series/").concat(selectedSerie === null || selectedSerie === void 0 ? void 0 : selectedSerie._id, "/items/bulk/excel"),
45364
+ catalogId: catalogId,
45226
45365
  authToken: jwt,
45227
45366
  acceptedFileTypes: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
45228
45367
  uploadHint: t('backoffice.idmEnricher.importexcel.uploadhint'),
@@ -46315,6 +46454,7 @@ var TableOptions$1 = observer(function () {
46315
46454
  buttonText: t('backoffice.idmEnricher.importexcel.label'),
46316
46455
  modalTitle: t('backoffice.idmEnricher.importexcel.label'),
46317
46456
  endpoint: "".concat(apiConfig.idmService, "/catalogs/").concat(catalogId, "/options/bulk/excel"),
46457
+ catalogId: catalogId,
46318
46458
  authToken: jwt,
46319
46459
  acceptedFileTypes: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
46320
46460
  uploadHint: t('backoffice.idmEnricher.importexcel.uploadhint'),
@@ -17,5 +17,5 @@ export * from './types';
17
17
  * @param props.uploadHint - Hint text for the upload area
18
18
  * @returns JSX element representing the upload modal
19
19
  */
20
- export default function UploadModal({ authToken, additionalFields, acceptedFileTypes, queryParams, endpoint, onUploadComplete, modalTitle, isOpen, onClose, uploadHint, }: UploadModalProps): React.JSX.Element;
20
+ export default function UploadModal({ authToken, additionalFields, acceptedFileTypes, queryParams, endpoint, catalogId, onUploadComplete, modalTitle, isOpen, onClose, uploadHint, }: UploadModalProps): React.JSX.Element;
21
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/UploadModal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAQtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C,cAAc,SAAS,CAAC;AAExB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,OAAO,EACP,UAAU,GACX,EAAE,gBAAgB,qBA6ClB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/UploadModal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAQtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C,cAAc,SAAS,CAAC;AAExB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,OAAO,EACP,UAAU,GACX,EAAE,gBAAgB,qBA+ClB"}
@@ -44,6 +44,8 @@ export interface BaseUploadModalProps {
44
44
  queryParams?: Record<string, string>;
45
45
  /** Endpoint URL for the upload request */
46
46
  endpoint: string;
47
+ /** Catalog ID; when set, a jobId in the upload response is treated as an async import job and polled for its result */
48
+ catalogId?: string;
47
49
  /** Callback function when upload is completed successfully */
48
50
  onUploadComplete?: (response: any) => void;
49
51
  /** Callback function to close the modal */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/UploadModal/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,aAAa,EAAE,CAAC;IACnC,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IAC3C,2CAA2C;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,sCAAsC;IACtC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;CACnC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/UploadModal/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,aAAa,EAAE,CAAC;IACnC,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,uHAAuH;IACvH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IAC3C,2CAA2C;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,sCAAsC;IACtC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;CACnC"}
@@ -10,6 +10,7 @@ import { UploadModalHookProps, UploadError } from './types';
10
10
  * @param props.acceptedFileTypes - Comma-separated list of accepted file types
11
11
  * @param props.queryParams - Query parameters for the upload request
12
12
  * @param props.endpoint - Endpoint URL for the upload request
13
+ * @param props.catalogId - Catalog ID; when set, a jobId in the upload response is treated as an async import job and polled for its result
13
14
  * @param props.onUploadComplete - Callback when upload completes
14
15
  * @param props.formRef - Reference to the form component
15
16
  * @param props.onClose - Callback to close the modal
@@ -24,7 +25,7 @@ import { UploadModalHookProps, UploadError } from './types';
24
25
  * @returns {RcFile|undefined} currentFile - Currently selected file
25
26
  * @returns {Function} onModalClose - Handler to close the modal and reset state
26
27
  */
27
- export default function useUploadModal({ authToken, additionalFields, acceptedFileTypes, queryParams, endpoint, onUploadComplete, formRef, onClose, uploadHint, autoZip, }: UploadModalHookProps): {
28
+ export default function useUploadModal({ authToken, additionalFields, acceptedFileTypes, queryParams, endpoint, catalogId, onUploadComplete, formRef, onClose, uploadHint, autoZip, }: UploadModalHookProps): {
28
29
  loading: boolean;
29
30
  progress: number;
30
31
  error: UploadError | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useUploadState.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/UploadModal/useUploadState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,UAAU,EACV,OAAO,GACR,EAAE,oBAAoB;;;;qBAmCS,GAAG;;;;EA6FlC"}
1
+ {"version":3,"file":"useUploadState.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/CommonComponents/UploadModal/useUploadState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,UAAU,EACV,OAAO,GACR,EAAE,oBAAoB;;;;qBAmGS,GAAG;;;;EA4GlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableItems/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAe/C,eAAO,MAAM,UAAU;;CAuFrB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableItems/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAe/C,eAAO,MAAM,UAAU;;CAwFrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableOptions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AActC,eAAO,MAAM,YAAY;;CAiEvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableOptions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AActC,eAAO,MAAM,YAAY;;CAkEvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "26.10.0-beta.8",
3
+ "version": "26.10.0-beta.9",
4
4
  "license": "COMMERCIAL",
5
5
  "devDependencies": {
6
6
  "@testing-library/jest-dom": "^6.5.0",
@@ -15,13 +15,13 @@
15
15
  "dependencies": {
16
16
  "@ant-design/icons": "6.1.0",
17
17
  "@babel/runtime": "7.24.7",
18
- "@crystaldesign/content-box": "26.10.0-beta.8",
19
- "@crystaldesign/content-item": "26.10.0-beta.8",
20
- "@crystaldesign/diva-core": "26.10.0-beta.8",
21
- "@crystaldesign/diva-utils": "26.10.0-beta.8",
22
- "@crystaldesign/media-upload": "26.10.0-beta.8",
23
- "@crystaldesign/rtf-editor": "26.10.0-beta.8",
24
- "@crystaldesign/spreadsheet": "26.10.0-beta.8",
18
+ "@crystaldesign/content-box": "26.10.0-beta.9",
19
+ "@crystaldesign/content-item": "26.10.0-beta.9",
20
+ "@crystaldesign/diva-core": "26.10.0-beta.9",
21
+ "@crystaldesign/diva-utils": "26.10.0-beta.9",
22
+ "@crystaldesign/media-upload": "26.10.0-beta.9",
23
+ "@crystaldesign/rtf-editor": "26.10.0-beta.9",
24
+ "@crystaldesign/spreadsheet": "26.10.0-beta.9",
25
25
  "@dnd-kit/core": "^6.1.0",
26
26
  "@dnd-kit/sortable": "^8.0.0",
27
27
  "@dnd-kit/utilities": "^3.2.2",
@@ -56,5 +56,5 @@
56
56
  },
57
57
  "module": "build/esm/index.js",
58
58
  "types": "./build/types/backoffice/src/index.d.ts",
59
- "gitHead": "42c00a0b1240200a22882b70c7aa405c24a8dfd2"
59
+ "gitHead": "0face1c3b7dcd1d47823411e5cbbf012504d3460"
60
60
  }