Skip to content

Commit

Permalink
Merge branch 'develop' into fallbackurl-in-goBack
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishith25 committed Jan 24, 2025
2 parents f71c397 + e60b48b commit 407dfd4
Show file tree
Hide file tree
Showing 22 changed files with 239 additions and 200 deletions.
2 changes: 2 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,7 @@
"prn_reason": "PRN Reason",
"procedure_suggestions": "Procedure Suggestions",
"procedures_select_placeholder": "Select procedures to add details",
"proceed": "Proceed",
"professional_info": "Professional Information",
"professional_info_note": "View or update user's professional information",
"professional_info_note_self": "View or update your professional information",
Expand Down Expand Up @@ -2012,6 +2013,7 @@
"start_time": "Start Time",
"start_time_must_be_before_end_time": "Start time must be before end time",
"state": "State",
"state_reason_for_archiving": "State reason for archiving <strong>{{name}}</strong> file?",
"status": "Status",
"stop": "Stop",
"stop_recording": "Stop Recording",
Expand Down
7 changes: 5 additions & 2 deletions src/components/Common/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Avatar = React.forwardRef<
return (
<AvatarPrimitive.Root
ref={ref}
className={cn("w-full h-full", className)}
className={cn("w-full h-full rounded-md", className)}
style={{
background: bgColor,
}}
Expand All @@ -66,7 +66,10 @@ const Avatar = React.forwardRef<
<AvatarPrimitive.Image
src={imageUrl}
alt={name}
className="aspect-square h-full w-full object-cover"
className={cn(
"aspect-square h-full w-full object-cover rounded-md",
className,
)}
/>
) : (
<AvatarPrimitive.Fallback className="flex h-full w-full select-none items-center justify-center text-center">
Expand Down
59 changes: 0 additions & 59 deletions src/components/Form/FormFields/DateFormField.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function PatientInfoCard(props: PatientInfoCardProps) {
>
<div className="flex justify-items-start gap-5 lg:justify-normal">
<div className="flex flex-col items-start lg:items-center">
<div className="w-16 min-w-16 bg-secondary-200 h-16 md:w-24 md:h-24">
<div className="w-16 min-w-16 bg-secondary-200 h-16 md:w-24 md:h-24 rounded">
<Avatar name={patient.name} className="w-full h-full" />
</div>
</div>
Expand Down
101 changes: 11 additions & 90 deletions src/components/Patient/PatientRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import SectionNavigator from "@/CAREUI/misc/SectionNavigator";
import Autocomplete from "@/components/ui/autocomplete";
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
import DateField from "@/components/ui/date-field";
import {
Form,
FormControl,
Expand Down Expand Up @@ -54,7 +55,7 @@ import dayjs from "@/Utils/dayjs";
import routes from "@/Utils/request/api";
import mutate from "@/Utils/request/mutate";
import query from "@/Utils/request/query";
import { parsePhoneNumber } from "@/Utils/utils";
import { dateQueryString, parsePhoneNumber } from "@/Utils/utils";
import GovtOrganizationSelector from "@/pages/Organization/components/GovtOrganizationSelector";
import { PatientModel } from "@/types/emr/patient";
import { Organization } from "@/types/organization/organization";
Expand Down Expand Up @@ -513,95 +514,15 @@ export default function PatientRegistration(
render={({ field }) => (
<FormItem>
<FormControl>
<div className="flex items-center gap-2">
<div className="flex flex-col gap-1">
<FormLabel required>{t("day")}</FormLabel>

<Input
type="number"
placeholder="DD"
{...field}
min={1}
max={31}
value={
form.watch("date_of_birth")?.split("-")[2]
}
onChange={(e) => {
form.setValue(
"date_of_birth",
`${form.watch("date_of_birth")?.split("-")[0]}-${form.watch("date_of_birth")?.split("-")[1]}-${e.target.value}`,
);
const day = parseInt(e.target.value);
if (
e.target.value.length === 2 &&
day >= 1 &&
day <= 31
) {
document
.getElementById("dob-month-input")
?.focus();
}
}}
data-cy="dob-day-input"
/>
</div>

<div className="flex flex-col gap-1">
<FormLabel required>{t("month")}</FormLabel>

<Input
type="number"
id="dob-month-input"
placeholder="MM"
{...field}
value={
form.watch("date_of_birth")?.split("-")[1]
}
min={1}
max={12}
onChange={(e) => {
form.setValue(
"date_of_birth",
`${form.watch("date_of_birth")?.split("-")[0]}-${e.target.value}-${form.watch("date_of_birth")?.split("-")[2]}`,
);
const month = parseInt(e.target.value);
if (
e.target.value.length === 2 &&
month >= 1 &&
month <= 12
) {
document
.getElementById("dob-year-input")
?.focus();
}
}}
data-cy="dob-month-input"
/>
</div>

<div className="flex flex-col gap-1">
<FormLabel required>{t("year")}</FormLabel>

<Input
type="number"
id="dob-year-input"
placeholder="YYYY"
{...field}
value={
form.watch("date_of_birth")?.split("-")[0]
}
min={1900}
max={new Date().getFullYear()}
onChange={(e) =>
form.setValue(
"date_of_birth",
`${e.target.value}-${form.watch("date_of_birth")?.split("-")[1]}-${form.watch("date_of_birth")?.split("-")[2]}`,
)
}
data-cy="dob-year-input"
/>
</div>
</div>
<DateField
date={
field.value ? new Date(field.value) : undefined
}
onChange={(date) =>
field.onChange(dateQueryString(date))
}
id="dob"
/>
</FormControl>
<FormMessage />
</FormItem>
Expand Down
1 change: 1 addition & 0 deletions src/components/Questionnaire/QuestionnaireForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export function QuestionnaireForm({
};

const handleSubmissionError = (results: ValidationErrorResponse[]) => {
toast.error("Form Errr");
const updatedForms = [...questionnaireForms];
const errorMessages: string[] = [];

Expand Down
4 changes: 2 additions & 2 deletions src/components/Users/UserAvailabilityTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default function UserAvailabilityTab({ userData: user }: Props) {
</div>

<div>
<ScrollArea className="h-[calc(100vh-24rem)] -mr-3 pr-3 pb-4">
<ScrollArea className="max-h-[calc(100vh-18rem)] overflow-auto -mr-3 pr-3 pb-4">
{view === "schedule" && (
<ScheduleTemplates
facilityId={facilityId}
Expand Down Expand Up @@ -282,7 +282,7 @@ function DayDetailsPopover({
</Button>
</div>

<ScrollArea className="h-[22rem]">
<ScrollArea className="max-h-[22rem] overflow-auto">
{templates.map((template) => (
<div key={template.id} className="border-t pt-3 mt-3">
<div className="flex items-center">
Expand Down
Loading

0 comments on commit 407dfd4

Please sign in to comment.