@evoke-platform/ui-components 1.0.1 → 1.0.2-testing.0

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.
@@ -108,7 +108,7 @@ const customSelector = (props) => {
108
108
  let opts = options;
109
109
  let inputType = props.fieldData?.inputType;
110
110
  // for tree view / related object properties, the properties are stored in the propertyTreeMap upon selection
111
- if (!!context.treeViewOpts && !!context.propertyTreeMap[rule.field]) {
111
+ if (!!context.treeViewOpts && !!context.propertyTreeMap?.[rule.field]) {
112
112
  inputType = context.propertyTreeMap[rule.field].type;
113
113
  }
114
114
  let readOnly = false;
@@ -274,7 +274,7 @@ export const valueEditor = (props) => {
274
274
  const CriteriaBuilder = (props) => {
275
275
  const { properties, criteria, setCriteria, originalCriteria, enablePresetValues, presetValues, operators, dynamicContentInput, disabled, disabledCriteria, hideBorder, presetGroupLabel, treeViewOpts, disableRegexEscapeChars, } = props;
276
276
  const [query, setQuery] = useState(undefined);
277
- const [propertyTreeMap, setPropertyTreeMap] = useState({});
277
+ const [propertyTreeMap, setPropertyTreeMap] = useState();
278
278
  useEffect(() => {
279
279
  if (criteria || originalCriteria) {
280
280
  const criteriaToParse = criteria || originalCriteria || {};
@@ -326,7 +326,7 @@ const CriteriaBuilder = (props) => {
326
326
  traverseRulesForIds(q.rules);
327
327
  const tempPropertyMap = { ...propertyTreeMap };
328
328
  ids.forEach(async (id) => {
329
- if (!propertyTreeMap[id] && treeViewOpts?.object && treeViewOpts?.fetchObject) {
329
+ if (!propertyTreeMap?.[id] && treeViewOpts?.object && treeViewOpts?.fetchObject) {
330
330
  const prop = await traversePropertyPath(id, treeViewOpts?.object, treeViewOpts?.fetchObject);
331
331
  if (prop)
332
332
  tempPropertyMap[id] = prop;
@@ -365,7 +365,9 @@ const CriteriaBuilder = (props) => {
365
365
  }
366
366
  };
367
367
  const fields = useMemo(() => {
368
- return properties.map((property) => {
368
+ return properties
369
+ .filter(({ type }) => type !== 'collection')
370
+ .map((property) => {
369
371
  return {
370
372
  name: property.type === 'object' ? `${property.id}.id` : property.id,
371
373
  label: property.name,
@@ -466,7 +468,15 @@ const CriteriaBuilder = (props) => {
466
468
  enablePresetValues,
467
469
  presetGroupLabel,
468
470
  disabledCriteria,
469
- treeViewOpts,
471
+ treeViewOpts: treeViewOpts
472
+ ? {
473
+ ...treeViewOpts,
474
+ object: {
475
+ ...treeViewOpts?.object,
476
+ properties: treeViewOpts?.object.properties.filter(({ type }) => type !== 'collection'),
477
+ },
478
+ }
479
+ : undefined,
470
480
  propertyTreeMap,
471
481
  setPropertyTreeMap,
472
482
  }, controlClassnames: {
@@ -49,8 +49,6 @@ const PropertyTree = ({ fetchObject, handleTreePropertySelect, rootObject, value
49
49
  if (originalValue.includes('.')) {
50
50
  const parts = originalValue.split('.');
51
51
  if (parts.length >= 2) {
52
- const parentId = parts.slice(0, -1).join('.');
53
- await fetchObject(parentId);
54
52
  if (!newObjectPropertyNamePathMap[originalValue]) {
55
53
  const fieldNamePath = await fetchDisplayNamePath(originalValue, rootObject, fetchObject);
56
54
  newObjectPropertyNamePathMap = {
@@ -20,7 +20,7 @@ const ValueEditor = (props) => {
20
20
  const { handleOnChange, value, operator, context, level, rule } = props;
21
21
  let inputType = props.inputType;
22
22
  let values = props.values;
23
- const property = context.propertyTreeMap[rule.field];
23
+ const property = context.propertyTreeMap?.[rule.field];
24
24
  // for tree view / related object properties, the properties are stored in the propertyTreeMap upon selection
25
25
  if (!!context.treeViewOpts && !!property) {
26
26
  inputType = property.type;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.0.1",
3
+ "version": "1.0.2-testing.0",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",