Skip to content

Commit

Permalink
en.json updated, debouncing is added all the requested changes are done
Browse files Browse the repository at this point in the history
  • Loading branch information
i0am0arunava committed Jan 9, 2025
1 parent 9615a9b commit 1afa00d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
7 changes: 6 additions & 1 deletion public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
"LOG_UPDATE_FIELD_LABEL__ventilator_spo2": "SpO₂",
"LOG_UPDATE_UPDATED_NOTIFICATION": "{{ roundType }} updated successfully",
"NORMAL": "Brief Update",
"no_sub_organizations_found": "No sub_organizations found",
"no_organizations_found_matching": "No organizations found matching",
"NURSING_CARE_PROCEDURE__ascitic_tapping": "Ascitic Tapping",
"NURSING_CARE_PROCEDURE__bed_bath": "Bed Bath",
"NURSING_CARE_PROCEDURE__catheter_care": "Catheter Care",
Expand Down Expand Up @@ -1609,6 +1611,8 @@
"search": "Search",
"search_by_emergency_contact_phone_number": "Search by Emergency Contact Phone Number",
"search_by_emergency_phone_number": "Search by Emergency Phone Number",
"search_facilities": "Search Facilities",
"search_by_name": "Search by name",
"search_by_patient_name": "Search by Patient Name",
"search_by_patient_no": "Search by Patient Number",
"search_by_phone_number": "Search by Phone Number",
Expand Down Expand Up @@ -1700,6 +1704,7 @@
"spokes": "Spoke Facilities",
"srf_id": "SRF ID",
"staff_list": "Staff List",
"staff": "Staff",
"start_consultation": "Start Consultation",
"start_datetime": "Start Date/Time",
"start_dosage": "Start Dosage",
Expand Down Expand Up @@ -1930,4 +1935,4 @@
"you_need_at_least_a_location_to_create_an_assest": "You need at least a location to create an assest.",
"zoom_in": "Zoom In",
"zoom_out": "Zoom Out"
}
}
12 changes: 6 additions & 6 deletions src/pages/FacilityOrganization/FacilityOrganizationView.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from "@tanstack/react-query";
import { Link } from "raviger";
import { useState } from "react";

import { useTranslation } from "react-i18next";
import CareIcon from "@/CAREUI/icons/CareIcon";

Check failure on line 5 in src/pages/FacilityOrganization/FacilityOrganizationView.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎`

import { Badge } from "@/components/ui/badge";
Expand Down Expand Up @@ -32,7 +32,7 @@ export default function FacilityOrganizationView({ id, facilityId }: Props) {
searchQuery,
500,
);

const {t}=useTranslation();

Check failure on line 35 in src/pages/FacilityOrganization/FacilityOrganizationView.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `const·{t}=` with `·const·{·t·}·=·`
const { data: children, isLoading } = useQuery({
queryKey: [
"facilityOrganization",
Expand All @@ -58,11 +58,11 @@ export default function FacilityOrganizationView({ id, facilityId }: Props) {
<FacilityOrganizationLayout id={id} facilityId={facilityId}>
<div className="space-y-6">
<div className="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
<h2 className="text-lg font-semibold">Organizations</h2>
<h2 className="text-lg font-semibold">{t("organizations")}</h2>
<div className="flex items-center gap-4 w-full sm:w-auto">
<div className="w-full sm:w-72">
<Input
placeholder="Search by name..."
placeholder={t("search_by_name")}
value={searchQuery}
onChange={(e) => {
setSearchQuery(e.target.value);
Expand Down Expand Up @@ -138,8 +138,8 @@ export default function FacilityOrganizationView({ id, facilityId }: Props) {
<Card className="col-span-full">
<CardContent className="p-6 text-center text-gray-500">
{searchQuery
? `No organizations found matching "${searchQuery}"`
: "No sub-organizations found."}
? `${t("no_organizations_found_matching")} "${searchQuery}"`
: `${t("no_sub_organizations_found")}`}
</CardContent>
</Card>
)}
Expand Down
9 changes: 5 additions & 4 deletions src/pages/Organization/OrganizationFacilities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { BaseFacility } from "@/types/facility/facility";

import AddFacilitySheet from "./components/AddFacilitySheet";
import OrganizationLayout from "./components/OrganizationLayout";

Check failure on line 20 in src/pages/Organization/OrganizationFacilities.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `t";⏎import·{·useTranslation·}·from·"react-i18nex`
import { useTranslation } from "react-i18next";

interface Props {
id: string;
Expand All @@ -32,7 +33,7 @@ export default function OrganizationFacilities({
useFilters({ limit: 14, cacheBlacklist: ["facility"] });

const [debouncedParams, setDebouncedParams] = useDebouncedState(qParams, 500);

const { t } = useTranslation();
const { data: facilities, isLoading } = useQuery({
queryKey: ["organizationFacilities", id, debouncedParams],
queryFn: query(routes.facility.list, {
Expand Down Expand Up @@ -63,7 +64,7 @@ export default function OrganizationFacilities({
<div className="flex gap-2">
<Input
type="text"
placeholder="Search facilities..."
placeholder={t("search_facilities")}
value={qParams.name || ""}
onChange={(e) => {
updateQuery({
Expand Down Expand Up @@ -106,7 +107,7 @@ export default function OrganizationFacilities({
) : facilities?.results?.length === 0 ? (
<Card className="col-span-full">
<CardContent className="p-6 text-center text-gray-500">
No facilities found.
{t("no_facilities_found")}
</CardContent>
</Card>
) : (
Expand Down Expand Up @@ -149,7 +150,7 @@ export default function OrganizationFacilities({
href={`/facility/${facility.id}`}
className="text-sm text-primary hover:underline"
>
View Facility
{t("view_facility")}

Check failure on line 153 in src/pages/Organization/OrganizationFacilities.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `·`
<Button
variant="ghost"
size="icon"
Expand Down
11 changes: 5 additions & 6 deletions src/pages/Organization/OrganizationView.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from "@tanstack/react-query";
import { Link } from "raviger";
import { useState } from "react";

import { useTranslation } from "react-i18next";
import CareIcon from "@/CAREUI/icons/CareIcon";

Check failure on line 5 in src/pages/Organization/OrganizationView.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `⏎`

import { Badge } from "@/components/ui/badge";
Expand Down Expand Up @@ -32,9 +32,8 @@ export default function OrganizationView({ id, navOrganizationId }: Props) {
searchQuery,
500,
);

const limit = 12; // 3x4 grid

const { t } = useTranslation();
const { data: children, isLoading } = useQuery({
queryKey: ["organization", id, "children", page, limit, debouncedParams],
queryFn: query(organizationApi.list, {
Expand All @@ -59,7 +58,7 @@ export default function OrganizationView({ id, navOrganizationId }: Props) {
<h2 className="text-lg font-semibold">Organizations</h2>
<div className="w-72">
<Input
placeholder="Search by name..."
placeholder={t("search_by_name")}
value={searchQuery}
onChange={(e) => {
setSearchQuery(e.target.value);
Expand Down Expand Up @@ -137,8 +136,8 @@ export default function OrganizationView({ id, navOrganizationId }: Props) {
<Card className="col-span-full">
<CardContent className="p-6 text-center text-gray-500">
{searchQuery
? `No organizations found matching "${searchQuery}"`
: "No sub-organizations found."}
? `${t("no_organizations_found_matching")} "${searchQuery}"`
: `${t("no_sub_organizations_found")}`}
</CardContent>
</Card>
)}
Expand Down

0 comments on commit 1afa00d

Please sign in to comment.