Skip to content

Commit

Permalink
Merge branch 'develop' into eslint_no_relative_path
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 authored Jan 20, 2025
2 parents 18572d9 + e5f2ce7 commit 553623e
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 30 deletions.
6 changes: 3 additions & 3 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
"allergen": "Allergen",
"allergies": "Allergies",
"allow_transfer": "Allow Transfer",
"allowed_formats_are": "Allowed formats are",
"allowed_formats_are": "Allowed formats are {{formats}}.",
"already_a_member": "Already a member?",
"alternate_phone_number": "Alternate Phone Number",
"ambulance_driver_name": "Name of ambulance driver",
Expand Down Expand Up @@ -1293,7 +1293,7 @@
"markdown_supported": "You can use markdown to format your facility description",
"max_dosage_24_hrs": "Max. dosage in 24 hrs.",
"max_dosage_in_24hrs_gte_base_dosage_error": "Max. dosage in 24 hours must be greater than or equal to base dosage",
"max_size_for_image_uploaded_should_be": "Max size for image uploaded should be",
"max_size_for_image_uploaded_should_be": "Max size for image uploaded should be {{maxSize}}.",
"measured_after": "Measured after",
"measured_before": "Measured before",
"medical": "Medical",
Expand Down Expand Up @@ -1691,7 +1691,7 @@
"reason_for_shift": "Reason for shift",
"reason_for_visit": "Reason for visit",
"reason_for_visit_placeholder": "Type the reason for booking appointment",
"recommended_aspect_ratio_for": "Recommended aspect ratio for",
"recommended_aspect_ratio_for": "Recommended aspect ratio for the image is {{aspectRatio}}.",
"record": "Record Audio",
"record_delete_confirm": "Are you sure you want to delete this record?",
"record_has_been_deleted_successfully": "Record has been deleted successfully.",
Expand Down
3 changes: 0 additions & 3 deletions public/locale/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
"all_changes_have_been_saved": "सभी परिवर्तन सहेज लिए गए हैं",
"all_details": "सभी विवरण",
"allergies": "एलर्जी",
"allowed_formats_are": "स्वीकृत प्रारूप हैं",
"already_a_member": "क्या पहले से ही सदस्य हैं?",
"ambulance_driver_name": "एम्बुलेंस चालक का नाम",
"ambulance_number": "एम्बुलेंस नं.",
Expand Down Expand Up @@ -475,7 +474,6 @@
"mark_transfer_complete_confirmation": "क्या आप वाकई इस स्थानांतरण को पूर्ण के रूप में चिह्नित करना चाहते हैं? ओरिजिन सुविधा अब इस रोगी तक पहुँच नहीं पाएगी",
"max_dosage_24_hrs": "अधिकतम खुराक 24 घंटे में.",
"max_dosage_in_24hrs_gte_base_dosage_error": "24 घंटे में अधिकतम खुराक आधार खुराक से अधिक या उसके बराबर होनी चाहिए",
"max_size_for_image_uploaded_should_be": "अपलोड की गई छवि का अधिकतम आकार होना चाहिए",
"medical_worker": "चिकित्साकर्मी",
"medicine": "दवा",
"medicine_administration_history": "औषधि प्रशासन इतिहास",
Expand Down Expand Up @@ -621,7 +619,6 @@
"reason_for_edit": "संपादन का कारण",
"reason_for_referral": "निर्दिष्ट करने की वजह",
"reason_for_shift": "बदलाव का कारण",
"recommended_aspect_ratio_for": "इसके लिए अनुशंसित पहलू अनुपात",
"record": "ऑडियो रिकॉर्ड करें",
"record_delete_confirm": "क्या आप वाकई इस रिकॉर्ड को हटाना चाहते हैं?",
"record_has_been_deleted_successfully": "रिकार्ड सफलतापूर्वक हटा दिया गया है.",
Expand Down
3 changes: 0 additions & 3 deletions public/locale/kn.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
"all_changes_have_been_saved": "ಎಲ್ಲಾ ಬದಲಾವಣೆಗಳನ್ನು ಉಳಿಸಲಾಗಿದೆ",
"all_details": "ಎಲ್ಲಾ ವಿವರಗಳು",
"allergies": "ಅಲರ್ಜಿಗಳು",
"allowed_formats_are": "ಅನುಮತಿಸಲಾದ ಸ್ವರೂಪಗಳು",
"already_a_member": "ಈಗಾಗಲೇ ಸದಸ್ಯರೇ?",
"ambulance_driver_name": "ಆಂಬ್ಯುಲೆನ್ಸ್ ಚಾಲಕನ ಹೆಸರು",
"ambulance_number": "ಆಂಬ್ಯುಲೆನ್ಸ್ ನಂ",
Expand Down Expand Up @@ -477,7 +476,6 @@
"mark_transfer_complete_confirmation": "ಈ ವರ್ಗಾವಣೆ ಪೂರ್ಣಗೊಂಡಿದೆ ಎಂದು ಗುರುತಿಸಲು ನೀವು ಖಚಿತವಾಗಿ ಬಯಸುವಿರಾ? ಮೂಲ ಸೌಲಭ್ಯವು ಇನ್ನು ಮುಂದೆ ಈ ರೋಗಿಗೆ ಪ್ರವೇಶವನ್ನು ಹೊಂದಿರುವುದಿಲ್ಲ",
"max_dosage_24_hrs": "ಗರಿಷ್ಠ 24 ಗಂಟೆಗಳಲ್ಲಿ ಡೋಸೇಜ್",
"max_dosage_in_24hrs_gte_base_dosage_error": "ಗರಿಷ್ಠ 24 ಗಂಟೆಗಳಲ್ಲಿ ಡೋಸೇಜ್ ಬೇಸ್ ಡೋಸೇಜ್‌ಗಿಂತ ಹೆಚ್ಚಾಗಿರಬೇಕು ಅಥವಾ ಸಮನಾಗಿರಬೇಕು",
"max_size_for_image_uploaded_should_be": "ಅಪ್‌ಲೋಡ್ ಮಾಡಿದ ಚಿತ್ರಕ್ಕೆ ಗರಿಷ್ಠ ಗಾತ್ರ ಇರಬೇಕು",
"medical_worker": "ವೈದ್ಯಕೀಯ ಕೆಲಸಗಾರ",
"medicine": "ಔಷಧಿ",
"medicine_administration_history": "ಮೆಡಿಸಿನ್ ಅಡ್ಮಿನಿಸ್ಟ್ರೇಷನ್ ಇತಿಹಾಸ",
Expand Down Expand Up @@ -623,7 +621,6 @@
"reason_for_edit": "ಸಂಪಾದನೆಗೆ ಕಾರಣ",
"reason_for_referral": "ಉಲ್ಲೇಖಕ್ಕೆ ಕಾರಣ",
"reason_for_shift": "ಸ್ಥಳಾಂತರಕ್ಕೆ ಕಾರಣ",
"recommended_aspect_ratio_for": "ಇದಕ್ಕಾಗಿ ಶಿಫಾರಸು ಮಾಡಲಾದ ಆಕಾರ ಅನುಪಾತ",
"record": "ರೆಕಾರ್ಡ್ ಆಡಿಯೋ",
"record_delete_confirm": "ಈ ದಾಖಲೆಯನ್ನು ಅಳಿಸಲು ನೀವು ಖಚಿತವಾಗಿ ಬಯಸುವಿರಾ?",
"record_has_been_deleted_successfully": "ದಾಖಲೆಯನ್ನು ಯಶಸ್ವಿಯಾಗಿ ಅಳಿಸಲಾಗಿದೆ.",
Expand Down
3 changes: 0 additions & 3 deletions public/locale/ml.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@
"allergen": "അലർജി",
"allergies": "അലർജികൾ",
"allow_transfer": "കൈമാറ്റം അനുവദിക്കുക",
"allowed_formats_are": "അനുവദനീയമായ ഫോർമാറ്റുകളാണ്",
"already_a_member": "ഇതിനകം തന്നെ ഒരു അംഗമാണോ?",
"alternate_phone_number": "ഇതര ഫോൺ നമ്പർ",
"ambulance_driver_name": "ആംബുലൻസ് ഡ്രൈവറുടെ പേര്",
Expand Down Expand Up @@ -1185,7 +1184,6 @@
"markdown_supported": "നിങ്ങളുടെ സൗകര്യ വിവരണം ഫോർമാറ്റ് ചെയ്യാൻ നിങ്ങൾക്ക് മാർക്ക്ഡൗൺ ഉപയോഗിക്കാം",
"max_dosage_24_hrs": "പരമാവധി. 24 മണിക്കൂറിനുള്ളിൽ ഡോസ്.",
"max_dosage_in_24hrs_gte_base_dosage_error": "പരമാവധി. 24 മണിക്കൂറിനുള്ളിലെ ഡോസ് അടിസ്ഥാന ഡോസേജിനേക്കാൾ കൂടുതലോ തുല്യമോ ആയിരിക്കണം",
"max_size_for_image_uploaded_should_be": "അപ്‌ലോഡ് ചെയ്‌ത ചിത്രത്തിനുള്ള പരമാവധി വലുപ്പം ആയിരിക്കണം",
"measured_after": "ശേഷം അളന്നു",
"measured_before": "മുമ്പ് അളന്നു",
"medical": "മെഡിക്കൽ",
Expand Down Expand Up @@ -1529,7 +1527,6 @@
"reason_for_shift": "ഷിഫ്റ്റിനുള്ള കാരണം",
"reason_for_visit": "സന്ദർശനത്തിനുള്ള കാരണം",
"reason_for_visit_placeholder": "അപ്പോയിൻ്റ്മെൻ്റ് ബുക്ക് ചെയ്യാനുള്ള കാരണം ടൈപ്പ് ചെയ്യുക",
"recommended_aspect_ratio_for": "ഇതിനായി ശുപാർശ ചെയ്യുന്ന വീക്ഷണ അനുപാതം",
"record": "റെക്കോർഡ് ഓഡിയോ",
"record_delete_confirm": "ഈ റെക്കോർഡ് ഇല്ലാതാക്കണമെന്ന് തീർച്ചയാണോ?",
"record_has_been_deleted_successfully": "റെക്കോർഡ് വിജയകരമായി ഇല്ലാതാക്കി.",
Expand Down
3 changes: 0 additions & 3 deletions public/locale/ta.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
"all_changes_have_been_saved": "அனைத்து மாற்றங்களும் சேமிக்கப்பட்டன",
"all_details": "அனைத்து விவரங்களும்",
"allergies": "ஒவ்வாமை",
"allowed_formats_are": "அனுமதிக்கப்பட்ட வடிவங்கள்",
"already_a_member": "ஏற்கனவே உறுப்பினரா?",
"ambulance_driver_name": "ஆம்புலன்ஸ் ஓட்டுநரின் பெயர்",
"ambulance_number": "ஆம்புலன்ஸ் எண்",
Expand Down Expand Up @@ -476,7 +475,6 @@
"mark_transfer_complete_confirmation": "இந்தப் பரிமாற்றம் முடிந்ததாக நிச்சயமாகக் குறிக்க விரும்புகிறீர்களா? இந்த நோயாளியை ஆரிஜின் வசதி இனி அணுகாது",
"max_dosage_24_hrs": "அதிகபட்சம். 24 மணி நேரத்தில் மருந்தளவு",
"max_dosage_in_24hrs_gte_base_dosage_error": "அதிகபட்சம். 24 மணிநேரத்தில் மருந்தளவு அடிப்படை அளவை விட அதிகமாகவோ அல்லது சமமாகவோ இருக்க வேண்டும்",
"max_size_for_image_uploaded_should_be": "பதிவேற்றப்பட்ட படத்திற்கான அதிகபட்ச அளவு இருக்க வேண்டும்",
"medical_worker": "மருத்துவ பணியாளர்",
"medicine": "மருந்து",
"medicine_administration_history": "மருத்துவ நிர்வாக வரலாறு",
Expand Down Expand Up @@ -621,7 +619,6 @@
"reason_for_edit": "திருத்தத்திற்கான காரணம்",
"reason_for_referral": "பரிந்துரைக்கான காரணம்",
"reason_for_shift": "மாற்றத்திற்கான காரணம்",
"recommended_aspect_ratio_for": "பரிந்துரைக்கப்பட்ட தோற்ற விகிதம்",
"record": "ஆடியோ பதிவு",
"record_delete_confirm": "இந்தப் பதிவை நிச்சயமாக நீக்க விரும்புகிறீர்களா?",
"record_has_been_deleted_successfully": "பதிவு வெற்றிகரமாக நீக்கப்பட்டது.",
Expand Down
16 changes: 10 additions & 6 deletions src/components/Common/AvatarEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface Props {
handleUpload: (file: File, onError: () => void) => Promise<void>;
handleDelete: (onError: () => void) => Promise<void>;
onClose?: () => void;
hint?: React.ReactNode;
}

const VideoConstraints = {
Expand Down Expand Up @@ -51,6 +52,7 @@ const AvatarEditModal = ({
handleUpload,
handleDelete,
onClose,
hint,
}: Props) => {
const [isProcessing, setIsProcessing] = useState(false);
const [selectedFile, setSelectedFile] = useState<File>();
Expand Down Expand Up @@ -165,15 +167,17 @@ const AvatarEditModal = ({
setIsDragging(false);
};

const commonHint = (
const defaultHint = (
<>
{t("max_size_for_image_uploaded_should_be")} 1mb.
{t("max_size_for_image_uploaded_should_be", { maxSize: "1MB" })}
<br />
{t("allowed_formats_are")} jpg,png,jpeg.{" "}
{t("recommended_aspect_ratio_for")} the image is 1:1
{t("allowed_formats_are", { formats: "jpg, png, jpeg" })}{" "}
{t("recommended_aspect_ratio_for", { aspectRatio: "1:1" })}
</>
);

const hintMessage = hint || defaultHint;

return (
<DialogModal
show={open}
Expand All @@ -195,7 +199,7 @@ const AvatarEditModal = ({
/>
</div>
<p className="text-center font-medium text-secondary-700">
{commonHint}
{hintMessage}
</p>
</>
) : (
Expand Down Expand Up @@ -246,7 +250,7 @@ const AvatarEditModal = ({
: `${t("drag_drop_image_to_upload")}`}
</p>
<p className="mt-4 text-center font-medium text-secondary-700">
{t("no_image_found")}. {commonHint}
{t("no_image_found")}. {hintMessage}
</p>
</div>
)}
Expand Down
21 changes: 18 additions & 3 deletions src/components/Facility/FacilityHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import Loading from "@/components/Common/Loading";

import { FACILITY_FEATURE_TYPES } from "@/common/constants";

import { PLUGIN_Component } from "@/PluginEngine";
import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import request from "@/Utils/request/request";
Expand Down Expand Up @@ -166,6 +167,15 @@ export const FacilityHome = ({ facilityId }: Props) => {

const hasPermissionToEditCoverImage = true;

const coverImageHint = (
<>
{t("max_size_for_image_uploaded_should_be", { maxSize: "1MB" })}
<br />
{t("allowed_formats_are", { formats: "jpg, png, jpeg" })}{" "}
{t("recommended_aspect_ratio_for", { aspectRatio: "16:9" })}
</>
);

return (
<div>
<ConfirmDialog
Expand All @@ -188,19 +198,20 @@ export const FacilityHome = ({ facilityId }: Props) => {
handleUpload={handleCoverImageUpload}
handleDelete={handleCoverImageDelete}
onClose={() => setEditCoverImage(false)}
hint={coverImageHint}
/>
<div className="container mx-auto p-6">
<div className="mx-auto max-w-3xl space-y-6">
<Card className="overflow-hidden border-none bg-transparent shadow-none">
<div className="group relative h-64 w-full overflow-hidden rounded-xl bg-gradient-to-br from-emerald-400 via-emerald-500 to-emerald-600">
{facilityData?.read_cover_image_url ? (
<>
<div className="absolute inset-0 bg-gradient-to-t from-black/60 via-black/30 to-transparent transition-opacity group-hover:opacity-70" />
<img
src={facilityData.read_cover_image_url}
alt={facilityData?.name}
className="h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"
/>
<div className="absolute inset-0 bg-gradient-to-t from-black/60 via-black/30 to-transparent transition-opacity group-hover:opacity-70" />
</>
) : (
<div className="relative h-full w-full bg-[radial-gradient(circle_at_50%_120%,rgba(255,255,255,0.2),transparent)]" />
Expand All @@ -227,7 +238,7 @@ export const FacilityHome = ({ facilityId }: Props) => {
<Button
variant="secondary"
size="icon"
className="bg-white/10 hover:bg-white/20"
className="bg-white/20 hover:bg-white/40"
>
<MoreVertical className="h-4 w-4 text-white" />
</Button>
Expand Down Expand Up @@ -267,6 +278,10 @@ export const FacilityHome = ({ facilityId }: Props) => {
{t("delete_facility")}
</DropdownMenuItem>
)} */}
<PLUGIN_Component
__name="FacilityHomeActions"
facility={facilityData}
/>
</DropdownMenuContent>
</DropdownMenu>
</div>
Expand All @@ -279,7 +294,7 @@ export const FacilityHome = ({ facilityId }: Props) => {
<CardContent>
<div className="flex flex-col gap-4 items-start mt-4">
<div className="flex items-start gap-3">
<MapPin className="mt-1 h-5 w-5 flex-shrink-0 text-muted-foreground" />
<MapPin className="mt-2 h-5 w-5 flex-shrink-0 text-muted-foreground" />
<div>
{facilityData?.geo_organization && (
<div className="mt-2 text-sm">
Expand Down
11 changes: 11 additions & 0 deletions src/components/Patient/PatientRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
import countryList from "@/common/static/countries.json";

import { PLUGIN_Component } from "@/PluginEngine";
import dayjs from "@/Utils/dayjs";
import routes from "@/Utils/request/api";
import mutate from "@/Utils/request/mutate";
import query from "@/Utils/request/query";
Expand Down Expand Up @@ -103,6 +104,10 @@ export default function PatientRegistration(
date_of_birth: z
.string()
.regex(/^\d{4}-\d{2}-\d{2}$/, t("date_of_birth_format"))
.refine((date) => {
const parsedDate = dayjs(date);
return parsedDate.isValid() && !parsedDate.isAfter(dayjs());
}, t("enter_valid_dob"))
.optional(),
age: z
.number()
Expand Down Expand Up @@ -519,6 +524,8 @@ export default function PatientRegistration(
type="number"
placeholder="DD"
{...field}
min={1}
max={31}
value={
form.watch("date_of_birth")?.split("-")[2]
}
Expand Down Expand Up @@ -553,6 +560,8 @@ export default function PatientRegistration(
value={
form.watch("date_of_birth")?.split("-")[1]
}
min={1}
max={12}
onChange={(e) => {
form.setValue(
"date_of_birth",
Expand Down Expand Up @@ -584,6 +593,8 @@ export default function PatientRegistration(
value={
form.watch("date_of_birth")?.split("-")[0]
}
min={1900}
max={new Date().getFullYear()}
onChange={(e) =>
form.setValue(
"date_of_birth",
Expand Down
17 changes: 11 additions & 6 deletions src/pages/Patient/components/AppointmentDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ import { formatAppointmentSlotTime } from "@/pages/Appointments/utils";
import PublicAppointmentApi from "@/types/scheduling/PublicAppointmentApi";
import { Appointment } from "@/types/scheduling/schedule";

function AppointmentDialog(props: {
function AppointmentDialog({
appointment,
open,
onOpenChange,
setAppointmentDialogOpen,
}: {
appointment: Appointment | undefined;
open: boolean;
onOpenChange: (open: boolean) => void;
Expand All @@ -40,10 +45,9 @@ function AppointmentDialog(props: {
queryClient.invalidateQueries({
queryKey: ["appointment", tokenData?.phoneNumber],
});
props.setAppointmentDialogOpen(false);
setAppointmentDialogOpen(false);
},
});
const { appointment, open, onOpenChange } = props;

if (!appointment) return <></>;

Expand Down Expand Up @@ -91,11 +95,12 @@ function AppointmentDialog(props: {
});
}}
>
<span>{t("Cancel")}</span>
<span>{t("cancel")}</span>
</Button>
<Button variant="secondary">
{/* TODO: wire this */}
{/* <Button variant="secondary">
<span>{t("reschedule")}</span>
</Button>
</Button> */}
</span>
</DialogFooter>
</DialogContent>
Expand Down
Loading

0 comments on commit 553623e

Please sign in to comment.