From d2275f414a7aa6ab10001b9d72740720370e044a Mon Sep 17 00:00:00 2001 From: Ashesh <3626859+Ashesh3@users.noreply.github.com> Date: Mon, 15 Apr 2024 23:04:16 +0530 Subject: [PATCH 1/6] Integrate Voice-Enabled Form Filling with Care Scribe in Care Frontend (#7481) * Implement Care Scribe * Update Scribe component and API routes * File type * Update and fix prettier issues * Fix fullscreen types in useFullscreen hook * Fix lint issues * Fix styling issue in SidebarUserCard component --- package-lock.json | 111 +++- package.json | 6 +- public/config.json | 1 + src/CAREUI/display/Card.tsx | 2 +- src/CAREUI/display/Chip.tsx | 2 +- src/CAREUI/display/NetworkSignal.tsx | 4 +- src/CAREUI/display/Timeline.tsx | 6 +- src/CAREUI/icons/icon.js | 2 +- src/CAREUI/interactive/KeyboardShortcut.tsx | 2 +- src/CAREUI/interactive/LegendInput.tsx | 4 +- src/CAREUI/interactive/ScrollOverlay.tsx | 2 +- src/CAREUI/interactive/SlideOver.tsx | 6 +- src/CAREUI/interactive/Switch.tsx | 2 +- src/CAREUI/misc/PaginatedList.tsx | 2 +- src/CAREUI/misc/ThemedFavicon.tsx | 2 +- src/Common/constants.tsx | 4 +- src/Common/hooks/useAsyncOptions.ts | 8 +- src/Common/hooks/useAuthUser.ts | 2 +- src/Common/hooks/useBreakpoints.ts | 2 +- src/Common/hooks/useConfig.ts | 4 + src/Common/hooks/useExport.tsx | 6 +- src/Common/hooks/useFeedPTZ.ts | 14 +- src/Common/hooks/useFilters.tsx | 6 +- src/Common/hooks/useFullscreen.ts | 19 +- src/Common/hooks/useMSEplayer.ts | 6 +- src/Common/hooks/useRangePagination.ts | 4 +- src/Common/hooks/useSlug.ts | 2 +- src/Common/hooks/useWindowDimensions.ts | 2 +- src/Common/utils.tsx | 4 +- src/Common/validation.tsx | 2 +- .../ABDM/ConfigureHealthFacility.tsx | 6 +- src/Components/ABDM/LinkABHANumberModal.tsx | 30 +- src/Components/Assets/AssetFilter.tsx | 6 +- src/Components/Assets/AssetImportModal.tsx | 6 +- src/Components/Assets/AssetManage.tsx | 20 +- .../Assets/AssetServiceEditModal.tsx | 4 +- .../Assets/AssetType/ONVIFCamera.tsx | 4 +- src/Components/Assets/AssetsList.tsx | 17 +- .../Assets/configure/MonitorConfigure.tsx | 4 +- src/Components/Auth/ResetPassword.tsx | 10 +- src/Components/CameraFeed/CameraFeed.tsx | 2 +- src/Components/CameraFeed/FeedAlert.tsx | 2 +- src/Components/CameraFeed/FeedButton.tsx | 2 +- src/Components/CameraFeed/NoFeedAvailable.tsx | 2 +- src/Components/CameraFeed/usePlayer.tsx | 4 +- src/Components/CameraFeed/utils.ts | 2 +- src/Components/Common/AssetSelect.tsx | 2 +- src/Components/Common/BedSelect.tsx | 4 +- src/Components/Common/Breadcrumbs.tsx | 4 +- src/Components/Common/DateInputV2.tsx | 46 +- src/Components/Common/Dialog.tsx | 2 +- src/Components/Common/FacilitySelect.tsx | 4 +- src/Components/Common/GLocationPicker.tsx | 20 +- src/Components/Common/HeadedTabs.tsx | 2 +- src/Components/Common/LanguageSelector.tsx | 2 +- .../Common/LanguageSelectorLogin.tsx | 2 +- src/Components/Common/LocationSelect.tsx | 2 +- src/Components/Common/PDFViewer.tsx | 2 +- src/Components/Common/Pagination.tsx | 2 +- .../Common/RouteToFacilitySelect.tsx | 2 +- src/Components/Common/Sidebar/Sidebar.tsx | 4 +- src/Components/Common/Sidebar/SidebarItem.tsx | 8 +- src/Components/Common/SkillSelect.tsx | 4 +- src/Components/Common/UpdatableApp.tsx | 4 +- src/Components/Common/Uptime.tsx | 32 +- .../Common/UserAutocompleteFormField.tsx | 4 +- src/Components/Common/components/ButtonV2.tsx | 4 +- src/Components/Common/components/Menu.tsx | 6 +- .../Common/components/SwitchTabs.tsx | 2 +- .../InvestigationBuilder.tsx | 22 +- .../PrescriptionDropdown.tsx | 2 +- .../PrescriptionMultiselect.tsx | 8 +- .../prescription-builder/ProcedureBuilder.tsx | 14 +- src/Components/Common/utils/Tooltip.tsx | 2 +- .../CriticalCare__API.tsx | 4 +- .../ConditionVerificationStatusMenu.tsx | 8 +- .../AddICD11Diagnosis.tsx | 2 +- .../ConsultationDiagnosisBuilder.tsx | 22 +- .../ConsultationDiagnosisEntry.tsx | 8 +- .../Diagnosis/DiagnosesListAccordion.tsx | 2 +- .../ExternalResult/ExternalResultUpload.tsx | 6 +- src/Components/ExternalResult/ListFilter.tsx | 8 +- src/Components/ExternalResult/ResultList.tsx | 8 +- .../ExternalResult/ResultUpdate.tsx | 4 +- src/Components/Facility/AddInventoryForm.tsx | 8 +- src/Components/Facility/AddLocationForm.tsx | 2 +- src/Components/Facility/AssetCreate.tsx | 10 +- src/Components/Facility/BedCapacity.tsx | 4 +- src/Components/Facility/BedManagement.tsx | 2 +- .../Facility/CentralNursingStation.tsx | 2 +- src/Components/Facility/ConsultationCard.tsx | 10 +- .../Facility/ConsultationClaims.tsx | 4 +- .../ConsultationInvestigationsTab.tsx | 2 +- .../ConsultationNeurologicalMonitoringTab.tsx | 2 +- .../ConsultationUpdatesTab.tsx | 49 +- .../ConsultationDetails/Events/EventsList.tsx | 4 +- .../Facility/ConsultationDetails/index.tsx | 22 +- .../ConsultationDoctorNotes/index.tsx | 2 +- src/Components/Facility/ConsultationForm.tsx | 72 +-- .../Facility/Consultations/Beds.tsx | 2 +- .../VirtualNursingAssistantLogUpdateCard.tsx | 2 +- .../Consultations/DailyRoundsFilter.tsx | 2 +- .../Consultations/DailyRoundsList.tsx | 2 +- .../Facility/Consultations/Feed.tsx | 22 +- .../Facility/Consultations/FeedButton.tsx | 2 +- .../Facility/Consultations/LiveFeed.tsx | 16 +- .../Facility/Consultations/Mews.tsx | 8 +- .../Consultations/NeurologicalTables.tsx | 14 +- .../Facility/Consultations/NursingPlot.tsx | 8 +- .../Facility/Consultations/NutritionPlots.tsx | 28 +- .../Facility/Consultations/PainDiagrams.tsx | 4 +- .../Consultations/PressureSoreDiagrams.tsx | 6 +- .../Consultations/PrimaryParametersPlot.tsx | 6 +- .../Facility/Consultations/VentilatorPlot.tsx | 2 +- .../components/StackedLinePlot.tsx | 4 +- .../Facility/CoverImageEditModal.tsx | 4 +- src/Components/Facility/DischargeModal.tsx | 8 +- .../Facility/DischargeSummaryModal.tsx | 12 +- .../Facility/DoctorVideoSlideover.tsx | 14 +- .../Facility/FacilityBedCapacity.tsx | 4 +- src/Components/Facility/FacilityCard.tsx | 13 +- src/Components/Facility/FacilityConfigure.tsx | 2 +- src/Components/Facility/FacilityCreate.tsx | 20 +- .../Facility/FacilityDoctorList.tsx | 2 +- .../FacilityFilter/DistrictSelect.tsx | 2 +- src/Components/Facility/FacilityHome.tsx | 8 +- .../Facility/FacilityHomeTriage.tsx | 10 +- src/Components/Facility/FacilityUsers.tsx | 2 +- src/Components/Facility/HospitalList.tsx | 10 +- src/Components/Facility/InventoryList.tsx | 4 +- .../InvestigationSuggestions.tsx | 37 +- .../Investigations/InvestigationTable.tsx | 4 +- .../Facility/Investigations/Reports/index.tsx | 20 +- .../Facility/Investigations/Reports/utils.tsx | 2 +- .../Investigations/ShowInvestigation.tsx | 11 +- .../Facility/Investigations/Table.tsx | 4 +- .../Investigations/ViewInvestigations.tsx | 2 +- .../Facility/Investigations/index.tsx | 32 +- .../Investigations/investigationsTab.tsx | 2 +- src/Components/Facility/MinQuantityList.tsx | 2 +- .../Facility/MinQuantityRequiredModal.tsx | 2 +- src/Components/Facility/PatientNoteCard.tsx | 4 +- .../Facility/PatientNotesSlideover.tsx | 8 +- src/Components/Facility/SetInventoryForm.tsx | 4 +- .../Facility/TransferPatientDialog.tsx | 4 +- src/Components/Facility/TreatmentSummary.tsx | 8 +- src/Components/Facility/TriageForm.tsx | 6 +- src/Components/Facility/models.tsx | 2 +- src/Components/Form/AutoCompleteAsync.tsx | 4 +- src/Components/Form/FieldValidators.tsx | 10 +- src/Components/Form/Form.tsx | 2 +- src/Components/Form/FormContext.ts | 2 +- .../AutoExpandingTextInputFormField.tsx | 2 +- .../Form/FormFields/Autocomplete.tsx | 6 +- .../FormFields/AutocompleteMultiselect.tsx | 8 +- src/Components/Form/FormFields/FormField.tsx | 4 +- .../FormFields/NumericWithUnitsFormField.tsx | 2 +- .../Form/FormFields/OtpFormField.tsx | 2 +- .../Form/FormFields/PhoneNumberFormField.tsx | 8 +- .../FormFields/RangeAutocompleteFormField.tsx | 4 +- .../Form/FormFields/SelectFormField.tsx | 2 +- .../Form/FormFields/TextAreaFormField.tsx | 4 +- .../Form/FormFields/TextFormField.tsx | 2 +- src/Components/Form/FormFields/Utils.ts | 6 +- src/Components/Form/MultiSelectMenuV2.tsx | 6 +- src/Components/Form/SearchInput.tsx | 4 +- src/Components/Form/SelectMenuV2.tsx | 2 +- src/Components/Form/Utils.ts | 4 +- src/Components/HCX/ClaimDetailCard.tsx | 2 +- src/Components/HCX/ClaimsItemsBuilder.tsx | 8 +- src/Components/HCX/CreateClaimCard.tsx | 10 +- .../HCX/InsuranceDetailsBuilder.tsx | 12 +- .../HCX/PatientInsuranceDetailsEditor.tsx | 4 +- src/Components/HCX/PolicyEligibilityCheck.tsx | 2 +- src/Components/HCX/validators.ts | 2 +- .../Medicine/AdministerMedicine.tsx | 6 +- .../Medicine/CreatePrescriptionForm.tsx | 18 +- .../Medicine/EditPrescriptionForm.tsx | 2 +- .../MedibaseAutocompleteFormField.tsx | 4 +- .../Medicine/MedicineAdministration.tsx | 14 +- .../AdministrationEventCell.tsx | 6 +- .../AdministrationTable.tsx | 4 +- .../AdministrationTableRow.tsx | 12 +- .../MedicineAdministrationSheet/index.tsx | 6 +- .../MedicineAdministrationSheet/utils.ts | 8 +- .../Medicine/PrescriptionBuilder.tsx | 2 +- .../Medicine/PrescriptionDetailCard.tsx | 8 +- .../Medicine/PrescriptionsTable.tsx | 4 +- .../Medicine/PrescrpitionTimeline.tsx | 12 +- .../Medicine/ResponsiveMedicineTables.tsx | 2 +- src/Components/Medicine/validators.ts | 2 +- .../Notifications/NotificationsList.tsx | 20 +- .../Patient/DailyRoundListDetails.tsx | 4 +- src/Components/Patient/DailyRounds.tsx | 40 +- src/Components/Patient/FileUpload.tsx | 32 +- .../Patient/InsuranceDetailsCard.tsx | 2 +- src/Components/Patient/ManagePatients.tsx | 32 +- .../Patient/PatientCategorySelect.tsx | 4 +- src/Components/Patient/PatientFilter.tsx | 24 +- src/Components/Patient/PatientHome.tsx | 46 +- src/Components/Patient/PatientInfoCard.tsx | 35 +- src/Components/Patient/PatientRegister.tsx | 48 +- src/Components/Patient/SampleDetails.tsx | 6 +- src/Components/Patient/SamplePreview.tsx | 10 +- src/Components/Patient/SampleTest.tsx | 4 +- src/Components/Patient/SampleTestCard.tsx | 8 +- src/Components/Patient/SampleViewAdmin.tsx | 24 +- src/Components/Patient/ShiftCreate.tsx | 10 +- src/Components/Patient/UpdateStatusDialog.tsx | 8 +- src/Components/Patient/Waveform.tsx | 2 +- src/Components/Patient/models.tsx | 2 +- src/Components/Resource/BadgesList.tsx | 12 +- src/Components/Resource/Commons.tsx | 4 +- src/Components/Resource/ResourceBoard.tsx | 6 +- src/Components/Resource/ResourceCreate.tsx | 4 +- src/Components/Resource/ResourceDetails.tsx | 2 +- .../Resource/ResourceDetailsUpdate.tsx | 2 +- src/Components/Scribe/Scribe.tsx | 608 ++++++++++++++++++ src/Components/Scribe/formDetails.ts | 194 ++++++ src/Components/Shifting/BadgesList.tsx | 14 +- src/Components/Shifting/BoardView.tsx | 6 +- src/Components/Shifting/Commons.tsx | 16 +- src/Components/Shifting/ListView.tsx | 4 +- src/Components/Shifting/ShiftDetails.tsx | 12 +- .../Shifting/ShiftDetailsUpdate.tsx | 6 +- src/Components/Shifting/ShiftingBoard.tsx | 10 +- src/Components/Users/LinkFacilityDialog.tsx | 2 +- src/Components/Users/ManageUsers.tsx | 16 +- src/Components/Users/SkillsSlideOver.tsx | 8 +- .../Users/SkillsSlideOverComponents.tsx | 2 +- src/Components/Users/UserAdd.tsx | 50 +- src/Components/Users/UserProfile.tsx | 14 +- .../VitalsMonitor/HL7DeviceClient.ts | 2 +- .../VitalsMonitor/HL7PatientVitalsMonitor.tsx | 8 +- .../VitalsMonitor/HL7VitalsRenderer.ts | 2 +- .../VentilatorPatientVitalsMonitor.tsx | 4 +- .../VentilatorWaveformsRenderer.ts | 2 +- .../VitalsMonitorAssetPopover.tsx | 2 +- .../VitalsMonitor/useHL7VitalsMonitor.ts | 14 +- .../useVentilatorVitalsMonitor.ts | 16 +- .../useVitalsAspectRatioConfig.ts | 2 +- src/Components/VitalsMonitor/utils.ts | 4 +- src/Integrations/Plausible.tsx | 2 +- src/Providers/AuthUserProvider.tsx | 2 +- src/Providers/HistoryAPIProvider.tsx | 2 +- src/Redux/Reducer.tsx | 2 +- src/Redux/actions.tsx | 10 +- src/Redux/api.tsx | 31 + src/Redux/fireRequest.tsx | 4 +- src/Routers/AppRouter.tsx | 6 +- src/Utils/AutoSave.tsx | 11 +- src/Utils/request/handleResponse.ts | 2 +- src/Utils/request/request.ts | 4 +- src/Utils/request/uploadFile.ts | 2 +- src/Utils/request/useQuery.ts | 4 +- src/Utils/request/utils.ts | 10 +- src/Utils/useRecorder.js | 2 +- src/Utils/useSegmentedRecorder.ts | 129 ++++ src/Utils/useVisibility.ts | 2 +- src/Utils/utils.ts | 40 +- src/index.tsx | 2 +- src/service-worker.ts | 6 +- src/style/index.css | 18 + 263 files changed, 2122 insertions(+), 1048 deletions(-) create mode 100644 src/Components/Scribe/Scribe.tsx create mode 100644 src/Components/Scribe/formDetails.ts create mode 100644 src/Utils/useSegmentedRecorder.ts 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..e8042058e9a 100644 --- a/src/Components/Assets/AssetsList.tsx +++ b/src/Components/Assets/AssetsList.tsx @@ -130,7 +130,7 @@ const AssetsList = () => { 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) {