@onehat/ui 0.4.47 → 0.4.50
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
|
@@ -422,18 +422,18 @@ function GridComponent(props) {
|
|
|
422
422
|
onView(!props.isEditorViewOnly);
|
|
423
423
|
}
|
|
424
424
|
} else {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
425
|
+
let canDoEdit = false,
|
|
426
|
+
canDoView = false;
|
|
427
|
+
if (onEdit && canUser && canUser(EDIT) && canRecordBeEdited && canRecordBeEdited(selection)) {
|
|
428
|
+
canDoEdit = true;
|
|
429
|
+
}
|
|
430
|
+
if (onView && canUser && canUser(VIEW)) {
|
|
431
|
+
canDoView = true;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (canDoEdit) {
|
|
432
435
|
onEdit();
|
|
433
|
-
} else if (
|
|
434
|
-
if (canUser && !canUser(VIEW)) { // permissions
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
436
|
+
} else if (canDoView) {
|
|
437
437
|
onView();
|
|
438
438
|
}
|
|
439
439
|
}
|
|
@@ -92,6 +92,9 @@ export default function withPdfButtons(WrappedComponent) {
|
|
|
92
92
|
}),
|
|
93
93
|
items = [];
|
|
94
94
|
_.each(ancillaryItemsClone, (ancillaryItem) => { // clone, as we don't want to alter the item by reference
|
|
95
|
+
if (ancillaryItem.skipInPdfButtons) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
95
98
|
let name;
|
|
96
99
|
if (ancillaryItem.pdfModel) {
|
|
97
100
|
name = ancillaryItem.pdfModel;
|