@crystaldesign/diva-backoffice 25.9.0-beta.39 → 25.9.0-beta.40

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.
@@ -32748,7 +32748,7 @@ var TablePackages = observer(function () {
32748
32748
  }, 3000);
32749
32749
  _context.prev = 3;
32750
32750
  _context.next = 6;
32751
- return downloadFile(url, root.dataStore.jwt, 'application/xml', ((_selectedNodes$0$data10 = selectedNodes[0].data) === null || _selectedNodes$0$data10 === void 0 ? void 0 : _selectedNodes$0$data10.name) + '.xml');
32751
+ return downloadFile(url, root.dataStore.jwt, 'application/zip', ((_selectedNodes$0$data10 = selectedNodes[0].data) === null || _selectedNodes$0$data10 === void 0 ? void 0 : _selectedNodes$0$data10.name) + '.zip');
32752
32752
  case 6:
32753
32753
  closeModal();
32754
32754
  _context.next = 12;
@@ -32826,7 +32826,7 @@ var TablePackages = observer(function () {
32826
32826
  cellDataType: 'lookup',
32827
32827
  editable: function editable(_ref6) {
32828
32828
  var data = _ref6.data;
32829
- return isEditable(data) && !data.basedCatalogId && !data.basedPackageId;
32829
+ return isEditable(data) && !data.basedPackageId;
32830
32830
  },
32831
32831
  customParams: {
32832
32832
  filterCellType: 'objectId',
@@ -32845,16 +32845,22 @@ var TablePackages = observer(function () {
32845
32845
  }, {
32846
32846
  lookupField: 'isApi',
32847
32847
  targetField: 'isApi'
32848
- }]
32848
+ }],
32849
+ filter: {
32850
+ filterType: 'text',
32851
+ type: 'equals',
32852
+ filter: '${idmCatalogId}',
32853
+ colId: 'catalogId'
32854
+ }
32849
32855
  },
32850
- additionalFields: ['basedCatalogName']
32856
+ additionalFields: ['basedCatalogName', 'idmCatalogId']
32851
32857
  }, {
32852
32858
  headerName: 'backoffice.idmEnricher.packages.label.packageId',
32853
32859
  field: 'basedPackageId',
32854
32860
  cellDataType: 'lookup',
32855
32861
  editable: function editable(_ref7) {
32856
32862
  var data = _ref7.data;
32857
- return isEditable(data) && !data.basedCatalogId && !data.basedPackageId;
32863
+ return isEditable(data) && !data.basedCatalogId;
32858
32864
  },
32859
32865
  customParams: {
32860
32866
  filterCellType: 'objectId',
@@ -32867,18 +32873,21 @@ var TablePackages = observer(function () {
32867
32873
  lookupLabelTemplate: function lookupLabelTemplate(data) {
32868
32874
  return data.name + (data.isApi ? ' (CE)' : '');
32869
32875
  },
32870
- filter: function filter(rowData, lookupData) {
32871
- return rowData._id !== lookupData._id;
32872
- },
32873
32876
  additionalMappings: [{
32874
32877
  lookupField: 'isoLanguageIds',
32875
32878
  targetField: 'isoLanguageIds'
32876
32879
  }, {
32877
32880
  lookupField: 'isApi',
32878
32881
  targetField: 'isApi'
32879
- }]
32882
+ }],
32883
+ filter: {
32884
+ filterType: 'text',
32885
+ type: 'equals',
32886
+ filter: '${idmCatalogId}',
32887
+ colId: 'idmCatalogId'
32888
+ }
32880
32889
  },
32881
- additionalFields: ['basedPackageName']
32890
+ additionalFields: ['basedPackageName', 'idmCatalogId']
32882
32891
  }, {
32883
32892
  field: 'isoLanguageIds',
32884
32893
  headerName: 'backoffice.idmCatalog.general.label.isoLanguageIds',
@@ -36491,6 +36500,7 @@ function useUploadState(idmService, organizationId) {
36491
36500
  var root = useStore();
36492
36501
  var _useState = useState({
36493
36502
  name: '',
36503
+ useOriginalMedia: false,
36494
36504
  error: undefined,
36495
36505
  fileList: [],
36496
36506
  uploadProgress: 0,
@@ -36508,6 +36518,7 @@ function useUploadState(idmService, organizationId) {
36508
36518
  var resetState = useCallback(function () {
36509
36519
  setState({
36510
36520
  name: '',
36521
+ useOriginalMedia: false,
36511
36522
  error: undefined,
36512
36523
  fileList: [],
36513
36524
  uploadProgress: 0,
@@ -36613,6 +36624,9 @@ function useUploadState(idmService, organizationId) {
36613
36624
  formData.append('file', state.fileToUpload);
36614
36625
  _context2.prev = 6;
36615
36626
  uploadAction = "".concat(idmService, "/v3.0/catalogs/upload?organizationId=").concat(organizationId, "&name=").concat(encodeURIComponent(state.name));
36627
+ if (state.useOriginalMedia) {
36628
+ uploadAction += '&keepOriginalMedia=true';
36629
+ }
36616
36630
  startTime = Date.now();
36617
36631
  fileSize = state.fileToUpload.size; // Estimate upload time based on file size (assuming ~1MB per second)
36618
36632
  estimatedUploadTimeMs = fileSize / (1024 * 1024) * 1000;
@@ -36624,7 +36638,7 @@ function useUploadState(idmService, organizationId) {
36624
36638
  });
36625
36639
  };
36626
36640
  progressInterval = setInterval(updateProgressBasedOnTime, 100);
36627
- _context2.next = 15;
36641
+ _context2.next = 16;
36628
36642
  return fetch(uploadAction, {
36629
36643
  method: 'POST',
36630
36644
  headers: {
@@ -36632,7 +36646,7 @@ function useUploadState(idmService, organizationId) {
36632
36646
  },
36633
36647
  body: formData
36634
36648
  });
36635
- case 15:
36649
+ case 16:
36636
36650
  response = _context2.sent;
36637
36651
  clearInterval(progressInterval);
36638
36652
  updateState({
@@ -36640,13 +36654,13 @@ function useUploadState(idmService, organizationId) {
36640
36654
  });
36641
36655
 
36642
36656
  // Add delay to show 100% progress before updating state
36643
- _context2.next = 20;
36657
+ _context2.next = 21;
36644
36658
  return new Promise(function (resolve) {
36645
36659
  return setTimeout(resolve, 300);
36646
36660
  });
36647
- case 20:
36661
+ case 21:
36648
36662
  if (!response.ok) {
36649
- _context2.next = 24;
36663
+ _context2.next = 25;
36650
36664
  break;
36651
36665
  }
36652
36666
  updateState({
@@ -36657,44 +36671,44 @@ function useUploadState(idmService, organizationId) {
36657
36671
  fileToUpload: null,
36658
36672
  name: ''
36659
36673
  });
36660
- _context2.next = 36;
36674
+ _context2.next = 37;
36661
36675
  break;
36662
- case 24:
36676
+ case 25:
36663
36677
  errorMessage = t('backoffice.idmEnricher.import.uploadfailed');
36664
- _context2.prev = 25;
36665
- _context2.next = 28;
36678
+ _context2.prev = 26;
36679
+ _context2.next = 29;
36666
36680
  return response.json();
36667
- case 28:
36681
+ case 29:
36668
36682
  errorResponse = _context2.sent;
36669
36683
  errorMessage = errorResponse.error || errorResponse.message || errorMessage;
36670
- _context2.next = 35;
36684
+ _context2.next = 36;
36671
36685
  break;
36672
- case 32:
36673
- _context2.prev = 32;
36674
- _context2.t0 = _context2["catch"](25);
36686
+ case 33:
36687
+ _context2.prev = 33;
36688
+ _context2.t0 = _context2["catch"](26);
36675
36689
  errorMessage = response.statusText || errorMessage;
36676
- case 35:
36690
+ case 36:
36677
36691
  updateState({
36678
36692
  uploadProgress: 100,
36679
36693
  isUploading: false,
36680
36694
  error: errorMessage
36681
36695
  });
36682
- case 36:
36683
- _context2.next = 41;
36696
+ case 37:
36697
+ _context2.next = 42;
36684
36698
  break;
36685
- case 38:
36686
- _context2.prev = 38;
36699
+ case 39:
36700
+ _context2.prev = 39;
36687
36701
  _context2.t1 = _context2["catch"](6);
36688
36702
  updateState({
36689
36703
  uploadProgress: 100,
36690
36704
  isUploading: false,
36691
36705
  error: _context2.t1 instanceof Error ? _context2.t1.message : t('backoffice.idmEnricher.import.uploadfailed')
36692
36706
  });
36693
- case 41:
36707
+ case 42:
36694
36708
  case "end":
36695
36709
  return _context2.stop();
36696
36710
  }
36697
- }, _callee2, null, [[6, 38], [25, 32]]);
36711
+ }, _callee2, null, [[6, 39], [26, 33]]);
36698
36712
  }));
36699
36713
  return function handleUpload() {
36700
36714
  return _ref2.apply(this, arguments);
@@ -36755,6 +36769,24 @@ function UploadForm(_ref) {
36755
36769
  placeholder: t('backoffice.idmEnricher.import.nameplaceholder'),
36756
36770
  disabled: state.isUploading
36757
36771
  })
36772
+ }), /*#__PURE__*/jsx(Form$1.Item, {
36773
+ label: t('backoffice.idmEnricher.import.originalmedia.name'),
36774
+ tooltip: /*#__PURE__*/jsxs("span", {
36775
+ children: [/*#__PURE__*/jsx("p", {
36776
+ children: t('backoffice.idmEnricher.import.originalmedia.info')
36777
+ }), /*#__PURE__*/jsx("p", {
36778
+ children: t('backoffice.idmEnricher.import.originalmedia.warning')
36779
+ })]
36780
+ }),
36781
+ children: /*#__PURE__*/jsx(Checkbox, {
36782
+ checked: state.useOriginalMedia,
36783
+ onChange: function onChange(e) {
36784
+ return updateState({
36785
+ useOriginalMedia: e.target.checked
36786
+ });
36787
+ },
36788
+ disabled: state.isUploading
36789
+ })
36758
36790
  }), /*#__PURE__*/jsx(Form$1.Item, {
36759
36791
  children: /*#__PURE__*/jsx("div", {
36760
36792
  className: uploadDraggerWrapper,
@@ -37125,7 +37157,7 @@ var TableCatalogs = observer(function () {
37125
37157
  }, 3000);
37126
37158
  _context.prev = 3;
37127
37159
  _context.next = 6;
37128
- return downloadFile(url, root.dataStore.jwt, 'application/xml', selectedNodes[0].data.name + '.xml');
37160
+ return downloadFile(url, root.dataStore.jwt, 'application/zip', selectedNodes[0].data.name + '.zip');
37129
37161
  case 6:
37130
37162
  closeModal();
37131
37163
  _context.next = 12;
@@ -37879,7 +37911,7 @@ var useSeriesSelector = function useSeriesSelector(modules) {
37879
37911
  selected = _useState2[0],
37880
37912
  setSelected = _useState2[1];
37881
37913
  var apiInterface = {
37882
- read: idmService + "/v3.0/catalogs/".concat(catalogId, "/series?fields=seriesName[").concat(i18n.language.toLocaleUpperCase(), "];_id")
37914
+ read: idmService + "/v3.0/catalogs/".concat(catalogId, "/series?fields=seriesName[").concat(i18n.language.toLocaleUpperCase(), "];_id;serieNo")
37883
37915
  };
37884
37916
  var selectMapping = {
37885
37917
  label: "${seriesName.".concat(i18n.language.toLocaleUpperCase(), "} (${serieNo})"),
@@ -1 +1 @@
1
- {"version":3,"file":"UploadForm.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/UploadModalButton/UploadForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACrD,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;CACvD;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,eAAe,qBAyDrF"}
1
+ {"version":3,"file":"UploadForm.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/UploadModalButton/UploadForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACrD,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;CACvD;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,eAAe,qBAwErF"}
@@ -2,6 +2,7 @@ import { UploadFile } from 'antd';
2
2
  import { RcFile } from 'antd/es/upload/interface';
3
3
  export interface UploadState {
4
4
  name: string;
5
+ useOriginalMedia: boolean;
5
6
  error: string | undefined;
6
7
  fileList: UploadFile<any>[];
7
8
  uploadProgress: number;
@@ -1 +1 @@
1
- {"version":3,"file":"useUploadState.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/UploadModalButton/useUploadState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIlD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;;2BAYrC,OAAO,CAAC,WAAW,CAAC;;uBAe9B,MAAM;;EA0GvC"}
1
+ {"version":3,"file":"useUploadState.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/UploadModalButton/useUploadState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIlD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;;2BAarC,OAAO,CAAC,WAAW,CAAC;;uBAgB9B,MAAM;;EA4GvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMEnricherEditor/modules/TablePackages/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AA6BpD,eAAO,MAAM,aAAa;;CAmVxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMEnricherEditor/modules/TablePackages/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AA6BpD,eAAO,MAAM,aAAa;;CA8VxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "25.9.0-beta.39",
3
+ "version": "25.9.0-beta.40",
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": "5.4.0",
17
17
  "@babel/runtime": "7.24.7",
18
- "@crystaldesign/content-box": "25.9.0-beta.39",
19
- "@crystaldesign/content-item": "25.9.0-beta.39",
20
- "@crystaldesign/diva-core": "25.9.0-beta.39",
21
- "@crystaldesign/diva-utils": "25.9.0-beta.39",
22
- "@crystaldesign/media-upload": "25.9.0-beta.39",
23
- "@crystaldesign/rtf-editor": "25.9.0-beta.39",
24
- "@crystaldesign/spreadsheet": "25.9.0-beta.39",
18
+ "@crystaldesign/content-box": "25.9.0-beta.40",
19
+ "@crystaldesign/content-item": "25.9.0-beta.40",
20
+ "@crystaldesign/diva-core": "25.9.0-beta.40",
21
+ "@crystaldesign/diva-utils": "25.9.0-beta.40",
22
+ "@crystaldesign/media-upload": "25.9.0-beta.40",
23
+ "@crystaldesign/rtf-editor": "25.9.0-beta.40",
24
+ "@crystaldesign/spreadsheet": "25.9.0-beta.40",
25
25
  "@google/model-viewer": "3.5.0",
26
26
  "ag-charts-community": "^10.1.0",
27
27
  "ag-charts-react": "^10.1.0",
@@ -51,5 +51,5 @@
51
51
  },
52
52
  "module": "build/esm/index.js",
53
53
  "types": "./build/types/backoffice/src/index.d.ts",
54
- "gitHead": "6f18b8feda7dcfea7969971b2364e304a9c9beb0"
54
+ "gitHead": "aaab08373082b3c6a37b0a3646f399b0925d387c"
55
55
  }