Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) Highlight selected options for the multi-select component #366

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions src/components/inputs/multi-select/multi-select.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,21 @@ const MultiSelect: React.FC<FormFieldInputProps> = ({ field, value, errors, warn
)}
</Layer>
</div>
<div className={styles.selectionDisplay}>
{value?.length && field.questionOptions.answers?.length > 5 ? (
<div className={styles.tagContainer}>
{formFieldAdapters[field.type]?.getDisplayValue(field, value)?.map((displayValue, index) => (
<Tag key={index} type="cool-gray">
{displayValue}
</Tag>
))}
</div>
) : (
<ValueEmpty />
)}
</div>
{!field.inlineMultiCheckbox && (
<div className={styles.selectionDisplay}>
{value?.length ? (
<div className={styles.tagContainer}>
{formFieldAdapters[field.type]?.getDisplayValue(field, value)?.map((displayValue, index) => (
<Tag key={index} type="cool-gray">
{displayValue}
</Tag>
))}
</div>
) : (
<ValueEmpty />
)}
</div>
)}
</>
)
);
Expand Down
1 change: 0 additions & 1 deletion src/provider/form-factory-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { type FormContextProps } from './form-provider';
import { processPostSubmissionActions, validateForm } from './form-factory-helper';
import { useTranslation } from 'react-i18next';
import { usePostSubmissionActions } from '../hooks/usePostSubmissionActions';
import { reportError } from '../utils/error-utils';

interface FormFactoryProviderContextProps {
patient: fhir.Patient;
Expand Down
23 changes: 8 additions & 15 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,39 @@
"add": "Add",
"addCameraImage": "Add camera image",
"addFile": "Add files",
"attachmentsSaved": "Attachment(s) saved successfully",
"cameraCapture": "Camera capture",
"cancel": "Cancel",
"chooseAnOption": "Choose an option",
"clearFile": "Clear file",
"close": "Close",
"closeCamera": "Close camera",
"closesNotification": "Closes notification",
"submittedForm": "Form submitted",
"submittedFormDescription": "Form submitted successfully",
"errorDescription": "{{errors}}",
"errorDescriptionTitle": "Error on saving form",
"errorLoadingFormSchema": "Error loading form schema",
"errorLoadingInitialValues": "Error loading initial values",
"errorRenderingField": "Error rendering field",
"errorSavingAttachments": "Error saving attachment(s)",
"errorSavingEncounter": "Error saving encounter",
"errorSavingPatientIdentifiers": "Error saving patient identifiers",
"errorSavingPatientPrograms": "Error saving patient program(s)",
"fieldErrorDescriptionTitle": "Validation Errors",
"fileUploadDescription": "",
"fileUploadDescriptionAny": "Upload any file type",
"invalidWorkspaceName": "Invalid workspace name.",
"invalidWorkspaceNameSubtitle": "Please provide a valid workspace name.",
"launchWorkspace": "",
"loading": "Loading",
"notification": "Notification",
"ordersSaved": "Order(s) saved sucessfully",
"patientIdentifiersSaved": "Patient identifier(s) saved sucessfully",
"patientProgramsSaved": "Patient program(s) saved successfully",
"nullMandatoryField": "Please fill the required fields",
"preview": "Preview",
"previousValue": "Previous value:",
"remove": "Remove",
"required": "Required",
"reuseValue": "Reuse value",
"revert": "Revert",
"save": "Save",
"search": "Search",
"submitting": "Submitting",
"time": "Time",
"unspecified": "Unspecified",
"unspecifyAll": "Unspecify All",
"updatedRecord": "Record updated",
"updatedRecordDescription": "The patient encounter was updated",
"upload": "Upload",
"uploadedPhoto": "Uploaded photo",
"uploadImage": "Upload image"
"uploadImage": "Upload image",
"valuesOutOfBound": "Some of the values are out of bounds"
}