@crystaldesign/diva-backoffice 26.6.0-beta.8 → 26.6.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.
@@ -41861,6 +41861,110 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
41861
41861
  }()
41862
41862
  }];
41863
41863
  }, [setSelectedCatalog, apiConfig, showLoadingModal, showErrorModal, closeModal, t, root.dataStore.jwt]);
41864
+ var contextMenuItems = useMemo(function () {
41865
+ var cloneCatalogItem = function cloneCatalogItem(_ref5) {
41866
+ var selectedNodes = _ref5.selectedNodes;
41867
+ return {
41868
+ name: t('backoffice.idmCatalog.catalogs.contextMenu.cloneCatalog'),
41869
+ icon: '<span class="ag-icon ag-icon-copy"/>',
41870
+ disabled: !selectedNodes.length,
41871
+ action: function () {
41872
+ var _action3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(actionParams) {
41873
+ var _actionParams$selecte;
41874
+ var catalogDocId, jwt, alertTimeout, _current, _current$refresh, res, message, errBody, _message;
41875
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
41876
+ while (1) switch (_context3.prev = _context3.next) {
41877
+ case 0:
41878
+ catalogDocId = (_actionParams$selecte = actionParams.selectedNodes[0]) === null || _actionParams$selecte === void 0 || (_actionParams$selecte = _actionParams$selecte.data) === null || _actionParams$selecte === void 0 ? void 0 : _actionParams$selecte._id;
41879
+ jwt = root.dataStore.jwt;
41880
+ if (!(!catalogDocId || !jwt)) {
41881
+ _context3.next = 4;
41882
+ break;
41883
+ }
41884
+ return _context3.abrupt("return");
41885
+ case 4:
41886
+ alertTimeout = setTimeout(function () {
41887
+ showLoadingModal(t('backoffice.idmCatalog.catalogs.clone.modaltext'));
41888
+ }, 300);
41889
+ _context3.prev = 5;
41890
+ _context3.next = 8;
41891
+ return fetch("".concat(apiConfig.idmService, "/catalogs/").concat(catalogDocId, "/clone"), {
41892
+ method: 'POST',
41893
+ headers: {
41894
+ Authorization: "Bearer ".concat(jwt),
41895
+ 'Content-Type': 'application/json'
41896
+ },
41897
+ body: '{}'
41898
+ });
41899
+ case 8:
41900
+ res = _context3.sent;
41901
+ closeModal();
41902
+ if (res.ok) {
41903
+ _context3.next = 34;
41904
+ break;
41905
+ }
41906
+ message = "HTTP ".concat(res.status);
41907
+ _context3.prev = 12;
41908
+ _context3.next = 15;
41909
+ return res.json();
41910
+ case 15:
41911
+ errBody = _context3.sent;
41912
+ if (errBody && _typeof(errBody) === 'object' && 'message' in errBody) {
41913
+ message = String((_message = errBody.message) !== null && _message !== void 0 ? _message : message);
41914
+ }
41915
+ _context3.next = 32;
41916
+ break;
41917
+ case 19:
41918
+ _context3.prev = 19;
41919
+ _context3.t0 = _context3["catch"](12);
41920
+ _context3.prev = 21;
41921
+ _context3.next = 24;
41922
+ return res.text();
41923
+ case 24:
41924
+ _context3.t1 = _context3.sent;
41925
+ if (_context3.t1) {
41926
+ _context3.next = 27;
41927
+ break;
41928
+ }
41929
+ _context3.t1 = message;
41930
+ case 27:
41931
+ message = _context3.t1;
41932
+ _context3.next = 32;
41933
+ break;
41934
+ case 30:
41935
+ _context3.prev = 30;
41936
+ _context3.t2 = _context3["catch"](21);
41937
+ case 32:
41938
+ showErrorModal(message);
41939
+ return _context3.abrupt("return");
41940
+ case 34:
41941
+ ref === null || ref === void 0 || (_current = ref.current) === null || _current === void 0 || (_current$refresh = _current.refresh) === null || _current$refresh === void 0 || _current$refresh.call(_current);
41942
+ _context3.next = 41;
41943
+ break;
41944
+ case 37:
41945
+ _context3.prev = 37;
41946
+ _context3.t3 = _context3["catch"](5);
41947
+ closeModal();
41948
+ showErrorModal(_context3.t3 instanceof Error ? _context3.t3.message : String(_context3.t3));
41949
+ case 41:
41950
+ _context3.prev = 41;
41951
+ clearTimeout(alertTimeout);
41952
+ return _context3.finish(41);
41953
+ case 44:
41954
+ case "end":
41955
+ return _context3.stop();
41956
+ }
41957
+ }, _callee3, null, [[5, 37, 41, 44], [12, 19], [21, 30]]);
41958
+ }));
41959
+ function action(_x3) {
41960
+ return _action3.apply(this, arguments);
41961
+ }
41962
+ return action;
41963
+ }()
41964
+ };
41965
+ };
41966
+ return ['insertRow', 'duplicateRow', cloneCatalogItem, 'paste', 'copy', 'cut', 'cutRow', 'separator', 'delete', 'deleteRow'];
41967
+ }, [apiConfig.idmService, closeModal, ref, root.dataStore.jwt, showErrorModal, showLoadingModal, t]);
41864
41968
  var configuration = useMemo(function () {
41865
41969
  var apiInterface = {
41866
41970
  read: apiConfig.idmService + '/catalogs?organizationId=${organizationId}',
@@ -42054,9 +42158,9 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
42054
42158
  return ((_oldData = u.oldData) === null || _oldData === void 0 ? void 0 : _oldData.actual) !== ((_data = u.data) === null || _data === void 0 ? void 0 : _data.actual);
42055
42159
  });
42056
42160
  if (actualChanged) {
42057
- var _current, _current$refresh;
42161
+ var _current2, _current2$refresh;
42058
42162
  onActualChange();
42059
- ref === null || ref === void 0 || (_current = ref.current) === null || _current === void 0 || (_current$refresh = _current.refresh) === null || _current$refresh === void 0 || _current$refresh.call(_current);
42163
+ ref === null || ref === void 0 || (_current2 = ref.current) === null || _current2 === void 0 || (_current2$refresh = _current2.refresh) === null || _current2$refresh === void 0 || _current2$refresh.call(_current2);
42060
42164
  }
42061
42165
  };
42062
42166
  }
@@ -42087,6 +42191,7 @@ var IdmCatalogs = /*#__PURE__*/forwardRef(function IdmCatalogs(_ref, ref) {
42087
42191
  rowActions: rowActions,
42088
42192
  preFilter: preFilter,
42089
42193
  configuration: configuration,
42194
+ contextMenuItems: contextMenuItems,
42090
42195
  hooks: hooks
42091
42196
  }), contextHolder]
42092
42197
  });
@@ -1 +1 @@
1
- {"version":3,"file":"IdmCatalogs.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/Tables/IdmCatalogs.tsx"],"names":[],"mappings":"AAAA,OAAO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EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhI,QAAA,MAAM,WAAW;oBAGG,MAAM;eACX,SAAS;eACT,OAAO;yBACG,oBAAoB;+BACd,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI;IAC/D,mEAAmE;qBAClD,MAAM,IAAI;IAC3B,oFAAoF;qBACnE,MAAM;6CAmZzB,CAAC;AAEH,eAAe,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "26.6.0-beta.8",
3
+ "version": "26.6.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.6.0-beta.8",
19
- "@crystaldesign/content-item": "26.6.0-beta.8",
20
- "@crystaldesign/diva-core": "26.6.0-beta.8",
21
- "@crystaldesign/diva-utils": "26.6.0-beta.8",
22
- "@crystaldesign/media-upload": "26.6.0-beta.8",
23
- "@crystaldesign/rtf-editor": "26.6.0-beta.8",
24
- "@crystaldesign/spreadsheet": "26.6.0-beta.8",
18
+ "@crystaldesign/content-box": "26.6.0-beta.9",
19
+ "@crystaldesign/content-item": "26.6.0-beta.9",
20
+ "@crystaldesign/diva-core": "26.6.0-beta.9",
21
+ "@crystaldesign/diva-utils": "26.6.0-beta.9",
22
+ "@crystaldesign/media-upload": "26.6.0-beta.9",
23
+ "@crystaldesign/rtf-editor": "26.6.0-beta.9",
24
+ "@crystaldesign/spreadsheet": "26.6.0-beta.9",
25
25
  "@google/genai": "^1.22.0",
26
26
  "@google/model-viewer": "3.5.0",
27
27
  "ag-charts-community": "^10.1.0",
@@ -53,5 +53,5 @@
53
53
  },
54
54
  "module": "build/esm/index.js",
55
55
  "types": "./build/types/backoffice/src/index.d.ts",
56
- "gitHead": "8be50be9e24be3403f8db90efeecf0cfb9e86cbd"
56
+ "gitHead": "0ab8386d03704240ab430bf0121060c7d9234e12"
57
57
  }