- this would actually apply to any “list”
- issue was with react “key” value being set based on array index
- RIFT-16249
Change-Id: I778e7d5043eb9f7288856b8666b2be6e5f8c5a91
Signed-off-by: Bob Gallagher <bob.gallagher@riftio.com>
import _isArray from 'lodash/isArray'
import _cloneDeep from 'lodash/cloneDeep'
import _debounce from 'lodash/debounce';
import _isArray from 'lodash/isArray'
import _cloneDeep from 'lodash/cloneDeep'
import _debounce from 'lodash/debounce';
+import _uniqueId from 'lodash/uniqueId';
+import _set from 'lodash/set';
+import _get from 'lodash/get';
+import _has from 'lodash/has';
import utils from '../libraries/utils'
import React from 'react'
import ClassNames from 'classnames'
import utils from '../libraries/utils'
import React from 'react'
import ClassNames from 'classnames'
const EMPTY_LEAF_PRESENT = '--empty-leaf-set--';
const EMPTY_LEAF_PRESENT = '--empty-leaf-set--';
+function resolveReactKey(value) {
+ const keyPath = ['uiState', 'fieldKey'];
+ if (!_has(value, keyPath)) {
+ _set(value, keyPath, _uniqueId());
+ }
+ return _get(value, keyPath);
+}
+
function getDescriptorMetaBasicForType(type) {
const basicPropertiesFilter = d => _includes(DESCRIPTOR_MODEL_FIELDS[type], d.name);
return DescriptorModelMetaFactory.getModelMetaForType(type, basicPropertiesFilter) || {properties: []};
function getDescriptorMetaBasicForType(type) {
const basicPropertiesFilter = d => _includes(DESCRIPTOR_MODEL_FIELDS[type], d.name);
return DescriptorModelMetaFactory.getModelMetaForType(type, basicPropertiesFilter) || {properties: []};
if (isArray) {
valuePath.push(index);
if (isArray) {
valuePath.push(index);
+ fieldId = resolveReactKey(value);