Skip to content

Commit

Permalink
Merge branch 'camera_error_fix_1' of https://github.com/Harsh-D-2004/…
Browse files Browse the repository at this point in the history
…care_fe into camera_error_fix_1
  • Loading branch information
Harsh-D-2004 committed Mar 3, 2025
2 parents 2bc136a + a022ccf commit 77683cb
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 27 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@
"address": "Address",
"address_is_required": "Address is required",
"adjust_resource_filters": "Try adjusting your filters or create a new resource",
"admin_dashboard": "Admin Dashboard",
"administer": "Administer",
"administer_medicine": "Administer Medicine",
"administer_medicines": "Administer Medicines",
Expand Down Expand Up @@ -2538,6 +2539,7 @@
"view_details": "View Details",
"view_encounter": "View Encounter",
"view_facility": "View Facility",
"view_facility_details": "View facility details",
"view_files": "View Files",
"view_patient": "View Patient",
"view_patients": "View Patients",
Expand Down Expand Up @@ -2565,6 +2567,7 @@
"we_ve_sent_you_a_code_to": "We've sent you a code to",
"weekly_schedule": "Weekly Schedule",
"weekly_working_hours_error": "Average weekly working hours must be a number between 0 and 168",
"welcome_back_name": "Welcome Back {{name}} !",
"welcome_back_to_hospital_dashboard": "Welcome back to the overview ",
"what_facility_assign_the_patient_to": "What facility would you like to assign the patient to",
"whatsapp_number": "Whatsapp Number",
Expand All @@ -2584,6 +2587,8 @@
"yesterday": "Yesterday",
"yet_to_be_decided": "Yet to be decided",
"you_need_at_least_a_location_to_create_an_assest": "You need at least a location to create an assest.",
"your_facilities": "Your Facilities",
"your_organizations": "Your Organizations",
"zoom_in": "Zoom In",
"zoom_out": "Zoom Out"
}
8 changes: 5 additions & 3 deletions public/locale/ml.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
"appointment_details": "അപ്പോയിൻ്റ്മെൻ്റ് വിശദാംശങ്ങൾ",
"appointment_not_found": "അപ്പോയിൻ്റ്മെൻ്റ് കണ്ടെത്തിയില്ല",
"appointment_type": "അപ്പോയിൻ്റ്മെൻ്റ് തരം",
"appointments": "നിയമനങ്ങൾ",
"appointments": "അപ്പോയ്ന്റ്മെന്റ്സ്",
"approve": "അംഗീകരിക്കുക",
"approved": "അംഗീകരിച്ചു",
"approved_by_district_covid_control_room": "ജില്ലാ കോവിഡ് കൺട്രോൾ റൂം അംഗീകരിച്ചു",
Expand Down Expand Up @@ -786,7 +786,7 @@
"emergency_contact_volunteer": "അടിയന്തര കോൺടാക്റ്റ് (വോളണ്ടിയർ)",
"emergency_phone_number": "എമർജൻസി ഫോൺ നമ്പർ",
"empty_date_time": "--:-- --; ------------",
"encounter": "ഏറ്റുമുട്ടൽ",
"encounter": "എൻകൗണ്ടർ",
"encounter_admit_sources__born": "ആശുപത്രിയിൽ ജനിച്ചു",
"encounter_admit_sources__emd": "അപകട/അടിയന്തര വിഭാഗത്തിൽ നിന്ന്",
"encounter_admit_sources__gp": "ജനറൽ പ്രാക്ടീഷണറുടെ റഫറൽ",
Expand Down Expand Up @@ -1217,6 +1217,7 @@
"moving_camera": "ചലിക്കുന്ന ക്യാമറ",
"my_doctors": "എൻ്റെ ഡോക്ടർമാർ",
"my_profile": "എൻ്റെ പ്രൊഫൈൽ",
"my_schedules": "എന്റെ ഷെഡ്യൂൾസ്",
"name": "പേര്",
"name_of_hospital": "ആശുപത്രിയുടെ പേര്",
"name_of_shifting_approving_facility": "ഷിഫ്റ്റിംഗ് അപ്രൂവിംഗ് സൗകര്യത്തിൻ്റെ പേര്",
Expand Down Expand Up @@ -1677,6 +1678,7 @@
"set_home_facility": "ഹോം സൗകര്യമായി സജ്ജമാക്കുക",
"set_your_local_language": "നിങ്ങളുടെ പ്രാദേശിക ഭാഷ സജ്ജമാക്കുക",
"settings_and_filters": "ക്രമീകരണങ്ങളും ഫിൽട്ടറുകളും",
"settings": "സെറ്റിംഗ്സ്",
"severity_of_breathlessness": "ശ്വാസതടസ്സത്തിൻ്റെ തീവ്രത",
"sex": "ലൈംഗികത",
"shared_by": "പങ്കിട്ടത്",
Expand Down Expand Up @@ -1875,7 +1877,7 @@
"username_available": "ഉപയോക്തൃനാമം ലഭ്യമാണ്",
"username_not_available": "ഉപയോക്തൃനാമം ലഭ്യമല്ല",
"username_userdetails_not_found": "ഉപയോക്തൃനാമമോ ഉപയോക്തൃ വിശദാംശങ്ങളോ കണ്ടെത്താനായില്ല",
"users": "ഉപയോക്താക്കൾ",
"users": "യൂസേഴ്സ്",
"vacant": "ഒഴിഞ്ഞുകിടക്കുന്നു",
"vaccinated": "വാക്സിനേഷൻ നൽകി",
"vaccine_name": "വാക്സിൻ പേര്",
Expand Down
3 changes: 1 addition & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
],
"automergeStrategy": "squash",
"automergeType": "pr",
"bumpVersion": "minor",
"packageRules": [
{
"groupName": "all dependencies (minor, patch)",
Expand All @@ -23,4 +22,4 @@
"automerge": true
}
]
}
}
2 changes: 1 addition & 1 deletion src/components/Patient/PatientHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const PatientHome = (props: {
</div>
</div>
</div>
<div className="h-full lg:flex">
<div className="lg:flex">
<div className="h-full lg:mr-7 lg:basis-5/6">
{Tab && (
<Tab
Expand Down
2 changes: 1 addition & 1 deletion src/components/Questionnaire/CloneQuestionnaireSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function CloneQuestionnaireSheet({
silent: true,
}),
onSuccess: async (data: QuestionnaireDetail) => {
navigate(`/admin/questionnaire/${data.slug}`);
navigate(`/admin/questionnaire/${data.slug}/edit`);
setOpen(false);
},
onError: (error) => {
Expand Down
7 changes: 3 additions & 4 deletions src/components/Questionnaire/QuestionnaireEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
onSuccess: (data: QuestionnaireDetail) => {
toast.success("Questionnaire created successfully");
queryClient.invalidateQueries({ queryKey: ["questionnaireDetail", id] });
navigate(`/admin/questionnaire/${data.slug}`);
navigate(`/admin/questionnaire/${data.slug}/edit`);
},
onError: (_error) => {
toast.error("Failed to create questionnaire");
Expand All @@ -698,10 +698,9 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
mutationFn: mutate(questionnaireApi.update, {
pathParams: { id: id! },
}),
onSuccess: (data: QuestionnaireDetail) => {
onSuccess: () => {
toast.success("Questionnaire updated successfully");
queryClient.invalidateQueries({ queryKey: ["questionnaireDetail", id] });
navigate(`/admin/questionnaire/${data.slug}`);
},
onError: (_error) => {
toast.error("Failed to update questionnaire");
Expand Down Expand Up @@ -775,7 +774,7 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
};

const handleCancel = () => {
navigate(id ? `/admin/questionnaire/${id}` : "/admin/questionnaire");
navigate("/admin/questionnaire");
};

const toggleQuestionExpanded = (questionId: string) => {
Expand Down
34 changes: 21 additions & 13 deletions src/pages/UserDashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ChevronRight, LogOut, Settings, User2Icon } from "lucide-react";
import { Link } from "raviger";
import { useTranslation } from "react-i18next";

import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
Expand All @@ -15,21 +16,23 @@ export default function UserDashboard() {
const user = useAuthUser();
const { signOut } = useAuthContext();
const facilities = user.facilities || [];
const { t } = useTranslation();

const organizations = user.organizations || [];

return (
<div className="container mx-auto space-y-4 md:space-y-8 max-w-5xl px-4 py-4 md:p-6">
{/* Welcome Section */}
<div className="flex flex-col gap-4 bg-card p-4 md:p-6 rounded-lg border shadow-sm">
<div className="flex flex-col gap-4 bg-card p-4 md:p-6 rounded-lg border shadow-sm w-full mx-auto">
<div className="flex flex-col sm:flex-row sm:items-center gap-4">
<Avatar
name={formatDisplayName(user)}
imageUrl={user.read_profile_picture_url}
className="h-14 w-14 md:h-16 md:w-16"
/>
<div className="space-y-1">
<div className="space-y-1 text-center sm:text-left">
<h1 className="text-xl md:text-2xl font-bold">
Welcome back, {user.first_name}!
{t("welcome_back_name", { name: user.first_name })}
</h1>
<p className="text-sm md:text-base text-gray-500">
{new Date().toLocaleDateString("en-US", {
Expand All @@ -41,7 +44,7 @@ export default function UserDashboard() {
</p>
</div>
</div>
<div className="flex gap-3">
<div className="flex flex-col sm:flex-row gap-3 w-full">
<Button
variant="outline"
size="sm"
Expand All @@ -50,10 +53,10 @@ export default function UserDashboard() {
>
<Link
href={`/users/${user.username}`}
className="gap-2 text-inherit"
className="gap-2 text-inherit flex items-center"
>
<Settings className="h-4 w-4" />
Edit Profile
{t("edit_profile")}
</Link>
</Button>
{user.is_superuser && (
Expand All @@ -63,28 +66,31 @@ export default function UserDashboard() {
className="w-full sm:w-auto"
asChild
>
<Link href="/admin/questionnaire" className="gap-2 text-inherit">
<Link
href="/admin/questionnaire"
className="gap-2 text-inherit flex items-center"
>
<User2Icon className="h-4 w-4" />
Admin Dashboard
{t("admin_dashboard")}
</Link>
</Button>
)}
<Button
variant="outline"
size="sm"
className="w-full sm:w-auto"
onClick={() => signOut()}
onClick={signOut}
>
<LogOut className="h-4 w-4" />
Sign Out
{t("sign_out")}
</Button>
</div>
</div>

{/* Facilities Section */}
{facilities.length > 0 && (
<section className="space-y-3 md:space-y-4">
<h2 className="text-lg font-semibold px-1">Your Facilities</h2>
<h2 className="text-lg font-semibold px-1">{t("your_facilities")}</h2>
<div
className="grid gap-3 md:gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
data-cy="facility-list"
Expand All @@ -105,7 +111,7 @@ export default function UserDashboard() {
{facility.name}
</h3>
<p className="text-xs md:text-sm text-gray-500 truncate">
View facility details
{t("view_facility_details")}
</p>
</div>
<ChevronRight className="h-4 w-4 md:h-5 md:w-5 text-gray-500" />
Expand All @@ -120,7 +126,9 @@ export default function UserDashboard() {
{/* Organizations Section */}
{organizations.length > 0 && (
<section className="space-y-3 md:space-y-4">
<h2 className="text-lg font-semibold px-1">Your Organizations</h2>
<h2 className="text-lg font-semibold px-1">
{t("your_organizations")}
</h2>
<div
className="grid gap-3 md:gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
data-cy="organization-list"
Expand Down

0 comments on commit 77683cb

Please sign in to comment.