diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 24343ec8fc3..105c271c3a0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -79,8 +79,8 @@ jobs: ghcr.io/${{ github.repository }} ${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }} tags: | - type=raw,value=production-latest,enable=${{ github.ref == 'refs/heads/v*' }} - type=raw,value=production-latest-${{ github.run_number }}-{{date 'YYYYMMDD'}}-{{sha}},enable=${{ github.ref == 'refs/heads/v*' }} + type=raw,value=production-latest,enable=${{ startsWith(github.event.ref, 'refs/tags/v') }} + type=raw,value=production-latest-${{ github.run_number }}-{{date 'YYYYMMDD'}}-{{sha}},enable=${{ startsWith(github.event.ref, 'refs/tags/v') }} type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }} type=raw,value=staging-latest-${{ github.run_number }}-{{date 'YYYYMMDD'}}-{{sha}},enable=${{ github.ref == 'refs/heads/staging' }} type=raw,value=latest,enable=${{ github.ref == 'refs/heads/develop' }} @@ -152,316 +152,9 @@ jobs: name: Staging-GCP url: https://care-staging.ohc.network/ steps: - - name: Checkout Kube Config - uses: actions/checkout@v3 - with: - repository: coronasafe/care-staging-gcp - token: ${{ secrets.GIT_ACCESS_TOKEN }} - path: kube - ref: main - - - uses: actions/setup-node@v3 - with: - node-version: '20' - - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - # Get the GKE credentials so we can deploy to the cluster - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: install kubectl - uses: azure/setup-kubectl@v3 - with: - version: "v1.23.6" - id: install - - - name: Deploy Care Fe Production - run: | - mkdir -p $HOME/.kube/ - cd kube/deployments/ - sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml - kubectl apply -f care-fe.yaml - - deploy-production-manipur: - needs: notify-release - name: Deploy to GKE Manipur - runs-on: ubuntu-latest - environment: - name: Production-Manipur - url: https://care.mn.gov.in - steps: - - name: Checkout Kube Config - uses: actions/checkout@v3 - with: - repository: coronasafe/mn-care-infra - token: ${{ secrets.GIT_ACCESS_TOKEN }} - path: kube - ref: main - - - uses: actions/setup-node@v3 - with: - node-version: '20' - - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - # Get the GKE credentials so we can deploy to the cluster - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: install kubectl - uses: azure/setup-kubectl@v3 - with: - version: "v1.23.6" - id: install - - - name: Deploy Care Fe Production - run: | - mkdir -p $HOME/.kube/ - cd kube/deployments/ - sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml - kubectl apply -f care-fe.yaml - - deploy-production-karnataka: - needs: notify-release - name: Deploy to GKE Karnataka - runs-on: ubuntu-latest - environment: - name: Production-Karnataka - url: https://karnataka.care - steps: - - name: Checkout Kube Config - uses: actions/checkout@v3 - with: - repository: coronasafe/ka-care-infra - token: ${{ secrets.GIT_ACCESS_TOKEN }} - path: kube - ref: main - - - uses: actions/setup-node@v3 - with: - node-version: '20' - - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - # Get the GKE credentials so we can deploy to the cluster - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: install kubectl - uses: azure/setup-kubectl@v3 - with: - version: "v1.23.6" - id: install - - - name: Deploy Care Fe Production - run: | - mkdir -p $HOME/.kube/ - cd kube/deployments/ - sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml - kubectl apply -f care-fe.yaml - - deploy-production-sikkim: - needs: notify-release - name: Deploy to GKE Sikkim - runs-on: ubuntu-latest - environment: - name: Production-Sikkim - url: https://care.sikkim.gov.in - steps: - - name: Checkout Kube Config - uses: actions/checkout@v3 - with: - repository: coronasafe/sk-care-infra - token: ${{ secrets.GIT_ACCESS_TOKEN }} - path: kube - ref: main - - - uses: actions/setup-node@v3 - with: - node-version: '20' - - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - # Get the GKE credentials so we can deploy to the cluster - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: install kubectl - uses: azure/setup-kubectl@v3 - with: - version: "v1.23.6" - id: install - - - name: Deploy Care Fe Production - run: | - mkdir -p $HOME/.kube/ - cd kube/deployments/ - sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml - kubectl apply -f care-fe.yaml - - deploy-production-assam: - needs: notify-release - name: Deploy to GKE Assam - runs-on: ubuntu-latest - environment: - name: Production-Assam - url: https://care.assam.gov.in - steps: - - name: Checkout Kube Config - uses: actions/checkout@v3 - with: - repository: coronasafe/as-care-infra - token: ${{ secrets.GIT_ACCESS_TOKEN }} - path: kube - ref: main - - - uses: actions/setup-node@v3 - with: - node-version: '20' - - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - # Get the GKE credentials so we can deploy to the cluster - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: install kubectl - uses: azure/setup-kubectl@v3 - with: - version: "v1.23.6" - id: install - - - name: Deploy Care Fe Production - run: | - mkdir -p $HOME/.kube/ - cd kube/deployments/ - sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml - kubectl apply -f care-fe.yaml - - deploy-production-nagaland: - needs: notify-release - name: Deploy to GKE Nagaland - runs-on: ubuntu-latest - environment: - name: Production - Nagaland - url: https://care.nagaland.gov.in - steps: - - name: Checkout Kube Config - uses: actions/checkout@v3 - with: - repository: coronasafe/nl-care-infra - token: ${{ secrets.GIT_ACCESS_TOKEN }} - path: kube - ref: main - - - uses: actions/setup-node@v3 - with: - node-version: '20' - - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - # Get the GKE credentials, so we can deploy to the cluster - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: install kubectl - uses: azure/setup-kubectl@v3 - with: - version: "v1.23.6" - id: install - - - name: Deploy Care Fe Production - run: | - mkdir -p $HOME/.kube/ - cd kube/deployments/ - sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml - kubectl apply -f care-fe.yaml - - deploy-production-meghalaya: - needs: notify-release - name: Deploy to GKE Meghalaya - runs-on: ubuntu-latest - environment: - name: Production-Meghalaya - url: https://care.meghealth.gov.in - steps: - - name: Checkout Kube Config - uses: actions/checkout@v3 - with: - repository: coronasafe/ml-care-infra - token: ${{ secrets.GIT_ACCESS_TOKEN }} - path: kube - ref: main - - - uses: actions/setup-node@v3 - with: - node-version: '20' - - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - # Get the GKE credentials, so we can deploy to the cluster - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ secrets.GKE_CLUSTER }} - location: ${{ secrets.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: install kubectl - uses: azure/setup-kubectl@v3 - with: - version: "v1.23.6" - id: install - - - name: Deploy Care Fe Production + - name: Trigger deploy run: | - mkdir -p $HOME/.kube/ - cd kube/deployments/ - sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml - kubectl apply -f care-fe.yaml + COMMIT_SHA=${{ github.sha }} + JSON='{ "substitutions": { "care_be_tag":"", "care_fe_tag": "'"$COMMIT_SHA"'", "metabase_tag": "" } }' + curl --location ${{ secrets.STAGING_GCP_DEPLOY_URL }} \ + --header 'Content-Type: application/json' --data "$JSON" diff --git a/package-lock.json b/package-lock.json index 7a0f730ba75..63a63942b68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -99,7 +99,7 @@ "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-mdx": "^2.2.0", "eslint-plugin-only-warn": "^1.1.0", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", @@ -110,8 +110,8 @@ "lint-staged": "^13.2.3", "local-cypress": "^1.2.6", "postcss": "^8.4.25", - "prettier": "^2.8.8", - "prettier-plugin-tailwindcss": "^0.4.0", + "prettier": "^3.2.5", + "prettier-plugin-tailwindcss": "^0.5.13", "prop-types": "^15.8.1", "redux-devtools-extension": "^2.13.9", "rescript": "^10.1.4", @@ -5278,6 +5278,21 @@ "node": ">=10" } }, + "node_modules/@storybook/cli/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@storybook/cli/node_modules/semver": { "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", @@ -5338,6 +5353,21 @@ "url": "https://opencollective.com/storybook" } }, + "node_modules/@storybook/codemod/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@storybook/components": { "version": "7.6.17", "resolved": "https://registry.npmjs.org/@storybook/components/-/components-7.6.17.tgz", @@ -11953,26 +11983,51 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", "dev": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" }, "engines": { - "node": ">=12.0.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { - "eslint": ">=7.28.0", - "prettier": ">=2.0.0" + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" }, "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, "eslint-config-prettier": { "optional": true } } }, + "node_modules/eslint-plugin-prettier/node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/eslint-plugin-promise": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", @@ -19318,15 +19373,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -19345,20 +19400,20 @@ } }, "node_modules/prettier-plugin-tailwindcss": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.4.1.tgz", - "integrity": "sha512-hwn2EiJmv8M+AW4YDkbjJ6HlZCTzLyz1QlySn9sMuKV/Px0fjwldlB7tol8GzdgqtkdPtzT3iJ4UzdnYXP25Ag==", + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.13.tgz", + "integrity": "sha512-2tPWHCFNC+WRjAC4SIWQNSOdcL1NNkydXim8w7TDqlZi+/ulZYz2OouAI6qMtkggnPt7lGamboj6LcTMwcCvoQ==", "dev": true, "engines": { - "node": ">=12.17.0" + "node": ">=14.21.3" }, "peerDependencies": { "@ianvs/prettier-plugin-sort-imports": "*", "@prettier/plugin-pug": "*", "@shopify/prettier-plugin-liquid": "*", - "@shufo/prettier-plugin-blade": "*", "@trivago/prettier-plugin-sort-imports": "*", - "prettier": "^2.2 || ^3.0", + "@zackad/prettier-plugin-twig-melody": "*", + "prettier": "^3.0", "prettier-plugin-astro": "*", "prettier-plugin-css-order": "*", "prettier-plugin-import-sort": "*", @@ -19366,9 +19421,9 @@ "prettier-plugin-marko": "*", "prettier-plugin-organize-attributes": "*", "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", "prettier-plugin-style-order": "*", - "prettier-plugin-svelte": "*", - "prettier-plugin-twig-melody": "*" + "prettier-plugin-svelte": "*" }, "peerDependenciesMeta": { "@ianvs/prettier-plugin-sort-imports": { @@ -19380,10 +19435,10 @@ "@shopify/prettier-plugin-liquid": { "optional": true }, - "@shufo/prettier-plugin-blade": { + "@trivago/prettier-plugin-sort-imports": { "optional": true }, - "@trivago/prettier-plugin-sort-imports": { + "@zackad/prettier-plugin-twig-melody": { "optional": true }, "prettier-plugin-astro": { @@ -19407,13 +19462,13 @@ "prettier-plugin-organize-imports": { "optional": true }, - "prettier-plugin-style-order": { + "prettier-plugin-sort-imports": { "optional": true }, - "prettier-plugin-svelte": { + "prettier-plugin-style-order": { "optional": true }, - "prettier-plugin-twig-melody": { + "prettier-plugin-svelte": { "optional": true } } diff --git a/package.json b/package.json index 205612f3ac0..67588f2d309 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-mdx": "^2.2.0", "eslint-plugin-only-warn": "^1.1.0", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", @@ -150,8 +150,8 @@ "lint-staged": "^13.2.3", "local-cypress": "^1.2.6", "postcss": "^8.4.25", - "prettier": "^2.8.8", - "prettier-plugin-tailwindcss": "^0.4.0", + "prettier": "^3.2.5", + "prettier-plugin-tailwindcss": "^0.5.13", "prop-types": "^15.8.1", "redux-devtools-extension": "^2.13.9", "rescript": "^10.1.4", diff --git a/public/config.json b/public/config.json index d02bd135cfe..d5703af91c3 100644 --- a/public/config.json +++ b/public/config.json @@ -23,5 +23,6 @@ "sample_format_external_result_import": "/External-Results-Template.csv", "enable_abdm": true, "enable_hcx": false, + "enable_scribe": false, "min_encounter_date": "2020-01-01" } diff --git a/src/CAREUI/display/Card.tsx b/src/CAREUI/display/Card.tsx index 82d535a5a0a..3772fa0b75b 100644 --- a/src/CAREUI/display/Card.tsx +++ b/src/CAREUI/display/Card.tsx @@ -3,7 +3,7 @@ import { HTMLAttributes, ReactNode } from "react"; export default function Card( props: { children?: ReactNode; - } & HTMLAttributes + } & HTMLAttributes, ) { const { children, ...rest } = props; return ( diff --git a/src/CAREUI/display/Chip.tsx b/src/CAREUI/display/Chip.tsx index 7bcbd6078e4..30f73ce4a43 100644 --- a/src/CAREUI/display/Chip.tsx +++ b/src/CAREUI/display/Chip.tsx @@ -43,7 +43,7 @@ export default function Chip({ custom: "", }[variant], - props.className + props.className, )} title={props.tooltip} > diff --git a/src/CAREUI/display/NetworkSignal.tsx b/src/CAREUI/display/NetworkSignal.tsx index b0ae2c541cb..2bcd2744acb 100644 --- a/src/CAREUI/display/NetworkSignal.tsx +++ b/src/CAREUI/display/NetworkSignal.tsx @@ -23,7 +23,7 @@ export default function NetworkSignal({ strength, children }: Props) { strength === 0 && "text-danger-500", strength === 1 && "text-danger-500", strength === 2 && "text-warning-500", - strength === 3 && "text-primary-500" + strength === 3 && "text-primary-500", )} >
@@ -45,7 +45,7 @@ export default function NetworkSignal({ strength, children }: Props) { i === 2 && "h-[15px]", // Whether to infill with strength color or not - strength > i ? "bg-current" : "bg-zinc-600" + strength > i ? "bg-current" : "bg-zinc-600", )} /> )) diff --git a/src/CAREUI/display/Timeline.tsx b/src/CAREUI/display/Timeline.tsx index 9889894ac47..b2401630e93 100644 --- a/src/CAREUI/display/Timeline.tsx +++ b/src/CAREUI/display/Timeline.tsx @@ -57,7 +57,7 @@ export const TimelineNode = (props: TimelineNodeProps) => {
@@ -66,14 +66,14 @@ export const TimelineNode = (props: TimelineNodeProps) => {
{props.title || ( diff --git a/src/CAREUI/icons/icon.js b/src/CAREUI/icons/icon.js index 0707d350f27..c917e664351 100644 --- a/src/CAREUI/icons/icon.js +++ b/src/CAREUI/icons/icon.js @@ -18,7 +18,7 @@ const createSvg = (className) => { const el = document.createElementNS(xmlns, "svg"); el.setAttribute( "class", - className.replace("care", "care-svg-icon__baseline") + className.replace("care", "care-svg-icon__baseline"), ); el.setAttribute("role", "img"); el.setAttribute("xmlns", xmlns); diff --git a/src/CAREUI/interactive/KeyboardShortcut.tsx b/src/CAREUI/interactive/KeyboardShortcut.tsx index 47a9fbfca28..06ce149fb51 100644 --- a/src/CAREUI/interactive/KeyboardShortcut.tsx +++ b/src/CAREUI/interactive/KeyboardShortcut.tsx @@ -21,7 +21,7 @@ export default function KeyboardShortcut(props: Props) { {props.helpText} diff --git a/src/CAREUI/interactive/LegendInput.tsx b/src/CAREUI/interactive/LegendInput.tsx index b057e7772c5..334c4b84838 100644 --- a/src/CAREUI/interactive/LegendInput.tsx +++ b/src/CAREUI/interactive/LegendInput.tsx @@ -97,7 +97,7 @@ export default function LegendInput(props: InputProps) { (focused || ref.current?.value) && props.size === "small" && "-top-[7px]", - props.error && "text-red-500" + props.error && "text-red-500", )} > {props.legend} @@ -134,7 +134,7 @@ export default function LegendInput(props: InputProps) { props.size === "large" && "px-5 py-4 text-lg", props.type === "PASSWORD" && "pr-10", props.error && "border-red-500", - props.className + props.className, )} /> {props.type === "PASSWORD" && ( diff --git a/src/CAREUI/interactive/ScrollOverlay.tsx b/src/CAREUI/interactive/ScrollOverlay.tsx index c49f7223149..7c481495b59 100644 --- a/src/CAREUI/interactive/ScrollOverlay.tsx +++ b/src/CAREUI/interactive/ScrollOverlay.tsx @@ -20,7 +20,7 @@ export default function ScrollOverlay(props: Props) {
{hasScrollContent && props.overlay} diff --git a/src/CAREUI/interactive/SlideOver.tsx b/src/CAREUI/interactive/SlideOver.tsx index a92344c41ba..68aa5dc088f 100644 --- a/src/CAREUI/interactive/SlideOver.tsx +++ b/src/CAREUI/interactive/SlideOver.tsx @@ -77,7 +77,7 @@ export default function SlideOver({
@@ -94,7 +94,7 @@ export default function SlideOver({ className={classNames( "pointer-events-auto fixed", directionClasses[slideFrom].stick, - !onlyChild && "md:p-2" + !onlyChild && "md:p-2", )} > {onlyChild ? ( @@ -104,7 +104,7 @@ export default function SlideOver({ className={classNames( "flex flex-col bg-white md:rounded-xl", directionClasses[slideFrom].proportions, - dialogClass + dialogClass, )} >
diff --git a/src/CAREUI/interactive/Switch.tsx b/src/CAREUI/interactive/Switch.tsx index 3e18795b034..48eca49151d 100644 --- a/src/CAREUI/interactive/Switch.tsx +++ b/src/CAREUI/interactive/Switch.tsx @@ -26,7 +26,7 @@ export default function Switch({ size === "lg" && "px-4 py-3 text-base", props.selected === tab ? "border-primary-500 bg-primary-500 font-semibold text-white hover:bg-primary-600 focus:border-primary-500 focus:ring-primary-500" - : "border-gray-400 bg-gray-50 hover:bg-gray-200 focus:border-primary-500 focus:ring-primary-500" + : "border-gray-400 bg-gray-50 hover:bg-gray-200 focus:border-primary-500 focus:ring-primary-500", )} onClick={() => props.onChange(tab as T)} > diff --git a/src/CAREUI/misc/PaginatedList.tsx b/src/CAREUI/misc/PaginatedList.tsx index 363e657f253..db68c6f042c 100644 --- a/src/CAREUI/misc/PaginatedList.tsx +++ b/src/CAREUI/misc/PaginatedList.tsx @@ -35,7 +35,7 @@ interface Props extends QueryOptions> { perPage?: number; children: ( ctx: PaginatedListContext, - query: ReturnType>> + query: ReturnType>>, ) => JSX.Element | JSX.Element[]; } diff --git a/src/CAREUI/misc/ThemedFavicon.tsx b/src/CAREUI/misc/ThemedFavicon.tsx index 55b8d34ec7e..b908f566b89 100644 --- a/src/CAREUI/misc/ThemedFavicon.tsx +++ b/src/CAREUI/misc/ThemedFavicon.tsx @@ -4,7 +4,7 @@ export default function ThemedFavicon() { useEffect(() => { const darkThemeMq = window.matchMedia("(prefers-color-scheme: dark)"); const favicon = document.querySelector( - "link[rel~='icon']" + "link[rel~='icon']", ) as HTMLLinkElement; favicon.href = darkThemeMq.matches ? "/favicon-light.ico" : "/favicon.ico"; diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 0e14203d4fa..095de35aec8 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -738,7 +738,7 @@ export const CAMERA_TYPE = [ export const GENDER: { [key: number]: string } = GENDER_TYPES.reduce( (acc, curr) => ({ ...acc, [curr.id]: curr.text }), - {} + {}, ); export type CameraPTZ = { @@ -1013,7 +1013,7 @@ export const XLSXAssetImportSchema = { if (!ip) return null; const isValid = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( - ip + ip, ); if (!isValid) { diff --git a/src/Common/hooks/useAsyncOptions.ts b/src/Common/hooks/useAsyncOptions.ts index 4c9199b02be..1a632dc366e 100644 --- a/src/Common/hooks/useAsyncOptions.ts +++ b/src/Common/hooks/useAsyncOptions.ts @@ -34,7 +34,7 @@ interface IUseAsyncOptionsArgs { */ export function useAsyncOptions>( uniqueKey: keyof T, - args?: IUseAsyncOptionsArgs + args?: IUseAsyncOptionsArgs, ) { const dispatch = useDispatch(); const [queryOptions, setQueryOptions] = useState([]); @@ -47,18 +47,18 @@ export function useAsyncOptions>( const res = await dispatch(action); if (res?.data) setQueryOptions( - args?.queryResponseExtractor?.(res.data) ?? (res.data as T[]) + args?.queryResponseExtractor?.(res.data) ?? (res.data as T[]), ); setIsLoading(false); }, args?.debounceInterval ?? 300), - [dispatch, args?.debounceInterval] + [dispatch, args?.debounceInterval], ); const mergeValueWithQueryOptions = (selected?: T[]) => { return mergeQueryOptions( selected ?? [], queryOptions, - (obj) => obj[uniqueKey] + (obj) => obj[uniqueKey], ); }; diff --git a/src/Common/hooks/useAuthUser.ts b/src/Common/hooks/useAuthUser.ts index dda5f399952..78bf93fa8f8 100644 --- a/src/Common/hooks/useAuthUser.ts +++ b/src/Common/hooks/useAuthUser.ts @@ -17,7 +17,7 @@ export const useAuthContext = () => { const ctx = useContext(AuthUserContext); if (!ctx) { throw new Error( - "'useAuthContext' must be used within 'AuthUserProvider' only" + "'useAuthContext' must be used within 'AuthUserProvider' only", ); } return ctx; diff --git a/src/Common/hooks/useBreakpoints.ts b/src/Common/hooks/useBreakpoints.ts index 5428a8d1b93..065177a00ed 100644 --- a/src/Common/hooks/useBreakpoints.ts +++ b/src/Common/hooks/useBreakpoints.ts @@ -21,7 +21,7 @@ const BREAKPOINT_WIDTH: Record = { * @returns The value mapped to the current breakpoint. */ export default function useBreakpoints( - map: Partial> & { default: T } + map: Partial> & { default: T }, ) { const { width } = useWindowDimensions(); diff --git a/src/Common/hooks/useConfig.ts b/src/Common/hooks/useConfig.ts index 03d9dada9b9..0bb619296a3 100644 --- a/src/Common/hooks/useConfig.ts +++ b/src/Common/hooks/useConfig.ts @@ -75,6 +75,10 @@ export interface IConfig { * Env to enable ABDM features */ enable_abdm: boolean; + /** + * Env to enable scribe features + */ + enable_scribe: boolean; /** * Env to toggle peacetime and wartime shifting */ diff --git a/src/Common/hooks/useExport.tsx b/src/Common/hooks/useExport.tsx index f2ce1c57bf6..e7a76036b07 100644 --- a/src/Common/hooks/useExport.tsx +++ b/src/Common/hooks/useExport.tsx @@ -17,7 +17,7 @@ export default function useExport() { const exportCSV = async ( filenamePrefix: string, action: any, - parse = (data: string) => data + parse = (data: string) => data, ) => { setIsExporting(true); @@ -40,7 +40,7 @@ export default function useExport() { const exportJSON = async ( filenamePrefix: string, action: any, - parse = (data: string) => data + parse = (data: string) => data, ) => { setIsExporting(true); @@ -62,7 +62,7 @@ export default function useExport() { action: any, filePrefix = "export", type = "csv", - parse = (data: string) => data + parse = (data: string) => data, ) => { if (!action) return; diff --git a/src/Common/hooks/useFeedPTZ.ts b/src/Common/hooks/useFeedPTZ.ts index b064e9180ee..a393edc5922 100644 --- a/src/Common/hooks/useFeedPTZ.ts +++ b/src/Common/hooks/useFeedPTZ.ts @@ -50,7 +50,7 @@ interface UseMSEMediaPlayerReturnType { getPTZPayload: ( action: PTZ, precision?: number, - value?: number + value?: number, ) => PTZPayload; getCameraStatus: (options: IOptions) => void; getPresets: (options: IOptions) => void; @@ -80,7 +80,7 @@ const getCameraStatus = action: { type: "get_status", }, - }) + }), ); resp && (resp.status === 200 @@ -97,7 +97,7 @@ const getPresets = action: { type: "get_presets", }, - }) + }), ); resp && (resp.status === 200 @@ -119,7 +119,7 @@ const gotoPreset = type: "goto_preset", data: payload, }, - }) + }), ); resp && (resp.status === 200 @@ -137,7 +137,7 @@ const absoluteMove = type: "absolute_move", data: payload, }, - }) + }), ); resp && (resp.status === 200 @@ -155,7 +155,7 @@ const relativeMove = type: "relative_move", data: payload, }, - }) + }), ); resp && (resp.status === 200 @@ -166,7 +166,7 @@ const relativeMove = export const getPTZPayload = ( action: PTZ, precision = 1, - value?: number + value?: number, ): PTZPayload => { let x = 0; let y = 0; diff --git a/src/Common/hooks/useFilters.tsx b/src/Common/hooks/useFilters.tsx index 1c62a10d9d0..b86206c4b2d 100644 --- a/src/Common/hooks/useFilters.tsx +++ b/src/Common/hooks/useFilters.tsx @@ -39,7 +39,7 @@ export default function useFilters({ const setQueryParams = ( query: QueryParam, - options?: setQueryParamsOptions + options?: setQueryParamsOptions, ) => { query = FiltersCache.utils.clean(query); _setQueryParams(query, options); @@ -142,7 +142,7 @@ export default function useFilters({ falseLabel?: string; trueValue?: string; falseValue?: string; - } + }, ) { const { trueLabel = "Yes", @@ -222,7 +222,7 @@ export default function useFilters({ className={classNames( "flex w-full justify-center", totalCount > limit ? "visible" : "invisible", - !noMargin && "mt-4" + !noMargin && "mt-4", )} > void; + webkitExitFullscreen?: () => void; +} + export default function useFullscreen(): [ boolean, - (value: boolean, element?: HTMLElement) => void + (value: boolean, element?: HTMLElement) => void, ] { const [isFullscreen, _setIsFullscreen] = useState( - !!document.fullscreenElement + !!document.fullscreenElement, ); useEffect(() => { @@ -18,17 +23,19 @@ export default function useFullscreen(): [ document.removeEventListener("fullscreenchange", onFullscreenChange); }, []); - function openFullscreen(elem: HTMLElement) { + function openFullscreen(elem: HTMLElementWithFullscreen) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - if (elem.webkitEnterFullscreen) elem.webkitEnterFullscreen(); // Safari + if (elem.webkitEnterFullscreen) + elem.webkitEnterFullscreen(); // Safari else elem.requestFullscreen(); } - function exitFullscreen(elem: HTMLElement) { + function exitFullscreen(elem: HTMLElementWithFullscreen) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - if (elem.webkitExitFullscreen) elem.webkitExitFullscreen(); // Safari + if (elem.webkitExitFullscreen) + elem.webkitExitFullscreen(); // Safari else document.exitFullscreen(); } diff --git a/src/Common/hooks/useMSEplayer.ts b/src/Common/hooks/useMSEplayer.ts index 23f9e7b70c7..482f991bc25 100644 --- a/src/Common/hooks/useMSEplayer.ts +++ b/src/Common/hooks/useMSEplayer.ts @@ -84,7 +84,7 @@ const Utf8ArrayToStr = (array: string | any[] | Uint8Array) => { char2 = array[i++]; char3 = array[i++]; out += String.fromCharCode( - ((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0) + ((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0), ); break; } @@ -163,7 +163,7 @@ export const useMSEMediaPlayer = ({ mimeCodec = Utf8ArrayToStr(decoded_arr); } mseSourceBuffer = mse.addSourceBuffer( - `video/mp4; codecs="${mimeCodec}"` + `video/mp4; codecs="${mimeCodec}"`, ); mseSourceBuffer.mode = "segments"; if (mseQueue.length > 0 && !mseSourceBuffer.updating) { @@ -177,7 +177,7 @@ export const useMSEMediaPlayer = ({ onError && onError(event); }; }, - false + false, ); } } catch (e) { diff --git a/src/Common/hooks/useRangePagination.ts b/src/Common/hooks/useRangePagination.ts index b7c8b8510a5..966596ffb33 100644 --- a/src/Common/hooks/useRangePagination.ts +++ b/src/Common/hooks/useRangePagination.ts @@ -14,7 +14,7 @@ interface Props { const useRangePagination = ({ bounds, perPage, ...props }: Props) => { const [currentRange, setCurrentRange] = useState( - getInitialBounds(bounds, perPage, props.defaultEnd) + getInitialBounds(bounds, perPage, props.defaultEnd), ); useEffect(() => { @@ -90,7 +90,7 @@ export default useRangePagination; const getInitialBounds = ( bounds: DateRange, perPage: number, - defaultEnd?: boolean + defaultEnd?: boolean, ) => { const deltaBounds = bounds.end.valueOf() - bounds.start.valueOf(); diff --git a/src/Common/hooks/useSlug.ts b/src/Common/hooks/useSlug.ts index 8885a074678..78d2a567e37 100644 --- a/src/Common/hooks/useSlug.ts +++ b/src/Common/hooks/useSlug.ts @@ -32,7 +32,7 @@ const findSlug = (segments: string[], prefix: string, fallback?: string) => { const index = segments.findIndex((segment) => segment === prefix); if (index === -1) { throw new Error( - `Prefix "${prefix}" not found in path "${segments.join("/")}"` + `Prefix "${prefix}" not found in path "${segments.join("/")}"`, ); } diff --git a/src/Common/hooks/useWindowDimensions.ts b/src/Common/hooks/useWindowDimensions.ts index 2118c158f86..372ea62f7e1 100644 --- a/src/Common/hooks/useWindowDimensions.ts +++ b/src/Common/hooks/useWindowDimensions.ts @@ -15,7 +15,7 @@ const getWindowDimensions = () => { */ export default function useWindowDimensions() { const [windowDimensions, setWindowDimensions] = useState( - getWindowDimensions() + getWindowDimensions(), ); useEffect(() => { diff --git a/src/Common/utils.tsx b/src/Common/utils.tsx index b1e98a9e196..05022d8bc2e 100644 --- a/src/Common/utils.tsx +++ b/src/Common/utils.tsx @@ -10,7 +10,7 @@ type AbortableFunction = (status: statusType) => any; export const useAbortableEffect = ( effect: AbortableFunction, - dependencies: Array + dependencies: Array, ) => { const status: statusType = {}; // mutable status object useEffect(() => { @@ -32,7 +32,7 @@ export const useAbortableEffect = ( export const parseOptionId: ( options: readonly OptionsType[], - id: string | string[] + id: string | string[], ) => string = (options, id) => { const textArray = options .filter((option) => { diff --git a/src/Common/validation.tsx b/src/Common/validation.tsx index ef60a40bd79..c7c084354a8 100644 --- a/src/Common/validation.tsx +++ b/src/Common/validation.tsx @@ -23,7 +23,7 @@ export const validateEmailAddress = (email: string) => { export const getArrayValueByKey = ( arr: Array, attr: string, - value: string | number + value: string | number, ) => { for (let i = 0; i < arr.length; i++) { if (arr[i][attr] === value) { diff --git a/src/Components/ABDM/ConfigureHealthFacility.tsx b/src/Components/ABDM/ConfigureHealthFacility.tsx index e64841464a1..6f13cf01374 100644 --- a/src/Components/ABDM/ConfigureHealthFacility.tsx +++ b/src/Components/ABDM/ConfigureHealthFacility.tsx @@ -82,7 +82,7 @@ export const ConfigureHealthFacility = (props: any) => { pathParams: { facility_id: facilityId, }, - } + }, ); response = res; responseData = data; @@ -96,7 +96,7 @@ export const ConfigureHealthFacility = (props: any) => { body: { hf_id: state.form.hf_id, }, - } + }, ); response = res; responseData = data; @@ -156,7 +156,7 @@ export const ConfigureHealthFacility = (props: any) => { "tooltip cursor-pointer text-sm", state.form.health_facility?.registered ? "text-primary-600 hover:text-primary-800" - : "text-warning-600 hover:text-warning-800" + : "text-warning-600 hover:text-warning-800", )} > {state.form.health_facility?.registered ? ( diff --git a/src/Components/ABDM/LinkABHANumberModal.tsx b/src/Components/ABDM/LinkABHANumberModal.tsx index 4aed5e0ee8f..fe789e6c909 100644 --- a/src/Components/ABDM/LinkABHANumberModal.tsx +++ b/src/Components/ABDM/LinkABHANumberModal.tsx @@ -17,7 +17,7 @@ import { ABDMError, ABHAQRContent } from "./models"; export const validateRule = ( condition: boolean, - content: JSX.Element | string + content: JSX.Element | string, ) => { return (
@@ -113,7 +113,7 @@ export default function LinkABHANumberModal({
{["AadhaarVerification", "MobileVerification", "HealthIDCreation"].find( - (step) => step === currentStep + (step) => step === currentStep, ) ? (

setCurrentStep("ScanExistingQR")} @@ -278,7 +278,7 @@ const ScanABHAQRSection = ({ txnId: txnId, patientId: patientId, }, - } + }, ); response = res; Rdata = data; @@ -296,7 +296,7 @@ const ScanABHAQRSection = ({ txnId: txnId, patientId: patientId, }, - } + }, ); response = res; Rdata = data; @@ -331,7 +331,7 @@ const ScanABHAQRSection = ({ onClick={async () => { const { res, data } = await request( routes.abha.initiateAbdmAuthentication, - { body: { authMethod: method, healthid: qrValue } } + { body: { authMethod: method, healthid: qrValue } }, ); if (res?.status === 200 && data?.txnId) { @@ -355,16 +355,16 @@ const ScanABHAQRSection = ({ body: { healthId: qrValue, }, - } + }, ); if (res?.status === 200 && data?.authMethods) { setAuthMethods( data.authMethods?.filter?.((method: string) => supportedAuthMethods.find( - (supported) => supported === method - ) - ) + (supported) => supported === method, + ), + ), ); } }} @@ -407,7 +407,7 @@ const VerifyAadhaarSection = ({ onVerified }: VerifyAadhaarSectionProps) => { const validateAadhaar = () => { if (aadhaarNumber.length !== 12 && aadhaarNumber.length !== 16) { setAadhaarNumberError( - "Should be a 12-digit aadhaar number or 16-digit virtual ID" + "Should be a 12-digit aadhaar number or 16-digit virtual ID", ); return false; } @@ -525,7 +525,7 @@ const VerifyAadhaarSection = ({ onVerified }: VerifyAadhaarSectionProps) => { Aadhaar number will not be stored by CARE @@ -841,19 +841,19 @@ const CreateHealthIDSection = ({

{validateRule( healthId.length >= 4, - "Should be atleast 4 character long" + "Should be atleast 4 character long", )} {validateRule( isNaN(Number(healthId[0])) && healthId[0] !== ".", - "Shouldn't start with a number or dot (.)" + "Shouldn't start with a number or dot (.)", )} {validateRule( healthId[healthId.length - 1] !== ".", - "Shouldn't end with a dot (.)" + "Shouldn't end with a dot (.)", )} {validateRule( /^[0-9a-zA-Z.]+$/.test(healthId), - "Should only contain letters, numbers and dot (.)" + "Should only contain letters, numbers and dot (.)", )}
)} diff --git a/src/Components/Assets/AssetFilter.tsx b/src/Components/Assets/AssetFilter.tsx index 1fca1475269..0470ea7f701 100644 --- a/src/Components/Assets/AssetFilter.tsx +++ b/src/Components/Assets/AssetFilter.tsx @@ -23,7 +23,7 @@ function AssetFilter(props: any) { const [facility, setFacility] = useState(null); const [asset_status, setAssetStatus] = useState(filter.status || ""); const [asset_class, setAssetClass] = useState( - filter.asset_class || "" + filter.asset_class || "", ); const [facilityId, setFacilityId] = useState(filter.facility); const [locationId, setLocationId] = useState(filter.location); @@ -46,7 +46,7 @@ function AssetFilter(props: any) { useEffect(() => { setFacilityId(facility?.id ? `${facility?.id}` : ""); setLocationId( - facility?.id === qParams.facility ? qParams.location ?? "" : "" + facility?.id === qParams.facility ? qParams.location ?? "" : "", ); }, [facility?.id, qParams.facility, qParams.location]); @@ -62,7 +62,7 @@ function AssetFilter(props: any) { status: asset_status ?? "", location: locationId ?? "", warranty_amc_end_of_validity_before: dateQueryString( - warrantyExpiry.before + warrantyExpiry.before, ), warranty_amc_end_of_validity_after: dateQueryString(warrantyExpiry.after), }; diff --git a/src/Components/Assets/AssetImportModal.tsx b/src/Components/Assets/AssetImportModal.tsx index 7e743219c7e..621d58fdd51 100644 --- a/src/Components/Assets/AssetImportModal.tsx +++ b/src/Components/Assets/AssetImportModal.tsx @@ -72,7 +72,7 @@ const AssetImportModal = ({ open, onClose, facility, onUpdate }: Props) => { case "csv": { const parsedData = await parseCsvFile( selectedFile, - XLSXAssetImportSchema + XLSXAssetImportSchema, ); setPreview(parsedData); break; @@ -188,11 +188,11 @@ const AssetImportModal = ({ open, onClose, facility, onUpdate }: Props) => { const dropedFile = e?.dataTransfer?.files[0]; if ( !["xlsx", "csv", "json"].includes( - dropedFile?.name?.split(".")?.pop() || "" + dropedFile?.name?.split(".")?.pop() || "", ) ) return dragProps.setFileDropError( - "Please drop a JSON / Excel file to upload!" + "Please drop a JSON / Excel file to upload!", ); setSelectedFile(dropedFile); }; diff --git a/src/Components/Assets/AssetManage.tsx b/src/Components/Assets/AssetManage.tsx index 786f24fce55..5835ad297f5 100644 --- a/src/Components/Assets/AssetManage.tsx +++ b/src/Components/Assets/AssetManage.tsx @@ -73,7 +73,7 @@ const AssetManage = (props: AssetManageProps) => { setTransactionFilter( data.qr_code_id ? { qr_code_id: data.qr_code_id } - : { external_id: assetId } + : { external_id: assetId }, ); } }, @@ -99,7 +99,7 @@ const AssetManage = (props: AssetManageProps) => { pathParams: { asset_external_id: assetId, }, - } + }, ); const handlePagination = (page: number, limit: number) => { @@ -158,7 +158,7 @@ const AssetManage = (props: AssetManageProps) => { - )) + )), ); } else { setTransactionDetails( @@ -169,7 +169,7 @@ const AssetManage = (props: AssetManageProps) => { >
No Transactions Found
- + , ); } }; @@ -235,7 +235,7 @@ const AssetManage = (props: AssetManageProps) => { - )) + )), ); } else { setServiceDetails( @@ -246,7 +246,7 @@ const AssetManage = (props: AssetManageProps) => { >
No Service Logs Found
- + , ); } }; @@ -386,7 +386,7 @@ const AssetManage = (props: AssetManageProps) => { /> )} {warrantyAmcValidityChip( - asset?.warranty_amc_end_of_validity as string + asset?.warranty_amc_end_of_validity as string, )} {asset?.latest_status === "Down" && ( { className="flex gap-2" onClick={() => navigate( - `/facility/${asset?.location_object.facility?.id}/assets/${asset?.id}/update` + `/facility/${asset?.location_object.facility?.id}/assets/${asset?.id}/update`, ) } id="update-asset" @@ -439,12 +439,12 @@ const AssetManage = (props: AssetManageProps) => { {asset?.asset_class && (asset?.asset_class !== "ONVIF" || ["DistrictAdmin", "StateAdmin", "Doctor"].includes( - authUser.user_type + authUser.user_type, )) && ( navigate( - `/facility/${asset?.location_object.facility?.id}/assets/${asset?.id}/configure` + `/facility/${asset?.location_object.facility?.id}/assets/${asset?.id}/configure`, ) } id="configure-asset" diff --git a/src/Components/Assets/AssetServiceEditModal.tsx b/src/Components/Assets/AssetServiceEditModal.tsx index 13a91e36477..87bf561d471 100644 --- a/src/Components/Assets/AssetServiceEditModal.tsx +++ b/src/Components/Assets/AssetServiceEditModal.tsx @@ -197,12 +197,12 @@ export const AssetServiceEditModal = (props: { if ( dayjs(date.value).format("YYYY-MM-DD") > new Date( - props.service_record.created_date + props.service_record.created_date, ).toLocaleDateString("en-ca") ) { Notification.Error({ msg: `Service date can't be after ${formatDate( - props.service_record.created_date + props.service_record.created_date, )} (Creation date)`, }); } else { diff --git a/src/Components/Assets/AssetType/ONVIFCamera.tsx b/src/Components/Assets/AssetType/ONVIFCamera.tsx index ba023788496..21beb5f7bf8 100644 --- a/src/Components/Assets/AssetType/ONVIFCamera.tsx +++ b/src/Components/Assets/AssetType/ONVIFCamera.tsx @@ -40,7 +40,7 @@ const ONVIFCamera = ({ assetId, facilityId, asset, onUpdated }: Props) => { const [loadingAddPreset, setLoadingAddPreset] = useState(false); const [loadingSetConfiguration, setLoadingSetConfiguration] = useState(false); const [refreshPresetsHash, setRefreshPresetsHash] = useState( - Number(new Date()) + Number(new Date()), ); const { data: facility, loading } = useQuery(routes.getPermittedFacility, { pathParams: { id: facilityId }, @@ -101,7 +101,7 @@ const ONVIFCamera = ({ assetId, facilityId, asset, onUpdated }: Props) => { setLoadingAddPreset(true); const response = await fetch( - `https://${resolvedMiddleware?.hostname}/status?hostname=${config.hostname}&port=${config.port}&username=${config.username}&password=${config.password}` + `https://${resolvedMiddleware?.hostname}/status?hostname=${config.hostname}&port=${config.port}&username=${config.username}&password=${config.password}`, ); if (!response.ok) { throw new Error("Network error"); diff --git a/src/Components/Assets/AssetsList.tsx b/src/Components/Assets/AssetsList.tsx index 9e21d1bfb04..9e1469c91a5 100644 --- a/src/Components/Assets/AssetsList.tsx +++ b/src/Components/Assets/AssetsList.tsx @@ -125,12 +125,12 @@ const AssetsList = () => { const checkValidAssetId = async (assetId: string) => { const { data: assetData } = await request(routes.getAsset, { - pathParams: { id: assetId }, + pathParams: { external_id: assetId }, }); try { if (assetData) { navigate( - `/facility/${assetData.location_object.facility?.id}/assets/${assetId}` + `/facility/${assetData.location_object.facility?.id}/assets/${assetId}`, ); } } catch (err) { @@ -143,7 +143,7 @@ const AssetsList = () => { }; const authorizedForImportExport = useIsAuthorized( - AuthorizeFor(["DistrictAdmin", "StateAdmin"]) + AuthorizeFor(["DistrictAdmin", "StateAdmin"]), ); if (isScannerActive) @@ -390,7 +390,7 @@ const AssetsList = () => { value( "Facility", "facility", - qParams.facility && facilityObject?.name + qParams.facility && facilityObject?.name, ), badge("Name/Serial No./QR ID", "search"), value("Asset Class", "asset_class", asset_class ?? ""), @@ -398,17 +398,17 @@ const AssetsList = () => { value( "Location", "location", - qParams.location && locationObject?.name + qParams.location && locationObject?.name, ), value( "Warranty AMC End Of Validity Before", "warranty_amc_end_of_validity_before", - qParams.warranty_amc_end_of_validity_before ?? "" + qParams.warranty_amc_end_of_validity_before ?? "", ), value( "Warranty AMC End Of Validity After", "warranty_amc_end_of_validity_after", - qParams.warranty_amc_end_of_validity_after ?? "" + qParams.warranty_amc_end_of_validity_after ?? "", ), ]} /> @@ -468,7 +468,7 @@ const AssetsList = () => { }; export const warrantyAmcValidityChip = ( - warranty_amc_end_of_validity: string + warranty_amc_end_of_validity: string, ) => { if (warranty_amc_end_of_validity === "" || !warranty_amc_end_of_validity) return; @@ -476,7 +476,8 @@ export const warrantyAmcValidityChip = ( const warrantyAmcEndDate = new Date(warranty_amc_end_of_validity); const days = Math.ceil( - Math.abs(Number(warrantyAmcEndDate) - Number(today)) / (1000 * 60 * 60 * 24) + Math.abs(Number(warrantyAmcEndDate) - Number(today)) / + (1000 * 60 * 60 * 24), ); if (warrantyAmcEndDate < today) { diff --git a/src/Components/Assets/configure/MonitorConfigure.tsx b/src/Components/Assets/configure/MonitorConfigure.tsx index 62931617b68..5053b5b7d02 100644 --- a/src/Components/Assets/configure/MonitorConfigure.tsx +++ b/src/Components/Assets/configure/MonitorConfigure.tsx @@ -22,7 +22,7 @@ const saveLink = async (assetId: string, bedId: string) => { const update_Link = async ( assetbedId: string, assetId: string, - bed: BedModel + bed: BedModel, ) => { await request(routes.partialUpdateAssetBed, { pathParams: { external_id: assetbedId }, @@ -55,7 +55,7 @@ export default function MonitorConfigure({ asset }: { asset: AssetData }) { update_Link( assetBed?.results[0].id as string, asset.id as string, - bed as BedModel + bed as BedModel, ); } else { saveLink(asset.id as string, bed?.id as string); diff --git a/src/Components/Auth/ResetPassword.tsx b/src/Components/Auth/ResetPassword.tsx index 47d120e1a97..325a53b9c80 100644 --- a/src/Components/Auth/ResetPassword.tsx +++ b/src/Components/Auth/ResetPassword.tsx @@ -127,19 +127,19 @@ export const ResetPassword = (props: any) => {
{validateRule( form.password?.length >= 8, - "Password should be atleast 8 characters long" + "Password should be atleast 8 characters long", )} {validateRule( form.password !== form.password.toUpperCase(), - "Password should contain at least 1 lowercase letter" + "Password should contain at least 1 lowercase letter", )} {validateRule( form.password !== form.password.toLowerCase(), - "Password should contain at least 1 uppercase letter" + "Password should contain at least 1 uppercase letter", )} {validateRule( /\d/.test(form.password), - "Password should contain at least 1 number" + "Password should contain at least 1 number", )}
)} @@ -156,7 +156,7 @@ export const ResetPassword = (props: any) => { form.confirm.length > 0 && validateRule( form.confirm === form.password, - "Confirm password should match the entered password" + "Confirm password should match the entered password", )}
diff --git a/src/Components/CameraFeed/CameraFeed.tsx b/src/Components/CameraFeed/CameraFeed.tsx index 6e2d8647c83..d5ea120e126 100644 --- a/src/Components/CameraFeed/CameraFeed.tsx +++ b/src/Components/CameraFeed/CameraFeed.tsx @@ -91,7 +91,7 @@ export default function CameraFeed(props: Props) {
diff --git a/src/Components/CameraFeed/FeedAlert.tsx b/src/Components/CameraFeed/FeedAlert.tsx index 0c2eb6aa429..a4f8a3beb18 100644 --- a/src/Components/CameraFeed/FeedAlert.tsx +++ b/src/Components/CameraFeed/FeedAlert.tsx @@ -58,7 +58,7 @@ export default function FeedAlert({ state }: Props) { diff --git a/src/Components/CameraFeed/FeedButton.tsx b/src/Components/CameraFeed/FeedButton.tsx index 033ffcc11ed..f0e568d4ad4 100644 --- a/src/Components/CameraFeed/FeedButton.tsx +++ b/src/Components/CameraFeed/FeedButton.tsx @@ -16,7 +16,7 @@ export default function FeedButton(props: Props) {