@onehat/ui 0.3.222 → 0.3.224

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/ui",
3
- "version": "0.3.222",
3
+ "version": "0.3.224",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -315,9 +315,13 @@ export const Tag = withAdditionalProps(
315
315
 
316
316
  function withAdditionalEditorProps(WrappedComponent) {
317
317
  return (props) => {
318
+ const {
319
+ _combo = {},
320
+ } = props;
321
+ _combo.isEditor = true;
318
322
  return <WrappedComponent
319
- _combo={{ isEditor: true }}
320
323
  {...props}
324
+ _combo={_combo}
321
325
  />;
322
326
  };
323
327
  }
@@ -305,8 +305,9 @@ export default function withSecondaryEditor(WrappedComponent, isTree = false) {
305
305
  const
306
306
  entity = secondarySelection[0],
307
307
  idProperty = SecondaryRepository.getSchema().model.idProperty,
308
- rawValues = _.omit(entity.getOriginalData(), idProperty),
309
- duplicate = await SecondaryRepository.add(rawValues, false, true);
308
+ rawValues = _.omit(entity.getOriginalData(), idProperty);
309
+ rawValues.id = null; // unset the id of the duplicate
310
+ const duplicate = await SecondaryRepository.add(rawValues, false, true);
310
311
  setSecondaryIsIgnoreNextSelectionChange(true);
311
312
  secondarySetSelection([duplicate]);
312
313
  secondarySetEditorMode(EDITOR_MODE__EDIT);
@@ -302,8 +302,9 @@ export default function withEditor(WrappedComponent, isTree = false) {
302
302
  const
303
303
  entity = selection[0],
304
304
  idProperty = Repository.getSchema().model.idProperty,
305
- rawValues = _.omit(entity.getOriginalData(), idProperty),
306
- duplicate = await Repository.add(rawValues, false, true);
305
+ rawValues = _.omit(entity.getOriginalData(), idProperty);
306
+ rawValues.id = null; // unset the id of the duplicate
307
+ const duplicate = await Repository.add(rawValues, false, true);
307
308
  setIsIgnoreNextSelectionChange(true);
308
309
  setSelection([duplicate]);
309
310
  setEditorMode(EDITOR_MODE__EDIT);