Skip to content

Commit

Permalink
03-2167:adding concept to the meta object
Browse files Browse the repository at this point in the history
  • Loading branch information
gitcliff committed Apr 22, 2024
1 parent aed3e64 commit 72990ac
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 45 deletions.
32 changes: 0 additions & 32 deletions src/api/OHRIFormField.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/components/encounter/ohri-encounter-form.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React, { Dispatch, SetStateAction, useCallback, useEffect, useMemo, useSt
import { SessionLocation, showToast, useLayoutType, Visit } from '@openmrs/esm-framework';
import { ConceptFalse, ConceptTrue } from '../../constants';
import {
OHRIFormField,
OHRIFormPage as OHRIFormPageProps,
OHRIFormSchema,
OpenmrsEncounter,
SessionMode,
ValidationResult,
RepeatObsGroupCounter,
} from '../../api/types';
import { OHRIFormField } from '../../api/OHRIFormField';
import OHRIFormPage from '../page/ohri-form-page';
import { OHRIFormContext } from '../../ohri-form-context';
import {
Expand Down Expand Up @@ -266,6 +266,7 @@ export const OHRIEncounterForm: React.FC<OHRIEncounterFormProps> = ({
field.meta = {
concept: matchingConcept,
};
console.log(field.meta)

Check failure on line 269 in src/components/encounter/ohri-encounter-form.component.tsx

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
if (field.questionOptions.answers) {
field.questionOptions.answers = field.questionOptions.answers.map((answer) => {
const matchingAnswerConcept = findConceptByReference(answer.concept, concepts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { render, fireEvent, screen, cleanup, act, waitFor } from '@testing-library/react';
import { Form, Formik } from 'formik';
import { EncounterContext, OHRIFormContext } from '../../../ohri-form-context';
import { OHRIFormField } from '../../../api/OHRIFormField';
import { OHRIFormField } from '../../../api/types';
import { ObsSubmissionHandler } from '../../../submission-handlers/base-handlers';
import { OHRIContentSwitcher } from './ohri-content-switcher.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createErrorHandler } from '@openmrs/esm-framework';
import { isInlineView } from '../../../utils/ohri-form-helper';
import { getAllLocations, getLocationsByTag } from '../../../api/api';
import { isTrue } from '../../../utils/boolean-utils';
import { OHRIFormField } from '../../../api/OHRIFormField';
import { OHRIFormField } from '../../../api/types';
import { OHRIFormContext } from '../../../ohri-form-context';
import { OHRIFieldValueView } from '../../value/view/ohri-field-value-view.component';
import styles from './ohri-encounter-location.scss';
Expand Down
2 changes: 1 addition & 1 deletion src/components/inputs/select/ohri-dropdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, fireEvent, screen, cleanup, act } from '@testing-library/react'
import { Form, Formik } from 'formik';
import { EncounterContext, OHRIFormContext } from '../../../ohri-form-context';
import OHRIDropdown from './ohri-dropdown.component';
import { OHRIFormField } from '../../../api/OHRIFormField';
import { OHRIFormField } from '../../../api/types';
import { ObsSubmissionHandler } from '../../../submission-handlers/base-handlers';

const question: OHRIFormField = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/inputs/tooltip/ohri-tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Tooltip } from '@carbon/react';
import { Information } from '@carbon/react/icons';
import styles from './ohri-tooltip.scss';
import { OHRIFormField } from '../../../api/OHRIFormField';
import { OHRIFormField } from '../../../api/types';

interface OHRITooltipProps {
field: OHRIFormField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { render, fireEvent, waitFor, act, screen } from '@testing-library/react';
import UISelectExtended from './ui-select-extended';
import { OHRIFormField } from '../../../api/OHRIFormField';
import { OHRIFormField } from '../../../api/types';
import { EncounterContext, OHRIFormContext } from '../../../ohri-form-context';
import { Form, Formik } from 'formik';
import { ObsSubmissionHandler } from '../../../submission-handlers/base-handlers';
Expand Down
2 changes: 1 addition & 1 deletion src/components/repeat/ohri-repeat.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useFormikContext } from 'formik';
import { useTranslation } from 'react-i18next';
import { OHRIFormContext } from '../../ohri-form-context';
import { OHRIFormFieldProps } from '../../api/types';
import { OHRIFormField } from '../../api/OHRIFormField';
import { OHRIFormField } from '../../api/types';
import { OHRIObsGroup } from '../group/ohri-obs-group.component';
import { evaluateAsyncExpression, evaluateExpression } from '../../utils/expression-runner';
import { isEmpty } from '../../validators/ohri-form-validator';
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/angular-fe-schema-transformer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FormSchemaTransformer, OHRIFormSchema } from '../api/types';
import { OHRIFormField } from '../api/OHRIFormField';
import { OHRIFormField } from '../api/types';

export const AngularFormEngineSchemaTransformer: FormSchemaTransformer = {
transform: (form: OHRIFormSchema) => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ohri-form-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LayoutType } from '@openmrs/esm-framework';
import { ConceptTrue } from '../constants';
import { EncounterContext } from '../ohri-form-context';
import { OHRIFormPage, OHRIFormSection, SessionMode, SubmissionHandler } from '../api/types';
import { OHRIFormField } from '../api/OHRIFormField';
import { OHRIFormField } from '../api/types';
import { OHRIDefaultFieldValueValidator } from '../validators/default-value-validator';
import { isEmpty } from '../validators/ohri-form-validator';
import { isTrue } from './boolean-utils';
Expand Down
2 changes: 1 addition & 1 deletion src/validators/ohri-form-validator.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OHRIFormField } from '../api/OHRIFormField';
import { OHRIFormField } from '../api/types';
import { OHRIFieldValidator } from './ohri-form-validator';

describe('OHRIFieldValidator - validate', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/validators/ohri-form-validator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FieldValidator } from '../api/types';
import { OHRIFormField } from '../api/OHRIFormField';
import { OHRIFormField } from '../api/types';
import { isTrue } from '../utils/boolean-utils';

export const fieldRequiredErrCode = 'field.required';
Expand Down
2 changes: 1 addition & 1 deletion src/validators/ohri-js-expression-validator.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dayjs from 'dayjs';
import { OHRIFormField } from '../api/OHRIFormField';
import { OHRIFormField } from '../api/types';
import { ExpressionContext } from '../utils/expression-runner';
import { testFields } from '../utils/expression-runner.test';
import { OHRIJSExpressionValidator } from './ohri-js-expression-validator';
Expand Down
2 changes: 1 addition & 1 deletion src/validators/ohri-js-expression-validator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FieldValidator } from '../api/types';
import { OHRIFormField } from '../api/OHRIFormField';
import { OHRIFormField } from '../api/types';
import { evaluateExpression, ExpressionContext } from '../utils/expression-runner';

interface JSExpressionValidatorConfig {
Expand Down

0 comments on commit 72990ac

Please sign in to comment.