@onehat/ui 0.3.351 → 0.3.352

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.351",
3
+ "version": "0.3.352",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -58,6 +58,27 @@ export default function withPdfButtons(WrappedComponent) {
58
58
  buildModalItems = () => {
59
59
  const modalItems = _.map(_.cloneDeep(items), (item, ix) => buildNextLayer(item, ix, columnDefaults)); // clone, as we don't want to alter the item by reference
60
60
 
61
+ // remove additionalEditButtons from the modal
62
+ function walkTreeToDeleteAdditionalEditButtons(item) {
63
+ if (!item) {
64
+ return;
65
+ }
66
+
67
+ let {
68
+ additionalEditButtons,
69
+ items,
70
+ } = item;
71
+ if (!_.isEmpty(items)) {
72
+ _.each(items, (item) => {
73
+ walkTreeToDeleteAdditionalEditButtons(item);
74
+ });
75
+ }
76
+ if (additionalEditButtons) {
77
+ delete item.additionalEditButtons;
78
+ }
79
+ }
80
+ _.each(modalItems, walkTreeToDeleteAdditionalEditButtons);
81
+
61
82
  if (!_.isEmpty(ancillaryItems)) {
62
83
  const
63
84
  ancillaryItemsClone = _.cloneDeep(ancillaryItems),
@@ -144,7 +165,7 @@ export default function withPdfButtons(WrappedComponent) {
144
165
  },
145
166
  getStartingValues = (modalItems) => {
146
167
  const startingValues = {};
147
- function walkTree(item) {
168
+ function walkTreeToSetStartingValues(item) {
148
169
  if (!item) {
149
170
  return;
150
171
  }
@@ -155,14 +176,14 @@ export default function withPdfButtons(WrappedComponent) {
155
176
  } = item;
156
177
  if (!_.isEmpty(items)) {
157
178
  _.each(items, (item) => {
158
- walkTree(item);
179
+ walkTreeToSetStartingValues(item);
159
180
  });
160
181
  }
161
182
  if (name) {
162
183
  startingValues[name] = true;
163
184
  }
164
185
  }
165
- _.each(modalItems, walkTree);
186
+ _.each(modalItems, walkTreeToSetStartingValues);
166
187
  return startingValues;
167
188
  },
168
189
  onChooseFields = (userWantsToEmail = false) => {