@crystaldesign/diva-backoffice 26.5.0-beta.33 → 26.5.0-beta.34

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.
@@ -34866,14 +34866,14 @@ function PublishCustomCell (_ref) {
34866
34866
  var unpublishedChanges = hasUnpublishedChanges(publishedData === null || publishedData === void 0 ? void 0 : publishedData.publishDate, data === null || data === void 0 ? void 0 : data.lastUpdatedDate);
34867
34867
  var disabled = isPublishing || !(data !== null && data !== void 0 && data.basedCatalogId) && !(data !== null && data !== void 0 && data.basedPackageId) || !(data !== null && data !== void 0 && data.name);
34868
34868
  var fetchOrganizationsWithAutomaticPublishing = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
34869
- var url, response, result, allowedOrgIds, currentOrg, currentOrgParentIds, filtered, allOrgIds;
34869
+ var url, response, result, allowedOrgIds, currentOrg, currentOrgParentIds, isOwner, filtered, allOrgIds;
34870
34870
  return _regeneratorRuntime.wrap(function _callee$(_context) {
34871
34871
  while (1) switch (_context.prev = _context.next) {
34872
34872
  case 0:
34873
34873
  setLoadingOrganizations(true);
34874
34874
  _context.prev = 1;
34875
34875
  // Request organizations with automaticPublishing field from their settings
34876
- url = apiConfig.authService + "/organizations/".concat(organizationId, "/related");
34876
+ url = apiConfig.authService + "/organizations/".concat(organizationId, "/related?limit=1000");
34877
34877
  _context.next = 5;
34878
34878
  return fetch(url, {
34879
34879
  headers: {
@@ -34898,7 +34898,8 @@ function PublishCustomCell (_ref) {
34898
34898
  currentOrg = (result.data || []).find(function (o) {
34899
34899
  return o._id === organizationId;
34900
34900
  });
34901
- currentOrgParentIds = (currentOrg === null || currentOrg === void 0 ? void 0 : currentOrg.parentOrganizations) || []; // Show organizations that are:
34901
+ currentOrgParentIds = (currentOrg === null || currentOrg === void 0 ? void 0 : currentOrg.parentOrganizations) || [];
34902
+ isOwner = data.organizationId === organizationId; // Show organizations that are:
34902
34903
  // 1. In package settings with AutomaticPublishing === true, OR
34903
34904
  // 2. Has access to the package AND have automaticPublishing === true in their own organization settings
34904
34905
  filtered = (result.data || []).filter(function (org) {
@@ -34907,18 +34908,22 @@ function PublishCustomCell (_ref) {
34907
34908
  if (org._id === organizationId) {
34908
34909
  return false;
34909
34910
  }
34910
- // EXCLUDE parents of the current organization
34911
- if (currentOrgParentIds.includes(org._id)) {
34912
- return false;
34913
- }
34914
- // EXCLUDE siblings and their children
34915
34911
  var orgParentIds = org.parentOrganizations || [];
34916
- var isChild = orgParentIds.includes(organizationId);
34917
- var isOfSiblingBranch = !isChild && currentOrgParentIds.some(function (parentId) {
34918
- return orgParentIds.includes(parentId);
34919
- });
34920
- if (isOfSiblingBranch) {
34921
- return false;
34912
+
34913
+ //if only shared with this organization, we only show the subtree of this organization for automatic publishing
34914
+ if (!isOwner) {
34915
+ // EXCLUDE parents of the current organization
34916
+ if (currentOrgParentIds.includes(org._id)) {
34917
+ return false;
34918
+ }
34919
+ // EXCLUDE siblings and their children
34920
+ var isChild = orgParentIds.includes(organizationId);
34921
+ var isOfSiblingBranch = !isChild && currentOrgParentIds.some(function (parentId) {
34922
+ return orgParentIds.includes(parentId);
34923
+ });
34924
+ if (isOfSiblingBranch) {
34925
+ return false;
34926
+ }
34922
34927
  }
34923
34928
  var hasAutomaticPublishingForPackage = ((_data$settings = data.settings) === null || _data$settings === void 0 || (_data$settings = _data$settings[org._id]) === null || _data$settings === void 0 ? void 0 : _data$settings.automaticPublishing) === true;
34924
34929
  var hasAccessToPackage = orgParentIds.includes(data.organizationId) || allowedOrgIds.includes(org._id) || allowedOrgIds.some(function (id) {
@@ -34935,21 +34940,21 @@ function PublishCustomCell (_ref) {
34935
34940
  });
34936
34941
  setSelectedOrganizationIds(allOrgIds);
34937
34942
  return _context.abrupt("return", filtered);
34938
- case 21:
34939
- _context.prev = 21;
34943
+ case 22:
34944
+ _context.prev = 22;
34940
34945
  _context.t0 = _context["catch"](1);
34941
34946
  modalState.showErrorModal("Error fetching organizations: ".concat(_context.t0 instanceof Error ? _context.t0.message : String(_context.t0)));
34942
34947
  setAvailableOrganizations([]);
34943
34948
  return _context.abrupt("return", []);
34944
- case 26:
34945
- _context.prev = 26;
34949
+ case 27:
34950
+ _context.prev = 27;
34946
34951
  setLoadingOrganizations(false);
34947
- return _context.finish(26);
34948
- case 29:
34952
+ return _context.finish(27);
34953
+ case 30:
34949
34954
  case "end":
34950
34955
  return _context.stop();
34951
34956
  }
34952
- }, _callee, null, [[1, 21, 26, 29]]);
34957
+ }, _callee, null, [[1, 22, 27, 30]]);
34953
34958
  })), [apiConfig.authService, organizationId, root.dataStore.jwt, modalState, data.allowedOrganizationIds, data.settings]);
34954
34959
  var performPublish = React.useCallback(/*#__PURE__*/function () {
34955
34960
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(publish) {
@@ -1 +1 @@
1
- {"version":3,"file":"PublishCustomCell.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMEnricherEditor/modules/TablePackages/PublishCustomCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAOzE,OAAO,EAAE,SAAS,EAAkB,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAK9E,MAAM,CAAC,OAAO,WAAW,EACvB,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,cAAc,GACf,EAAE,2BAA2B,CAAC,GAAG,EAAE,GAAG,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,iBAAiB,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC,0BAsOxH"}
1
+ {"version":3,"file":"PublishCustomCell.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMEnricherEditor/modules/TablePackages/PublishCustomCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAOzE,OAAO,EAAE,SAAS,EAAkB,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAK9E,MAAM,CAAC,OAAO,WAAW,EACvB,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,EACH,UAAU,EACV,cAAc,GACf,EAAE,2BAA2B,CAAC,GAAG,EAAE,GAAG,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,iBAAiB,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC,0BA4OxH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "26.5.0-beta.33",
3
+ "version": "26.5.0-beta.34",
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.5.0-beta.33",
19
- "@crystaldesign/content-item": "26.5.0-beta.33",
20
- "@crystaldesign/diva-core": "26.5.0-beta.33",
21
- "@crystaldesign/diva-utils": "26.5.0-beta.33",
22
- "@crystaldesign/media-upload": "26.5.0-beta.33",
23
- "@crystaldesign/rtf-editor": "26.5.0-beta.33",
24
- "@crystaldesign/spreadsheet": "26.5.0-beta.33",
18
+ "@crystaldesign/content-box": "26.5.0-beta.34",
19
+ "@crystaldesign/content-item": "26.5.0-beta.34",
20
+ "@crystaldesign/diva-core": "26.5.0-beta.34",
21
+ "@crystaldesign/diva-utils": "26.5.0-beta.34",
22
+ "@crystaldesign/media-upload": "26.5.0-beta.34",
23
+ "@crystaldesign/rtf-editor": "26.5.0-beta.34",
24
+ "@crystaldesign/spreadsheet": "26.5.0-beta.34",
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": "91e6993700c6c2fdcfb67924c4850a1758d25f4b"
56
+ "gitHead": "fb3cc935f495ef006c65e2bb19840ae7ea7a0a3a"
57
57
  }