Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuravi committed Jan 20, 2025
1 parent 8ad8776 commit 9f202d7
Show file tree
Hide file tree
Showing 68 changed files with 63 additions and 87 deletions.
2 changes: 1 addition & 1 deletion src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, MouseEvent } from 'react';
import { useState, MouseEvent } from 'react';
import './Accordion.css';

type AccordionProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FocusEvent, useContext, useState } from 'react';
import { FocusEvent, useContext, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { findTreeArray, TreeContext } from '../../store/treeStore/treeStore';
import { Extension, QuestionnaireItem } from '../../types/fhir';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Extension, QuestionnaireItem } from '../../../types/fhir';
import { IExtentionType } from '../../../types/IQuestionnareItemType';
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdvancedQuestionOptions/Code/Codes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import {
addItemCodeAction,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useState } from 'react';
import { useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { TreeContext } from '../../../store/treeStore/treeStore';
import GroupedSelect from '../../Select/GroupedSelect';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FocusEvent, useContext } from 'react';
import { FocusEvent, useContext } from 'react';
import { useTranslation } from 'react-i18next';

import { getGuidanceAction } from '../../../helpers/QuestionHelper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FocusEvent, useContext, useState } from 'react';
import { FocusEvent, useContext, useState } from 'react';
import { useTranslation } from 'react-i18next';

import { getGuidanceParameterName, isValidGuidanceParameterName } from '../../../helpers/QuestionHelper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect, useLayoutEffect, useContext } from 'react';
import { useState, useEffect, useLayoutEffect, useContext } from 'react';

import { useTranslation } from 'react-i18next';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AdvancedQuestionOptions/Initial/Initial.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import { useContext } from 'react';
import { TreeContext } from '../../../store/treeStore/treeStore';
import { QuestionnaireItem, QuestionnaireItemInitial } from '../../../types/fhir';
import { IItemProperty, IQuestionnaireItemType } from '../../../types/IQuestionnareItemType';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { QuestionnaireItemInitial } from '../../../types/fhir';
import FormField from '../../FormField/FormField';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useState } from 'react';
import { useContext, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Coding, QuestionnaireItem, QuestionnaireItemInitial } from '../../../types/fhir';
import SwitchBtn from '../../SwitchBtn/SwitchBtn';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { QuestionnaireItemInitial } from '../../../types/fhir';
import FormField from '../../FormField/FormField';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { QuestionnaireItemInitial } from '../../../types/fhir';
import FormField from '../../FormField/FormField';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { QuestionnaireItemInitial } from '../../../types/fhir';
import FormField from '../../FormField/FormField';
Expand Down
6 changes: 3 additions & 3 deletions src/components/AnchorMenu/AnchorMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import './AnchorMenu.css';
import { DndProvider, useDrag, DndProviderProps } from 'react-dnd';
import { useState } from 'react';
import { DndProvider, useDrag } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';

import React from 'react';
import { useTranslation } from 'react-i18next';
import { ActionType, Items, MarkedItem, OrderItem } from '../../store/treeStore/treeStore';
import { IQuestionnaireItemType } from '../../types/IQuestionnareItemType';
Expand Down Expand Up @@ -108,7 +108,7 @@ const YourExternalNodeComponent = ({ node }: { node: Node }): JSX.Element | null
// The main component "AnchorMenu"
const AnchorMenu = (props: AnchorMenuProps): JSX.Element => {
const { t } = useTranslation();
const [collapsedNodes, setCollapsedNodes] = React.useState<string[]>([]);
const [collapsedNodes, setCollapsedNodes] = useState<string[]>([]);


const mapToTreeData = (item: OrderItem[], hierarchy: string, parentLinkId?: string): Node[] => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/AnchorMenu/ItemButtons/ItemButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { MouseEvent } from 'react';
import { MouseEvent } from 'react';
import { TFunction } from 'react-i18next';

import { ActionType } from '../../../store/treeStore/treeStore';
Expand Down
1 change: 0 additions & 1 deletion src/components/AnswerOption/AnswerOption.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';
import { QuestionnaireItemAnswerOption } from '../../types/fhir';
Expand Down
1 change: 0 additions & 1 deletion src/components/Btn/Btn.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import './Btn.css';

type BtnProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'react-datepicker/dist/react-datepicker.css';
import './DatePicker.css';

import ReactDatePicker, { registerLocale, setDefaultLocale } from 'react-datepicker';
import React, { useState } from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';

import { enUS } from 'date-fns/locale';
Expand Down
2 changes: 1 addition & 1 deletion src/components/DatePicker/DateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'react-datepicker/dist/react-datepicker.css';
import './DatePicker.css';

import DatePicker, { registerLocale, setDefaultLocale } from 'react-datepicker';
import React, { useState } from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';

import { nb } from 'date-fns/locale';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, ReactNode, useRef } from 'react';
import { forwardRef, ReactNode, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import IconBtn from '../IconBtn/IconBtn';

Expand Down
1 change: 0 additions & 1 deletion src/components/EnableWhen/EnableBehavior.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { QuestionnaireItem, QuestionnaireItemEnableBehaviorCodes } from '../../types/fhir';
import RadioBtn from '../RadioBtn/RadioBtn';
Expand Down
2 changes: 1 addition & 1 deletion src/components/EnableWhen/EnableWhen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ValueSet,
ValueSetComposeIncludeConcept,
} from '../../types/fhir';
import React, { useContext } from 'react';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';

import EnableBehavior from './EnableBehavior';
Expand Down
2 changes: 1 addition & 1 deletion src/components/EnableWhen/EnableWhenAnswerTypes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import { format, parse, formatISO, parseISO } from 'date-fns';
import {
Expand Down
1 change: 0 additions & 1 deletion src/components/EnableWhen/EnableWhenInfoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {

import { IOperator } from '../../types/IQuestionnareItemType';
import Infobox from './Infobox';
import React from 'react';
import { useTranslation } from 'react-i18next';
import createUUID from '../../helpers/CreateUUID';
import { format } from 'date-fns';
Expand Down
1 change: 0 additions & 1 deletion src/components/EnableWhen/EnableWhenOperator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { IOperator, IQuestionnaireItemType } from '../../types/IQuestionnareItemType';
import Select from '../Select/Select';
Expand Down
2 changes: 0 additions & 2 deletions src/components/EnableWhen/Infobox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

type Props = {
title: string;
children: JSX.Element | JSX.Element[];
Expand Down
8 changes: 4 additions & 4 deletions src/components/FormField/UriField.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import { useEffect, useState, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { isUriValid } from '../../helpers/uriHelper';

Expand All @@ -10,10 +10,10 @@ type Props = {

const UriField = ({ value, disabled, onBlur }: Props): JSX.Element => {
const { t } = useTranslation();
const ref = React.useRef<HTMLInputElement>(null);
const [hasValidUri, setHasValidUri] = React.useState<boolean>(isUriValid(value || ''));
const ref = useRef<HTMLInputElement>(null);
const [hasValidUri, setHasValidUri] = useState<boolean>(isUriValid(value || ''));

React.useEffect(() => {
useEffect(() => {
// if new value is sent as prop, set this as the current value
if (ref.current) {
ref.current.value = value || '';
Expand Down
4 changes: 2 additions & 2 deletions src/components/ImportValueSet/ImportValueSet.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useState } from 'react';
import { useContext, useState, useRef } from 'react';
import { useTranslation } from 'react-i18next';

import { BundleEntry, ValueSet } from '../../types/fhir';
Expand All @@ -17,7 +17,7 @@ type Props = {
};

const ImportValueSet = ({ close }: Props): JSX.Element => {
const uploadRef = React.useRef<HTMLInputElement>(null);
const uploadRef = useRef<HTMLInputElement>(null);
const { t } = useTranslation();
const { dispatch, state } = useContext(TreeContext);

Expand Down
2 changes: 0 additions & 2 deletions src/components/InputField/inputField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

type InputFieldProps = {
defaultValue?: string;
value?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Languages/LanguageAccordion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useState } from 'react';
import { useContext, useState, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { languageToIsoString, translateQuestionnaire } from '../../helpers/FhirToTreeStateMapper';
import { generateMainQuestionnaire, getUsedValueSet } from '../../helpers/generateQuestionnaire';
Expand All @@ -25,7 +25,7 @@ const LanguageAccordion = (props: LanguageAccordionProps): JSX.Element => {
const { t } = useTranslation();
const { state, dispatch } = useContext(TreeContext);
const { qItems, qMetadata, qContained, qAdditionalLanguages } = state;
const uploadRef = React.useRef<HTMLInputElement>(null);
const uploadRef = useRef<HTMLInputElement>(null);

const [selectedLang, setSelectedLang] = useState('');
const [fileUploadError, setFileUploadError] = useState<string>('');
Expand Down
2 changes: 1 addition & 1 deletion src/components/Languages/Languages.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import { TreeContext } from '../../store/treeStore/treeStore';
import PlusIcon from '../../images/icons/add-circle-outline.svg';

Check failure on line 4 in src/components/Languages/Languages.tsx

View workflow job for this annotation

GitHub Actions / build_test (16.x)

Cannot find module '../../images/icons/add-circle-outline.svg' or its corresponding type declarations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { ValueSet } from '../../../types/fhir';
import { ActionType, Languages } from '../../../store/treeStore/treeStore';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Languages/Translation/TranslateItemRow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useState } from 'react';
import { useContext, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { QuestionnaireItem, QuestionnaireItemAnswerOption } from '../../../types/fhir';
import FormField from '../../FormField/FormField';
Expand Down
1 change: 0 additions & 1 deletion src/components/Languages/Translation/TranslateMetaData.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { translatableMetadata } from '../../../helpers/LanguageHelper';
import { ActionType, TreeState } from '../../../store/treeStore/treeStore';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { MetadataProperty } from '../../../types/LanguageTypes';
import { ActionType, TreeState } from '../../../store/treeStore/treeStore';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { QuestionnaireItemAnswerOption } from '../../../types/fhir';
import FormField from '../../FormField/FormField';
import InputField from '../../InputField/inputField';
Expand Down
1 change: 0 additions & 1 deletion src/components/Languages/Translation/TranslateSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { ActionType, Languages } from '../../../store/treeStore/treeStore';
import FormField from '../../FormField/FormField';
Expand Down
1 change: 0 additions & 1 deletion src/components/Languages/Translation/TranslateSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { ActionType, Items, Languages } from '../../../store/treeStore/treeStore';
import { isItemControlSidebar } from '../../../helpers/itemControl';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Languages/Translation/TranslationModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useState } from 'react';
import { useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import Modal from '../../Modal/Modal';
import { OrderItem, TreeContext } from '../../../store/treeStore/treeStore';
Expand Down
2 changes: 1 addition & 1 deletion src/components/MarkdownEditor/MarkdownEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import React, { useState } from 'react';
import { useState } from 'react';
// @ts-ignore
import { CKEditor } from '@ckeditor/ckeditor5-react';
// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion src/components/Metadata/QuestionnaireSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useState } from 'react';
import { useContext, useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
DragDropContext,
Expand Down
6 changes: 3 additions & 3 deletions src/components/Question/Question.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import './Question.css';

Expand All @@ -15,7 +15,7 @@ import { IExtentionType, IItemProperty, IQuestionnaireItemType } from '../../typ
import { updateItemAction } from '../../store/treeStore/treeActions';
import { isRecipientList } from '../../helpers/QuestionHelper';
import { createMarkdownExtension, removeItemExtension, setItemExtension, hasExtension } from '../../helpers/extensionHelper';
import { isItemControlInline, isItemControlReceiverComponent, isItemControlHighlight } from '../../helpers/itemControl';
import { isItemControlInline, isItemControlHighlight } from '../../helpers/itemControl';

import Accordion from '../Accordion/Accordion';
import { ActionType } from '../../store/treeStore/treeStore';
Expand Down Expand Up @@ -55,7 +55,7 @@ interface QuestionProps {

const Question = (props: QuestionProps): JSX.Element => {
const { t } = useTranslation();
const [isMarkdownActivated, setIsMarkdownActivated] = React.useState<boolean>(!!props.item._text);
const [isMarkdownActivated, setIsMarkdownActivated] = useState<boolean>(!!props.item._text);
const codeElements = props.item.code ? `(${props.item.code.length})` : '(0)';

const dispatchUpdateItem = (
Expand Down
1 change: 0 additions & 1 deletion src/components/Question/QuestionType/DateType.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { removeItemExtension, setItemExtension } from '../../../helpers/extensionHelper';
import { createItemControlExtension, ItemControlType } from '../../../helpers/itemControl';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Question/QuestionType/Infotext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import { TreeContext } from '../../../store/treeStore/treeStore';
import FormField from '../../FormField/FormField';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Question/QuestionType/OptionReference.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import './OptionReference.css';
import { Extension, QuestionnaireItem } from '../../../types/fhir';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { getValueSetValues } from '../../../helpers/valueSetHelper';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Question/SliderSettings/SliderSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useState } from 'react';
import { useContext, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { TreeContext } from '../../../store/treeStore/treeStore';
import { removeItemExtension, setItemExtension } from '../../../helpers/extensionHelper';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Question/UnitType/UnitTypeSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ChangeEvent, useContext } from 'react';
import { ChangeEvent, useContext } from 'react';
import { useTranslation } from 'react-i18next';
import FormField from '../../FormField/FormField';
import Select from '../../Select/Select';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { format, parse } from 'date-fns';
import Picker from '../../DatePicker/DatePicker';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import FormField from '../../FormField/FormField';
import { IExtentionType } from '../../../types/IQuestionnareItemType';
Expand Down
Loading

0 comments on commit 9f202d7

Please sign in to comment.