@crystaldesign/diva-backoffice 26.13.0-rc.4 → 26.13.0-rc.6

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.
@@ -35696,6 +35696,33 @@ function getNewChildData(parent) {
35696
35696
  };
35697
35697
  }
35698
35698
 
35699
+ /**
35700
+ * The type the children of `org` get as parentType: retailer channels and campaigns belong to a retailer, dealers to a supplier,
35701
+ * a shell organization passes on the type of its ancestors.
35702
+ */
35703
+ function getChildParentType(org, inheritedParentType) {
35704
+ var _org$type;
35705
+ if (org.type === 'RETAILERCHILD') return 'RETAILER';
35706
+ if (org.type === 'DEALER') return 'SUPPLIER';
35707
+ return (_org$type = org.type) !== null && _org$type !== void 0 ? _org$type : inheritedParentType;
35708
+ }
35709
+
35710
+ /**
35711
+ * Whether an organization of `type` may be created below `parent`, the same type rules diva-auth applies when it creates one.
35712
+ *
35713
+ * @param type the stored type of the new organization, undefined for a shell, retailer channel or dealer
35714
+ * @param parent the organization the new one is added to
35715
+ * @param parentType the type the children of `parent` get, see {@link getChildParentType}
35716
+ */
35717
+ function canHaveChildOfType(type, parent, parentType) {
35718
+ var _parent$settings;
35719
+ if (!type) return true;
35720
+ if (type === 'CAMPAIGN') return parentType === 'RETAILER' && !!((_parent$settings = parent.settings) !== null && _parent$settings !== void 0 && _parent$settings.isCampaign);
35721
+ if (parentType === 'RETAILER' || parentType === 'SUPPLIER') return false;
35722
+ if (parentType === 'ASSOCIATION' && type === 'SUPPLIER') return false;
35723
+ return true;
35724
+ }
35725
+
35699
35726
  function ownKeys$1R(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
35700
35727
  function _objectSpread$1R(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1R(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1R(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
35701
35728
  var SOURCE_MAPPING = {
@@ -35713,18 +35740,23 @@ var NOT_COPIED_FIELDS = ['_id', 'parent', 'parentOrganizations', 'childOrganizat
35713
35740
 
35714
35741
  // bind the organization 1:1 to an external Meta or LeadTable campaign, the copy needs its own
35715
35742
  var NOT_COPIED_CAMPAIGN_FIELDS = ['metaAdSetId', 'metaCampaignId', 'leadTableCampaignId', 'leadTableCustomerId', 'leadTableUrl'];
35716
- function getWritableOrgs(org) {
35743
+ function getOrgs(org, inheritedParentType) {
35717
35744
  var _org$children;
35718
- var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
35719
- if (org.writePermission) result.push(org);
35745
+ var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
35746
+ var childParentType = getChildParentType(org, inheritedParentType);
35747
+ result.push({
35748
+ org: org,
35749
+ childParentType: childParentType
35750
+ });
35720
35751
  (_org$children = org.children) === null || _org$children === void 0 || _org$children.forEach(function (child) {
35721
- return getWritableOrgs(child, result);
35752
+ return getOrgs(child, childParentType, result);
35722
35753
  });
35723
35754
  return result;
35724
35755
  }
35725
35756
 
35726
35757
  /**
35727
35758
  * Button that asks for the parent of the copy and then opens the create form prefilled with the values of the source.
35759
+ * Only parents the type of the source may be created below can be chosen.
35728
35760
  */
35729
35761
  var DuplicateOrganization = function DuplicateOrganization(_ref) {
35730
35762
  var action = _ref.action,
@@ -35743,114 +35775,142 @@ var DuplicateOrganization = function DuplicateOrganization(_ref) {
35743
35775
  _useState4 = _slicedToArray(_useState3, 2),
35744
35776
  loading = _useState4[0],
35745
35777
  setLoading = _useState4[1];
35746
- var _useState5 = useState(true),
35778
+ var _useState5 = useState(),
35747
35779
  _useState6 = _slicedToArray(_useState5, 2),
35748
- sameLevel = _useState6[0],
35749
- setSameLevel = _useState6[1];
35750
- var _useState7 = useState(),
35780
+ sourceData = _useState6[0],
35781
+ setSourceData = _useState6[1];
35782
+ var _useState7 = useState(true),
35751
35783
  _useState8 = _slicedToArray(_useState7, 2),
35752
- otherParentId = _useState8[0],
35753
- setOtherParentId = _useState8[1];
35754
- var writableOrgs = useMemo(function () {
35755
- return getWritableOrgs(tree);
35756
- }, [tree]);
35757
- var target = sameLevel ? parent : writableOrgs.find(function (org) {
35784
+ sameLevel = _useState8[0],
35785
+ setSameLevel = _useState8[1];
35786
+ var _useState9 = useState(),
35787
+ _useState10 = _slicedToArray(_useState9, 2),
35788
+ otherParentId = _useState10[0],
35789
+ setOtherParentId = _useState10[1];
35790
+ var openingRef = useRef(0);
35791
+ var allowedParents = useMemo(function () {
35792
+ return sourceData ? getOrgs(tree).filter(function (_ref2) {
35793
+ var org = _ref2.org,
35794
+ childParentType = _ref2.childParentType;
35795
+ return canHaveChildOfType(sourceData.type, org, childParentType);
35796
+ }).map(function (_ref3) {
35797
+ var org = _ref3.org;
35798
+ return org;
35799
+ }) : [];
35800
+ }, [tree, sourceData]);
35801
+ var sameLevelAllowed = !!parent.writePermission && allowedParents.some(function (org) {
35802
+ return org.id === parent.id;
35803
+ });
35804
+ var writableParents = allowedParents.filter(function (org) {
35805
+ return org.writePermission;
35806
+ });
35807
+ var target = sameLevel ? sameLevelAllowed ? parent : undefined : writableParents.find(function (org) {
35758
35808
  return org.id === otherParentId;
35759
35809
  });
35760
- var openDialog = function openDialog() {
35761
- setSameLevel(!!parent.writePermission);
35762
- setOtherParentId(undefined);
35763
- setOpen(true);
35764
- };
35765
- var openForm = /*#__PURE__*/function () {
35766
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
35767
- var _sourceData$settings;
35768
- var apiInterface, createUrl, sourceData, _sourceData, values, campaignSettings;
35810
+ var openDialog = /*#__PURE__*/function () {
35811
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
35812
+ var opening, data;
35769
35813
  return _regeneratorRuntime.wrap(function _callee$(_context) {
35770
35814
  while (1) switch (_context.prev = _context.next) {
35771
35815
  case 0:
35772
- if (target) {
35773
- _context.next = 2;
35774
- break;
35775
- }
35776
- return _context.abrupt("return");
35777
- case 2:
35778
- apiInterface = action.apiInterface;
35779
- createUrl = _typeof(apiInterface) == 'object' && typeof apiInterface.create == 'string' ? apiInterface.create : undefined;
35816
+ // a read of an earlier opening may settle after this one, only the latest opening may change the dialog
35817
+ opening = ++openingRef.current;
35818
+ setSourceData(undefined);
35819
+ setOtherParentId(undefined);
35820
+ setOpen(true);
35780
35821
  setLoading(true);
35781
35822
  _context.prev = 5;
35782
35823
  _context.next = 8;
35783
35824
  return new _default$c({
35784
- apiInterface: apiInterface,
35825
+ apiInterface: action.apiInterface,
35785
35826
  type: 'Button'
35786
35827
  }, root).read(SOURCE_MAPPING, {
35787
35828
  id: source.id
35788
35829
  });
35789
35830
  case 8:
35790
- sourceData = _context.sent;
35791
- if ((_sourceData = sourceData) !== null && _sourceData !== void 0 && _sourceData._id) {
35831
+ data = _context.sent;
35832
+ if (data !== null && data !== void 0 && data._id) {
35792
35833
  _context.next = 11;
35793
35834
  break;
35794
35835
  }
35795
35836
  throw new Error("Organization ".concat(source.id, " could not be loaded"));
35796
35837
  case 11:
35797
- _context.next = 17;
35798
- break;
35799
- case 13:
35800
- _context.prev = 13;
35801
- _context.t0 = _context["catch"](5);
35802
- root.addError(t('backoffice.orgtree.duplicateAction.loadError', 'Die Organisation konnte nicht geladen werden.'));
35838
+ if (!(opening !== openingRef.current)) {
35839
+ _context.next = 13;
35840
+ break;
35841
+ }
35803
35842
  return _context.abrupt("return");
35843
+ case 13:
35844
+ setSourceData(data);
35845
+ setSameLevel(!!parent.writePermission);
35846
+ _context.next = 23;
35847
+ break;
35804
35848
  case 17:
35805
35849
  _context.prev = 17;
35806
- setLoading(false);
35807
- return _context.finish(17);
35808
- case 20:
35809
- setOpen(false);
35810
- values = Object.fromEntries(Object.entries(sourceData).filter(function (_ref3) {
35811
- var _ref4 = _slicedToArray(_ref3, 1),
35812
- key = _ref4[0];
35813
- return !NOT_COPIED_FIELDS.includes(key);
35814
- }));
35815
- campaignSettings = (_sourceData$settings = sourceData.settings) === null || _sourceData$settings === void 0 ? void 0 : _sourceData$settings.campaignSettings;
35816
- if (campaignSettings) {
35817
- values.settings = _objectSpread$1R(_objectSpread$1R({}, sourceData.settings), {}, {
35818
- campaignSettings: Object.fromEntries(Object.entries(campaignSettings).filter(function (_ref5) {
35819
- var _ref6 = _slicedToArray(_ref5, 1),
35820
- key = _ref6[0];
35821
- return !NOT_COPIED_CAMPAIGN_FIELDS.includes(key);
35822
- }))
35823
- });
35850
+ _context.t0 = _context["catch"](5);
35851
+ if (!(opening !== openingRef.current)) {
35852
+ _context.next = 21;
35853
+ break;
35824
35854
  }
35825
- root.detailStore.openRightDetail({
35826
- configurationId: action.id,
35827
- type: action.type,
35828
- title: typeof action.title == 'function' ? action.title(source) : action.title,
35829
- // the form fills ${parentId} from the mapping data
35830
- apiInterface: {
35831
- create: createUrl === null || createUrl === void 0 ? void 0 : createUrl.replace('${organizationId}', encodeURIComponent(source.id))
35832
- },
35833
- mappingData: {
35834
- id: target.id
35835
- },
35836
- data: _objectSpread$1R(_objectSpread$1R({}, values), {}, {
35837
- displayName: t('backoffice.orgtree.duplicateAction.copyName', {
35838
- defaultValue: '{{name}} (Kopie)',
35839
- name: sourceData.displayName
35840
- })
35841
- }, getNewChildData(target)),
35842
- callback: onDuplicated
35843
- });
35844
- case 25:
35855
+ return _context.abrupt("return");
35856
+ case 21:
35857
+ root.addError(t('backoffice.orgtree.duplicateAction.loadError', 'Die Organisation konnte nicht geladen werden.'));
35858
+ setOpen(false);
35859
+ case 23:
35860
+ _context.prev = 23;
35861
+ if (opening === openingRef.current) setLoading(false);
35862
+ return _context.finish(23);
35863
+ case 26:
35845
35864
  case "end":
35846
35865
  return _context.stop();
35847
35866
  }
35848
- }, _callee, null, [[5, 13, 17, 20]]);
35867
+ }, _callee, null, [[5, 17, 23, 26]]);
35849
35868
  }));
35850
- return function openForm() {
35851
- return _ref2.apply(this, arguments);
35869
+ return function openDialog() {
35870
+ return _ref4.apply(this, arguments);
35852
35871
  };
35853
35872
  }();
35873
+ var openForm = function openForm() {
35874
+ var _sourceData$settings;
35875
+ if (!target || !sourceData) return;
35876
+ var apiInterface = action.apiInterface;
35877
+ var createUrl = _typeof(apiInterface) == 'object' && typeof apiInterface.create == 'string' ? apiInterface.create : undefined;
35878
+ setOpen(false);
35879
+ var values = Object.fromEntries(Object.entries(sourceData).filter(function (_ref5) {
35880
+ var _ref6 = _slicedToArray(_ref5, 1),
35881
+ key = _ref6[0];
35882
+ return !NOT_COPIED_FIELDS.includes(key);
35883
+ }));
35884
+ var campaignSettings = (_sourceData$settings = sourceData.settings) === null || _sourceData$settings === void 0 ? void 0 : _sourceData$settings.campaignSettings;
35885
+ if (campaignSettings) {
35886
+ values.settings = _objectSpread$1R(_objectSpread$1R({}, sourceData.settings), {}, {
35887
+ campaignSettings: Object.fromEntries(Object.entries(campaignSettings).filter(function (_ref7) {
35888
+ var _ref8 = _slicedToArray(_ref7, 1),
35889
+ key = _ref8[0];
35890
+ return !NOT_COPIED_CAMPAIGN_FIELDS.includes(key);
35891
+ }))
35892
+ });
35893
+ }
35894
+ root.detailStore.openRightDetail({
35895
+ configurationId: action.id,
35896
+ type: action.type,
35897
+ title: typeof action.title == 'function' ? action.title(source) : action.title,
35898
+ // the form fills ${parentId} from the mapping data
35899
+ apiInterface: {
35900
+ create: createUrl === null || createUrl === void 0 ? void 0 : createUrl.replace('${organizationId}', encodeURIComponent(source.id))
35901
+ },
35902
+ mappingData: {
35903
+ id: target.id
35904
+ },
35905
+ data: _objectSpread$1R(_objectSpread$1R({}, values), {}, {
35906
+ displayName: t('backoffice.orgtree.duplicateAction.copyName', {
35907
+ defaultValue: '{{name}} (Kopie)',
35908
+ name: sourceData.displayName
35909
+ })
35910
+ }, getNewChildData(target)),
35911
+ callback: onDuplicated
35912
+ });
35913
+ };
35854
35914
  return (
35855
35915
  /*#__PURE__*/
35856
35916
  // the dialog is rendered inside the tree node, keep its clicks from selecting the node
@@ -35870,9 +35930,9 @@ var DuplicateOrganization = function DuplicateOrganization(_ref) {
35870
35930
  okText: t('backoffice.orgtree.duplicateAction.ok', 'Weiter'),
35871
35931
  cancelText: t('backoffice.orgtree.duplicateAction.cancel', 'Abbrechen'),
35872
35932
  okButtonProps: {
35873
- disabled: !target
35933
+ disabled: !target,
35934
+ loading: loading
35874
35935
  },
35875
- confirmLoading: loading,
35876
35936
  onOk: openForm,
35877
35937
  onCancel: function onCancel() {
35878
35938
  return setOpen(false);
@@ -35884,6 +35944,7 @@ var DuplicateOrganization = function DuplicateOrganization(_ref) {
35884
35944
  },
35885
35945
  children: [/*#__PURE__*/jsx(Radio.Group, {
35886
35946
  value: sameLevel,
35947
+ disabled: !sourceData,
35887
35948
  onChange: function onChange(e) {
35888
35949
  return setSameLevel(e.target.value);
35889
35950
  },
@@ -35891,7 +35952,7 @@ var DuplicateOrganization = function DuplicateOrganization(_ref) {
35891
35952
  direction: "vertical",
35892
35953
  children: [/*#__PURE__*/jsx(Radio, {
35893
35954
  value: true,
35894
- disabled: !parent.writePermission,
35955
+ disabled: !sameLevelAllowed,
35895
35956
  children: t('backoffice.orgtree.duplicateAction.sameLevel', {
35896
35957
  defaultValue: 'Gleiche Ebene ({{parent}})',
35897
35958
  parent: parent.displayName
@@ -35913,7 +35974,7 @@ var DuplicateOrganization = function DuplicateOrganization(_ref) {
35913
35974
  var _option$label;
35914
35975
  return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes(input.toLowerCase());
35915
35976
  },
35916
- options: writableOrgs.map(function (org) {
35977
+ options: writableParents.map(function (org) {
35917
35978
  return {
35918
35979
  value: org.id,
35919
35980
  label: org.displayName
@@ -35958,6 +36019,11 @@ var OrgItem = function OrgItem(_ref) {
35958
36019
  var _useTranslation = useTranslation(),
35959
36020
  t = _useTranslation.t;
35960
36021
  var root = useStore();
36022
+ var _useDivaCore = useDivaCore(),
36023
+ userHasPermission = _useDivaCore.actions.userHasPermission;
36024
+ // end customers cannot set the organization type (and its API2 servers) in the create form, so they may only copy shells and retailer channels;
36025
+ // campaigns show as RETAILERCHILD too but store their own type
36026
+ var canDuplicate = (!data.type || data.type === 'RETAILERCHILD') && !data.storedType || userHasPermission('backoffice_admin_organizations');
35961
36027
  return /*#__PURE__*/jsxs("div", {
35962
36028
  id: data.id,
35963
36029
  className: classNames(label$4, itemChain.find(function (i) {
@@ -35990,7 +36056,7 @@ var OrgItem = function OrgItem(_ref) {
35990
36056
  setUpdate(update + 1);
35991
36057
  (_configuration$create = configuration.createAction) === null || _configuration$create === void 0 || (_configuration$create2 = _configuration$create.callback) === null || _configuration$create2 === void 0 || _configuration$create2.call(_configuration$create, data);
35992
36058
  }
35993
- }, "create"), configuration.duplicateAction && data.readPermission && itemChain.length > 1 && ((_itemChain2 = itemChain[itemChain.length - 1]) === null || _itemChain2 === void 0 ? void 0 : _itemChain2.id) == data.id && /*#__PURE__*/jsx(DuplicateOrganization$1, {
36059
+ }, "create"), configuration.duplicateAction && canDuplicate && data.readPermission && itemChain.length > 1 && ((_itemChain2 = itemChain[itemChain.length - 1]) === null || _itemChain2 === void 0 ? void 0 : _itemChain2.id) == data.id && /*#__PURE__*/jsx(DuplicateOrganization$1, {
35994
36060
  action: configuration.duplicateAction,
35995
36061
  source: data,
35996
36062
  parent: itemChain[itemChain.length - 2],
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=canHaveChildOfType.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canHaveChildOfType.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/tests/unit/ui/TreeChart/canHaveChildOfType.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/TreeChart/DuplicateOrganization/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,YAAY,EAAW,MAAM,wBAAwB,CAAC;AAI/D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAwB/B,UAAU,KAAK;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,oCAAoC;IACpC,MAAM,EAAE,GAAG,CAAC;IACZ,+DAA+D;IAC/D,MAAM,EAAE,GAAG,CAAC;IACZ,0DAA0D;IAC1D,IAAI,EAAE,GAAG,CAAC;IACV,YAAY,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;0EAW8E,KAAK;;;AAqGpF,wBAA+C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/TreeChart/DuplicateOrganization/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAIzD,OAAO,EAAE,YAAY,EAAW,MAAM,wBAAwB,CAAC;AAK/D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAwB/B,UAAU,KAAK;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,oCAAoC;IACpC,MAAM,EAAE,GAAG,CAAC;IACZ,+DAA+D;IAC/D,MAAM,EAAE,GAAG,CAAC;IACZ,0DAA0D;IAC1D,IAAI,EAAE,GAAG,CAAC;IACV,YAAY,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;0EAmB8E,KAAK;;;AAoHpF,wBAA+C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/TreeChart/OrgItem/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAQrD,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,GAAG,CAAC;IACV,aAAa,EAAE,oBAAoB,CAAC;IACpC,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9D,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;iHAqBsG,KAAK;;;AA+F7G,wBAAiC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/TreeChart/OrgItem/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAQrD,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,GAAG,CAAC;IACV,aAAa,EAAE,oBAAoB,CAAC;IACpC,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9D,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;iHAqBsG,KAAK;;;AAsG7G,wBAAiC"}
@@ -0,0 +1,15 @@
1
+ import { Org } from './types';
2
+ /**
3
+ * The type the children of `org` get as parentType: retailer channels and campaigns belong to a retailer, dealers to a supplier,
4
+ * a shell organization passes on the type of its ancestors.
5
+ */
6
+ export declare function getChildParentType(org: Org, inheritedParentType?: string): string | undefined;
7
+ /**
8
+ * Whether an organization of `type` may be created below `parent`, the same type rules diva-auth applies when it creates one.
9
+ *
10
+ * @param type the stored type of the new organization, undefined for a shell, retailer channel or dealer
11
+ * @param parent the organization the new one is added to
12
+ * @param parentType the type the children of `parent` get, see {@link getChildParentType}
13
+ */
14
+ export declare function canHaveChildOfType(type: string | undefined, parent: Org, parentType?: string): boolean;
15
+ //# sourceMappingURL=canHaveChildOfType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canHaveChildOfType.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/TreeChart/canHaveChildOfType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAE9B;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,mBAAmB,CAAC,EAAE,MAAM,sBAIxE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM,WAM5F"}
@@ -22,6 +22,8 @@ export interface Org {
22
22
  children?: Org[];
23
23
  onClick?: () => void;
24
24
  type?: string;
25
+ /** The type stored on the organization; `type` shows campaigns as RETAILERCHILD */
26
+ storedType?: string;
25
27
  readPermission?: boolean;
26
28
  deletePermission?: boolean;
27
29
  writePermission?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/TreeChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE5F,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;IAClE,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACrC;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/TreeChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE5F,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;IAClE,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACrC;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "26.13.0-rc.4",
3
+ "version": "26.13.0-rc.6",
4
4
  "description": "Ant Design backoffice shell (configuration modules), the Diva Data Engine component hosting the IDM and enricher editors, and the Produkt Onboarding component hosting the Assortment Manager.",
5
5
  "license": "COMMERCIAL",
6
6
  "devDependencies": {
@@ -16,16 +16,16 @@
16
16
  "dependencies": {
17
17
  "@ant-design/icons": "6.3.4",
18
18
  "@babel/runtime": "7.24.7",
19
- "@crystaldesign/classification": "26.13.0-rc.4",
20
- "@crystaldesign/content-box": "26.13.0-rc.4",
21
- "@crystaldesign/content-item": "26.13.0-rc.4",
22
- "@crystaldesign/diva-agent": "26.13.0-rc.4",
23
- "@crystaldesign/diva-core": "26.13.0-rc.4",
24
- "@crystaldesign/diva-utils": "26.13.0-rc.4",
25
- "@crystaldesign/mass-configurator": "26.13.0-rc.4",
26
- "@crystaldesign/media-upload": "26.13.0-rc.4",
27
- "@crystaldesign/rtf-editor": "26.13.0-rc.4",
28
- "@crystaldesign/spreadsheet": "26.13.0-rc.4",
19
+ "@crystaldesign/classification": "26.13.0-rc.6",
20
+ "@crystaldesign/content-box": "26.13.0-rc.6",
21
+ "@crystaldesign/content-item": "26.13.0-rc.6",
22
+ "@crystaldesign/diva-agent": "26.13.0-rc.6",
23
+ "@crystaldesign/diva-core": "26.13.0-rc.6",
24
+ "@crystaldesign/diva-utils": "26.13.0-rc.6",
25
+ "@crystaldesign/mass-configurator": "26.13.0-rc.6",
26
+ "@crystaldesign/media-upload": "26.13.0-rc.6",
27
+ "@crystaldesign/rtf-editor": "26.13.0-rc.6",
28
+ "@crystaldesign/spreadsheet": "26.13.0-rc.6",
29
29
  "@dnd-kit/core": "^6.1.0",
30
30
  "@dnd-kit/sortable": "^8.0.0",
31
31
  "@dnd-kit/utilities": "^3.2.2",
@@ -63,5 +63,5 @@
63
63
  "suiteName": "diva-backoffice",
64
64
  "outputDirectory": "./test-reports"
65
65
  },
66
- "gitHead": "e9d86c47a5dd669ef7bdda9425c7d8953c1463b9"
66
+ "gitHead": "51ace3c5471304f49c1c87c210fdd341d9baec32"
67
67
  }