Skip to content

Commit

Permalink
Changes 'CONSULTATION NOTES' to 'GENERAL INSTRUCTIONS (ADVICE)' (#8216)
Browse files Browse the repository at this point in the history
* Changes 'CONSULTATION NOTES' to 'GENERAL INSTRUCTIONS (ADVICE)'

* Minor Changes

* Minor changes

* Apply suggestions from Code Review

---------

Co-authored-by: rithviknishad <[email protected]>
  • Loading branch information
ahmedobaid23 and rithviknishad authored Jul 31, 2024
1 parent 5a47aed commit 2ba8471
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
9 changes: 6 additions & 3 deletions src/CAREUI/display/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ export const TimelineNode = (props: TimelineNodeProps) => {
}`}{" "}
</span>
)}
{props.titleSuffix
? props.titleSuffix
: `${props.event.type} the ${props.name || name}.`}
{props.titleSuffix || (
<>
{`${props.event.type} the `}
<span className="capitalize">{props.name || name}</span>
</>
)}
</p>
<div className="md:w-fit">
{props.actions && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ export default function EventsList() {
{(item, items) => (
<TimelineNode
name={
item.event_type.name
.split("_")
.map(
(text) =>
text[0].toUpperCase() + text.toLowerCase().slice(1),
)
.join(" ") + " Event"
t(item.event_type.name.toLowerCase()).replaceAll(
/_/g,
" ",
) + " Event"
}
event={{
type: item.change_type.replace(/_/g, " ").toLowerCase(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import type { ReactNode } from "react";
import { useTranslation } from "react-i18next";

interface IProps {
values: Record<string, unknown>;
}
Expand Down Expand Up @@ -80,12 +82,13 @@ const formatValue = (value: unknown, key?: string): ReactNode => {
};

export default function GenericEvent(props: IProps) {
const { t } = useTranslation();
return (
<div className="flex w-full flex-col gap-4 rounded-lg border border-secondary-400 p-4 @container">
{Object.entries(props.values).map(([key, value]) => (
<div className="flex w-full flex-col items-start gap-2">
<span className="text-xs uppercase text-secondary-700">
{key.replaceAll(/_/g, " ")}
<span className="text-xs capitalize text-secondary-700">
{t(key).replaceAll(/_/g, " ")}
</span>
<span className="break-all text-sm font-semibold text-secondary-700">
{formatValue(value, key)}
Expand Down
5 changes: 3 additions & 2 deletions src/Locale/en/Consultation.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
"encounter_date_field_label__HI": "Date & Time of Consultation",
"encounter_date_field_label__R": "Date & Time of Consultation",
"back_dated_encounter_date_caution": "You are creating an encounter for",
"encounter_duration_confirmation": "The duration of this encounter would be"
}
"encounter_duration_confirmation": "The duration of this encounter would be",
"consultation_notes": "General Instructions (Advice)"
}

0 comments on commit 2ba8471

Please sign in to comment.