diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 072ef946575..a89b65fe487 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/issue-automation.yml b/.github/workflows/issue-automation.yml index 7910b26a18c..59f164781b8 100644 --- a/.github/workflows/issue-automation.yml +++ b/.github/workflows/issue-automation.yml @@ -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 @@ -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 @@ -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 diff --git a/package-lock.json b/package-lock.json index 64e65897005..6949b7b3ad1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -144,7 +144,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" }, @@ -5866,50 +5866,50 @@ ] }, "node_modules/@sentry-internal/browser-utils": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.51.0.tgz", - "integrity": "sha512-r94yfRK17zNJER0hgQE4qOSy5pWzsnFcGTJQSqhSEKUcC4KK37qSfoPrPejFxtIqXhqlkd/dTWKvrMwXWcn0MQ==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.52.0.tgz", + "integrity": "sha512-ojFldpRpGrgacIQMbbMZeqLYetNJJ61n+Pz29FpggaIRrbkq84ocoy4FCy+9BuLo6ywgxtUFrjOXD9pPRcZtUA==", "license": "MIT", "dependencies": { - "@sentry/core": "8.51.0" + "@sentry/core": "8.52.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/feedback": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.51.0.tgz", - "integrity": "sha512-VgfxSZWLYUPKDnkt2zG+Oe5ccv8U3WPM6Mo4kfABIJT3Ai4VbZB7+vb2a4pm6lUCF9DeOPXHb5o9Tg17SHDAHw==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.52.0.tgz", + "integrity": "sha512-r62Ufg4uGlvQsQ+nRSiq9y0ieVFRlZvUaoT/zMjmPuMg29O9rRAMdPJuiCpBH4++x8KJoJ9c2HBRizn6/3uc5Q==", "license": "MIT", "dependencies": { - "@sentry/core": "8.51.0" + "@sentry/core": "8.52.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/replay": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.51.0.tgz", - "integrity": "sha512-lkm7id3a2n3yMZeF5socCVQUeEeShNOGr7Wtsmb5RORacEnld0z+NfbMTilo1mDwiWBzI5OYBjm62eglm1HFsQ==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.52.0.tgz", + "integrity": "sha512-b4hQPni1G2tcV5XuAPSV4RTX3vqPXO9RfUXLuTBzOTNzBHDoj8nQv0yVvcysGy5tBAuVRo5ya5A+PG/iC6FA9A==", "license": "MIT", "dependencies": { - "@sentry-internal/browser-utils": "8.51.0", - "@sentry/core": "8.51.0" + "@sentry-internal/browser-utils": "8.52.0", + "@sentry/core": "8.52.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/replay-canvas": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.51.0.tgz", - "integrity": "sha512-ERXIbwdULkdtIQnfkMLRVfpoGV2rClwySGRlTPepFKeLxlcXo9o09cPu+qbukiDnGK0cgEgRnrV961hMg21Bmw==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.52.0.tgz", + "integrity": "sha512-4ES2uCUb9yEO1cbg15UBqiYU/syQYj5GviI+TvYvnPX3I8K2mK941ZRqfHh2HpFMhMxLgfX4jDqDGizNhXWdqg==", "license": "MIT", "dependencies": { - "@sentry-internal/replay": "8.51.0", - "@sentry/core": "8.51.0" + "@sentry-internal/replay": "8.52.0", + "@sentry/core": "8.52.0" }, "engines": { "node": ">=14.18" @@ -5945,25 +5945,25 @@ } }, "node_modules/@sentry/browser": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.51.0.tgz", - "integrity": "sha512-1kbbyVfBBAx5Xyynp+lC5lLnAHo0qJ2r4mtmdT6koPjesvoOocEK0QQnouQBmdUbm3L0L/bPI1SgXjbeJyhzHQ==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.52.0.tgz", + "integrity": "sha512-7JpJ9zpInozBzy61eJf/6RPHoKUCFcoFuKd9rttkN1gyY9xkU1cQK+x1f0deiIHnF9ydftmDtXW+kGFI/+xqtw==", "license": "MIT", "dependencies": { - "@sentry-internal/browser-utils": "8.51.0", - "@sentry-internal/feedback": "8.51.0", - "@sentry-internal/replay": "8.51.0", - "@sentry-internal/replay-canvas": "8.51.0", - "@sentry/core": "8.51.0" + "@sentry-internal/browser-utils": "8.52.0", + "@sentry-internal/feedback": "8.52.0", + "@sentry-internal/replay": "8.52.0", + "@sentry-internal/replay-canvas": "8.52.0", + "@sentry/core": "8.52.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry/core": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.51.0.tgz", - "integrity": "sha512-Go0KxCYLw+OBIlLSv5YsYX+x9NW43fNVcyB6rhkSp2Q5Zme3tAE6KtZFvyu4SO7G/903wisW5Q6qV6UuK/ee4A==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.52.0.tgz", + "integrity": "sha512-2j3B7IKmseTKFm6AyheJ+RSgXqIsx+3blFSuxpkdvsEt60Lbzva2uDkCENfBDOclioo1kvHgsyuXLfWW4A+wwA==", "license": "MIT", "engines": { "node": ">=14.18" @@ -8602,9 +8602,9 @@ "license": "MIT" }, "node_modules/cypress": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-14.0.0.tgz", - "integrity": "sha512-kEGqQr23so5IpKeg/dp6GVi7RlHx1NmW66o2a2Q4wk9gRaAblLZQSiZJuDI8UMC4LlG5OJ7Q6joAiqTrfRNbTw==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-14.0.1.tgz", + "integrity": "sha512-gBAvKZE3f6eBaW1v8OtrwAFP90rjNZjjOO40M2KvOvmwVXk96Ps5Yjyck1EzGkXmNCaC/8kXFOY/1KD/wsaWpQ==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -14792,9 +14792,9 @@ } }, "node_modules/prettier-plugin-tailwindcss": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.9.tgz", - "integrity": "sha512-r0i3uhaZAXYP0At5xGfJH876W3HHGHDp+LCRUJrs57PBeQ6mYHMwr25KH8NPX44F2yGTvdnH7OqCshlQx183Eg==", + "version": "0.6.11", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.11.tgz", + "integrity": "sha512-YxaYSIvZPAqhrrEpRtonnrXdghZg1irNg4qrjboCXrpybLWVs55cW2N3juhspVJiO0JBvYJT8SYsJpc8OQSnsA==", "dev": true, "license": "MIT", "engines": { @@ -14805,7 +14805,7 @@ "@prettier/plugin-pug": "*", "@shopify/prettier-plugin-liquid": "*", "@trivago/prettier-plugin-sort-imports": "*", - "@zackad/prettier-plugin-twig-melody": "*", + "@zackad/prettier-plugin-twig": "*", "prettier": "^3.0", "prettier-plugin-astro": "*", "prettier-plugin-css-order": "*", @@ -14832,7 +14832,7 @@ "@trivago/prettier-plugin-sort-imports": { "optional": true }, - "@zackad/prettier-plugin-twig-melody": { + "@zackad/prettier-plugin-twig": { "optional": true }, "prettier-plugin-astro": { @@ -18207,17 +18207,17 @@ } }, "node_modules/vite-plugin-pwa": { - "version": "0.20.5", - "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.20.5.tgz", - "integrity": "sha512-aweuI/6G6n4C5Inn0vwHumElU/UEpNuO+9iZzwPZGTCH87TeZ6YFMrEY6ZUBQdIHHlhTsbMDryFARcSuOdsz9Q==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.21.1.tgz", + "integrity": "sha512-rkTbKFbd232WdiRJ9R3u+hZmf5SfQljX1b45NF6oLA6DSktEKpYllgTo1l2lkiZWMWV78pABJtFjNXfBef3/3Q==", "dev": true, "license": "MIT", "dependencies": { "debug": "^4.3.6", "pretty-bytes": "^6.1.1", - "tinyglobby": "^0.2.0", - "workbox-build": "^7.1.0", - "workbox-window": "^7.1.0" + "tinyglobby": "^0.2.10", + "workbox-build": "^7.3.0", + "workbox-window": "^7.3.0" }, "engines": { "node": ">=16.0.0" @@ -18227,9 +18227,9 @@ }, "peerDependencies": { "@vite-pwa/assets-generator": "^0.2.6", - "vite": "^3.1.0 || ^4.0.0 || ^5.0.0", - "workbox-build": "^7.1.0", - "workbox-window": "^7.1.0" + "vite": "^3.1.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", + "workbox-build": "^7.3.0", + "workbox-window": "^7.3.0" }, "peerDependenciesMeta": { "@vite-pwa/assets-generator": { diff --git a/package.json b/package.json index 4de4ddb48bf..0fb0ca5dd58 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/src/Utils/utils.ts b/src/Utils/utils.ts index a0694146ba1..64d8aeca38b 100644 --- a/src/Utils/utils.ts +++ b/src/Utils/utils.ts @@ -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 diff --git a/src/components/Facility/FacilityForm.tsx b/src/components/Facility/FacilityForm.tsx index bac5b022fdc..1aea913355c 100644 --- a/src/components/Facility/FacilityForm.tsx +++ b/src/components/Facility/FacilityForm.tsx @@ -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(); @@ -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); @@ -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, }); } diff --git a/src/components/Patient/PatientDetailsTab/Demography.tsx b/src/components/Patient/PatientDetailsTab/Demography.tsx index a246d8d464c..c88cd4f27dd 100644 --- a/src/components/Patient/PatientDetailsTab/Demography.tsx +++ b/src/components/Patient/PatientDetailsTab/Demography.tsx @@ -265,22 +265,6 @@ export const Demography = (props: PatientProps) => {