Skip to content

Commit

Permalink
fix: fix type diff on schema and dummy schema
Browse files Browse the repository at this point in the history
  • Loading branch information
usamaidrsk committed Oct 24, 2024
1 parent b8c8bd2 commit dd7a1de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
12 changes: 4 additions & 8 deletions src/components/form-editor/form-editor.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { useParams } from 'react-router-dom';
import { type TFunction, useTranslation } from 'react-i18next';
import { ConfigurableLink, showModal, useConfig } from '@openmrs/esm-framework';
import type { IMarker } from 'react-ace';
import type { FormSchema } from '@openmrs/esm-form-engine-lib';
import type { Schema } from '../../types';
import { useClobdata } from '../../hooks/useClobdata';
import { useForm } from '../../hooks/useForm';
Expand Down Expand Up @@ -143,7 +142,7 @@ const FormEditorContent: React.FC<TranslationFnProps> = ({ t }) => {
};

const inputDummySchema = useCallback(() => {
const dummySchema: FormSchema = {
const dummySchema: typeof schema = {
encounterType: '',
name: 'Sample Form',
processor: 'EncounterFormProcessor',
Expand Down Expand Up @@ -183,18 +182,15 @@ const FormEditorContent: React.FC<TranslationFnProps> = ({ t }) => {
answers: [
{
concept: 'another-system-defined-concept-uuid',
label: 'Choice 1',
conceptMappings: [],
label: 'Choice 1'
},
{
concept: 'yet-another-system-defined-concept-uuid',
label: 'Choice 2',
conceptMappings: [],
label: 'Choice 2'
},
{
concept: 'yet-one-more-system-defined-concept-uuid',
label: 'Choice 3',
conceptMappings: [],
label: 'Choice 3'
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Accordion, AccordionItem, Button, IconButton, InlineLoading } from '@ca
import { Add, TrashCan } from '@carbon/react/icons';
import { useParams } from 'react-router-dom';
import { showModal, showSnackbar } from '@openmrs/esm-framework';
import type { FormSchema } from '@openmrs/esm-form-engine-lib';
import type { Schema, Question } from '../../types';
import DraggableQuestion from './draggable-question.component';
import Droppable from './droppable-container.component';
Expand Down Expand Up @@ -45,7 +44,7 @@ const InteractiveBuilder: React.FC<InteractiveBuilderProps> = ({
const isEditingExistingForm = Boolean(formUuid);

const initializeSchema = useCallback(() => {
const dummySchema: FormSchema = {
const dummySchema: typeof schema = {
name: '',
pages: [],
processor: 'EncounterFormProcessor',
Expand Down

0 comments on commit dd7a1de

Please sign in to comment.