Skip to content

Commit

Permalink
fixed compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ZardenSawtooth authored and Aqeel committed Aug 21, 2024
1 parent cd9b63f commit 684ea1a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const AdvancedQuestionOptions = ({ item, parentArray }: AdvancedQuestionOptionsP
<div className="msg-error" aria-live="polite">
{`${t('LinkId is already in use')} `}
<button onClick={resetLinkId}>
<img src={UndoIcon} height={16} />
<img src={UndoIcon} alt="Undo Button" height={16} />
{` ${t('Sett tilbake til opprinnelig verdi')}`}
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Languages/Translation/TranslateSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const TranslateSettings = ({
<div>
<div className="translation-section-header">{t('Questionnaire settings')}</div>
{Object.values(translatableSettings).map((extensionToTranslate) => {
if (!extensionToTranslate) return;
if (!extensionToTranslate) return [];

const mainExtension = (extensions || []).find((e) => e.url === extensionToTranslate.extension);
let baseValue;
Expand Down
12 changes: 0 additions & 12 deletions src/components/Metadata/MetadataEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { TreeContext } from '../../store/treeStore/treeStore';
import { updateQuestionnaireMetadataAction } from '../../store/treeStore/treeActions';
import RadioBtn from '../RadioBtn/RadioBtn';
import InputField from '../InputField/inputField';
import { UseContextSystem } from '../../types/IQuestionnareItemType';

const MetadataEditor = (): JSX.Element => {
const { t } = useTranslation();
Expand All @@ -31,17 +30,6 @@ const MetadataEditor = (): JSX.Element => {
dispatch(updateQuestionnaireMetadataAction(propName, value));
};

const getUseContextSystem = (): string => {
const system =
qMetadata.useContext &&
qMetadata.useContext.length > 0 &&
qMetadata.useContext[0].valueCodeableConcept?.coding &&
qMetadata.useContext[0].valueCodeableConcept.coding.length > 0 &&
qMetadata.useContext[0].valueCodeableConcept.coding[0].system;

return system || UseContextSystem.helsetjeneste_full;
};

return (
<div id="metadata-editor">
<FormField label={t('Identifier')}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const Navbar = ({
<>
<header ref={navBarRef}>
<div className="pull-left form-title">
<h1><IconBtn type="x" title={t('Close')} onClick={() => {close()}} /><a className="survey-title-button" onClick={toggleFormDetails}>{title || 'Phoenix Survey Builder'}</a></h1>
<h1><IconBtn type="x" title={t('Close')} onClick={() => {close()}} /><a className="survey-title-button" href="#!" onClick={toggleFormDetails}>{title || 'Phoenix Survey Builder'}</a></h1>
</div>

<div className="pull-right">
Expand Down
9 changes: 2 additions & 7 deletions src/components/Question/Question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 All @@ -36,7 +36,6 @@ import { ValidationErrors } from '../../helpers/orphanValidation';
import {
canTypeBeRequired,
canTypeBeValidated,
canTypeHaveSublabel,
getItemDisplayType,
} from '../../helpers/questionTypeFeatures';
import SliderSettings from './SliderSettings/SliderSettings';
Expand All @@ -54,7 +53,7 @@ interface QuestionProps {

const Question = (props: QuestionProps): JSX.Element => {
const { t } = useTranslation();
const [isMarkdownActivated, setIsMarkdownActivated] = React.useState<boolean>(!!props.item._text);
const [isMarkdownActivated] = React.useState<boolean>(!!props.item._text);
const codeElements = props.item.code ? `(${props.item.code.length})` : '(0)';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const removeMd = require('remove-markdown');
Expand All @@ -75,10 +74,6 @@ const Question = (props: QuestionProps): JSX.Element => {
return labelText || props.item.text || '';
};

const getSublabelText = (): string => {
return props.item.extension?.find((x) => x.url === IExtentionType.sublabel)?.valueMarkdown || '';
};

const convertToPlaintext = (stringToBeConverted: string) => {
let plainText = removeMd(stringToBeConverted);
plainText = plainText.replaceAll('\\*', '*');
Expand Down
2 changes: 1 addition & 1 deletion src/components/Question/QuestionType/Choice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import SwitchBtn from '../../SwitchBtn/SwitchBtn';
import { createUriUUID } from '../../../helpers/uriHelper';
import DraggableAnswerOptions from '../../AnswerOption/DraggableAnswerOptions';
import PredefinedValueSets from './PredefinedValueSets';
import { ItemControlType, isItemControlCheckbox, isItemControlDropDown } from '../../../helpers/itemControl';
import { ItemControlType, isItemControlCheckbox } from '../../../helpers/itemControl';
import { checkboxExtension } from '../../../helpers/QuestionHelper';

type Props = {
Expand Down

0 comments on commit 684ea1a

Please sign in to comment.