From 01f6cf3ef677a8f38bee5358c00ef1c9eadc2612 Mon Sep 17 00:00:00 2001 From: Mohsin Hayat Date: Fri, 15 Nov 2024 14:52:21 +0500 Subject: [PATCH] ET-372: ICD questions QA and wrap up (#174) * feat(forms): add question description for ICD-10 api call * feat(forms): add separate label for icd search placeholder * fix: revert yarnrc changes * feat: bump ui-library version --- package.json | 2 +- src/molecules/question/Question.tsx | 56 +++++++++++++-------- src/molecules/question/question.module.scss | 14 ++++++ src/molecules/question/types.ts | 3 ++ 4 files changed, 52 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 5bfd955..448b235 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@awell-health/ui-library", - "version": "0.1.82", + "version": "0.1.83", "description": "UI components to integrate with Awell Health", "repository": { "type": "git", diff --git a/src/molecules/question/Question.tsx b/src/molecules/question/Question.tsx index 8618c49..38823e1 100644 --- a/src/molecules/question/Question.tsx +++ b/src/molecules/question/Question.tsx @@ -408,28 +408,40 @@ export const QuestionData = ({ defaultValue="" rules={{ required: config?.mandatory }} render={({ field: { onChange, value } }) => ( - { + onChange(data) + onAnswerChange() + }} + type="single" + options={icdClassificationOptions ?? []} + mandatory={config?.mandatory} + showCount + filtering + onSearch={onIcdClassificationSearchChange} + loading={optionsLoading} + allowSearchAfterSelect={true} + allowEmptyOptionsList={true} + /> + + {labels.select?.icd_10_catalogue_description}{' '} + + {labels.select?.icd_10_catalogue_link} + + {'.'} + + )} /> ) diff --git a/src/molecules/question/question.module.scss b/src/molecules/question/question.module.scss index c527fbe..eac38b8 100644 --- a/src/molecules/question/question.module.scss +++ b/src/molecules/question/question.module.scss @@ -9,3 +9,17 @@ margin-top: var(--awell-spacing-4); } } + +.awell_question_description { + display: block; + color: var(--awell-neutralMid400); + font-size: 0.875rem; + line-height: 20px; + margin-top: var(--awell-spacing-2); + font-weight: 400; + + & > a { + color: var(--awell-blue400); + text-decoration: underline; + } +} diff --git a/src/molecules/question/types.ts b/src/molecules/question/types.ts index 3a730e5..a8a11ce 100644 --- a/src/molecules/question/types.ts +++ b/src/molecules/question/types.ts @@ -6,8 +6,11 @@ export interface QuestionLabels { no_label: string select?: { search_placeholder: string + search_icd_placeholder: string no_options: string loading?: string + icd_10_catalogue_description?: string + icd_10_catalogue_link?: string } slider: { tooltip_guide: string