@onehat/ui 0.3.202 → 0.3.204

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.202",
3
+ "version": "0.3.204",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -38,6 +38,7 @@ export default function withEditor(WrappedComponent, isTree = false) {
38
38
  onDelete,
39
39
  onSave, // this could also be called 'onEdit'
40
40
  newEntityDisplayValue,
41
+ newEntityDisplayProperty, // in case the field to set for newEntityDisplayValue is different from model
41
42
  defaultValues,
42
43
 
43
44
  // withComponent
@@ -115,7 +116,7 @@ export default function withEditor(WrappedComponent, isTree = false) {
115
116
  }
116
117
 
117
118
  if (getNewEntityDisplayValue()) {
118
- const displayPropertyName = Repository.getSchema().model.displayProperty;
119
+ const displayPropertyName = newEntityDisplayProperty || Repository.getSchema().model.displayProperty;
119
120
  addValues[displayPropertyName] = getNewEntityDisplayValue();
120
121
  }
121
122
 
@@ -29,7 +29,7 @@ export default function getIconButtonFromConfig(config, ix, parent) {
29
29
  key={key || ix}
30
30
  parent={parent}
31
31
  reference={key || ix}
32
- onPress={handler}
32
+ onPress={() => handler(parent)}
33
33
  icon={icon}
34
34
  _icon={_icon}
35
35
  isDisabled={isDisabled}