Skip to content

Commit

Permalink
Only highlight selected values for the compact multi-select
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmale committed Aug 13, 2024
1 parent ac62e61 commit aee6bcd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
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 ? (
<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
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"
}

0 comments on commit aee6bcd

Please sign in to comment.