@openmrs/esm-form-engine-lib 3.1.3-pre.1747 → 3.1.3-pre.1754

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": "@openmrs/esm-form-engine-lib",
3
- "version": "3.1.3-pre.1747",
3
+ "version": "3.1.3-pre.1754",
4
4
  "description": "React Form Engine for O3",
5
5
  "browser": "dist/openmrs-esm-form-engine-lib.js",
6
6
  "main": "src/index.ts",
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { type FormFieldInputProps } from '../../types';
4
4
  import styles from './obs-group.scss';
5
- import { FormFieldRenderer, isGroupField } from '../renderer/field/form-field-renderer.component';
5
+ import { ErrorFallback, FormFieldRenderer, isGroupField } from '../renderer/field/form-field-renderer.component';
6
6
  import { useFormProviderContext } from '../../provider/form-provider';
7
7
  import { FormGroup } from '@carbon/react';
8
8
  import { useTranslation } from 'react-i18next';
@@ -18,6 +18,11 @@ export const ObsGroup: React.FC<FormFieldInputProps> = ({ field, ...restProps })
18
18
  .filter((child) => !child.isHidden)
19
19
  .map((child, index) => {
20
20
  const key = `${child.id}_${index}`;
21
+ if (child.id === field.id) {
22
+ return (
23
+ <ErrorFallback error={new Error('ObsGroup child has same id as parent question')}/>
24
+ );
25
+ }
21
26
 
22
27
  if (child.type === 'obsGroup' && isGroupField(child.questionOptions.rendering)) {
23
28
  return (
@@ -215,7 +215,7 @@ export const FormFieldRenderer = ({ fieldId, valueAdapter, repeatOptions }: Form
215
215
  );
216
216
  };
217
217
 
218
- function ErrorFallback({ error }) {
218
+ export function ErrorFallback({ error }) {
219
219
  const { t } = useTranslation();
220
220
  return (
221
221
  <ToastNotification
@@ -105,4 +105,8 @@
105
105
  &:global(.cds--inline-loading) {
106
106
  min-height: layout.$spacing-05;
107
107
  }
108
- }
108
+ }
109
+
110
+ .closeButton {
111
+ @extend .button;
112
+ }