Skip to content

Commit

Permalink
Merge branch 'develop' into resource-request-form
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishith25 authored Jan 29, 2025
2 parents 5631c50 + d9689df commit 8eaea75
Show file tree
Hide file tree
Showing 17 changed files with 147 additions and 115 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
Expand All @@ -45,7 +45,7 @@ jobs:
${{ runner.os }}-buildx-test-
- name: Test build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
${{ runner.os }}-buildx-build-
- name: Build and push image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: github.repository == 'ohcnetwork/care_fe' && github.event_name == 'issues' && github.event.action == 'opened' || github.event.action == 'reopened'
steps:
- name: 'Move issue to "Triage"'
uses: leonsteinhaeuser/project-beta-automations@v1.3.0
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
with:
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
organization: ohcnetwork
Expand All @@ -26,7 +26,7 @@ jobs:
if: github.repository == 'ohcnetwork/care_fe' && github.event_name == 'issues' && github.event.action == 'closed'
steps:
- name: 'Moved issue to "Done"'
uses: leonsteinhaeuser/project-beta-automations@v1.3.0
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
with:
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
organization: ohcnetwork
Expand All @@ -39,7 +39,7 @@ jobs:
if: github.repository == 'ohcnetwork/care_fe' && github.event_name == 'issues' && github.event.action == 'assigned'
steps:
- name: 'Move issue to "In Progress"'
uses: leonsteinhaeuser/project-beta-automations@v1.3.0
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
with:
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
organization: ohcnetwork
Expand Down
94 changes: 47 additions & 47 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"uuid": "^11.0.2",
"vite": "^5.4.10",
"vite-plugin-checker": "^0.8.0",
"vite-plugin-pwa": "^0.20.5",
"vite-plugin-pwa": "^0.21.0",
"vite-plugin-static-copy": "^2.0.0",
"zod": "^3.23.8"
},
Expand Down
1 change: 0 additions & 1 deletion src/Utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ export const formatPatientAge = (
obj: PatientModel | Patient,
abbreviated = false,
) => {
if (obj.age != null) return `${obj.age} Y`;
const suffixes = getRelativeDateSuffix(abbreviated);
const start = dayjs(
obj.date_of_birth
Expand Down
17 changes: 15 additions & 2 deletions src/components/Facility/FacilityForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ interface FacilityProps {
onSubmitSuccess?: () => void;
}

function extractHierarchyLevels(org: Organization | undefined): Organization[] {
const levels: Organization[] = [];
while (org && org.level_cache >= 0) {
levels.unshift(org as Organization);
org = org.parent as Organization | undefined;
}
return levels;
}

export default function FacilityForm(props: FacilityProps) {
const { t } = useTranslation();
const queryClient = useQueryClient();
Expand Down Expand Up @@ -177,7 +186,11 @@ export default function FacilityForm(props: FacilityProps) {

useEffect(() => {
if (facilityId) return;
const orgLevels = extractHierarchyLevels(org);
const districtMatch =
districtOrg && orgLevels.some((level) => level.name === districtOrg.name);
const levels: Organization[] = [];
if (districtMatch) return;
if (stateOrg) levels.push(stateOrg);
if (districtOrg) levels.push(districtOrg);
if (!stateOrg && !districtOrg && org) levels.push(org);
Expand Down Expand Up @@ -211,8 +224,8 @@ export default function FacilityForm(props: FacilityProps) {
)?.id,
address: facilityData.address,
phone_number: facilityData.phone_number,
latitude: facilityData.latitude,
longitude: facilityData.longitude,
latitude: Number(facilityData.latitude),
longitude: Number(facilityData.longitude),
is_public: facilityData.is_public,
});
}
Expand Down
16 changes: 0 additions & 16 deletions src/components/Patient/PatientDetailsTab/Demography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,22 +265,6 @@ export const Demography = (props: PatientProps) => {
</div>

<div className="lg:basis-4/5">
<div className="mb-2 flex flex-row justify-between">
<div>
<Button
id="update-patient-details"
variant="outline"
className="mt-4"
disabled={!!patientData.death_datetime}
onClick={withPermissionCheck(() =>
navigate(`/facility/${id}/patient/${id}/update`),
)}
>
<CareIcon icon="l-edit-alt" className="text-lg pr-1" />
{t("edit_profile")}
</Button>
</div>
</div>
{/* <div className="mt-4 rounded-md border border-blue-400 bg-blue-50 p-5 grid grid-cols-1 gap-x-4 gap-y-2 md:grid-cols-2 md:gap-y-8 lg:grid-cols-2">
{[
{ label: t("abha_number"), value: "-" },
Expand Down
7 changes: 4 additions & 3 deletions src/components/Patient/PatientRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,10 @@ export default function PatientRegistration(
same_address:
patientQuery.data.address === patientQuery.data.permanent_address,
age_or_dob: patientQuery.data.date_of_birth ? "dob" : "age",
age: !patientQuery.data.date_of_birth
? patientQuery.data.age
: undefined,
age:
!patientQuery.data.date_of_birth && patientQuery.data.year_of_birth
? new Date().getFullYear() - patientQuery.data.year_of_birth
: undefined,
date_of_birth: patientQuery.data.date_of_birth
? patientQuery.data.date_of_birth
: undefined,
Expand Down
8 changes: 6 additions & 2 deletions src/components/Resource/ResourceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,17 @@ export default function ResourceDetails(props: { id: string }) {
<div className="mx-auto max-w-7xl space-y-6 p-4 md:p-6">
{/* Action Buttons */}
<div className="flex items-center justify-between">
<div className="flex gap-2">
<Button onClick={() => setIsPrintMode(true)}>
<div className="flex flex-wrap gap-2 w-full">
<Button
onClick={() => setIsPrintMode(true)}
className="w-full sm:w-auto"
>
<CareIcon icon="l-file-alt" className="mr-2 h-4 w-4" />
{t("request_letter")}
</Button>
<Button
variant="outline"
className="w-full sm:w-auto"
onClick={() => navigate(`/resource/${data.id}/update`)}
>
<CareIcon icon="l-edit" className="mr-2 h-4 w-4" />
Expand Down
Loading

0 comments on commit 8eaea75

Please sign in to comment.