@onehat/ui 0.3.159 → 0.3.161

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.159",
3
+ "version": "0.3.161",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -329,8 +329,15 @@ function GridComponent(props) {
329
329
  if (!isSelected) { // If a row was already selected when double-clicked, the first click will deselect it,
330
330
  onRowClick(item, e); // so reselect it
331
331
  }
332
- if (onEdit) {
333
- onEdit();
332
+
333
+ if (UiGlobals.doubleClickingGridRowOpensEditorInViewMode) { // global setting
334
+ if (onView) {
335
+ onView(true);
336
+ }
337
+ } else {
338
+ if (onEdit) {
339
+ onEdit();
340
+ }
334
341
  }
335
342
  break;
336
343
  case 3: // triple click
@@ -259,14 +259,14 @@ export default function withEditor(WrappedComponent, isTree = false) {
259
259
  onDelete(selection);
260
260
  }
261
261
  },
262
- doView = async () => {
262
+ doView = async (allowEditing = false) => {
263
263
  if (!userCanView) {
264
264
  return;
265
265
  }
266
266
  if (selection.length !== 1) {
267
267
  return;
268
268
  }
269
- setIsEditorViewOnly(true);
269
+ setIsEditorViewOnly(!allowEditing);
270
270
  setEditorMode(EDITOR_MODE__VIEW);
271
271
  setIsEditorShown(true);
272
272
 
@@ -339,7 +339,7 @@ export default function withEditor(WrappedComponent, isTree = false) {
339
339
  await Repository.save();
340
340
  success = true;
341
341
  } catch (e) {
342
- alert(e.context);
342
+ // alert(e.context);
343
343
  success = false;
344
344
  }
345
345
  setIsSaving(false);