@crystaldesign/diva-backoffice 25.8.0-beta.2 → 25.8.0-beta.21

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.
Files changed (38) hide show
  1. package/build/esm/index.js +752 -294
  2. package/build/types/backoffice/src/ui/IDMCatalogEditor/components/PrefilterSelectors/SeriesSelector.d.ts.map +1 -1
  3. package/build/types/backoffice/src/ui/IDMCatalogEditor/hooks/useCatalogContext.d.ts +4 -4
  4. package/build/types/backoffice/src/ui/IDMCatalogEditor/hooks/useCatalogContext.d.ts.map +1 -1
  5. package/build/types/backoffice/src/ui/IDMCommonComponents/SpreadsheetWrapper/index.d.ts +2 -2
  6. package/build/types/backoffice/src/ui/IDMCommonComponents/SpreadsheetWrapper/index.d.ts.map +1 -1
  7. package/build/types/backoffice/src/ui/IDMCommonComponents/createTranslatedColumnConfig.d.ts +1 -1
  8. package/build/types/backoffice/src/ui/IDMCommonComponents/createTranslatedColumnConfig.d.ts.map +1 -1
  9. package/build/types/backoffice/src/ui/IDMEnricherEditor/Tables/Prices/PriceFactorHeaderComponent.d.ts +37 -0
  10. package/build/types/backoffice/src/ui/IDMEnricherEditor/Tables/Prices/PriceFactorHeaderComponent.d.ts.map +1 -0
  11. package/build/types/backoffice/src/ui/IDMEnricherEditor/Tables/Prices/PriceFactorInput/index.d.ts +2 -2
  12. package/build/types/backoffice/src/ui/IDMEnricherEditor/Tables/Prices/PriceFactorInput/index.d.ts.map +1 -1
  13. package/build/types/backoffice/src/ui/IDMEnricherEditor/Tables/Prices/index.d.ts +2 -1
  14. package/build/types/backoffice/src/ui/IDMEnricherEditor/Tables/Prices/index.d.ts.map +1 -1
  15. package/build/types/backoffice/src/ui/IDMEnricherEditor/components/PrefilterSelectors/PackageSelector.d.ts.map +1 -1
  16. package/build/types/backoffice/src/ui/IDMEnricherEditor/hooks/useEnricherContext.d.ts +4 -0
  17. package/build/types/backoffice/src/ui/IDMEnricherEditor/hooks/useEnricherContext.d.ts.map +1 -1
  18. package/build/types/backoffice/src/ui/IDMEnricherEditor/hooks/useModule.d.ts +1 -0
  19. package/build/types/backoffice/src/ui/IDMEnricherEditor/hooks/useModule.d.ts.map +1 -1
  20. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TablePackages/PublishCustomCell.d.ts +2 -1
  21. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TablePackages/PublishCustomCell.d.ts.map +1 -1
  22. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TablePackages/index.d.ts.map +1 -1
  23. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TablePriceList/index.d.ts.map +1 -1
  24. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/catalogConfig.d.ts +3 -3
  25. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/catalogConfig.d.ts.map +1 -1
  26. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/detailInfosConfig.d.ts +4 -3
  27. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/detailInfosConfig.d.ts.map +1 -1
  28. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/featureConfig.d.ts +4 -3
  29. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/featureConfig.d.ts.map +1 -1
  30. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/itemConfig.d.ts +4 -3
  31. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/itemConfig.d.ts.map +1 -1
  32. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/optionsConfig.d.ts +4 -3
  33. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/optionsConfig.d.ts.map +1 -1
  34. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/seriesConfig.d.ts +4 -3
  35. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableRenaming/tableConfiguration/seriesConfig.d.ts.map +1 -1
  36. package/build/types/backoffice/src/ui/IDMEnricherEditor/modules/TableTabGroups/index.d.ts.map +1 -1
  37. package/build/types/backoffice/src/ui/SelectSimple/useSelectSimpleData.d.ts.map +1 -1
  38. package/package.json +9 -9
@@ -119,9 +119,11 @@ import Descriptions$1 from 'antd/es/descriptions';
119
119
  import { Spreadsheet as Spreadsheet$1 } from '@crystaldesign/spreadsheet';
120
120
  import EditOutlined from '@ant-design/icons/lib/icons/EditOutlined';
121
121
  import Checkbox$1 from 'antd/es/checkbox/Checkbox';
122
+ import WarningOutlined from '@ant-design/icons/lib/icons/WarningOutlined';
122
123
  import Modal$3 from 'antd/es/modal';
123
124
  import Spin$1 from 'antd/es/spin';
124
125
  import Flex from 'antd/es/flex';
126
+ import { useTranslation as useTranslation$1 } from 'react-i18next';
125
127
  import JSZip from 'jszip';
126
128
  import { DropzoneAreaBase } from 'react-mui-dropzone';
127
129
  import Switch$1 from 'antd/es/switch';
@@ -7894,6 +7896,20 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
7894
7896
  hidden: function hidden(data) {
7895
7897
  return (data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER' && (data === null || data === void 0 ? void 0 : data.type) === undefined;
7896
7898
  }
7899
+ }, {
7900
+ name: 'privacyPolicyUrl',
7901
+ label: t('backoffice.form.organizationdetails.items.privacyPolicyUrl'),
7902
+ type: 'input',
7903
+ hidden: function hidden(data) {
7904
+ return (data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER' && (data === null || data === void 0 ? void 0 : data.type) === undefined;
7905
+ }
7906
+ }, {
7907
+ name: 'termsAndConditionsUrl',
7908
+ label: t('backoffice.form.organizationdetails.items.termsAndConditionsUrl'),
7909
+ type: 'input',
7910
+ hidden: function hidden(data) {
7911
+ return (data === null || data === void 0 ? void 0 : data.parentType) === 'SUPPLIER' && (data === null || data === void 0 ? void 0 : data.type) === undefined;
7912
+ }
7897
7913
  }, {
7898
7914
  name: ['defaultCatalog', 'catalogId'],
7899
7915
  accountName: ['defaultCatalog', 'accountId'],
@@ -8809,6 +8825,14 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
8809
8825
  }, {
8810
8826
  name: 'mediaItemRefVideo',
8811
8827
  hidden: true
8828
+ }, {
8829
+ name: 'loop',
8830
+ type: 'checkbox',
8831
+ label: t('backoffice.form.contentItem.loop'),
8832
+ doTranslate: false,
8833
+ hidden: function hidden(d) {
8834
+ return (d === null || d === void 0 ? void 0 : d.type) !== 'Video';
8835
+ }
8812
8836
  }]
8813
8837
  });
8814
8838
  translationItems.push({
@@ -8867,6 +8891,12 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
8867
8891
  label: t('backoffice.form.api2servers.items.url'),
8868
8892
  doTranslate: true
8869
8893
  });
8894
+ translationItems.push({
8895
+ name: [].concat(_toConsumableArray(p), ['loop']),
8896
+ type: 'checkbox',
8897
+ label: t('backoffice.form.contentItem.loop'),
8898
+ doTranslate: false
8899
+ });
8870
8900
  break;
8871
8901
  case 'Wrapper':
8872
8902
  translationItems.push({
@@ -9102,6 +9132,12 @@ function loadConfiguration(t, root, config, lang, apiConfig) {
9102
9132
  label: t('backoffice.form.api2servers.items.url'),
9103
9133
  doTranslate: true
9104
9134
  });
9135
+ translationItems.push({
9136
+ name: [].concat(_toConsumableArray(p), ['loop']),
9137
+ type: 'checkbox',
9138
+ label: t('backoffice.form.contentItem.loop'),
9139
+ doTranslate: false
9140
+ });
9105
9141
  break;
9106
9142
  case 'Wrapper':
9107
9143
  translationItems.push({
@@ -17004,7 +17040,7 @@ var JsonEditor$2 = function JsonEditor(_ref) {
17004
17040
  });
17005
17041
  };
17006
17042
 
17007
- var _excluded$3 = ["key", "name"];
17043
+ var _excluded$4 = ["key", "name"];
17008
17044
  function ownKeys$U(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; }
17009
17045
  function _objectSpread$U(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$U(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$U(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17010
17046
  var FormList$2 = function FormList(_ref) {
@@ -17040,7 +17076,7 @@ var FormList$2 = function FormList(_ref) {
17040
17076
  children: [fields.map(function (_ref3) {
17041
17077
  var key = _ref3.key,
17042
17078
  name = _ref3.name,
17043
- restField = _objectWithoutProperties(_ref3, _excluded$3);
17079
+ restField = _objectWithoutProperties(_ref3, _excluded$4);
17044
17080
  return /*#__PURE__*/jsxs("div", {
17045
17081
  id: key.toString(),
17046
17082
  style: {
@@ -17475,14 +17511,29 @@ function useSelectSimpleData (_ref) {
17475
17511
  });
17476
17512
  return selected.value;
17477
17513
  }, [selected]);
17514
+ var setLoadedOptions = function setLoadedOptions(options) {
17515
+ var _options$;
17516
+ setOptions(options);
17517
+ if (value && options) {
17518
+ LOG$a.debug('value changed', toJS(value), toJS(options));
17519
+ var _selected = findByValue(value, options, selectMapping);
17520
+ var selectedValues = Array.isArray(_selected) ? _selected.map(function (item) {
17521
+ return item.value;
17522
+ }) : _selected === null || _selected === void 0 ? void 0 : _selected.value;
17523
+ onSelectionChanged(selectedValues, _selected);
17524
+ } else if (options !== null && options !== void 0 && (_options$ = options[0]) !== null && _options$ !== void 0 && _options$.value && autoSelectFirst) {
17525
+ onSelectionChanged(options[0].value, options[0]);
17526
+ }
17527
+ };
17478
17528
  useEffect(function () {
17479
17529
  if (configuredOptions) {
17480
17530
  if (apiHandler.canReadList) LOG$a.warn('If options are provided, apiInterface will not be used');
17481
- setOptions(configuredOptions);
17531
+ setLoadedOptions(configuredOptions);
17482
17532
  setLoading(false);
17483
17533
  return;
17484
17534
  }
17485
- if (options) {
17535
+ if (sharedState !== null && sharedState !== void 0 && sharedState.options) {
17536
+ setLoadedOptions(sharedState.options);
17486
17537
  setLoading(false);
17487
17538
  return;
17488
17539
  }
@@ -17494,25 +17545,11 @@ function useSelectSimpleData (_ref) {
17494
17545
  var options = data.data.map(function (item) {
17495
17546
  return parseDataEntry(item, selectMapping);
17496
17547
  });
17497
- setOptions(options);
17548
+ setLoadedOptions(options);
17498
17549
  })["finally"](function () {
17499
17550
  setLoading(false);
17500
17551
  });
17501
17552
  }, []);
17502
- useEffect(function () {
17503
- var _options$;
17504
- // set the selected option only after the options are loaded
17505
- if (value && options) {
17506
- LOG$a.debug('value changed', value);
17507
- var _selected = findByValue(value, options, selectMapping);
17508
- var selectedValues = Array.isArray(_selected) ? _selected.map(function (item) {
17509
- return item.value;
17510
- }) : _selected === null || _selected === void 0 ? void 0 : _selected.value;
17511
- onSelectionChanged(selectedValues, _selected);
17512
- } else if (options !== null && options !== void 0 && (_options$ = options[0]) !== null && _options$ !== void 0 && _options$.value && autoSelectFirst) {
17513
- onSelectionChanged(options[0].value, options[0]);
17514
- }
17515
- }, [value, options]);
17516
17553
  var onSelectionChanged = function onSelectionChanged(value, option) {
17517
17554
  setSelected(option);
17518
17555
  onChange === null || onChange === void 0 || onChange(parseReturnData(option, selectMapping));
@@ -17581,7 +17618,7 @@ var wrapper$6 = "wrapper-4xyke";
17581
17618
  var css_248z$u = ".wrapper-4xyke {\n display: flex;\n flex-direction: column;\n min-height: 50px;\n justify-content: flex-end;\n font-size: 12px;\n}\n";
17582
17619
  styleInject(css_248z$u);
17583
17620
 
17584
- var _excluded$2 = ["apiInterface", "selectMapping", "apiMapping", "onChange", "value", "search", "options", "autoSelectFirst", "title", "sharedState"];
17621
+ var _excluded$3 = ["apiInterface", "selectMapping", "apiMapping", "onChange", "value", "search", "options", "autoSelectFirst", "title", "sharedState"];
17585
17622
  function ownKeys$S(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; }
17586
17623
  function _objectSpread$S(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$S(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$S(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17587
17624
  var SelectWrapper$1 = function SelectWrapper(_ref, ref) {
@@ -17595,7 +17632,7 @@ var SelectWrapper$1 = function SelectWrapper(_ref, ref) {
17595
17632
  autoSelectFirst = _ref.autoSelectFirst,
17596
17633
  title = _ref.title,
17597
17634
  sharedState = _ref.sharedState,
17598
- selectProps = _objectWithoutProperties(_ref, _excluded$2);
17635
+ selectProps = _objectWithoutProperties(_ref, _excluded$3);
17599
17636
  var state = useSelectSimpleData({
17600
17637
  apiInterface: apiInterface,
17601
17638
  selectMapping: selectMapping,
@@ -25595,7 +25632,7 @@ function LinkCell (_ref) {
25595
25632
  }
25596
25633
  }
25597
25634
 
25598
- var _excluded$1 = ["index"],
25635
+ var _excluded$2 = ["index"],
25599
25636
  _excluded2 = ["children", "dataIndex", "record", "handleSave", "column"];
25600
25637
  function ownKeys$y(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; }
25601
25638
  function _objectSpread$y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$y(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -25603,7 +25640,7 @@ var LOG$4 = getLogger('Backoffice', 'CellRenderer');
25603
25640
  var EditableContext = /*#__PURE__*/React.createContext(null);
25604
25641
  var CustomRow = function CustomRow(_ref) {
25605
25642
  _ref.index;
25606
- var props = _objectWithoutProperties(_ref, _excluded$1);
25643
+ var props = _objectWithoutProperties(_ref, _excluded$2);
25607
25644
  var _Form$useForm = Form$1.useForm(),
25608
25645
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
25609
25646
  form = _Form$useForm2[0];
@@ -27492,7 +27529,7 @@ function filter(f, data) {
27492
27529
  }) : result;
27493
27530
  }
27494
27531
 
27495
- var _excluded = ["_id"];
27532
+ var _excluded$1 = ["_id"];
27496
27533
  function ownKeys$t(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; }
27497
27534
  function _objectSpread$t(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$t(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$t(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
27498
27535
  function useTableData$1 (_ref) {
@@ -27576,7 +27613,7 @@ function useTableData$1 (_ref) {
27576
27613
  setState(newState);
27577
27614
  var formData = new FormData();
27578
27615
  processedDataRow._id;
27579
- var value = _objectWithoutProperties(processedDataRow, _excluded);
27616
+ var value = _objectWithoutProperties(processedDataRow, _excluded$1);
27580
27617
  apiHandler.create(undefined, (_configuration$create = configuration.createMapping) !== null && _configuration$create !== void 0 ? _configuration$create : configuration.mapping, _objectSpread$t(_objectSpread$t({}, catalogItem), {}, {
27581
27618
  filterContex: filterContex,
27582
27619
  value: JSON.stringify([value])
@@ -31104,6 +31141,8 @@ var useEnricherContext = function useEnricherContext() {
31104
31141
  root.contextStore.updateContext('enricher', {
31105
31142
  selectedPackage: newPackage,
31106
31143
  packageId: newPackage._id,
31144
+ viewOnly: newPackage.organizationId !== root.dataStore.organizationId,
31145
+ //if the package is not created in the current organization, it can only be viewed
31107
31146
  selectedSerie: undefined,
31108
31147
  selectedFeature: undefined,
31109
31148
  lookupSeriesSelectorState: createDefaultSelectState('lookupSeriesSelectorState'),
@@ -31150,14 +31189,7 @@ var PackageSelector = function PackageSelector(_ref) {
31150
31189
  return /*#__PURE__*/jsx(SimpleSelect, {
31151
31190
  sharedState: packageSelectorState,
31152
31191
  apiInterface: {
31153
- read: "".concat(enricherService, "/packages?fields=name;_id;isoLanguageIds;isApi&filter=organizationId==\"").concat(organizationId, "\"")
31154
- },
31155
- apiMapping: {
31156
- type: 'query',
31157
- map: [{
31158
- globalValue: 'organizationId',
31159
- targetField: 'organizationId'
31160
- }]
31192
+ read: "".concat(enricherService, "/packages?fields=name;_id;isoLanguageIds;isApi;organizationId&organizationId=").concat(organizationId)
31161
31193
  },
31162
31194
  selectMapping: {
31163
31195
  label: '${name}',
@@ -31187,7 +31219,8 @@ function useModule$1 (currentModules) {
31187
31219
  setSelectedPackage = _useEnricherContext.setSelectedPackage,
31188
31220
  organizationId = _useEnricherContext.organizationId,
31189
31221
  selectedSerie = _useEnricherContext.selectedSerie,
31190
- selectedFeature = _useEnricherContext.selectedFeature;
31222
+ selectedFeature = _useEnricherContext.selectedFeature,
31223
+ viewOnly = _useEnricherContext.viewOnly;
31191
31224
  var location = useLocation();
31192
31225
  var _useSearchParams = useSearchParams(),
31193
31226
  _useSearchParams2 = _slicedToArray(_useSearchParams, 1),
@@ -31398,7 +31431,8 @@ function useModule$1 (currentModules) {
31398
31431
  apiConfig: root.configurationStore.apiConfig,
31399
31432
  setSelectedPackage: setSelectedPackage,
31400
31433
  selectedSerie: selectedSerie,
31401
- selectedFeature: selectedFeature
31434
+ selectedFeature: selectedFeature,
31435
+ viewOnly: viewOnly
31402
31436
  };
31403
31437
  }
31404
31438
 
@@ -31592,10 +31626,11 @@ var TableGroups = observer(function () {
31592
31626
  packageId = _useModule.packageId,
31593
31627
  organizationId = _useModule.organizationId,
31594
31628
  apiConfig = _useModule.apiConfig,
31595
- selectedPackage = _useModule.selectedPackage;
31629
+ selectedPackage = _useModule.selectedPackage,
31630
+ viewOnly = _useModule.viewOnly;
31596
31631
  useTools({
31597
31632
  packageId: packageId,
31598
- isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
31633
+ isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi
31599
31634
  });
31600
31635
  var applicationData = useMemo(function () {
31601
31636
  return {
@@ -31606,10 +31641,10 @@ var TableGroups = observer(function () {
31606
31641
  var apiInterface = useMemo(function () {
31607
31642
  return {
31608
31643
  read: apiConfig.enricherService + '/packages/${packageId}/groups',
31609
- create: apiConfig.enricherService + '/packages/${packageId}/groups',
31610
- restore: apiConfig.enricherService + '/packages/${packageId}/groups/${_id}',
31611
- "delete": apiConfig.enricherService + '/packages/${packageId}/groups/${_id}',
31612
- update: apiConfig.enricherService + '/packages/${packageId}/groups/${_id}',
31644
+ create: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/groups',
31645
+ restore: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/groups/${_id}',
31646
+ "delete": viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/groups/${_id}',
31647
+ update: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/groups/${_id}',
31613
31648
  bulk: apiConfig.enricherService + '/packages/${packageId}/groups/bulk'
31614
31649
  };
31615
31650
  }, []);
@@ -31623,7 +31658,7 @@ var TableGroups = observer(function () {
31623
31658
  field: 'serieNos',
31624
31659
  headerName: 'backoffice.idmEnricher.groups.label.serieNos',
31625
31660
  cellDataType: 'lookup',
31626
- editable: true,
31661
+ editable: !viewOnly,
31627
31662
  customParams: {
31628
31663
  filterCellType: 'number',
31629
31664
  nameField: 'serieNosDisplayTexts',
@@ -31646,7 +31681,7 @@ var TableGroups = observer(function () {
31646
31681
  field: 'typeNos',
31647
31682
  headerName: 'backoffice.idmEnricher.groups.label.typeNos',
31648
31683
  cellDataType: 'lookup',
31649
- editable: true,
31684
+ editable: !viewOnly,
31650
31685
  customParams: {
31651
31686
  nameField: 'typeNosDisplayTexts',
31652
31687
  displayLabelTemplate: '${name} (${value})',
@@ -31701,7 +31736,7 @@ var TableGroups = observer(function () {
31701
31736
  cellDataType: 'objectId'
31702
31737
  }]
31703
31738
  };
31704
- }, [apiInterface, t, selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds]);
31739
+ }, [apiInterface, t, selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds, viewOnly]);
31705
31740
  return /*#__PURE__*/jsxs(Fragment, {
31706
31741
  children: [/*#__PURE__*/jsx(Descriptions$1, {
31707
31742
  title: /*#__PURE__*/jsxs("div", {
@@ -31723,22 +31758,28 @@ var TableGroups = observer(function () {
31723
31758
  });
31724
31759
 
31725
31760
  function PublishCustomCell (_ref) {
31761
+ var _data$published, _data$removedOrganiza;
31726
31762
  var data = _ref.data,
31727
31763
  apiConfig = _ref.apiConfig,
31728
31764
  context = _ref.context,
31729
31765
  api = _ref.api,
31730
- modalState = _ref.modalState;
31766
+ modalState = _ref.modalState,
31767
+ organizationId = _ref.organizationId;
31731
31768
  var _useTranslation = useTranslation(),
31732
31769
  t = _useTranslation.t;
31733
31770
  var _React$useState = React.useState(false),
31734
31771
  _React$useState2 = _slicedToArray(_React$useState, 2),
31735
31772
  loading = _React$useState2[0],
31736
31773
  isLoading = _React$useState2[1];
31737
- var unpublishedChanges = hasUnpublishedChanges(data.publishDate, data.lastUpdatedDate);
31738
- var disabled = !data.basedCatalogId && !data.basedPackageId || !data.name;
31774
+ var publishedData = (_data$published = data.published) === null || _data$published === void 0 ? void 0 : _data$published[organizationId];
31775
+ var isReleaseWithdrawn = !!((_data$removedOrganiza = data.removedOrganizationIds) !== null && _data$removedOrganiza !== void 0 && _data$removedOrganiza.find(function (id) {
31776
+ return id === organizationId;
31777
+ }));
31778
+ var unpublishedChanges = hasUnpublishedChanges(publishedData === null || publishedData === void 0 ? void 0 : publishedData.publishDate, publishedData === null || publishedData === void 0 ? void 0 : publishedData.lastUpdatedDate);
31779
+ var disabled = !(data !== null && data !== void 0 && data.basedCatalogId) && !(data !== null && data !== void 0 && data.basedPackageId) || !(data !== null && data !== void 0 && data.name);
31739
31780
  var _onChange = /*#__PURE__*/function () {
31740
31781
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(publish) {
31741
- var loadingTimeout, response;
31782
+ var loadingTimeout, response, _errorText, errorText, json;
31742
31783
  return _regeneratorRuntime.wrap(function _callee$(_context) {
31743
31784
  while (1) switch (_context.prev = _context.next) {
31744
31785
  case 0:
@@ -31753,7 +31794,7 @@ function PublishCustomCell (_ref) {
31753
31794
  }
31754
31795
  _context.next = 6;
31755
31796
  return context === null || context === void 0 ? void 0 : context.updateServerData(data, {
31756
- update: apiConfig.enricherService + '/packages/${_id}/publish',
31797
+ update: apiConfig.enricherService + '/packages/${_id}/publish?organizationId=' + organizationId,
31757
31798
  usePut: true
31758
31799
  }, undefined, true);
31759
31800
  case 6:
@@ -31763,7 +31804,7 @@ function PublishCustomCell (_ref) {
31763
31804
  case 9:
31764
31805
  _context.next = 11;
31765
31806
  return context === null || context === void 0 ? void 0 : context.updateServerData(data, {
31766
- update: apiConfig.enricherService + '/packages/${_id}/unpublish',
31807
+ update: apiConfig.enricherService + '/packages/${_id}/unpublish?organizationId=' + organizationId,
31767
31808
  usePut: true
31768
31809
  }, undefined, true);
31769
31810
  case 11:
@@ -31775,7 +31816,7 @@ function PublishCustomCell (_ref) {
31775
31816
  break;
31776
31817
  }
31777
31818
  modalState.showWarningModal(t("backoffice.idmEnricher.packages.label.warning.".concat(publish ? 'publishing' : 'unpublishing')));
31778
- _context.next = 22;
31819
+ _context.next = 34;
31779
31820
  break;
31780
31821
  case 17:
31781
31822
  if (!(response.status == 200)) {
@@ -31783,30 +31824,46 @@ function PublishCustomCell (_ref) {
31783
31824
  break;
31784
31825
  }
31785
31826
  modalState.closeModal();
31786
- _context.next = 22;
31827
+ _context.next = 34;
31787
31828
  break;
31788
31829
  case 21:
31789
- throw new Error("Server errror: ".concat(response.statusText, " (").concat(response.status, ")"));
31790
- case 22:
31830
+ _context.prev = 21;
31831
+ _context.next = 24;
31832
+ return response.json();
31833
+ case 24:
31834
+ json = _context.sent;
31835
+ errorText = json.error;
31836
+ _context.next = 33;
31837
+ break;
31838
+ case 28:
31839
+ _context.prev = 28;
31840
+ _context.t0 = _context["catch"](21);
31841
+ _context.next = 32;
31842
+ return response.text();
31843
+ case 32:
31844
+ errorText = _context.sent;
31845
+ case 33:
31846
+ throw new Error((_errorText = errorText) !== null && _errorText !== void 0 ? _errorText : "Server error (".concat(response.status, ")"));
31847
+ case 34:
31791
31848
  context === null || context === void 0 || context.reset({
31792
31849
  context: context,
31793
31850
  api: api
31794
31851
  });
31795
- _context.next = 28;
31852
+ _context.next = 40;
31796
31853
  break;
31797
- case 25:
31798
- _context.prev = 25;
31799
- _context.t0 = _context["catch"](2);
31800
- modalState.showErrorModal("Error on ".concat(publish ? 'publish' : 'unpublish', ": ").concat(_context.t0 instanceof Error ? _context.t0.message : String(_context.t0)));
31801
- case 28:
31802
- _context.prev = 28;
31854
+ case 37:
31855
+ _context.prev = 37;
31856
+ _context.t1 = _context["catch"](2);
31857
+ modalState.showErrorModal("Error on ".concat(publish ? 'publish' : 'unpublish', ": ").concat(_context.t1 instanceof Error ? _context.t1.message : String(_context.t1)));
31858
+ case 40:
31859
+ _context.prev = 40;
31803
31860
  isLoading(false);
31804
- return _context.finish(28);
31805
- case 31:
31861
+ return _context.finish(40);
31862
+ case 43:
31806
31863
  case "end":
31807
31864
  return _context.stop();
31808
31865
  }
31809
- }, _callee, null, [[2, 25, 28, 31]]);
31866
+ }, _callee, null, [[2, 37, 40, 43], [21, 28]]);
31810
31867
  }));
31811
31868
  return function onChange(_x) {
31812
31869
  return _ref2.apply(this, arguments);
@@ -31818,9 +31875,9 @@ function PublishCustomCell (_ref) {
31818
31875
  children: /*#__PURE__*/jsxs(Space$1, {
31819
31876
  size: "middle",
31820
31877
  children: [/*#__PURE__*/jsx(Tooltip, {
31821
- title: !!data.isPublished ? t('backoffice.idmEnricher.packages.label.unpublish') : t('backoffice.idmEnricher.packages.label.publish'),
31878
+ title: !!publishedData ? t('backoffice.idmEnricher.packages.label.unpublish') : t('backoffice.idmEnricher.packages.label.publish'),
31822
31879
  children: /*#__PURE__*/jsx(Checkbox$1, {
31823
- checked: !!data.isPublished,
31880
+ checked: !!publishedData,
31824
31881
  disabled: disabled,
31825
31882
  indeterminate: unpublishedChanges,
31826
31883
  onChange: function onChange(e) {
@@ -31836,6 +31893,12 @@ function PublishCustomCell (_ref) {
31836
31893
  return _onChange(true);
31837
31894
  }
31838
31895
  })
31896
+ }), isReleaseWithdrawn && /*#__PURE__*/jsx(Tooltip, {
31897
+ title: t('backoffice.idmEnricher.packages.label.releaseWithdrawn'),
31898
+ children: /*#__PURE__*/jsx(Button$1, {
31899
+ shape: "circle",
31900
+ icon: /*#__PURE__*/jsx(WarningOutlined, {})
31901
+ })
31839
31902
  })]
31840
31903
  })
31841
31904
  });
@@ -32157,6 +32220,7 @@ var useLoadingModal = function useLoadingModal() {
32157
32220
  };
32158
32221
 
32159
32222
  var TablePackages = observer(function () {
32223
+ var _root$dataStore$curre;
32160
32224
  var root = useStore();
32161
32225
  var _useTranslation = useTranslation(),
32162
32226
  t = _useTranslation.t,
@@ -32167,23 +32231,20 @@ var TablePackages = observer(function () {
32167
32231
  closeModal = modalState.closeModal,
32168
32232
  contextHolder = modalState.contextHolder;
32169
32233
  var _useEnricherContext = useEnricherContext([]),
32170
- setSelectedPackage = _useEnricherContext.setSelectedPackage;
32171
- useTools({});
32234
+ setSelectedPackage = _useEnricherContext.setSelectedPackage,
32235
+ selectedPackage = _useEnricherContext.selectedPackage;
32236
+ useTools({
32237
+ isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi
32238
+ });
32172
32239
  var organizationId = root.dataStore.organizationId;
32240
+ var organizationDisplayText = (_root$dataStore$curre = root.dataStore.currentOrganization) === null || _root$dataStore$curre === void 0 ? void 0 : _root$dataStore$curre.displayName;
32173
32241
  var apiConfig = root.configurationStore.apiConfig;
32174
32242
  var applicationData = useMemo(function () {
32175
32243
  return {
32176
- organizationId: organizationId
32177
- };
32178
- }, [organizationId]);
32179
- var preFilter = useMemo(function () {
32180
- return {
32181
- colId: 'organizationId',
32182
- filterType: 'text',
32183
- type: 'equals',
32184
- filter: organizationId
32244
+ organizationId: organizationId,
32245
+ organizationDisplayText: organizationDisplayText
32185
32246
  };
32186
- }, [organizationId]);
32247
+ }, [organizationId, organizationDisplayText]);
32187
32248
  var rowActions = useMemo(function () {
32188
32249
  return [{
32189
32250
  icon: /*#__PURE__*/jsx(EditOutlined, {}),
@@ -32198,8 +32259,9 @@ var TablePackages = observer(function () {
32198
32259
  }, {
32199
32260
  icon: /*#__PURE__*/jsx(DownloadOutlined, {}),
32200
32261
  disabled: function disabled(_ref3) {
32262
+ var _selectedNodes$0$data;
32201
32263
  var selectedNodes = _ref3.selectedNodes;
32202
- return !selectedNodes[0].data.isPublished;
32264
+ return !((_selectedNodes$0$data = selectedNodes[0].data.published) !== null && _selectedNodes$0$data !== void 0 && _selectedNodes$0$data[organizationId]);
32203
32265
  },
32204
32266
  action: function () {
32205
32267
  var _action = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref4) {
@@ -32243,14 +32305,18 @@ var TablePackages = observer(function () {
32243
32305
  }, [apiConfig.enricherService, root.dataStore.jwt]);
32244
32306
  var apiInterface = useMemo(function () {
32245
32307
  return {
32246
- read: apiConfig.enricherService + '/packages?organizationId=${organizationId}',
32308
+ read: apiConfig.enricherService + '/packages?organizationId=' + organizationId,
32247
32309
  create: apiConfig.enricherService + '/packages',
32248
32310
  restore: apiConfig.enricherService + '/packages/${_id}',
32249
32311
  "delete": apiConfig.enricherService + '/packages/${_id}',
32250
32312
  update: apiConfig.enricherService + '/packages/${_id}',
32251
- bulk: apiConfig.enricherService + '/packages/bulk?organizationId=${organizationId}'
32313
+ bulk: apiConfig.enricherService + '/packages/bulk?organizationId=' + organizationId
32252
32314
  };
32253
- }, [apiConfig.enricherService]);
32315
+ }, [apiConfig.enricherService, organizationId]);
32316
+ var isEditable = useCallback(function (params) {
32317
+ var _params$data, _params$data2;
32318
+ return ((_params$data = params.data) === null || _params$data === void 0 ? void 0 : _params$data.organizationId) === organizationId || !((_params$data2 = params.data) !== null && _params$data2 !== void 0 && _params$data2._id);
32319
+ }, [organizationId]);
32254
32320
  var configuration = useMemo(function () {
32255
32321
  return {
32256
32322
  type: 'dotnetSSM',
@@ -32258,15 +32324,15 @@ var TablePackages = observer(function () {
32258
32324
  dateFormat: 'DD.MM.YYYY, HH:mm:ss',
32259
32325
  floatingFilter: true,
32260
32326
  colDef: [{
32261
- field: 'isPublished',
32327
+ field: "published.".concat(organizationId),
32262
32328
  //the cell should refresh on changes of this fields
32263
32329
  valueGetter: function valueGetter(_ref5) {
32330
+ var _data$published, _data$published2;
32264
32331
  var data = _ref5.data;
32265
32332
  return {
32266
- isPublished: data === null || data === void 0 ? void 0 : data.isPublished,
32267
32333
  name: data === null || data === void 0 ? void 0 : data.name,
32268
- basedCatalogId: data === null || data === void 0 ? void 0 : data.basedCatalogId,
32269
- basedPackageId: data === null || data === void 0 ? void 0 : data.basedPackageId
32334
+ basedCatalogId: data === null || data === void 0 || (_data$published = data.published) === null || _data$published === void 0 || (_data$published = _data$published[organizationId]) === null || _data$published === void 0 ? void 0 : _data$published.basedCatalogId,
32335
+ basedPackageId: data === null || data === void 0 || (_data$published2 = data.published) === null || _data$published2 === void 0 || (_data$published2 = _data$published2[organizationId]) === null || _data$published2 === void 0 ? void 0 : _data$published2.basedPackageId
32270
32336
  };
32271
32337
  },
32272
32338
  headerName: 'backoffice.idmEnricher.packages.label.published',
@@ -32277,19 +32343,22 @@ var TablePackages = observer(function () {
32277
32343
  lockPinned: true,
32278
32344
  cellRendererParams: {
32279
32345
  apiConfig: apiConfig,
32280
- modalState: modalState
32281
- }
32346
+ modalState: modalState,
32347
+ organizationId: organizationId
32348
+ },
32349
+ isDictionary: true
32282
32350
  }, {
32283
32351
  headerName: 'backoffice.idmEnricher.packages.label.name',
32284
32352
  field: 'name',
32285
- required: true
32353
+ required: true,
32354
+ editable: isEditable
32286
32355
  }, {
32287
32356
  headerName: 'backoffice.idmEnricher.packages.label.catalogId',
32288
32357
  field: 'basedCatalogId',
32289
32358
  cellDataType: 'lookup',
32290
32359
  editable: function editable(_ref6) {
32291
32360
  var data = _ref6.data;
32292
- return !data.basedCatalogId && !data.basedPackageId;
32361
+ return isEditable(data) && !data.basedCatalogId && !data.basedPackageId;
32293
32362
  },
32294
32363
  customParams: {
32295
32364
  filterCellType: 'objectId',
@@ -32317,7 +32386,7 @@ var TablePackages = observer(function () {
32317
32386
  cellDataType: 'lookup',
32318
32387
  editable: function editable(_ref7) {
32319
32388
  var data = _ref7.data;
32320
- return !data.basedCatalogId && !data.basedPackageId;
32389
+ return isEditable(data) && !data.basedCatalogId && !data.basedPackageId;
32321
32390
  },
32322
32391
  customParams: {
32323
32392
  filterCellType: 'objectId',
@@ -32346,13 +32415,43 @@ var TablePackages = observer(function () {
32346
32415
  field: 'isoLanguageIds',
32347
32416
  headerName: 'backoffice.idmCatalog.general.label.isoLanguageIds',
32348
32417
  cellDataType: 'enum',
32349
- editable: true,
32418
+ editable: isEditable,
32350
32419
  required: true,
32351
32420
  customParams: {
32352
32421
  enumData: getLanguageKey(t),
32353
32422
  multiple: true
32354
32423
  },
32355
32424
  defaultValue: ['DE']
32425
+ }, {
32426
+ field: 'allowedOrganizationIds',
32427
+ headerName: 'backoffice.idmEnricher.packages.label.allowedOrganizationIds',
32428
+ cellDataType: 'lookup',
32429
+ editable: isEditable,
32430
+ cellRendererSelector: function cellRendererSelector(params) {
32431
+ var _params$data3, _params$data4;
32432
+ if (((_params$data3 = params.data) === null || _params$data3 === void 0 ? void 0 : _params$data3.organizationId) === organizationId || !((_params$data4 = params.data) !== null && _params$data4 !== void 0 && _params$data4._id)) {
32433
+ return undefined;
32434
+ }
32435
+ return {
32436
+ component: function component() {
32437
+ var _params$data$organiza, _params$data5, _params$data6;
32438
+ return /*#__PURE__*/jsxs("p", {
32439
+ children: ["Freigegeben durch ", (_params$data$organiza = (_params$data5 = params.data) === null || _params$data5 === void 0 ? void 0 : _params$data5.organizationDisplayText) !== null && _params$data$organiza !== void 0 ? _params$data$organiza : (_params$data6 = params.data) === null || _params$data6 === void 0 ? void 0 : _params$data6.organizationId]
32440
+ });
32441
+ }
32442
+ };
32443
+ },
32444
+ customParams: {
32445
+ nameField: 'allowedOrganizationsDisplayTexts',
32446
+ apiInterface: {
32447
+ read: apiConfig.authService + "/clientrelationtargets/organization/".concat(organizationId, "/organizations")
32448
+ },
32449
+ lookupValue: 'displayName',
32450
+ lookupKey: '_id',
32451
+ serverType: 'nodejs',
32452
+ multiple: true
32453
+ },
32454
+ additionalFields: ['allowedOrganizationsDisplayTexts']
32356
32455
  }, {
32357
32456
  headerName: 'backoffice.idmEnricher.packages.label.isApi2',
32358
32457
  field: 'isApi',
@@ -32370,9 +32469,10 @@ var TablePackages = observer(function () {
32370
32469
  editable: false
32371
32470
  }, {
32372
32471
  headerName: 'backoffice.idmEnricher.packages.label.publishDate',
32373
- field: 'publishDate',
32472
+ field: "published.".concat(organizationId, ".publishDate"),
32374
32473
  cellDataType: 'dateString',
32375
- editable: false
32474
+ editable: false,
32475
+ isDictionary: true
32376
32476
  }, {
32377
32477
  headerName: 'backoffice.idmEnricher.general.label.createdBy',
32378
32478
  field: 'createdByDisplayText',
@@ -32383,8 +32483,9 @@ var TablePackages = observer(function () {
32383
32483
  editable: false
32384
32484
  }, {
32385
32485
  headerName: 'backoffice.idmEnricher.packages.label.publishedBy',
32386
- field: 'publishedByDisplayText',
32387
- editable: false
32486
+ field: "published.".concat(organizationId, ".publishedByDisplayText"),
32487
+ editable: false,
32488
+ isDictionary: true
32388
32489
  }, {
32389
32490
  headerName: 'backoffice.idmEnricher.general.label._id',
32390
32491
  field: '_id',
@@ -32397,9 +32498,26 @@ var TablePackages = observer(function () {
32397
32498
  lockVisible: true,
32398
32499
  suppressColumnsToolPanel: true,
32399
32500
  defaultValue: '${organizationId}'
32501
+ }, {
32502
+ field: 'organizationDisplayText',
32503
+ editable: false,
32504
+ hide: true,
32505
+ lockVisible: true,
32506
+ suppressColumnsToolPanel: true,
32507
+ defaultValue: '${organizationDisplayText}'
32508
+ }, {
32509
+ field: 'removedOrganizationIds',
32510
+ editable: false,
32511
+ hide: true,
32512
+ lockVisible: true,
32513
+ suppressColumnsToolPanel: true
32400
32514
  }]
32401
32515
  };
32402
- }, [apiInterface, apiConfig, i18n.language]);
32516
+ }, [apiInterface, apiConfig, i18n.language, organizationId]);
32517
+ var isRowEditable = useCallback(function (node) {
32518
+ var _node$data, _node$data2;
32519
+ return ((_node$data = node.data) === null || _node$data === void 0 ? void 0 : _node$data.organizationId) === organizationId || !((_node$data2 = node.data) !== null && _node$data2 !== void 0 && _node$data2._id);
32520
+ }, [organizationId]);
32403
32521
  return /*#__PURE__*/jsxs(Fragment, {
32404
32522
  children: [/*#__PURE__*/jsx(Descriptions$1, {
32405
32523
  title: t('backoffice.menu.items.label.IDMEnricherTablePackages')
@@ -32407,8 +32525,8 @@ var TablePackages = observer(function () {
32407
32525
  gridId: 'packages-grid',
32408
32526
  applicationData: applicationData,
32409
32527
  rowActions: rowActions,
32410
- preFilter: preFilter,
32411
- configuration: configuration
32528
+ configuration: configuration,
32529
+ isRowEditable: isRowEditable
32412
32530
  }), contextHolder]
32413
32531
  });
32414
32532
  });
@@ -32420,10 +32538,11 @@ var TableProperties = observer(function () {
32420
32538
  packageId = _useModule.packageId,
32421
32539
  organizationId = _useModule.organizationId,
32422
32540
  apiConfig = _useModule.apiConfig,
32423
- selectedPackage = _useModule.selectedPackage;
32541
+ selectedPackage = _useModule.selectedPackage,
32542
+ viewOnly = _useModule.viewOnly;
32424
32543
  useTools({
32425
32544
  packageId: packageId,
32426
- isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
32545
+ isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi
32427
32546
  });
32428
32547
  var applicationData = useMemo(function () {
32429
32548
  return {
@@ -32434,10 +32553,10 @@ var TableProperties = observer(function () {
32434
32553
  var apiInterface = useMemo(function () {
32435
32554
  return {
32436
32555
  read: apiConfig.enricherService + '/packages/${packageId}/properties',
32437
- create: apiConfig.enricherService + '/packages/${packageId}/properties',
32438
- restore: apiConfig.enricherService + '/packages/${packageId}/properties/${_id}',
32439
- "delete": apiConfig.enricherService + '/packages/${packageId}/properties/${_id}',
32440
- update: apiConfig.enricherService + '/packages/${packageId}/properties/${_id}',
32556
+ create: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/properties',
32557
+ restore: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/properties/${_id}',
32558
+ "delete": viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/properties/${_id}',
32559
+ update: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/properties/${_id}',
32441
32560
  bulk: apiConfig.enricherService + '/packages/${packageId}/properties/bulk'
32442
32561
  };
32443
32562
  }, []);
@@ -32455,7 +32574,7 @@ var TableProperties = observer(function () {
32455
32574
  field: 'featureNos',
32456
32575
  headerName: 'backoffice.idmEnricher.renaming.label.featureNr',
32457
32576
  cellDataType: 'lookup',
32458
- editable: true,
32577
+ editable: !viewOnly,
32459
32578
  customParams: {
32460
32579
  nameField: 'featureNosDisplayTexts',
32461
32580
  displayLabelTemplate: '${name} (${value})',
@@ -32473,7 +32592,7 @@ var TableProperties = observer(function () {
32473
32592
  field: 'optionKeys',
32474
32593
  headerName: 'backoffice.idmEnricher.renaming.label.optionKeys',
32475
32594
  cellDataType: 'lookup',
32476
- editable: true,
32595
+ editable: !viewOnly,
32477
32596
  customParams: {
32478
32597
  nameField: 'optionKeysDisplayTexts',
32479
32598
  displayLabelTemplate: '${name} (${value})',
@@ -32497,7 +32616,7 @@ var TableProperties = observer(function () {
32497
32616
  field: 'serieNos',
32498
32617
  headerName: 'backoffice.idmEnricher.renaming.label.serieNos',
32499
32618
  cellDataType: 'lookup',
32500
- editable: true,
32619
+ editable: !viewOnly,
32501
32620
  customParams: {
32502
32621
  filterCellType: 'number',
32503
32622
  nameField: 'serieNosDisplayTexts',
@@ -32520,7 +32639,7 @@ var TableProperties = observer(function () {
32520
32639
  field: 'typeNos',
32521
32640
  headerName: 'backoffice.idmEnricher.properties.label.typeNos',
32522
32641
  cellDataType: 'lookup',
32523
- editable: true,
32642
+ editable: !viewOnly,
32524
32643
  customParams: {
32525
32644
  nameField: 'typeNosDisplayTexts',
32526
32645
  displayLabelTemplate: '${name} (${value})',
@@ -32575,7 +32694,7 @@ var TableProperties = observer(function () {
32575
32694
  cellDataType: 'objectId'
32576
32695
  }]
32577
32696
  };
32578
- }, [apiInterface, t, selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds]);
32697
+ }, [apiInterface, t, selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds, viewOnly]);
32579
32698
  return /*#__PURE__*/jsxs(Fragment, {
32580
32699
  children: [/*#__PURE__*/jsx(Descriptions$1, {
32581
32700
  title: /*#__PURE__*/jsxs("div", {
@@ -32596,7 +32715,7 @@ var TableProperties = observer(function () {
32596
32715
  });
32597
32716
  });
32598
32717
 
32599
- var getConfig$6 = function getConfig(isoLanguageIds, t) {
32718
+ var getConfig$6 = function getConfig(isoLanguageIds, t, viewOnly) {
32600
32719
  return {
32601
32720
  colDef: [{
32602
32721
  field: 'translatedName',
@@ -32606,7 +32725,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32606
32725
  placeHolderField: 'origName',
32607
32726
  combinedField: 'name'
32608
32727
  },
32609
- additionalFields: ['origName', 'name']
32728
+ additionalFields: ['origName', 'name'],
32729
+ editable: !viewOnly
32610
32730
  }, {
32611
32731
  field: 'translatedComment',
32612
32732
  cellDataType: 'withPlaceholder',
@@ -32615,14 +32735,15 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32615
32735
  placeHolderField: 'origComment',
32616
32736
  combinedField: 'comment'
32617
32737
  },
32618
- additionalFields: ['origComment', 'comment']
32738
+ additionalFields: ['origComment', 'comment'],
32739
+ editable: !viewOnly
32619
32740
  }, createTranslatedColumnConfig('translatedCatalogName', 'backoffice.idmEnricher.renaming.label.catalogName', isoLanguageIds, false, 'withPlaceholder', {
32620
32741
  placeHolderField: 'origCatalogName',
32621
32742
  combinedField: 'catalogName'
32622
- }, ['origCatalogName', 'catalogName']), createTranslatedColumnConfig('translatedCatalogInfo', 'backoffice.idmEnricher.renaming.label.catalogInfo', isoLanguageIds, false, 'withPlaceholder', {
32743
+ }, ['origCatalogName', 'catalogName'], !viewOnly), createTranslatedColumnConfig('translatedCatalogInfo', 'backoffice.idmEnricher.renaming.label.catalogInfo', isoLanguageIds, false, 'withPlaceholder', {
32623
32744
  placeHolderField: 'origCatalogInfo',
32624
32745
  combinedField: 'catalogInfo'
32625
- }, ['origCatalogInfo', 'catalogInfo']), {
32746
+ }, ['origCatalogInfo', 'catalogInfo'], !viewOnly), {
32626
32747
  headerName: 'backoffice.idmEnricher.renaming.label.contactperson',
32627
32748
  field: 'translatedContactPersonNo1',
32628
32749
  cellDataType: 'withPlaceholder',
@@ -32630,7 +32751,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32630
32751
  placeHolderField: 'origContactPersonNo1',
32631
32752
  combinedField: 'contactPersonNo1'
32632
32753
  },
32633
- additionalFields: ['origContactPersonNo1', 'contactPersonNo1']
32754
+ additionalFields: ['origContactPersonNo1', 'contactPersonNo1'],
32755
+ editable: !viewOnly
32634
32756
  }, {
32635
32757
  headerName: 'backoffice.idmEnricher.renaming.label.contactrole',
32636
32758
  field: 'translatedContactRole1',
@@ -32639,7 +32761,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32639
32761
  placeHolderField: 'origContactRole1',
32640
32762
  combinedField: 'contactRole1'
32641
32763
  },
32642
- additionalFields: ['origContactRole1', 'contactRole1']
32764
+ additionalFields: ['origContactRole1', 'contactRole1'],
32765
+ editable: !viewOnly
32643
32766
  }, {
32644
32767
  headerName: 'backoffice.idmEnricher.renaming.label.translated.contactname',
32645
32768
  field: 'translatedContactName1',
@@ -32648,7 +32771,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32648
32771
  placeHolderField: 'origContactName1',
32649
32772
  combinedField: 'contactName1'
32650
32773
  },
32651
- additionalFields: ['origContactName1', 'contactName1']
32774
+ additionalFields: ['origContactName1', 'contactName1'],
32775
+ editable: !viewOnly
32652
32776
  }, {
32653
32777
  headerName: 'backoffice.idmEnricher.renaming.label.translated.firstname',
32654
32778
  field: 'translatedFirstName1',
@@ -32657,7 +32781,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32657
32781
  placeHolderField: 'origFirstName1',
32658
32782
  combinedField: 'firstName1'
32659
32783
  },
32660
- additionalFields: ['origFirstName1', 'firstName1']
32784
+ additionalFields: ['origFirstName1', 'firstName1'],
32785
+ editable: !viewOnly
32661
32786
  }, {
32662
32787
  headerName: 'backoffice.idmEnricher.renaming.label.translated.form_of_address',
32663
32788
  field: 'translatedFormOfAddress1',
@@ -32669,7 +32794,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32669
32794
  enumData: getFormOfAddressKey(t),
32670
32795
  displayLabelTemplate: '${name} (${value})'
32671
32796
  },
32672
- additionalFields: ['origFormOfAddress1', 'formOfAddress1']
32797
+ additionalFields: ['origFormOfAddress1', 'formOfAddress1'],
32798
+ editable: !viewOnly
32673
32799
  }, {
32674
32800
  headerName: 'backoffice.idmEnricher.renaming.label.translated.department',
32675
32801
  field: 'translatedDepartment1',
@@ -32678,7 +32804,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32678
32804
  placeHolderField: 'origDepartment1',
32679
32805
  combinedField: 'department1'
32680
32806
  },
32681
- additionalFields: ['origDepartment1', 'department1']
32807
+ additionalFields: ['origDepartment1', 'department1'],
32808
+ editable: !viewOnly
32682
32809
  }, {
32683
32810
  headerName: 'backoffice.idmEnricher.renaming.label.translated.telephone',
32684
32811
  field: 'translatedTelephone1',
@@ -32687,7 +32814,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32687
32814
  placeHolderField: 'origTelephone1',
32688
32815
  combinedField: 'telephone1'
32689
32816
  },
32690
- additionalFields: ['origTelephone1', 'telephone1']
32817
+ additionalFields: ['origTelephone1', 'telephone1'],
32818
+ editable: !viewOnly
32691
32819
  }, {
32692
32820
  headerName: 'backoffice.idmEnricher.renaming.label.translated.fax',
32693
32821
  field: 'translatedFax1',
@@ -32696,7 +32824,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32696
32824
  placeHolderField: 'origFax1',
32697
32825
  combinedField: 'fax1'
32698
32826
  },
32699
- additionalFields: ['origFax1', 'fax1']
32827
+ additionalFields: ['origFax1', 'fax1'],
32828
+ editable: !viewOnly
32700
32829
  }, {
32701
32830
  field: 'translatedEmail1',
32702
32831
  headerName: 'backoffice.idmEnricher.renaming.label.translated.email',
@@ -32705,7 +32834,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32705
32834
  placeHolderField: 'origEmail1',
32706
32835
  combinedField: 'email1'
32707
32836
  },
32708
- additionalFields: ['origEmail1', 'email1']
32837
+ additionalFields: ['origEmail1', 'email1'],
32838
+ editable: !viewOnly
32709
32839
  }, {
32710
32840
  headerName: 'backoffice.idmEnricher.renaming.label.translated.street',
32711
32841
  field: 'translatedStreet1',
@@ -32714,7 +32844,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32714
32844
  placeHolderField: 'origStreet1',
32715
32845
  combinedField: 'street1'
32716
32846
  },
32717
- additionalFields: ['origStreet1', 'street1']
32847
+ additionalFields: ['origStreet1', 'street1'],
32848
+ editable: !viewOnly
32718
32849
  }, {
32719
32850
  headerName: 'backoffice.idmEnricher.renaming.label.translated.zip',
32720
32851
  field: 'translatedZipCodeStreet1',
@@ -32723,7 +32854,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32723
32854
  placeHolderField: 'origZipCodeStreet1',
32724
32855
  combinedField: 'zipCodeStreet1'
32725
32856
  },
32726
- additionalFields: ['origZipCodeStreet1', 'zipCodeStreet1']
32857
+ additionalFields: ['origZipCodeStreet1', 'zipCodeStreet1'],
32858
+ editable: !viewOnly
32727
32859
  }, {
32728
32860
  field: 'translatedCity1',
32729
32861
  headerName: 'backoffice.idmEnricher.renaming.label.translated.city',
@@ -32732,7 +32864,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32732
32864
  placeHolderField: 'origCity1',
32733
32865
  combinedField: 'city1'
32734
32866
  },
32735
- additionalFields: ['origCity1', 'city1']
32867
+ additionalFields: ['origCity1', 'city1'],
32868
+ editable: !viewOnly
32736
32869
  }, {
32737
32870
  field: 'translatedIsoCountryId1',
32738
32871
  headerName: 'backoffice.idmEnricher.renaming.label.translated.country',
@@ -32743,7 +32876,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32743
32876
  combinedField: 'isoCountryId1',
32744
32877
  enumData: getCountryKey(t)
32745
32878
  },
32746
- additionalFields: ['origIsoCountryId1', 'isoCountryId1']
32879
+ additionalFields: ['origIsoCountryId1', 'isoCountryId1'],
32880
+ editable: !viewOnly
32747
32881
  }, {
32748
32882
  field: 'translatedContactPersonNo2',
32749
32883
  headerName: 'backoffice.idmEnricher.renaming.label.contactperson2',
@@ -32752,7 +32886,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32752
32886
  placeHolderField: 'origContactPersonNo2',
32753
32887
  combinedField: 'contactPersonNo2'
32754
32888
  },
32755
- additionalFields: ['origContactPersonNo2', 'contactPersonNo2']
32889
+ additionalFields: ['origContactPersonNo2', 'contactPersonNo2'],
32890
+ editable: !viewOnly
32756
32891
  }, {
32757
32892
  headerName: 'backoffice.idmEnricher.renaming.label.contactrole2',
32758
32893
  field: 'translatedContactRole2',
@@ -32761,7 +32896,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32761
32896
  placeHolderField: 'origContactRole2',
32762
32897
  combinedField: 'contactRole2'
32763
32898
  },
32764
- additionalFields: ['origContactRole2', 'contactRole2']
32899
+ additionalFields: ['origContactRole2', 'contactRole2'],
32900
+ editable: !viewOnly
32765
32901
  }, {
32766
32902
  headerName: 'backoffice.idmEnricher.renaming.label.translated.contactname2',
32767
32903
  field: 'translatedContactName2',
@@ -32770,7 +32906,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32770
32906
  placeHolderField: 'origContactName2',
32771
32907
  combinedField: 'contactName2'
32772
32908
  },
32773
- additionalFields: ['origContactName2', 'contactName2']
32909
+ additionalFields: ['origContactName2', 'contactName2'],
32910
+ editable: !viewOnly
32774
32911
  }, {
32775
32912
  headerName: 'backoffice.idmEnricher.renaming.label.translated.firstname2',
32776
32913
  field: 'translatedFirstName2',
@@ -32779,7 +32916,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32779
32916
  placeHolderField: 'origFirstName2',
32780
32917
  combinedField: 'firstName2'
32781
32918
  },
32782
- additionalFields: ['origFirstName2', 'firstName2']
32919
+ additionalFields: ['origFirstName2', 'firstName2'],
32920
+ editable: !viewOnly
32783
32921
  }, {
32784
32922
  headerName: 'backoffice.idmEnricher.renaming.label.translated.form_of_address2',
32785
32923
  field: 'translatedFormOfAddress2',
@@ -32791,7 +32929,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32791
32929
  enumData: getFormOfAddressKey(t),
32792
32930
  displayLabelTemplate: '${name} (${value})'
32793
32931
  },
32794
- additionalFields: ['origFormOfAddress2', 'formOfAddress2']
32932
+ additionalFields: ['origFormOfAddress2', 'formOfAddress2'],
32933
+ editable: !viewOnly
32795
32934
  }, {
32796
32935
  headerName: 'backoffice.idmEnricher.renaming.label.translated.department2',
32797
32936
  field: 'translatedDepartment2',
@@ -32800,7 +32939,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32800
32939
  placeHolderField: 'origDepartment2',
32801
32940
  combinedField: 'department2'
32802
32941
  },
32803
- additionalFields: ['origDepartment2', 'department2']
32942
+ additionalFields: ['origDepartment2', 'department2'],
32943
+ editable: !viewOnly
32804
32944
  }, {
32805
32945
  headerName: 'backoffice.idmEnricher.renaming.label.translated.telephone2',
32806
32946
  field: 'translatedTelephone2',
@@ -32809,7 +32949,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32809
32949
  placeHolderField: 'origTelephone2',
32810
32950
  combinedField: 'telephone2'
32811
32951
  },
32812
- additionalFields: ['origTelephone2', 'telephone2']
32952
+ additionalFields: ['origTelephone2', 'telephone2'],
32953
+ editable: !viewOnly
32813
32954
  }, {
32814
32955
  headerName: 'backoffice.idmEnricher.renaming.label.translated.fax2',
32815
32956
  field: 'translatedFax2',
@@ -32818,7 +32959,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32818
32959
  placeHolderField: 'origFax2',
32819
32960
  combinedField: 'fax2'
32820
32961
  },
32821
- additionalFields: ['origFax2', 'fax2']
32962
+ additionalFields: ['origFax2', 'fax2'],
32963
+ editable: !viewOnly
32822
32964
  }, {
32823
32965
  headerName: 'backoffice.idmEnricher.renaming.label.translated.email2',
32824
32966
  field: 'translatedEmail2',
@@ -32827,7 +32969,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32827
32969
  placeHolderField: 'origEmail2',
32828
32970
  combinedField: 'email2'
32829
32971
  },
32830
- additionalFields: ['origEmail2', 'email2']
32972
+ additionalFields: ['origEmail2', 'email2'],
32973
+ editable: !viewOnly
32831
32974
  }, {
32832
32975
  headerName: 'backoffice.idmEnricher.renaming.label.translated.street2',
32833
32976
  field: 'translatedStreet2',
@@ -32836,7 +32979,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32836
32979
  placeHolderField: 'origStreet2',
32837
32980
  combinedField: 'street2'
32838
32981
  },
32839
- additionalFields: ['origStreet2', 'street2']
32982
+ additionalFields: ['origStreet2', 'street2'],
32983
+ editable: !viewOnly
32840
32984
  }, {
32841
32985
  headerName: 'backoffice.idmEnricher.renaming.label.translated.zip2',
32842
32986
  field: 'translatedZipCodeStreet2',
@@ -32845,7 +32989,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32845
32989
  placeHolderField: 'origZipCodeStreet2',
32846
32990
  combinedField: 'zipCodeStreet2'
32847
32991
  },
32848
- additionalFields: ['origZipCodeStreet2', 'zipCodeStreet2']
32992
+ additionalFields: ['origZipCodeStreet2', 'zipCodeStreet2'],
32993
+ editable: !viewOnly
32849
32994
  }, {
32850
32995
  headerName: 'backoffice.idmEnricher.renaming.label.translated.city2',
32851
32996
  field: 'translatedCity2',
@@ -32854,11 +32999,11 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32854
32999
  placeHolderField: 'origCity2',
32855
33000
  combinedField: 'city2'
32856
33001
  },
32857
- additionalFields: ['origCity2', 'city2']
33002
+ additionalFields: ['origCity2', 'city2'],
33003
+ editable: !viewOnly
32858
33004
  }, {
32859
33005
  headerName: 'backoffice.idmEnricher.renaming.label.translated.country2',
32860
33006
  field: 'translatedIsoCountryId2',
32861
- editable: true,
32862
33007
  cellDataType: 'withPlaceholder',
32863
33008
  type: ['withPlaceholderEnum'],
32864
33009
  customParams: {
@@ -32866,7 +33011,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32866
33011
  combinedField: 'isoCountryId2',
32867
33012
  enumData: getCountryKey(t)
32868
33013
  },
32869
- additionalFields: ['origIsoCountryId2', 'isoCountryId2']
33014
+ additionalFields: ['origIsoCountryId2', 'isoCountryId2'],
33015
+ editable: !viewOnly
32870
33016
  }, {
32871
33017
  headerName: 'backoffice.idmEnricher.renaming.label.translated.manufacturename',
32872
33018
  field: 'translatedManufactureName1',
@@ -32875,7 +33021,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32875
33021
  placeHolderField: 'origManufactureName1',
32876
33022
  combinedField: 'manufactureName1'
32877
33023
  },
32878
- additionalFields: ['origManufactureName1', 'manufactureName1']
33024
+ additionalFields: ['origManufactureName1', 'manufactureName1'],
33025
+ editable: !viewOnly
32879
33026
  }, {
32880
33027
  headerName: 'backoffice.idmEnricher.renaming.label.translated.manufacturename2',
32881
33028
  field: 'translatedManufactureName2',
@@ -32884,7 +33031,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32884
33031
  placeHolderField: 'origManufactureName2',
32885
33032
  combinedField: 'manufactureName2'
32886
33033
  },
32887
- additionalFields: ['origManufactureName2', 'manufactureName2']
33034
+ additionalFields: ['origManufactureName2', 'manufactureName2'],
33035
+ editable: !viewOnly
32888
33036
  }, {
32889
33037
  headerName: 'backoffice.idmEnricher.renaming.label.translated.email',
32890
33038
  field: 'translatedEmail',
@@ -32893,7 +33041,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32893
33041
  placeHolderField: 'origEmail',
32894
33042
  combinedField: 'email'
32895
33043
  },
32896
- additionalFields: ['origEmail', 'email']
33044
+ additionalFields: ['origEmail', 'email'],
33045
+ editable: !viewOnly
32897
33046
  }, {
32898
33047
  headerName: 'backoffice.idmEnricher.renaming.label.translated.internetaddress',
32899
33048
  field: 'translatedInternetAddress',
@@ -32902,7 +33051,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32902
33051
  placeHolderField: 'origInternetAddress',
32903
33052
  combinedField: 'internetAddress'
32904
33053
  },
32905
- additionalFields: ['origInternetAddress', 'internetAddress']
33054
+ additionalFields: ['origInternetAddress', 'internetAddress'],
33055
+ editable: !viewOnly
32906
33056
  }, {
32907
33057
  headerName: 'backoffice.idmEnricher.renaming.label.translated.street',
32908
33058
  field: 'translatedStreet',
@@ -32911,7 +33061,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32911
33061
  placeHolderField: 'origStreet',
32912
33062
  combinedField: 'street'
32913
33063
  },
32914
- additionalFields: ['origStreet', 'street']
33064
+ additionalFields: ['origStreet', 'street'],
33065
+ editable: !viewOnly
32915
33066
  }, {
32916
33067
  headerName: 'backoffice.idmEnricher.renaming.label.translated.zip',
32917
33068
  field: 'translatedZipCodeStreet',
@@ -32920,7 +33071,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32920
33071
  placeHolderField: 'origZipCodeStreet',
32921
33072
  combinedField: 'zipCodeStreet'
32922
33073
  },
32923
- additionalFields: ['origZipCodeStreet', 'zipCodeStreet']
33074
+ additionalFields: ['origZipCodeStreet', 'zipCodeStreet'],
33075
+ editable: !viewOnly
32924
33076
  }, {
32925
33077
  headerName: 'backoffice.idmEnricher.renaming.label.translated.city',
32926
33078
  field: 'translatedCity',
@@ -32929,11 +33081,11 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32929
33081
  placeHolderField: 'origCity',
32930
33082
  combinedField: 'city'
32931
33083
  },
32932
- additionalFields: ['origCity', 'city']
33084
+ additionalFields: ['origCity', 'city'],
33085
+ editable: !viewOnly
32933
33086
  }, {
32934
33087
  headerName: 'backoffice.idmEnricher.renaming.label.translated.country',
32935
33088
  field: 'translatedContactSupplierIsoCountryId',
32936
- editable: true,
32937
33089
  cellDataType: 'withPlaceholder',
32938
33090
  type: ['withPlaceholderEnum'],
32939
33091
  customParams: {
@@ -32941,7 +33093,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32941
33093
  combinedField: 'contactSupplierIsoCountryId',
32942
33094
  enumData: getCountryKey(t)
32943
33095
  },
32944
- additionalFields: ['origContactSupplierIsoCountryId', 'contactSupplierIsoCountryId']
33096
+ additionalFields: ['origContactSupplierIsoCountryId', 'contactSupplierIsoCountryId'],
33097
+ editable: !viewOnly
32945
33098
  }, {
32946
33099
  headerName: 'backoffice.idmEnricher.renaming.label.translated.zippostbox',
32947
33100
  field: 'translatedZipCodePostBox',
@@ -32950,7 +33103,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32950
33103
  placeHolderField: 'origZipCodePostBox',
32951
33104
  combinedField: 'zipCodePostBox'
32952
33105
  },
32953
- additionalFields: ['origZipCodePostBox', 'zipCodePostBox']
33106
+ additionalFields: ['origZipCodePostBox', 'zipCodePostBox'],
33107
+ editable: !viewOnly
32954
33108
  }, {
32955
33109
  headerName: 'backoffice.idmEnricher.renaming.label.translated.postbox',
32956
33110
  field: 'translatedPostBox',
@@ -32959,7 +33113,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32959
33113
  placeHolderField: 'origPostBox',
32960
33114
  combinedField: 'postBox'
32961
33115
  },
32962
- additionalFields: ['origPostBox', 'postBox']
33116
+ additionalFields: ['origPostBox', 'postBox'],
33117
+ editable: !viewOnly
32963
33118
  }, {
32964
33119
  headerName: 'backoffice.idmEnricher.renaming.label.translated.telephoneswitchboard',
32965
33120
  field: 'translatedTelephoneSwitchboard',
@@ -32968,7 +33123,8 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32968
33123
  placeHolderField: 'origTelephoneSwitchboard',
32969
33124
  combinedField: 'telephoneSwitchboard'
32970
33125
  },
32971
- additionalFields: ['origTelephoneSwitchboard', 'telephoneSwitchboard']
33126
+ additionalFields: ['origTelephoneSwitchboard', 'telephoneSwitchboard'],
33127
+ editable: !viewOnly
32972
33128
  }, {
32973
33129
  headerName: 'backoffice.idmEnricher.renaming.label.translated.faxswitchboard',
32974
33130
  field: 'translatedFaxSwitchboard',
@@ -32977,12 +33133,13 @@ var getConfig$6 = function getConfig(isoLanguageIds, t) {
32977
33133
  placeHolderField: 'origFaxSwitchboard',
32978
33134
  combinedField: 'faxSwitchboard'
32979
33135
  },
32980
- additionalFields: ['origFaxSwitchboard', 'faxSwitchboard']
33136
+ additionalFields: ['origFaxSwitchboard', 'faxSwitchboard'],
33137
+ editable: !viewOnly
32981
33138
  }]
32982
33139
  };
32983
33140
  };
32984
33141
 
32985
- var getConfig$5 = function getConfig(isoLanguageIds) {
33142
+ var getConfig$5 = function getConfig(isoLanguageIds, t, viewOnly) {
32986
33143
  return {
32987
33144
  colDef: [{
32988
33145
  headerName: 'backoffice.idmEnricher.renaming.label.detailinfo_nr',
@@ -32991,17 +33148,17 @@ var getConfig$5 = function getConfig(isoLanguageIds) {
32991
33148
  }, createTranslatedColumnConfig('translatedExternalName', 'backoffice.idmEnricher.renaming.label.externalName', isoLanguageIds, false, 'withPlaceholder', {
32992
33149
  placeHolderField: 'origExternalName',
32993
33150
  combinedField: 'externalName'
32994
- }, ['origExternalName', 'externalName']), createTranslatedColumnConfig('translatedInternalName', 'backoffice.idmEnricher.renaming.label.internalName', isoLanguageIds, false, 'withPlaceholder', {
33151
+ }, ['origExternalName', 'externalName'], !viewOnly), createTranslatedColumnConfig('translatedInternalName', 'backoffice.idmEnricher.renaming.label.internalName', isoLanguageIds, false, 'withPlaceholder', {
32995
33152
  placeHolderField: 'origInternalName',
32996
33153
  combinedField: 'internalName'
32997
- }, ['origInternalName', 'internalName']), createTranslatedColumnConfig('translatedToolTip', 'backoffice.idmEnricher.renaming.label.tooltip', isoLanguageIds, false, 'withPlaceholder', {
33154
+ }, ['origInternalName', 'internalName'], !viewOnly), createTranslatedColumnConfig('translatedToolTip', 'backoffice.idmEnricher.renaming.label.tooltip', isoLanguageIds, false, 'withPlaceholder', {
32998
33155
  placeHolderField: 'origToolTip',
32999
33156
  combinedField: 'toolTip'
33000
- }, ['origToolTip', 'toolTip'])]
33157
+ }, ['origToolTip', 'toolTip'], !viewOnly)]
33001
33158
  };
33002
33159
  };
33003
33160
 
33004
- var getConfig$4 = function getConfig(isoLanguageIds) {
33161
+ var getConfig$4 = function getConfig(isoLanguageIds, t, viewOnly) {
33005
33162
  return {
33006
33163
  colDef: [{
33007
33164
  headerName: 'backoffice.idmEnricher.renaming.label.featureNr',
@@ -33012,11 +33169,11 @@ var getConfig$4 = function getConfig(isoLanguageIds) {
33012
33169
  }, createTranslatedColumnConfig('translatedFeatureText', 'backoffice.idmEnricher.renaming.label.featuretext', isoLanguageIds, false, 'withPlaceholder', {
33013
33170
  placeHolderField: 'origFeatureText',
33014
33171
  combinedField: 'featureText'
33015
- }, ['origFeatureText', 'featureText'])]
33172
+ }, ['origFeatureText', 'featureText'], !viewOnly)]
33016
33173
  };
33017
33174
  };
33018
33175
 
33019
- var getConfig$3 = function getConfig(isoLanguageIds) {
33176
+ var getConfig$3 = function getConfig(isoLanguageIds, t, viewOnly) {
33020
33177
  return {
33021
33178
  colDef: [{
33022
33179
  headerName: 'backoffice.idmEnricher.renaming.label.typeNo',
@@ -33027,13 +33184,13 @@ var getConfig$3 = function getConfig(isoLanguageIds) {
33027
33184
  }, createTranslatedColumnConfig('translatedShortText', 'backoffice.idmEnricher.renaming.label.shortText', isoLanguageIds, false, 'withPlaceholder', {
33028
33185
  placeHolderField: 'origShortText',
33029
33186
  combinedField: 'shortText'
33030
- }, ['origShortText', 'shortText']), createTranslatedColumnConfig('translatedFullText', 'backoffice.idmEnricher.renaming.label.fullText', isoLanguageIds, false, 'withPlaceholder', {
33187
+ }, ['origShortText', 'shortText'], !viewOnly), createTranslatedColumnConfig('translatedFullText', 'backoffice.idmEnricher.renaming.label.fullText', isoLanguageIds, false, 'withPlaceholder', {
33031
33188
  placeHolderField: 'origFullText',
33032
33189
  combinedField: 'fullText'
33033
- }, ['origFullText', 'fullText']), createTranslatedColumnConfig('translatedPlanningAdvice', 'backoffice.idmEnricher.renaming.label.planningAdvice', isoLanguageIds, false, 'withPlaceholder', {
33190
+ }, ['origFullText', 'fullText'], !viewOnly), createTranslatedColumnConfig('translatedPlanningAdvice', 'backoffice.idmEnricher.renaming.label.planningAdvice', isoLanguageIds, false, 'withPlaceholder', {
33034
33191
  placeHolderField: 'origPlanningAdvice',
33035
33192
  combinedField: 'planningAdvice'
33036
- }, ['origPlanningAdvice', 'planningAdvice']), {
33193
+ }, ['origPlanningAdvice', 'planningAdvice'], !viewOnly), {
33037
33194
  headerName: 'backoffice.idmEnricher.renaming.label.translatedSalesNumber',
33038
33195
  field: 'translatedSalesNumber',
33039
33196
  cellDataType: 'withPlaceholder',
@@ -33041,7 +33198,8 @@ var getConfig$3 = function getConfig(isoLanguageIds) {
33041
33198
  placeHolderField: 'origSalesNumber',
33042
33199
  combinedField: 'salesNumber'
33043
33200
  },
33044
- additionalFields: ['origSalesNumber', 'salesNumber']
33201
+ additionalFields: ['origSalesNumber', 'salesNumber'],
33202
+ editable: !viewOnly
33045
33203
  }, {
33046
33204
  field: 'sequenceNo',
33047
33205
  headerName: 'backoffice.idmEnricher.renaming.label.sequenceNo',
@@ -33055,7 +33213,8 @@ var getConfig$3 = function getConfig(isoLanguageIds) {
33055
33213
  placeHolderField: 'origEdpNumber',
33056
33214
  combinedField: 'edpNumber'
33057
33215
  },
33058
- additionalFields: ['origEdpNumber', 'edpNumber']
33216
+ additionalFields: ['origEdpNumber', 'edpNumber'],
33217
+ editable: !viewOnly
33059
33218
  }, {
33060
33219
  headerName: 'backoffice.idmEnricher.renaming.label.eannummer',
33061
33220
  field: 'translatedEanNumber',
@@ -33064,12 +33223,13 @@ var getConfig$3 = function getConfig(isoLanguageIds) {
33064
33223
  placeHolderField: 'origEanNumber',
33065
33224
  combinedField: 'eanNumber'
33066
33225
  },
33067
- additionalFields: ['origEanNumber', 'eanNumber']
33226
+ additionalFields: ['origEanNumber', 'eanNumber'],
33227
+ editable: !viewOnly
33068
33228
  }]
33069
33229
  };
33070
33230
  };
33071
33231
 
33072
- var getConfig$2 = function getConfig(isoLanguageIds) {
33232
+ var getConfig$2 = function getConfig(isoLanguageIds, t, viewOnly) {
33073
33233
  return {
33074
33234
  colDef: [{
33075
33235
  headerName: 'backoffice.idmEnricher.renaming.label.optionKey',
@@ -33080,10 +33240,10 @@ var getConfig$2 = function getConfig(isoLanguageIds) {
33080
33240
  }, createTranslatedColumnConfig('translatedOptionText', 'backoffice.idmEnricher.renaming.label.optionText', isoLanguageIds, false, 'withPlaceholder', {
33081
33241
  placeHolderField: 'origOptionText',
33082
33242
  combinedField: 'optionText'
33083
- }, ['origOptionText', 'optionText']), createTranslatedColumnConfig('translatedOptionCommentText', 'backoffice.idmEnricher.renaming.label.optionCommentText', isoLanguageIds, false, 'withPlaceholder', {
33243
+ }, ['origOptionText', 'optionText'], !viewOnly), createTranslatedColumnConfig('translatedOptionCommentText', 'backoffice.idmEnricher.renaming.label.optionCommentText', isoLanguageIds, false, 'withPlaceholder', {
33084
33244
  placeHolderField: 'origOptionCommentText',
33085
33245
  combinedField: 'optionCommentText'
33086
- }, ['origOptionCommentText', 'optionCommentText']), {
33246
+ }, ['origOptionCommentText', 'optionCommentText'], !viewOnly), {
33087
33247
  field: 'featureNos',
33088
33248
  headerName: 'backoffice.idmCatalogEditor.catalogoptions.label.featureIds',
33089
33249
  cellDataType: 'lookup',
@@ -33108,7 +33268,7 @@ var getConfig$2 = function getConfig(isoLanguageIds) {
33108
33268
  };
33109
33269
  };
33110
33270
 
33111
- var getConfig$1 = function getConfig(isoLanguageIds) {
33271
+ var getConfig$1 = function getConfig(isoLanguageIds, t, viewOnly) {
33112
33272
  return {
33113
33273
  colDef: [{
33114
33274
  headerName: 'backoffice.idmEnricher.renaming.label.serieNo',
@@ -33119,10 +33279,10 @@ var getConfig$1 = function getConfig(isoLanguageIds) {
33119
33279
  }, createTranslatedColumnConfig('translatedSeriesName', 'backoffice.idmEnricher.renaming.label.serieName', isoLanguageIds, false, 'withPlaceholder', {
33120
33280
  placeHolderField: 'origSeriesName',
33121
33281
  combinedField: 'seriesName'
33122
- }, ['origSeriesName', 'seriesName']), createTranslatedColumnConfig('translatedSeriesFullText', 'backoffice.idmEnricher.renaming.label.serieFullText', isoLanguageIds, false, 'withPlaceholder', {
33282
+ }, ['origSeriesName', 'seriesName'], !viewOnly), createTranslatedColumnConfig('translatedSeriesFullText', 'backoffice.idmEnricher.renaming.label.serieFullText', isoLanguageIds, false, 'withPlaceholder', {
33123
33283
  placeHolderField: 'origSeriesFullText',
33124
33284
  combinedField: 'seriesFullText'
33125
- }, ['origSeriesFullText', 'seriesFullText'])]
33285
+ }, ['origSeriesFullText', 'seriesFullText'], !viewOnly)]
33126
33286
  };
33127
33287
  };
33128
33288
 
@@ -33210,14 +33370,15 @@ var RenamingTable = observer(function (_ref) {
33210
33370
  packageId = _useModule.packageId,
33211
33371
  apiConfig = _useModule.apiConfig,
33212
33372
  selectedPackage = _useModule.selectedPackage,
33213
- selectedSerie = _useModule.selectedSerie;
33373
+ selectedSerie = _useModule.selectedSerie,
33374
+ viewOnly = _useModule.viewOnly;
33375
+ var baseConfiguration = useMemo(function () {
33376
+ return getConfig((selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds) || ['DE'], t, viewOnly);
33377
+ }, [selectedPackage, i18n.language]);
33214
33378
  useTools({
33215
33379
  packageId: packageId,
33216
- isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
33380
+ isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi
33217
33381
  });
33218
- var baseConfiguration = useMemo(function () {
33219
- return getConfig((selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds) || ['DE'], t);
33220
- }, [selectedPackage, i18n.language]);
33221
33382
  var applicationData = useMemo(function () {
33222
33383
  return {
33223
33384
  packageId: packageId
@@ -33243,7 +33404,7 @@ var RenamingTable = observer(function (_ref) {
33243
33404
  var apiInterface = useMemo(function () {
33244
33405
  return {
33245
33406
  read: apiConfig.enricherService + '/packages/${packageId}/renamings/' + type,
33246
- update: apiConfig.enricherService + '/packages/${packageId}/renamings/' + type + '/${_id}',
33407
+ update: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/renamings/' + type + '/${_id}',
33247
33408
  bulk: apiConfig.enricherService + '/packages/${packageId}/renamings/' + type + '/bulk'
33248
33409
  };
33249
33410
  }, [type]);
@@ -33269,7 +33430,7 @@ var RenamingTable = observer(function (_ref) {
33269
33430
  cellDataType: 'objectId'
33270
33431
  }])
33271
33432
  };
33272
- }, [apiInterface, baseConfiguration.colDef]);
33433
+ }, [apiInterface, baseConfiguration.colDef, viewOnly]);
33273
33434
  var showTable = useMemo(function () {
33274
33435
  return selectedPackage && (!['items'].includes(type) || type === 'items' && preFilter);
33275
33436
  }, [type, preFilter, selectedPackage]);
@@ -33774,10 +33935,11 @@ var ExclusivityTable = observer(function (_ref) {
33774
33935
  apiConfig = _useModule.apiConfig,
33775
33936
  organizationId = _useModule.organizationId,
33776
33937
  selectedPackage = _useModule.selectedPackage,
33777
- selectedSerie = _useModule.selectedSerie;
33938
+ selectedSerie = _useModule.selectedSerie,
33939
+ viewOnly = _useModule.viewOnly;
33778
33940
  useTools({
33779
33941
  packageId: packageId,
33780
- isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
33942
+ isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi
33781
33943
  });
33782
33944
  var apiInterface = useMemo(function () {
33783
33945
  var patchId = '${_id}';
@@ -33792,7 +33954,7 @@ var ExclusivityTable = observer(function (_ref) {
33792
33954
  var listType = type === 'eitems' ? 'items' : 'options';
33793
33955
  return {
33794
33956
  read: !['eitems'].includes(type) ? apiConfig.enricherService + '/packages/${packageId}/exclusivities/' + subType : apiConfig.enricherService + '/packages/${packageId}/exclusivities/' + subType + '/${subTypeId}/' + listType,
33795
- update: !['eitems', 'eoptions'].includes(type) ? apiConfig.enricherService + '/packages/${packageId}/exclusivities/' + subType + '/' + patchId : type === 'eoptions' ? apiConfig.enricherService + '/packages/${packageId}/exclusivities/' + subType + '/' + patchId + '?featureNos=' + patchId2 : apiConfig.enricherService + '/packages/${packageId}/exclusivities/' + subType + '/${subTypeId}/' + listType + '/' + patchId
33957
+ update: viewOnly ? undefined : !['eitems', 'eoptions'].includes(type) ? apiConfig.enricherService + '/packages/${packageId}/exclusivities/' + subType + '/' + patchId : type === 'eoptions' ? apiConfig.enricherService + '/packages/${packageId}/exclusivities/' + subType + '/' + patchId + '?featureNos=' + patchId2 : apiConfig.enricherService + '/packages/${packageId}/exclusivities/' + subType + '/${subTypeId}/' + listType + '/' + patchId
33796
33958
  };
33797
33959
  }, [type]);
33798
33960
  var oldDataRef = useRef();
@@ -33821,7 +33983,7 @@ var ExclusivityTable = observer(function (_ref) {
33821
33983
  floatingFilter: true,
33822
33984
  colDef: [{
33823
33985
  field: 'active',
33824
- editable: true,
33986
+ editable: !viewOnly,
33825
33987
  cellDataType: 'boolean',
33826
33988
  pinned: 'left',
33827
33989
  lockPinned: true
@@ -33837,11 +33999,11 @@ var ExclusivityTable = observer(function (_ref) {
33837
33999
  }, {
33838
34000
  headerName: 'backoffice.idmEnricher.general.label._id',
33839
34001
  field: '_id',
33840
- editable: true,
34002
+ editable: false,
33841
34003
  cellDataType: 'objectId'
33842
34004
  }])
33843
34005
  };
33844
- }, [apiInterface, selectedSerie, config.colDef]);
34006
+ }, [apiInterface, selectedSerie, config.colDef, viewOnly]);
33845
34007
  return /*#__PURE__*/jsxs(Fragment, {
33846
34008
  children: [/*#__PURE__*/jsx(Descriptions$1, {
33847
34009
  title: /*#__PURE__*/jsxs("div", {
@@ -33872,10 +34034,11 @@ var TableTabGroups = observer(function () {
33872
34034
  packageId = _useModule.packageId,
33873
34035
  organizationId = _useModule.organizationId,
33874
34036
  apiConfig = _useModule.apiConfig,
33875
- selectedPackage = _useModule.selectedPackage;
34037
+ selectedPackage = _useModule.selectedPackage,
34038
+ viewOnly = _useModule.viewOnly;
33876
34039
  useTools({
33877
34040
  packageId: packageId,
33878
- isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
34041
+ isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi
33879
34042
  });
33880
34043
  var applicationData = useMemo(function () {
33881
34044
  return {
@@ -33887,10 +34050,10 @@ var TableTabGroups = observer(function () {
33887
34050
  return {
33888
34051
  //TODO: Es gibt globale Tabgroups, die vordefiniert sind und pro Enricher Paket nochmals angepasst werden können -endpoint anpassen?
33889
34052
  read: apiConfig.enricherService + '/packages/${packageId}/tabgroups',
33890
- create: apiConfig.enricherService + '/packages/${packageId}/tabgroups',
33891
- restore: apiConfig.enricherService + '/packages/${packageId}/tabgroups/${_id}',
33892
- "delete": apiConfig.enricherService + '/packages/${packageId}/tabgroups/${_id}',
33893
- update: apiConfig.enricherService + '/packages/${packageId}/tabgroups/${_id}',
34053
+ create: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/tabgroups',
34054
+ restore: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/tabgroups/${_id}',
34055
+ "delete": viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/tabgroups/${_id}',
34056
+ update: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/tabgroups/${_id}',
33894
34057
  bulk: apiConfig.enricherService + '/packages/${packageId}/tabgroups/bulk'
33895
34058
  };
33896
34059
  }, []);
@@ -33904,7 +34067,7 @@ var TableTabGroups = observer(function () {
33904
34067
  field: 'featureNos',
33905
34068
  headerName: 'backoffice.idmEnricher.renaming.label.featureNr',
33906
34069
  cellDataType: 'lookup',
33907
- editable: true,
34070
+ editable: !viewOnly,
33908
34071
  customParams: {
33909
34072
  nameField: 'featureNosDisplayTexts',
33910
34073
  displayLabelTemplate: '${name} (${value})',
@@ -33918,7 +34081,7 @@ var TableTabGroups = observer(function () {
33918
34081
  },
33919
34082
  additionalFields: ['featureNosDisplayTexts'],
33920
34083
  isDictionary: true
33921
- }, createTranslatedColumnConfig('name', 'backoffice.idmEnricher.tabgroups.label.name', selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds, true), {
34084
+ }, createTranslatedColumnConfig('name', 'backoffice.idmEnricher.tabgroups.label.name', selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds, !viewOnly), {
33922
34085
  field: 'organizationId',
33923
34086
  editable: false,
33924
34087
  hide: true,
@@ -33948,7 +34111,7 @@ var TableTabGroups = observer(function () {
33948
34111
  cellDataType: 'objectId'
33949
34112
  }]
33950
34113
  };
33951
- }, [apiInterface, selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds]);
34114
+ }, [apiInterface, selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isoLanguageIds, viewOnly]);
33952
34115
  return /*#__PURE__*/jsxs(Fragment, {
33953
34116
  children: [/*#__PURE__*/jsx(Descriptions$1, {
33954
34117
  title: /*#__PURE__*/jsxs("div", {
@@ -33976,10 +34139,11 @@ var TablePartlistPos = observer(function () {
33976
34139
  packageId = _useModule.packageId,
33977
34140
  organizationId = _useModule.organizationId,
33978
34141
  apiConfig = _useModule.apiConfig,
33979
- selectedPackage = _useModule.selectedPackage;
34142
+ selectedPackage = _useModule.selectedPackage,
34143
+ viewOnly = _useModule.viewOnly;
33980
34144
  useTools({
33981
34145
  packageId: packageId,
33982
- isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
34146
+ isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi
33983
34147
  });
33984
34148
  var posInvisibility = useMemo(function () {
33985
34149
  return [{
@@ -34002,10 +34166,10 @@ var TablePartlistPos = observer(function () {
34002
34166
  var apiInterface = useMemo(function () {
34003
34167
  return {
34004
34168
  read: apiConfig.enricherService + '/packages/${packageId}/partlistpos',
34005
- create: apiConfig.enricherService + '/packages/${packageId}/partlistpos',
34006
- restore: apiConfig.enricherService + '/packages/${packageId}/partlistpos/${_id}',
34007
- "delete": apiConfig.enricherService + '/packages/${packageId}/partlistpos/${_id}',
34008
- update: apiConfig.enricherService + '/packages/${packageId}/partlistpos/${_id}',
34169
+ create: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/partlistpos',
34170
+ restore: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/partlistpos/${_id}',
34171
+ "delete": viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/partlistpos/${_id}',
34172
+ update: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/partlistpos/${_id}',
34009
34173
  bulk: apiConfig.enricherService + '/packages/${packageId}/partlistpos/bulk'
34010
34174
  };
34011
34175
  }, []);
@@ -34018,12 +34182,12 @@ var TablePartlistPos = observer(function () {
34018
34182
  colDef: [{
34019
34183
  headerName: 'backoffice.idmEnricher.partlistpos.label.retailPrefix',
34020
34184
  field: 'retailPrefix',
34021
- editable: true,
34185
+ editable: !viewOnly,
34022
34186
  pinned: 'left'
34023
34187
  }, {
34024
34188
  headerName: 'backoffice.idmEnricher.partlistpos.label.retailArtilceNumber',
34025
34189
  field: 'retailArtilceNumber',
34026
- editable: true,
34190
+ editable: !viewOnly,
34027
34191
  pinned: 'left'
34028
34192
  }, {
34029
34193
  headerName: 'backoffice.idmEnricher.partlistpos.label.partlistKey',
@@ -34125,7 +34289,7 @@ var TablePartlistPos = observer(function () {
34125
34289
  cellDataType: 'objectId'
34126
34290
  }]
34127
34291
  };
34128
- }, [apiInterface, posInvisibility]);
34292
+ }, [apiInterface, posInvisibility, viewOnly]);
34129
34293
  return /*#__PURE__*/jsxs(Fragment, {
34130
34294
  children: [/*#__PURE__*/jsx(Descriptions$1, {
34131
34295
  title: /*#__PURE__*/jsxs("div", {
@@ -34710,24 +34874,24 @@ function getPriceFeatureGroups(selectedSerie, language) {
34710
34874
  if (!(selectedSerie !== null && selectedSerie !== void 0 && selectedSerie.pricefeaturegroups)) {
34711
34875
  return [];
34712
34876
  }
34713
- var priceFeatureGroups = (_selectedSerie$pricef = selectedSerie.pricefeaturegroups) === null || _selectedSerie$pricef === void 0 ? void 0 : _selectedSerie$pricef.map(function (priceFeatureGroups, i) {
34877
+ var priceFeatureGroups = (_selectedSerie$pricef = selectedSerie.pricefeaturegroups) === null || _selectedSerie$pricef === void 0 ? void 0 : _selectedSerie$pricef.map(function (priceFeatureGroupKey, i) {
34714
34878
  var _selectedSerie$pricef2, _selectedSerie$pricef3;
34715
34879
  return {
34716
- id: priceFeatureGroups,
34717
- displayText: (_selectedSerie$pricef2 = (_selectedSerie$pricef3 = selectedSerie.pricefeaturegroupsDisplayTexts) === null || _selectedSerie$pricef3 === void 0 || (_selectedSerie$pricef3 = _selectedSerie$pricef3[i]) === null || _selectedSerie$pricef3 === void 0 ? void 0 : _selectedSerie$pricef3[language.toUpperCase()]) !== null && _selectedSerie$pricef2 !== void 0 ? _selectedSerie$pricef2 : priceFeatureGroups,
34880
+ id: 'PRFG' + priceFeatureGroupKey,
34881
+ displayText: (_selectedSerie$pricef2 = (_selectedSerie$pricef3 = selectedSerie.pricefeaturegroupsDisplayTexts) === null || _selectedSerie$pricef3 === void 0 || (_selectedSerie$pricef3 = _selectedSerie$pricef3[i]) === null || _selectedSerie$pricef3 === void 0 ? void 0 : _selectedSerie$pricef3[language.toUpperCase()]) !== null && _selectedSerie$pricef2 !== void 0 ? _selectedSerie$pricef2 : priceFeatureGroupKey,
34718
34882
  keys: [],
34719
34883
  keysDisplayTexts: []
34720
34884
  };
34721
34885
  });
34722
- (_selectedSerie$pricef4 = selectedSerie.pricefeaturegroupsKeys) === null || _selectedSerie$pricef4 === void 0 || _selectedSerie$pricef4.forEach(function (priceFeatureGroupKey, i) {
34723
- var pfgSplit = priceFeatureGroupKey.split('_');
34724
- var pfgId = pfgSplit[0].replace('PRFG', '');
34886
+ (_selectedSerie$pricef4 = selectedSerie.pricefeaturegroupsKeys) === null || _selectedSerie$pricef4 === void 0 || _selectedSerie$pricef4.forEach(function (priceGroupKey, i) {
34887
+ var pfgSplit = priceGroupKey.split('_');
34888
+ var pfgId = pfgSplit[0];
34725
34889
  var pfg = priceFeatureGroups.find(function (pfg) {
34726
34890
  return pfg.id == pfgId;
34727
34891
  });
34728
34892
  if (pfg) {
34729
34893
  var _selectedSerie$pricef5;
34730
- pfg.keys.push(priceFeatureGroupKey);
34894
+ pfg.keys.push(priceGroupKey);
34731
34895
  pfg.keysDisplayTexts.push((_selectedSerie$pricef5 = selectedSerie.pricefeaturegroupsKeysDisplayTexts) === null || _selectedSerie$pricef5 === void 0 || (_selectedSerie$pricef5 = _selectedSerie$pricef5[i]) === null || _selectedSerie$pricef5 === void 0 ? void 0 : _selectedSerie$pricef5[language.toUpperCase()]);
34732
34896
  }
34733
34897
  });
@@ -34740,18 +34904,33 @@ var disabled$1 = "disabled-Llkqu";
34740
34904
  var css_248z$b = ".wrapper-5t6RT {\n display: flex;\n flex-direction: column;\n min-height: 50px;\n justify-content: flex-end;\n font-size: 12px;\n}\n\n.input-leHam {\n position: relative;\n width: 200px;\n height: 32px;\n border: 1px solid #d9d9d9;\n background: #ffffff;\n padding: 0 11px;\n border-radius: 6px;\n font-size: 14px;\n line-height: 30px;\n cursor: pointer;\n}\n\n.darkmode .input-leHam {\n background: #141414;\n border: 1px solid #424242;\n}\n\n.input-leHam.disabled-Llkqu {\n cursor: default;\n color: rgba(0, 0, 0, 0.25);\n}\n\n.darkmode .input-leHam.disabled-Llkqu {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.input-leHam:hover {\n border-color: #4096ff;\n}\n";
34741
34905
  styleInject(css_248z$b);
34742
34906
 
34907
+ var _excluded = ["onSave", "value"];
34743
34908
  function ownKeys$d(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; }
34744
34909
  function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
34745
- function PriceFactorInput(props) {
34910
+ function PriceFactorInput(_ref) {
34911
+ var _onSave = _ref.onSave,
34912
+ value = _ref.value,
34913
+ props = _objectWithoutProperties(_ref, _excluded);
34914
+ var _useState = useState(value),
34915
+ _useState2 = _slicedToArray(_useState, 2),
34916
+ innerValue = _useState2[0],
34917
+ setInnerValue = _useState2[1];
34918
+ useEffect(function () {
34919
+ setInnerValue(value);
34920
+ }, [value]);
34746
34921
  return /*#__PURE__*/jsxs("div", {
34747
34922
  className: classnames(wrapper$3, props.className),
34748
34923
  children: [props.title, /*#__PURE__*/jsx(Tooltip$1, {
34749
34924
  title: props.tooltip,
34750
34925
  children: /*#__PURE__*/jsx("div", {
34751
- id: "price-factor-input",
34752
- className: classnames(input, _defineProperty({}, disabled$1, props.disabled)),
34926
+ className: classnames(input, 'price-factor-input', _defineProperty({}, disabled$1, props.disabled)),
34753
34927
  children: /*#__PURE__*/jsx(PriceFactorCellRenderer, _objectSpread$d(_objectSpread$d({}, props), {}, {
34754
- isNotInAGGrid: true
34928
+ isNotInAGGrid: true,
34929
+ value: innerValue,
34930
+ onSave: function onSave(data, value) {
34931
+ setInnerValue(value);
34932
+ return _onSave(data, value);
34933
+ }
34755
34934
  }))
34756
34935
  })
34757
34936
  })]
@@ -34760,9 +34939,46 @@ function PriceFactorInput(props) {
34760
34939
 
34761
34940
  var inputHeader = "input-header--4KDP";
34762
34941
  var factorInput = "factor-input-MX85Z";
34763
- var css_248z$a = ".input-header--4KDP .ag-header-cell-text {\n width: 100%;\n}\n\n.factor-input-MX85Z {\n min-height: 0;\n flex: 1;\n}\n\n.factor-input-MX85Z #price-factor-input {\n width: 100%;\n background-color: var(--ag-input-background-color);\n border: var(--ag-input-border);\n border-radius: var(--ag-input-border-radius);\n color: var(--ag-input-text-color);\n height: var(--ag-input-height);\n line-height: var(--ag-input-height);\n font-size: var(--ag-font-size);\n}\n\n.factor-input-MX85Z #price-factor-input:hover {\n border-color: #4096ff;\n}\n";
34942
+ var css_248z$a = ".input-header--4KDP .ag-header-cell-text {\n width: 100%;\n}\n\n.input-header--4KDP .ag-header-group-cell-label {\n width: 100%;\n max-width: 250px;\n}\n\n.input-header--4KDP .ag-header-group-text {\n width: 100%;\n}\n\n.factor-input-MX85Z {\n min-height: 0;\n flex: 1;\n}\n\n.factor-input-MX85Z .price-factor-input {\n width: 100%;\n background-color: var(--ag-input-background-color);\n border: var(--ag-input-border);\n border-radius: var(--ag-input-border-radius);\n color: var(--ag-input-text-color);\n height: var(--ag-input-height);\n line-height: var(--ag-input-height);\n font-size: var(--ag-font-size);\n}\n\n.factor-input-MX85Z .price-factor-input:hover {\n border-color: #4096ff;\n}\n";
34764
34943
  styleInject(css_248z$a);
34765
34944
 
34945
+ function PriceFactorHeaderComponent(_ref) {
34946
+ var onSave = _ref.onSave,
34947
+ onPriorityChange = _ref.onPriorityChange,
34948
+ priority = _ref.priority,
34949
+ priorityForced = _ref.priorityForced,
34950
+ value = _ref.value,
34951
+ inputTooltip = _ref.inputTooltip,
34952
+ checkboxTooltip = _ref.checkboxTooltip;
34953
+ var _useTranslation = useTranslation$1(),
34954
+ t = _useTranslation.t;
34955
+ var _useState = useState(priority || priorityForced),
34956
+ _useState2 = _slicedToArray(_useState, 2),
34957
+ innerChecked = _useState2[0],
34958
+ setInnerChecked = _useState2[1];
34959
+ useEffect(function () {
34960
+ setInnerChecked(priority || priorityForced);
34961
+ }, [priority, priorityForced]);
34962
+ return /*#__PURE__*/jsxs(Fragment, {
34963
+ children: [/*#__PURE__*/jsx(PriceFactorInput, {
34964
+ onSave: onSave,
34965
+ value: value,
34966
+ className: factorInput,
34967
+ tooltip: t(inputTooltip)
34968
+ }), /*#__PURE__*/jsx(Tooltip$1, {
34969
+ title: t("".concat(checkboxTooltip, ".").concat(priorityForced ? 'forced' : priority ? 'true' : 'false')),
34970
+ children: /*#__PURE__*/jsx(Checkbox, {
34971
+ checked: innerChecked,
34972
+ disabled: priorityForced,
34973
+ onChange: function onChange(e) {
34974
+ setInnerChecked(e.target.checked);
34975
+ onPriorityChange(e.target.checked);
34976
+ }
34977
+ })
34978
+ })]
34979
+ });
34980
+ }
34981
+
34766
34982
  function ownKeys$c(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; }
34767
34983
  function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
34768
34984
  var Prices = observer(function (_ref) {
@@ -34771,11 +34987,83 @@ var Prices = observer(function (_ref) {
34771
34987
  packageId = _ref.packageId,
34772
34988
  apiConfig = _ref.apiConfig,
34773
34989
  pricelist = _ref.pricelist,
34774
- setNodeDataValue = _ref.setNodeDataValue;
34990
+ setNodeDataValue = _ref.setNodeDataValue,
34991
+ viewOnly = _ref.viewOnly;
34775
34992
  var _useTranslation = useTranslation(),
34776
34993
  t = _useTranslation.t;
34777
34994
  var _useEnricherContext = useEnricherContext(['pricelists']),
34778
34995
  selectedSerie = _useEnricherContext.selectedSerie;
34996
+ var updatePfgPriceFactor = useCallback(function (priceFeatureGroupItem, value) {
34997
+ if (!selectedSerie) return;
34998
+
34999
+ // Create copies of the objects to modify
35000
+ var newFactors = _objectSpread$c({}, pricelist.pfgPricefactors);
35001
+ var serieFactors = _objectSpread$c({}, newFactors[selectedSerie.serieNo]);
35002
+ if (value.length === 0) {
35003
+ // Remove the empty price feature group
35004
+ delete serieFactors[priceFeatureGroupItem];
35005
+
35006
+ // If serie factors is now empty, remove the entire serie entry
35007
+ if (Object.keys(serieFactors).length === 0) {
35008
+ delete newFactors[selectedSerie.serieNo];
35009
+ } else {
35010
+ newFactors[selectedSerie.serieNo] = serieFactors;
35011
+ }
35012
+
35013
+ // If no more series exist, set pfgPricefactors to undefined
35014
+ if (Object.keys(newFactors).length === 0) {
35015
+ setNodeDataValue({
35016
+ pfgPricefactors: undefined
35017
+ });
35018
+ return;
35019
+ }
35020
+ } else {
35021
+ // Add/update the value
35022
+ serieFactors[priceFeatureGroupItem] = value;
35023
+ newFactors[selectedSerie.serieNo] = serieFactors;
35024
+ }
35025
+ setNodeDataValue({
35026
+ pfgPricefactors: newFactors
35027
+ });
35028
+ }, [selectedSerie]);
35029
+ var updatePfgPriority = useCallback(function (priceFeatureGroupItem, value) {
35030
+ var _newPriority$selected;
35031
+ if (!selectedSerie) return;
35032
+ var newPriority = _objectSpread$c({}, pricelist.pfgPricefactorsPriority);
35033
+ var seriesPriority = new Set((_newPriority$selected = newPriority[selectedSerie.serieNo]) !== null && _newPriority$selected !== void 0 ? _newPriority$selected : []);
35034
+ if (value === true) {
35035
+ seriesPriority.add(priceFeatureGroupItem);
35036
+ } else {
35037
+ seriesPriority["delete"](priceFeatureGroupItem);
35038
+ }
35039
+ if (seriesPriority.size === 0) {
35040
+ delete newPriority[selectedSerie.serieNo];
35041
+ } else {
35042
+ newPriority[selectedSerie.serieNo] = Array.from(seriesPriority);
35043
+ }
35044
+ setNodeDataValue({
35045
+ pfgPricefactorsPriority: newPriority
35046
+ });
35047
+ }, [selectedSerie]);
35048
+ var updatePgPriority = useCallback(function (priceFeatureGroupItem, value) {
35049
+ var _newPriority$selected2;
35050
+ if (!selectedSerie) return;
35051
+ var newPriority = _objectSpread$c({}, pricelist.pgPricefactorsPriority);
35052
+ var seriesPriority = new Set((_newPriority$selected2 = newPriority[selectedSerie.serieNo]) !== null && _newPriority$selected2 !== void 0 ? _newPriority$selected2 : []);
35053
+ if (value === true) {
35054
+ seriesPriority.add(priceFeatureGroupItem);
35055
+ } else {
35056
+ seriesPriority["delete"](priceFeatureGroupItem);
35057
+ }
35058
+ if (seriesPriority.size === 0) {
35059
+ delete newPriority[selectedSerie.serieNo];
35060
+ } else {
35061
+ newPriority[selectedSerie.serieNo] = Array.from(seriesPriority);
35062
+ }
35063
+ setNodeDataValue({
35064
+ pgPricefactorsPriority: newPriority
35065
+ });
35066
+ }, [selectedSerie]);
34779
35067
  var updatePgPriceFactor = useCallback(function (priceFeatureGroupItem, value) {
34780
35068
  if (!selectedSerie) return;
34781
35069
 
@@ -34910,7 +35198,7 @@ var Prices = observer(function (_ref) {
34910
35198
  var apiInterface = useMemo(function () {
34911
35199
  return {
34912
35200
  read: apiConfig.enricherService + '/packages/${packageId}/pricelists/${pricelistId}/serie/${serieNo}/prices',
34913
- update: apiConfig.enricherService + '/packages/${packageId}/pricelists/${pricelistId}/serie/${serieNo}/prices/${_id}'
35201
+ update: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/pricelists/${pricelistId}/serie/${serieNo}/prices/${_id}'
34914
35202
  };
34915
35203
  }, []);
34916
35204
  var priceFeatureGroups = usePriceFeatureGroupsFromSerie(selectedSerie);
@@ -35010,16 +35298,57 @@ var Prices = observer(function (_ref) {
35010
35298
  sortable: false,
35011
35299
  editable: false
35012
35300
  }].concat(_toConsumableArray((_priceFeatureGroups$m = priceFeatureGroups === null || priceFeatureGroups === void 0 ? void 0 : priceFeatureGroups.map(function (priceFeatureGroup) {
35013
- var _priceFeatureGroup$ke, _priceFeatureGroup$ke2;
35301
+ var _pricelist$pfgPricefa, _pricelist$pfgPricefa2, _priceFeatureGroup$ke, _priceFeatureGroup$ke2;
35014
35302
  return {
35015
35303
  headerName: priceFeatureGroup.displayText,
35304
+ headerClass: inputHeader,
35305
+ headerGroupComponentParams: {
35306
+ additionalElement: /*#__PURE__*/jsx(PriceFactorHeaderComponent, {
35307
+ onSave: (/*#__PURE__*/function () {
35308
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data, value) {
35309
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
35310
+ while (1) switch (_context3.prev = _context3.next) {
35311
+ case 0:
35312
+ updatePfgPriceFactor(priceFeatureGroup.id, value);
35313
+ case 1:
35314
+ case "end":
35315
+ return _context3.stop();
35316
+ }
35317
+ }, _callee3);
35318
+ }));
35319
+ return function (_x5, _x6) {
35320
+ return _ref4.apply(this, arguments);
35321
+ };
35322
+ }()),
35323
+ value: (_pricelist$pfgPricefa = pricelist.pfgPricefactors) === null || _pricelist$pfgPricefa === void 0 || (_pricelist$pfgPricefa = _pricelist$pfgPricefa[selectedSerie === null || selectedSerie === void 0 ? void 0 : selectedSerie.serieNo]) === null || _pricelist$pfgPricefa === void 0 ? void 0 : _pricelist$pfgPricefa[priceFeatureGroup.id],
35324
+ onPriorityChange: (/*#__PURE__*/function () {
35325
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(value) {
35326
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
35327
+ while (1) switch (_context4.prev = _context4.next) {
35328
+ case 0:
35329
+ updatePfgPriority(priceFeatureGroup.id, value);
35330
+ case 1:
35331
+ case "end":
35332
+ return _context4.stop();
35333
+ }
35334
+ }, _callee4);
35335
+ }));
35336
+ return function (_x7) {
35337
+ return _ref5.apply(this, arguments);
35338
+ };
35339
+ }()),
35340
+ priority: !!((_pricelist$pfgPricefa2 = pricelist.pfgPricefactorsPriority) !== null && _pricelist$pfgPricefa2 !== void 0 && (_pricelist$pfgPricefa2 = _pricelist$pfgPricefa2[selectedSerie === null || selectedSerie === void 0 ? void 0 : selectedSerie.serieNo]) !== null && _pricelist$pfgPricefa2 !== void 0 && _pricelist$pfgPricefa2.includes(priceFeatureGroup.id)),
35341
+ inputTooltip: 'backoffice.idmCatalog.prices.priceFactor.label.pfg',
35342
+ checkboxTooltip: 'backoffice.idmCatalog.prices.priceFactor.label.pfgPriority'
35343
+ })
35344
+ },
35016
35345
  marryChildren: true,
35017
- children: _toConsumableArray((_priceFeatureGroup$ke = (_priceFeatureGroup$ke2 = priceFeatureGroup.keys) === null || _priceFeatureGroup$ke2 === void 0 ? void 0 : _priceFeatureGroup$ke2.map(function (priceFeatureGroupItem, j) {
35018
- var _priceFeatureGroup$ke3, _pricelist$pgPricefac;
35346
+ children: _toConsumableArray((_priceFeatureGroup$ke = (_priceFeatureGroup$ke2 = priceFeatureGroup.keys) === null || _priceFeatureGroup$ke2 === void 0 ? void 0 : _priceFeatureGroup$ke2.map(function (priceGroup, j) {
35347
+ var _priceFeatureGroup$ke3, _pricelist$pgPricefac, _pricelist$pgPricefac2, _pricelist$pfgPricefa3;
35019
35348
  return {
35020
- headerName: priceFeatureGroupItem,
35021
- field: "prices.".concat(priceFeatureGroupItem),
35022
- editable: true,
35349
+ headerName: priceGroup,
35350
+ field: "prices.".concat(priceGroup),
35351
+ editable: !viewOnly,
35023
35352
  filter: false,
35024
35353
  sortable: false,
35025
35354
  isDictionary: true,
@@ -35028,31 +35357,49 @@ var Prices = observer(function (_ref) {
35028
35357
  cellRenderer: PriceDisplayCellRenderer,
35029
35358
  cellRendererParams: {
35030
35359
  commas: pricelist.commas,
35031
- item: priceFeatureGroupItem
35360
+ item: priceGroup
35032
35361
  },
35033
- additionalFields: ["origPrices.".concat(priceFeatureGroupItem)],
35362
+ additionalFields: ["origPrices.".concat(priceGroup)],
35034
35363
  headerClass: inputHeader,
35035
35364
  headerComponentParams: {
35036
- additionalElement: /*#__PURE__*/jsx(PriceFactorInput, {
35365
+ additionalElement: /*#__PURE__*/jsx(PriceFactorHeaderComponent, {
35037
35366
  onSave: (/*#__PURE__*/function () {
35038
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data, value) {
35039
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
35040
- while (1) switch (_context3.prev = _context3.next) {
35367
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data, value) {
35368
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
35369
+ while (1) switch (_context5.prev = _context5.next) {
35370
+ case 0:
35371
+ updatePgPriceFactor(priceGroup, value);
35372
+ case 1:
35373
+ case "end":
35374
+ return _context5.stop();
35375
+ }
35376
+ }, _callee5);
35377
+ }));
35378
+ return function (_x8, _x9) {
35379
+ return _ref6.apply(this, arguments);
35380
+ };
35381
+ }()),
35382
+ value: (_pricelist$pgPricefac = pricelist.pgPricefactors) === null || _pricelist$pgPricefac === void 0 || (_pricelist$pgPricefac = _pricelist$pgPricefac[selectedSerie === null || selectedSerie === void 0 ? void 0 : selectedSerie.serieNo]) === null || _pricelist$pgPricefac === void 0 ? void 0 : _pricelist$pgPricefac[priceGroup],
35383
+ onPriorityChange: (/*#__PURE__*/function () {
35384
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(value) {
35385
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
35386
+ while (1) switch (_context6.prev = _context6.next) {
35041
35387
  case 0:
35042
- updatePgPriceFactor(priceFeatureGroupItem, value);
35388
+ updatePgPriority(priceGroup, value);
35043
35389
  case 1:
35044
35390
  case "end":
35045
- return _context3.stop();
35391
+ return _context6.stop();
35046
35392
  }
35047
- }, _callee3);
35393
+ }, _callee6);
35048
35394
  }));
35049
- return function (_x5, _x6) {
35050
- return _ref4.apply(this, arguments);
35395
+ return function (_x10) {
35396
+ return _ref7.apply(this, arguments);
35051
35397
  };
35052
35398
  }()),
35053
- value: (_pricelist$pgPricefac = pricelist.pgPricefactors) === null || _pricelist$pgPricefac === void 0 || (_pricelist$pgPricefac = _pricelist$pgPricefac[selectedSerie === null || selectedSerie === void 0 ? void 0 : selectedSerie.serieNo]) === null || _pricelist$pgPricefac === void 0 ? void 0 : _pricelist$pgPricefac[priceFeatureGroupItem],
35054
- className: factorInput,
35055
- tooltip: t('backoffice.idmCatalog.prices.priceFactor.label.pfg')
35399
+ priority: !!((_pricelist$pgPricefac2 = pricelist.pgPricefactorsPriority) !== null && _pricelist$pgPricefac2 !== void 0 && (_pricelist$pgPricefac2 = _pricelist$pgPricefac2[selectedSerie === null || selectedSerie === void 0 ? void 0 : selectedSerie.serieNo]) !== null && _pricelist$pgPricefac2 !== void 0 && _pricelist$pgPricefac2.includes(priceGroup)),
35400
+ priorityForced: !!((_pricelist$pfgPricefa3 = pricelist.pfgPricefactorsPriority) !== null && _pricelist$pfgPricefa3 !== void 0 && (_pricelist$pfgPricefa3 = _pricelist$pfgPricefa3[selectedSerie === null || selectedSerie === void 0 ? void 0 : selectedSerie.serieNo]) !== null && _pricelist$pfgPricefa3 !== void 0 && _pricelist$pfgPricefa3.includes(priceFeatureGroup.id)),
35401
+ inputTooltip: 'backoffice.idmCatalog.prices.priceFactor.label.pg',
35402
+ checkboxTooltip: 'backoffice.idmCatalog.prices.priceFactor.label.pgPriority'
35056
35403
  })
35057
35404
  }
35058
35405
  };
@@ -35103,7 +35450,7 @@ var Prices = observer(function (_ref) {
35103
35450
  cellDataType: 'objectId'
35104
35451
  }])
35105
35452
  };
35106
- }, [apiInterface, selectedSerie, pricelist, priceFeatureGroups]);
35453
+ }, [apiInterface, selectedSerie, pricelist, priceFeatureGroups, viewOnly]);
35107
35454
  return /*#__PURE__*/jsxs(Fragment, {
35108
35455
  children: [/*#__PURE__*/jsx(Descriptions$1, {
35109
35456
  title: /*#__PURE__*/jsx("div", {
@@ -35115,19 +35462,19 @@ var Prices = observer(function (_ref) {
35115
35462
  value: (_pricelist$seriePrice = pricelist.seriePricefactors) === null || _pricelist$seriePrice === void 0 ? void 0 : _pricelist$seriePrice[selectedSerie === null || selectedSerie === void 0 ? void 0 : selectedSerie.serieNo],
35116
35463
  title: t('backoffice.idmCatalog.prices.priceFactor.label.series'),
35117
35464
  onSave: (/*#__PURE__*/function () {
35118
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_, value) {
35119
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
35120
- while (1) switch (_context4.prev = _context4.next) {
35465
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_, value) {
35466
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
35467
+ while (1) switch (_context7.prev = _context7.next) {
35121
35468
  case 0:
35122
35469
  updateSeriePriceFactor(value);
35123
35470
  case 1:
35124
35471
  case "end":
35125
- return _context4.stop();
35472
+ return _context7.stop();
35126
35473
  }
35127
- }, _callee4);
35474
+ }, _callee7);
35128
35475
  }));
35129
- return function (_x7, _x8) {
35130
- return _ref5.apply(this, arguments);
35476
+ return function (_x11, _x12) {
35477
+ return _ref8.apply(this, arguments);
35131
35478
  };
35132
35479
  }()),
35133
35480
  disabled: !selectedSerie
@@ -35155,7 +35502,8 @@ var TablePriceList = observer(function () {
35155
35502
  packageId = _useModule.packageId,
35156
35503
  organizationId = _useModule.organizationId,
35157
35504
  apiConfig = _useModule.apiConfig,
35158
- selectedPackage = _useModule.selectedPackage;
35505
+ selectedPackage = _useModule.selectedPackage,
35506
+ viewOnly = _useModule.viewOnly;
35159
35507
  var _React$useState = React.useState(),
35160
35508
  _React$useState2 = _slicedToArray(_React$useState, 2),
35161
35509
  selectedPriceList = _React$useState2[0],
@@ -35166,7 +35514,7 @@ var TablePriceList = observer(function () {
35166
35514
  setSelectedNodeId = _React$useState4[1];
35167
35515
  useTools({
35168
35516
  packageId: packageId,
35169
- isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi2
35517
+ isApi2: selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.isApi
35170
35518
  });
35171
35519
  var setNodeDataValue = useCallback(function (data) {
35172
35520
  spreadsheetRef.current.setNodeDataValue(selectedNodeId, data);
@@ -35183,7 +35531,8 @@ var TablePriceList = observer(function () {
35183
35531
  packageId: packageId,
35184
35532
  apiConfig: apiConfig,
35185
35533
  pricelist: selectedPriceList,
35186
- setNodeDataValue: setNodeDataValue
35534
+ setNodeDataValue: setNodeDataValue,
35535
+ viewOnly: viewOnly
35187
35536
  },
35188
35537
  startWidth: 300,
35189
35538
  defaultPinned: false,
@@ -35207,10 +35556,10 @@ var TablePriceList = observer(function () {
35207
35556
  var apiInterface = useMemo(function () {
35208
35557
  return {
35209
35558
  read: apiConfig.enricherService + '/packages/${packageId}/pricelists',
35210
- create: apiConfig.enricherService + '/packages/${packageId}/pricelists',
35211
- restore: apiConfig.enricherService + '/packages/${packageId}/pricelists/${_id}',
35212
- "delete": apiConfig.enricherService + '/packages/${packageId}/pricelists/${_id}',
35213
- update: apiConfig.enricherService + '/packages/${packageId}/pricelists/${_id}'
35559
+ create: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/pricelists',
35560
+ restore: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/pricelists/${_id}',
35561
+ "delete": viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/pricelists/${_id}',
35562
+ update: viewOnly ? undefined : apiConfig.enricherService + '/packages/${packageId}/pricelists/${_id}'
35214
35563
  };
35215
35564
  }, []);
35216
35565
  var hooks = useMemo(function () {
@@ -35255,11 +35604,11 @@ var TablePriceList = observer(function () {
35255
35604
  colDef: [{
35256
35605
  headerName: 'backoffice.idmEnricher.pricelists.label.name',
35257
35606
  field: 'name',
35258
- editable: true
35607
+ editable: !viewOnly
35259
35608
  }, {
35260
35609
  headerName: 'backoffice.idmEnricher.pricelists.label.basedPricelistId',
35261
35610
  field: 'basedPricelistId',
35262
- editable: true,
35611
+ editable: !viewOnly,
35263
35612
  cellDataType: 'lookup',
35264
35613
  customParams: {
35265
35614
  filterCellType: 'id',
@@ -35289,7 +35638,7 @@ var TablePriceList = observer(function () {
35289
35638
  }, {
35290
35639
  headerName: 'backoffice.idmEnricher.pricelists.label.rounding',
35291
35640
  field: 'rounding',
35292
- editable: true,
35641
+ editable: !viewOnly,
35293
35642
  cellDataType: 'enum',
35294
35643
  customParams: {
35295
35644
  enumData: roundingOptions,
@@ -35298,25 +35647,25 @@ var TablePriceList = observer(function () {
35298
35647
  }, {
35299
35648
  headerName: 'backoffice.idmEnricher.pricelists.label.commas',
35300
35649
  field: 'commas',
35301
- editable: true,
35650
+ editable: !viewOnly,
35302
35651
  cellDataType: 'number'
35303
35652
  }, {
35304
35653
  headerName: 'backoffice.idmEnricher.pricelists.label.currency',
35305
35654
  field: 'currency',
35306
35655
  cellDataType: 'enum',
35307
- editable: true,
35656
+ editable: !viewOnly,
35308
35657
  customParams: {
35309
35658
  enumData: getCurrencyKey(t)
35310
35659
  }
35311
35660
  }, {
35312
35661
  headerName: 'backoffice.idmEnricher.pricelists.label.forPublishing',
35313
35662
  field: 'forPublishing',
35314
- editable: true,
35663
+ editable: !viewOnly,
35315
35664
  cellDataType: 'boolean'
35316
35665
  }, {
35317
35666
  headerName: 'backoffice.idmEnricher.pricelists.label.validFrom',
35318
35667
  field: 'validFrom',
35319
- editable: true,
35668
+ editable: !viewOnly,
35320
35669
  cellDataType: 'dateString',
35321
35670
  customParams: {
35322
35671
  dateFormat: 'DD.MM.YYYY'
@@ -35324,7 +35673,7 @@ var TablePriceList = observer(function () {
35324
35673
  }, {
35325
35674
  headerName: 'backoffice.idmEnricher.pricelists.label.validTo',
35326
35675
  field: 'validTo',
35327
- editable: true,
35676
+ editable: !viewOnly,
35328
35677
  cellDataType: 'dateString',
35329
35678
  customParams: {
35330
35679
  dateFormat: 'DD.MM.YYYY'
@@ -35382,9 +35731,24 @@ var TablePriceList = observer(function () {
35382
35731
  cellDataType: 'object',
35383
35732
  editable: false,
35384
35733
  hide: true
35734
+ }, {
35735
+ field: 'pfgPricefactors',
35736
+ cellDataType: 'object',
35737
+ editable: false,
35738
+ hide: true
35739
+ }, {
35740
+ field: 'pgPricefactorsPriority',
35741
+ cellDataType: 'object',
35742
+ editable: false,
35743
+ hide: true
35744
+ }, {
35745
+ field: 'pfgPricefactorsPriority',
35746
+ cellDataType: 'object',
35747
+ editable: false,
35748
+ hide: true
35385
35749
  }]
35386
35750
  };
35387
- }, [apiInterface, i18n.language]);
35751
+ }, [apiInterface, i18n.language, viewOnly]);
35388
35752
  return /*#__PURE__*/jsxs(Fragment, {
35389
35753
  children: [/*#__PURE__*/jsx(Descriptions$1, {
35390
35754
  title: /*#__PURE__*/jsxs("div", {
@@ -35873,24 +36237,34 @@ var useCatalogContext = function useCatalogContext() {
35873
36237
  root.contextStore.clearContext('catalog');
35874
36238
  }
35875
36239
 
35876
- // Only update if catalog changed
35877
- // initally ony the id is set so we need to update it again if we get the full catalog form the selector, so only checking for id is not enough
36240
+ // initally only the id is set so we need to update it again if we get the full catalog form the selector
35878
36241
  var currentCatalog = getContext().selectedCatalog;
35879
- if (currentCatalog._id === newCatalog._id && currentCatalog.name === newCatalog.name && JSON.stringify(currentCatalog.isoLanguageIds) === JSON.stringify(newCatalog.isoLanguageIds)) {
35880
- return; // No changes detected
36242
+ var catalogChanged = currentCatalog._id !== newCatalog._id;
36243
+ var catalogDataOnlyChanged = currentCatalog.name === newCatalog.name && JSON.stringify(currentCatalog.isoLanguageIds) === JSON.stringify(newCatalog.isoLanguageIds);
36244
+ if (!catalogChanged && !catalogDataOnlyChanged) {
36245
+ // No changes detected
36246
+ return;
36247
+ }
36248
+ if (!catalogChanged && catalogDataOnlyChanged) {
36249
+ // Only the data changed, so we only need to update the context of the catalog
36250
+ root.contextStore.updateContext('catalog', {
36251
+ selectedCatalog: newCatalog,
36252
+ catalogId: newCatalog._id
36253
+ });
36254
+ return;
35881
36255
  }
36256
+ if (catalogChanged) {
36257
+ // The catalog changed, so we need to rest the full context
36258
+ root.contextStore.updateContext('catalog', {
36259
+ selectedCatalog: newCatalog,
36260
+ catalogId: newCatalog._id,
36261
+ selectedSerie: undefined,
36262
+ selectedItem: undefined,
36263
+ selectedFeature: undefined,
36264
+ seriesSelectorState: createDefaultSelectState('seriesSelectorState'),
36265
+ featureSelectorState: createDefaultSelectState('featureSelectorState')
36266
+ });
35882
36267
 
35883
- // Update any field catalog changed
35884
- root.contextStore.updateContext('catalog', {
35885
- selectedCatalog: newCatalog,
35886
- catalogId: newCatalog._id,
35887
- selectedSerie: undefined,
35888
- selectedItem: undefined,
35889
- selectedFeature: undefined,
35890
- seriesSelectorState: createDefaultSelectState('seriesSelectorState'),
35891
- featureSelectorState: createDefaultSelectState('featureSelectorState')
35892
- });
35893
- if (currentCatalog._id !== newCatalog._id) {
35894
36268
  // Update URL only if the id changed
35895
36269
  navigate(path + newCatalog._id + (modules.length ? '/' + modules.join('/') : '') + (searchParams ? '?' + searchParams.toString() : ''));
35896
36270
  }
@@ -36719,27 +37093,22 @@ var CatalogSelector$1 = observer(CatalogSelector);
36719
37093
  var SeriesSelector = function SeriesSelector(_ref) {
36720
37094
  var modules = _ref.modules;
36721
37095
  var _useTranslation = useTranslation(),
36722
- t = _useTranslation.t,
36723
- i18n = _useTranslation.i18n;
36724
- var _useCatalogContext = useCatalogContext(modules),
36725
- catalogId = _useCatalogContext.catalogId,
36726
- idmService = _useCatalogContext.idmService,
36727
- selectedSerie = _useCatalogContext.selectedSerie,
36728
- setSelectedSerie = _useCatalogContext.setSelectedSerie,
36729
- seriesSelectorState = _useCatalogContext.seriesSelectorState;
37096
+ t = _useTranslation.t;
37097
+ var _useSeriesSelector = useSeriesSelector(modules),
37098
+ catalogId = _useSeriesSelector.catalogId,
37099
+ seriesSelectorState = _useSeriesSelector.seriesSelectorState,
37100
+ apiInterface = _useSeriesSelector.apiInterface,
37101
+ selectedSerie = _useSeriesSelector.selectedSerie,
37102
+ onChange = _useSeriesSelector.onChange,
37103
+ selectMapping = _useSeriesSelector.selectMapping;
36730
37104
  return /*#__PURE__*/jsx(SimpleSelect, {
36731
37105
  sharedState: seriesSelectorState,
36732
- apiInterface: {
36733
- read: idmService + '/v3.0/catalogs/' + catalogId + "/series?fields=seriesName[".concat(i18n.language.toLocaleUpperCase(), "];_id;serieNo;pricefeaturegroups;pricefeaturegroupsDisplayTexts;pricefeaturegroupsKeys;pricefeaturegroupsKeysDisplayTexts")
36734
- },
36735
- selectMapping: {
36736
- label: "${seriesName.".concat(i18n.language.toLocaleUpperCase(), "}"),
36737
- value: '${_id}'
36738
- },
37106
+ apiInterface: apiInterface,
37107
+ selectMapping: selectMapping,
36739
37108
  autoSelectFirst: true,
36740
37109
  title: t('backoffice.menu.items.label.IDMCatalogEditorTableSeries'),
36741
37110
  value: selectedSerie,
36742
- onChange: setSelectedSerie,
37111
+ onChange: onChange,
36743
37112
  search: true,
36744
37113
  style: {
36745
37114
  width: 200
@@ -36748,6 +37117,95 @@ var SeriesSelector = function SeriesSelector(_ref) {
36748
37117
  }, catalogId);
36749
37118
  };
36750
37119
  var SeriesSelector$1 = observer(SeriesSelector);
37120
+ var useSeriesSelector = function useSeriesSelector(modules) {
37121
+ var _useTranslation2 = useTranslation(),
37122
+ i18n = _useTranslation2.i18n;
37123
+ var root = useStore();
37124
+ var _useCatalogContext = useCatalogContext(modules),
37125
+ catalogId = _useCatalogContext.catalogId,
37126
+ idmService = _useCatalogContext.idmService,
37127
+ selectedSerie = _useCatalogContext.selectedSerie,
37128
+ setSelectedSerie = _useCatalogContext.setSelectedSerie,
37129
+ seriesSelectorState = _useCatalogContext.seriesSelectorState;
37130
+ var _useState = useState(selectedSerie),
37131
+ _useState2 = _slicedToArray(_useState, 2),
37132
+ selected = _useState2[0],
37133
+ setSelected = _useState2[1];
37134
+ var apiInterface = {
37135
+ read: idmService + "/v3.0/catalogs/".concat(catalogId, "/series?fields=seriesName[").concat(i18n.language.toLocaleUpperCase(), "];_id")
37136
+ };
37137
+ var selectMapping = {
37138
+ label: "${seriesName.".concat(i18n.language.toLocaleUpperCase(), "}"),
37139
+ value: '${_id}'
37140
+ };
37141
+ var fetchSerie = /*#__PURE__*/function () {
37142
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(newSerie) {
37143
+ var _seriesSelectorState$, _seriesSelectorState$2;
37144
+ var isLoaded, api, serie, option;
37145
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
37146
+ while (1) switch (_context.prev = _context.next) {
37147
+ case 0:
37148
+ if (newSerie) {
37149
+ _context.next = 2;
37150
+ break;
37151
+ }
37152
+ return _context.abrupt("return");
37153
+ case 2:
37154
+ // if the extend series data is already loaded, use it
37155
+ isLoaded = !!((_seriesSelectorState$ = seriesSelectorState.options) !== null && _seriesSelectorState$ !== void 0 && (_seriesSelectorState$ = _seriesSelectorState$.find(function (option) {
37156
+ return option.value === (newSerie === null || newSerie === void 0 ? void 0 : newSerie._id);
37157
+ })) !== null && _seriesSelectorState$ !== void 0 && (_seriesSelectorState$ = _seriesSelectorState$.data) !== null && _seriesSelectorState$ !== void 0 && _seriesSelectorState$.serieNo);
37158
+ if (!isLoaded) {
37159
+ _context.next = 6;
37160
+ break;
37161
+ }
37162
+ setSelectedSerie(newSerie);
37163
+ return _context.abrupt("return");
37164
+ case 6:
37165
+ //fetching of pricefeatruegroups is slow, so we can't fetch it in the list, but only for the selected serie
37166
+ seriesSelectorState.setLoading(true);
37167
+ api = new _default$d({
37168
+ type: 'SelectSimple',
37169
+ apiInterface: {
37170
+ read: idmService + "/v3.0/catalogs/".concat(catalogId, "/series/").concat(newSerie._id, "?fields=seriesName[").concat(i18n.language.toLocaleUpperCase(), "];_id;serieNo;pricefeaturegroups;pricefeaturegroupsDisplayTexts;pricefeaturegroupsKeys;pricefeaturegroupsKeysDisplayTexts")
37171
+ }
37172
+ }, root);
37173
+ _context.next = 10;
37174
+ return api.read();
37175
+ case 10:
37176
+ serie = _context.sent;
37177
+ //save the extended series data in the options, without triggering state change
37178
+ option = (_seriesSelectorState$2 = seriesSelectorState.options) === null || _seriesSelectorState$2 === void 0 ? void 0 : _seriesSelectorState$2.find(function (option) {
37179
+ return option.value === newSerie._id;
37180
+ });
37181
+ if (option) {
37182
+ option.data = serie;
37183
+ }
37184
+ setSelectedSerie(serie);
37185
+ seriesSelectorState.setLoading(false);
37186
+ case 15:
37187
+ case "end":
37188
+ return _context.stop();
37189
+ }
37190
+ }, _callee);
37191
+ }));
37192
+ return function fetchSerie(_x) {
37193
+ return _ref2.apply(this, arguments);
37194
+ };
37195
+ }();
37196
+ var onChange = function onChange(value) {
37197
+ setSelected(value);
37198
+ fetchSerie(value);
37199
+ };
37200
+ return {
37201
+ catalogId: catalogId,
37202
+ seriesSelectorState: seriesSelectorState,
37203
+ apiInterface: apiInterface,
37204
+ selectMapping: selectMapping,
37205
+ selectedSerie: selected,
37206
+ onChange: onChange
37207
+ };
37208
+ };
36751
37209
 
36752
37210
  function useModule (currentModules) {
36753
37211
  var root = useStore();