@k-int/stripes-kint-components 2.8.0 → 2.8.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 2.8.1 2022-07-21
2
+ * ActionList previously added actionListItems directly to cached object--sometimes this caused the react-query cache ITSELF to update, although I'm not sure why here and not anywhere else. Fixed by creating a clone internally in ActionListFieldArray and assigning actionListActions on that.
3
+
1
4
  ## 2.8.0 2022-07-15
2
5
  * Fixed bug where non-createable fields which were editable would display a field on creation.
3
6
  * RichSelect -- A Select style form component allowing for more custom render behaviour.
@@ -15,6 +15,8 @@ var _reactIntl = require("react-intl");
15
15
 
16
16
  var _get = _interopRequireDefault(require("lodash/get"));
17
17
 
18
+ var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
19
+
18
20
  var _reactFinalForm = require("react-final-form");
19
21
 
20
22
  var _components = require("@folio/stripes/components");
@@ -316,7 +318,7 @@ var ActionListFieldArray = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
316
318
  var assignActions = function assignActions() {
317
319
  return fields.map(function (fieldName, fieldIndex) {
318
320
  // Fetch the content from the field Values
319
- var cd = (0, _get.default)(values, fieldName);
321
+ var cd = (0, _cloneDeep.default)((0, _get.default)(values, fieldName));
320
322
  cd.actionListActions = actionAssigner(cd);
321
323
  return _objectSpread(_objectSpread({}, cd), {}, {
322
324
  fieldName: fieldName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-int/stripes-kint-components",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Stripes Component library for K-Int specific applications",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -2,6 +2,7 @@ import React, { forwardRef, useImperativeHandle, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { FormattedMessage } from 'react-intl';
4
4
  import get from 'lodash/get';
5
+ import cloneDeep from 'lodash/cloneDeep';
5
6
 
6
7
  import { Field, useForm, useFormState } from 'react-final-form';
7
8
  import { Button, Headline, IconButton, MultiColumnList, TextField } from '@folio/stripes/components';
@@ -244,7 +245,7 @@ const ActionListFieldArray = forwardRef(({
244
245
  return (
245
246
  fields.map((fieldName, fieldIndex) => {
246
247
  // Fetch the content from the field Values
247
- const cd = get(values, fieldName);
248
+ const cd = cloneDeep(get(values, fieldName));
248
249
  cd.actionListActions = actionAssigner(cd);
249
250
  return { ...cd, fieldName, fieldIndex };
250
251
  })