Skip to content

Commit

Permalink
Merge branch 'develop' into camera_error_fix_1
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh-D-2004 authored Mar 4, 2025
2 parents ba36501 + 3a85bfb commit e6f52e1
Show file tree
Hide file tree
Showing 29 changed files with 495 additions and 173 deletions.
18 changes: 13 additions & 5 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,10 @@
"associate": "Associate",
"associate_location": "Associate Location",
"associate_location_description": "Select a location to associate with this device",
"associated_by": "Associated by",
"associating": "Associating...",
"association_end_date": "Association end date",
"association_start_date": "Association start date",
"at_least_one_department_is_required": "At least one department is required",
"at_time": "at <strong>{{time}}</strong>",
"atypical_presentation_details": "Atypical presentation details",
Expand Down Expand Up @@ -709,6 +712,7 @@
"create_template": "Create Template",
"create_user": "Create User",
"create_user_and_add_to_org": "Create a new user and add them to the organization.",
"create_valueset": "Create ValueSet",
"created": "Created",
"created_by": "Created By",
"created_date": "Created Date",
Expand All @@ -718,7 +722,7 @@
"critical": "Critical",
"criticality": "Criticality",
"csv_file_in_the_specified_format": "Select a CSV file in the specified format",
"current_address": "Current Address",
"current_address": "Current Address and Route to Home",
"current_location_description": "The current location of this device",
"current_organizations": "Current Organizations",
"current_password": "Current Password",
Expand Down Expand Up @@ -782,6 +786,7 @@
"device_availability_status_lost": "Lost",
"device_contact_description": "Contact points associated with this device",
"device_information": "Device Information",
"device_location_history": "Device Location History",
"device_not_found": "Device not found",
"device_status_active": "Active",
"device_status_entered_in_error": "Entered in Error",
Expand Down Expand Up @@ -1175,6 +1180,7 @@
"from_date_must_be_before_to_date": "From date must be before to date",
"from_user": "from User",
"fulfilled": "Fulfilled",
"full_day_unavailable": "Full Day Unavailable",
"full_name": "Full Name",
"full_screen": "Full Screen",
"gender": "Gender",
Expand Down Expand Up @@ -1411,7 +1417,8 @@
"make_facility_public": "Make this facility public",
"make_facility_public_description": "When enabled, this facility will be visible to the public and can be discovered by anyone using the platform",
"make_multiple_beds_label": "Do you want to make multiple beds?",
"manage_and_view_questionnaires": "Manage and view questionnaires",
"manage_and_view_questionnaires": "Manage and View Questionnaires",
"manage_and_view_valuesets": "Manage and View ValueSets",
"manage_bed_presets": "Manage Presets of Bed",
"manage_facility_users": "Manage encounters",
"manage_my_schedule": "Manage my schedule",
Expand Down Expand Up @@ -1884,12 +1891,12 @@
"quantity_approved": "Quantity Approved",
"quantity_requested": "Quantity Requested",
"quantity_required": "Quantity Required",
"questionnaire": "Questionnaire",
"questionnaire_error_loading": "Error loading questionnaire",
"questionnaire_not_exist": "The questionnaire you tried to access does not exist.",
"questionnaire_one": "Questionnaire",
"questionnaire_other": "Questionnaires",
"questionnaire_submission_failed": "Failed to submit questionnaire",
"questionnaire_submitted_successfully": "Questionnaire submitted successfully",
"questionnaires": "Questionnaires",
"quick_access": "Quick Access",
"quick_actions": "Quick Actions",
"quick_actions_description": "Schedule an appointment or create a new encounter",
Expand Down Expand Up @@ -2106,6 +2113,7 @@
"search_user": "Search User",
"search_user_description": "Search for a user and assign a role to add them to the patient.",
"search_users": "Search users...",
"search_valuesets": "Search ValueSets",
"searching": "Searching...",
"see_attachments": "See Attachments",
"see_details": "See Details",
Expand Down Expand Up @@ -2501,7 +2509,7 @@
"valid_year_of_birth": "Please enter a valid year of birth (YYYY)",
"value": "Value",
"value_set": "Value Set",
"valuesets": "Valuesets",
"valuesets": "ValueSets",
"vehicle_preference": "Vehicle preference",
"vendor_name": "Vendor Name",
"ventilator_interface": "Respiratory Support Type",
Expand Down
2 changes: 1 addition & 1 deletion public/locale/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -801,4 +801,4 @@
"you_need_at_least_a_location_to_create_an_assest": "संपत्ति बनाने के लिए आपको कम से कम एक स्थान की आवश्यकता होगी।",
"zoom_in": "ज़ूम इन",
"zoom_out": "ज़ूम आउट"
}
}
1 change: 0 additions & 1 deletion public/locale/ml.json
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,6 @@
"quantity_approved": "അളവ് അംഗീകരിച്ചു",
"quantity_requested": "അഭ്യർത്ഥിച്ച അളവ്",
"quantity_required": "ആവശ്യമായ അളവ്",
"questionnaire": "ചോദ്യാവലി",
"questionnaire_error_loading": "ചോദ്യാവലി ലോഡുചെയ്യുന്നതിൽ പിശക്",
"questionnaire_not_exist": "നിങ്ങൾ ആക്സസ് ചെയ്യാൻ ശ്രമിച്ച ചോദ്യാവലി നിലവിലില്ല.",
"raise_consent_request": "ABDM വഴി രോഗിയുടെ രേഖകൾ ലഭ്യമാക്കാൻ സമ്മത അഭ്യർത്ഥന ഉന്നയിക്കുക",
Expand Down
16 changes: 16 additions & 0 deletions src/components/Facility/FacilityForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import validators from "@/Utils/validators";
import GovtOrganizationSelector from "@/pages/Organization/components/GovtOrganizationSelector";
import { BaseFacility } from "@/types/facility/facility";
import { Organization } from "@/types/organization/organization";
import organizationApi from "@/types/organization/organizationApi";

interface FacilityProps {
organizationId?: string;
Expand All @@ -50,6 +51,7 @@ interface FacilityProps {
}

export default function FacilityForm({
organizationId,
facilityId,
onSubmitSuccess,
}: FacilityProps) {
Expand Down Expand Up @@ -91,6 +93,20 @@ export default function FacilityForm({
},
});

const { data: org } = useQuery({
queryKey: ["organization", organizationId],
queryFn: query(organizationApi.get, {
pathParams: { id: organizationId },
}),
enabled: !!organizationId,
});

useEffect(() => {
const levels: Organization[] = [];
if (org && org.org_type === "govt") levels.push(org);
setSelectedLevels(levels);
}, [org, organizationId]);

const { mutate: createFacility, isPending } = useMutation({
mutationFn: mutate(routes.facility.create),
onSuccess: (_data: BaseFacility) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Patient/EncounterQuestionnaire.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function EncounterQuestionnaire({
enabled: !!encounterId,
});
return (
<Page title={t("questionnaire")}>
<Page title={t("questionnaire_one")}>
<div className="flex flex-col space-y-4 mt-4">
{encounter && (
<div className="size-full rounded-lg border bg-white text-black shadow">
Expand Down
3 changes: 2 additions & 1 deletion src/components/Questionnaire/QuestionnaireList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import questionnaireApi from "@/types/questionnaire/questionnaireApi";
export function QuestionnaireList() {
const { qParams, updateQuery, Pagination, resultsPerPage } = useFilters({
limit: 15,
disableCache: true,
});

const navigate = useNavigate();
Expand All @@ -45,7 +46,7 @@ export function QuestionnaireList() {
<div className="container mx-auto px-4 py-6">
<div className="mb-4 ">
<div className="mb-2">
<h1 className="text-2xl font-bold">{t("questionnaires")}</h1>
<h1 className="text-2xl font-bold">{t("questionnaire_other")}</h1>
<p className="text-gray-600">{t("manage_and_view_questionnaires")}</p>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/components/Questionnaire/QuestionnaireSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ export function QuestionnaireSearch({
<CareIcon icon="l-arrow-down" className="ml-2 h-4 w-4" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-[600px] p-0" align="start">
<PopoverContent className="w-full sm:w-[600px] p-0" align="start">
<div className="flex items-center border-b px-3">
<CareIcon
icon="l-search"
className="mr-2 h-4 w-4 shrink-0 text-gray-500"
/>
<input
className="flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-gray-500 disabled:cursor-not-allowed disabled:opacity-50"
className="flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-gray-500 disabled:cursor-not-allowed disabled:opacity-50 focus:ring-0 focus:border-transparent"
placeholder="Search questionnaires..."
value={search}
onChange={(e) => setSearch(e.target.value)}
Expand Down
11 changes: 7 additions & 4 deletions src/components/Users/UserAvailabilityTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,15 @@ export default function UserAvailabilityTab({ userData: user }: Props) {
/>

<div className="space-y-4">
<div className="flex items-end justify-between">
<div className="flex bg-gray-100 rounded-lg p-1 gap-1 max-w-min">
<div className="flex items-end justify-between gap-3 md:gap-0">
<div className="flex bg-gray-100 rounded-lg p-0 md:p-1 gap-1 max-w-min">
<Button
variant={view === "schedule" ? "outline" : "ghost"}
onClick={() => setQParams({ tab: "schedule" })}
className={cn(view === "schedule" && "shadow", "hover:bg-white")}
className={cn(
view === "schedule" && "shadow",
"hover:bg-white text-xs sm:text-sm px-2 md:px-4",
)}
>
{t("schedule")}
</Button>
Expand All @@ -189,7 +192,7 @@ export default function UserAvailabilityTab({ userData: user }: Props) {
onClick={() => setQParams({ tab: "exceptions" })}
className={cn(
view === "exceptions" && "shadow",
"hover:bg-white",
"hover:bg-white text-xs sm:text-sm px-2 md:px-4",
)}
>
{t("exceptions")}
Expand Down
37 changes: 23 additions & 14 deletions src/components/Users/UserBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { TooltipComponent } from "@/components/ui/tooltip";

import { Avatar } from "@/components/Common/Avatar";

import { formatDisplayName, formatName } from "@/Utils/utils";
Expand All @@ -12,29 +14,36 @@ export default function UserBanner({ userData }: { userData: UserBase }) {

return (
<div className="mt-2 flex flex-col justify-between gap-3 sm:flex-row">
<div className="mb-3 flex w-full flex-col justify-between gap-3 rounded bg-white p-3 shadow-sm transition-all duration-200 ease-in-out sm:flex-row md:p-6">
<div className="mb-3 flex flex-col w-full justify-between gap-3 rounded p-3 shadow-sm transition-all duration-200 ease-in-out sm:flex-row md:p-6">
<div className="flex flex-row gap-2 self-center">
<Avatar
imageUrl={userData?.profile_picture_url}
name={formatDisplayName(userData)}
className="h-20 w-20 md:mr-2 lg:mr-3 lg:h-16 lg:w-16"
className="h-20 w-20 md:mr-2 shrink-0"
/>
<div className="flex flex-col self-center">
<div className="grid grid-cols-1 self-center">
<div className="flex flex-row items-center gap-3">
<h1 className="text-xl font-bold" id="users-name">
{formatName(userData)}
</h1>
<TooltipComponent content={formatName(userData)} side="top">
<h1 className="text-xl font-bold truncate" id="users-name">
{formatName(userData)}
</h1>
</TooltipComponent>
<div className="min-width-50 shrink-0 text-sm text-secondary-600">
<UserStatusIndicator user={userData} addPadding />
<UserStatusIndicator
user={userData}
addPadding
className="pl-0"
/>
</div>
</div>

<span
id="username"
className="text-sm font-light leading-relaxed text-secondary-600"
>
{userData.username}
</span>
<TooltipComponent content={userData.username} side="bottom">
<p
id="username"
className="text-sm font-light leading-relaxed text-secondary-600 truncate"
>
{userData.username}
</p>
</TooltipComponent>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Users/UserListAndCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const UserCard = ({ user }: { user: UserBase }) => {
<div className="flex flex-col min-w-0 flex-1">
<div className="flex flex-col gap-1">
<div className="flex items-start justify-between">
<h1 className="text-base font-bold break-words pr-2">
<h1 className="text-base font-bold break-words pr-2 w-[50%] text-wrap">
{user.first_name} {user.last_name}
</h1>
<span className="text-sm text-gray-500">
Expand Down
12 changes: 8 additions & 4 deletions src/components/Users/UserViewDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useTranslation } from "react-i18next";

import { TooltipComponent } from "@/components/ui/tooltip";

import { UserBase } from "@/types/user/user";

interface UserViewDetailsProps {
Expand All @@ -16,10 +18,12 @@ const LabelValue = ({
id?: string;
}) => (
<div className="flex flex-col gap-1">
<span className="text-sm text-gray-500">{label}</span>
<span id={`view-${id}`} className="text-sm">
{value || "-"}
</span>
<p className="text-sm text-gray-500">{label}</p>
<TooltipComponent content={value || "-"} side="bottom">
<span id={`view-${id}`} className="text-sm truncate max-w-fit">
{value || "-"}
</span>
</TooltipComponent>
</div>
);

Expand Down
6 changes: 5 additions & 1 deletion src/components/ValueSet/ValueSetForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,11 @@ export function ValueSetForm({
>
{t("cancel")}
</Button>
<Button variant="primary" type="submit" disabled={isSubmitting}>
<Button
variant="primary"
type="submit"
disabled={isSubmitting || !form.formState.isDirty}
>
{isSubmitting ? t("saving") : t("save_valueset")}
</Button>
</div>
Expand Down
Loading

0 comments on commit e6f52e1

Please sign in to comment.