From cc368a9d83a334846e1caa48ad1257e10d695e09 Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan <40040905+Jacobjeevan@users.noreply.github.com> Date: Sat, 9 Nov 2024 11:04:24 +0530 Subject: [PATCH 1/2] Avatar in UserAutoComplete (#8967) --- cypress/e2e/assets_spec/AssetHomepage.cy.ts | 11 +++-- cypress/e2e/assets_spec/AssetsCreation.cy.ts | 5 +- cypress/e2e/assets_spec/AssetsManage.cy.ts | 4 +- .../e2e/facility_spec/FacilityCreation.cy.ts | 2 +- .../e2e/facility_spec/FacilityHomepage.cy.ts | 7 ++- .../e2e/facility_spec/FacilityInventory.cy.ts | 2 +- .../e2e/facility_spec/FacilityManage.cy.ts | 7 +-- .../patient_spec/PatientBedManagement.cy.ts | 2 +- .../PatientConsultationCreation.cy.ts | 10 ++-- .../patient_spec/PatientDoctorConnect.cy.ts | 1 + cypress/e2e/patient_spec/PatientFileUpload.ts | 1 + .../e2e/patient_spec/PatientLogUpdate.cy.ts | 2 +- .../patient_spec/PatientPrescription.cy.ts | 2 +- .../patient_spec/PatientRegistration.cy.ts | 6 +-- .../e2e/resource_spec/ResourcesHomepage.cy.ts | 2 +- cypress/e2e/users_spec/UsersCreation.cy.ts | 6 +-- cypress/e2e/users_spec/UsersManage.cy.ts | 2 +- .../Common/UserAutocompleteFormField.tsx | 13 +++++ .../Form/FormFields/Autocomplete.tsx | 47 +++++++++++-------- 19 files changed, 78 insertions(+), 54 deletions(-) diff --git a/cypress/e2e/assets_spec/AssetHomepage.cy.ts b/cypress/e2e/assets_spec/AssetHomepage.cy.ts index bda4abdfae3..906cd9b2edc 100644 --- a/cypress/e2e/assets_spec/AssetHomepage.cy.ts +++ b/cypress/e2e/assets_spec/AssetHomepage.cy.ts @@ -1,10 +1,11 @@ -import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; -import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan"; -import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; -import { AssetFilters } from "../../pageobject/Asset/AssetFilters"; +import { v4 as uuidv4 } from "uuid"; + import { AssetPage } from "../../pageobject/Asset/AssetCreation"; +import { AssetFilters } from "../../pageobject/Asset/AssetFilters"; +import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; +import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan"; +import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; import LoginPage from "../../pageobject/Login/LoginPage"; -import { v4 as uuidv4 } from "uuid"; describe("Asset Tab", () => { const assetSearchPage = new AssetSearchPage(); diff --git a/cypress/e2e/assets_spec/AssetsCreation.cy.ts b/cypress/e2e/assets_spec/AssetsCreation.cy.ts index 16a4fd050fb..61c6fe9b517 100644 --- a/cypress/e2e/assets_spec/AssetsCreation.cy.ts +++ b/cypress/e2e/assets_spec/AssetsCreation.cy.ts @@ -1,7 +1,8 @@ -import { AssetPage } from "../../pageobject/Asset/AssetCreation"; import { v4 as uuidv4 } from "uuid"; -import LoginPage from "../../pageobject/Login/LoginPage"; + +import { AssetPage } from "../../pageobject/Asset/AssetCreation"; import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; +import LoginPage from "../../pageobject/Login/LoginPage"; describe("Asset", () => { const assetPage = new AssetPage(); diff --git a/cypress/e2e/assets_spec/AssetsManage.cy.ts b/cypress/e2e/assets_spec/AssetsManage.cy.ts index 756d3b261a6..17ee99bdb62 100644 --- a/cypress/e2e/assets_spec/AssetsManage.cy.ts +++ b/cypress/e2e/assets_spec/AssetsManage.cy.ts @@ -1,8 +1,8 @@ import { AssetPage } from "../../pageobject/Asset/AssetCreation"; -import LoginPage from "../../pageobject/Login/LoginPage"; +import { AssetFilters } from "../../pageobject/Asset/AssetFilters"; import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; import FacilityPage from "../../pageobject/Facility/FacilityCreation"; -import { AssetFilters } from "../../pageobject/Asset/AssetFilters"; +import LoginPage from "../../pageobject/Login/LoginPage"; function addDaysToDate(numberOfDays: number) { const inputDate = new Date(); diff --git a/cypress/e2e/facility_spec/FacilityCreation.cy.ts b/cypress/e2e/facility_spec/FacilityCreation.cy.ts index 4961ae4a4cb..fff1311fdd6 100644 --- a/cypress/e2e/facility_spec/FacilityCreation.cy.ts +++ b/cypress/e2e/facility_spec/FacilityCreation.cy.ts @@ -1,6 +1,6 @@ import FacilityPage from "../../pageobject/Facility/FacilityCreation"; -import LoginPage from "../../pageobject/Login/LoginPage"; import FacilityHome from "../../pageobject/Facility/FacilityHome"; +import LoginPage from "../../pageobject/Login/LoginPage"; import ManageUserPage from "../../pageobject/Users/ManageUserPage"; import { UserCreationPage } from "../../pageobject/Users/UserCreation"; diff --git a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts index e6caf645f7a..bc84aea4882 100644 --- a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts +++ b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts @@ -1,11 +1,10 @@ // FacilityCreation - -import LoginPage from "../../pageobject/Login/LoginPage"; +import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; +import FacilityPage from "../../pageobject/Facility/FacilityCreation"; import FacilityHome from "../../pageobject/Facility/FacilityHome"; +import LoginPage from "../../pageobject/Login/LoginPage"; import ManageUserPage from "../../pageobject/Users/ManageUserPage"; -import FacilityPage from "../../pageobject/Facility/FacilityCreation"; import { UserPage } from "../../pageobject/Users/UserSearch"; -import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; describe("Facility Homepage Function", () => { const loginPage = new LoginPage(); diff --git a/cypress/e2e/facility_spec/FacilityInventory.cy.ts b/cypress/e2e/facility_spec/FacilityInventory.cy.ts index cdada75ee06..a9f32984efc 100644 --- a/cypress/e2e/facility_spec/FacilityInventory.cy.ts +++ b/cypress/e2e/facility_spec/FacilityInventory.cy.ts @@ -1,6 +1,6 @@ import FacilityPage from "../../pageobject/Facility/FacilityCreation"; -import LoginPage from "../../pageobject/Login/LoginPage"; import FacilityHome from "../../pageobject/Facility/FacilityHome"; +import LoginPage from "../../pageobject/Login/LoginPage"; describe("Inventory Management Section", () => { const facilityPage = new FacilityPage(); diff --git a/cypress/e2e/facility_spec/FacilityManage.cy.ts b/cypress/e2e/facility_spec/FacilityManage.cy.ts index 1f0d2b66108..10074e81166 100644 --- a/cypress/e2e/facility_spec/FacilityManage.cy.ts +++ b/cypress/e2e/facility_spec/FacilityManage.cy.ts @@ -1,8 +1,9 @@ -import LoginPage from "../../pageobject/Login/LoginPage"; -import FacilityManage from "../../pageobject/Facility/FacilityManage"; -import FacilityPage from "../../pageobject/Facility/FacilityCreation"; import { v4 as uuidv4 } from "uuid"; +import FacilityPage from "../../pageobject/Facility/FacilityCreation"; +import FacilityManage from "../../pageobject/Facility/FacilityManage"; +import LoginPage from "../../pageobject/Login/LoginPage"; + describe("Facility Manage Functions", () => { const loginPage = new LoginPage(); const facilityManage = new FacilityManage(); diff --git a/cypress/e2e/patient_spec/PatientBedManagement.cy.ts b/cypress/e2e/patient_spec/PatientBedManagement.cy.ts index 84ef2f4800e..65adf131c87 100644 --- a/cypress/e2e/patient_spec/PatientBedManagement.cy.ts +++ b/cypress/e2e/patient_spec/PatientBedManagement.cy.ts @@ -1,7 +1,7 @@ import LoginPage from "../../pageobject/Login/LoginPage"; +import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation"; import { PatientPage } from "../../pageobject/Patient/PatientCreation"; import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate"; -import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation"; describe("Patient swtich bed functionality", () => { const loginPage = new LoginPage(); diff --git a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts index ee38b24d746..4c84f7fad8f 100644 --- a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts +++ b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts @@ -1,12 +1,12 @@ import LoginPage from "../../pageobject/Login/LoginPage"; -import { PatientPage } from "../../pageobject/Patient/PatientCreation"; import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation"; -import PatientPredefined from "../../pageobject/Patient/PatientPredefined"; -import ShiftCreation from "../../pageobject/Shift/ShiftCreation"; -import PatientInvestigation from "../../pageobject/Patient/PatientInvestigation"; -import PatientTreatmentPlan from "../../pageobject/Patient/PatientTreatmentPlan"; +import { PatientPage } from "../../pageobject/Patient/PatientCreation"; import PatientDeathReport from "../../pageobject/Patient/PatientDeathReport"; +import PatientInvestigation from "../../pageobject/Patient/PatientInvestigation"; +import PatientPredefined from "../../pageobject/Patient/PatientPredefined"; import PatientPrescription from "../../pageobject/Patient/PatientPrescription"; +import PatientTreatmentPlan from "../../pageobject/Patient/PatientTreatmentPlan"; +import ShiftCreation from "../../pageobject/Shift/ShiftCreation"; describe("Patient Consultation in multiple combination", () => { const patientConsultationPage = new PatientConsultationPage(); diff --git a/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts b/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts index 9197cac2d90..dd626f619ce 100644 --- a/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts +++ b/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts @@ -1,4 +1,5 @@ import { DoctorConnect } from "pageobject/Patient/PatientDoctorConnect"; + import LoginPage from "../../pageobject/Login/LoginPage"; import { PatientPage } from "../../pageobject/Patient/PatientCreation"; diff --git a/cypress/e2e/patient_spec/PatientFileUpload.ts b/cypress/e2e/patient_spec/PatientFileUpload.ts index cc94943fd6f..110631551a1 100644 --- a/cypress/e2e/patient_spec/PatientFileUpload.ts +++ b/cypress/e2e/patient_spec/PatientFileUpload.ts @@ -1,6 +1,7 @@ import LoginPage from "../../pageobject/Login/LoginPage"; import { PatientPage } from "../../pageobject/Patient/PatientCreation"; import { PatientFileUpload } from "../../pageobject/Patient/PatientFileupload"; + const loginPage = new LoginPage(); const patientPage = new PatientPage(); const patientFileUpload = new PatientFileUpload(); diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts index b32990872e2..b6d7ecbc173 100644 --- a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts +++ b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts @@ -1,8 +1,8 @@ import LoginPage from "../../pageobject/Login/LoginPage"; import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation"; import { PatientPage } from "../../pageobject/Patient/PatientCreation"; -import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate"; import PatientInvestigation from "../../pageobject/Patient/PatientInvestigation"; +import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate"; import PatientPrescription from "../../pageobject/Patient/PatientPrescription"; describe("Patient Log Update in Normal, Critical and TeleIcu", () => { diff --git a/cypress/e2e/patient_spec/PatientPrescription.cy.ts b/cypress/e2e/patient_spec/PatientPrescription.cy.ts index f5febc85fdc..53e67324199 100644 --- a/cypress/e2e/patient_spec/PatientPrescription.cy.ts +++ b/cypress/e2e/patient_spec/PatientPrescription.cy.ts @@ -1,6 +1,6 @@ -import PatientPrescription from "../../pageobject/Patient/PatientPrescription"; import LoginPage from "../../pageobject/Login/LoginPage"; import { PatientPage } from "../../pageobject/Patient/PatientCreation"; +import PatientPrescription from "../../pageobject/Patient/PatientPrescription"; const patientPrescription = new PatientPrescription(); const loginPage = new LoginPage(); diff --git a/cypress/e2e/patient_spec/PatientRegistration.cy.ts b/cypress/e2e/patient_spec/PatientRegistration.cy.ts index d774a90ceb8..cb84fa06674 100644 --- a/cypress/e2e/patient_spec/PatientRegistration.cy.ts +++ b/cypress/e2e/patient_spec/PatientRegistration.cy.ts @@ -1,10 +1,10 @@ +import FacilityPage from "../../pageobject/Facility/FacilityCreation"; import LoginPage from "../../pageobject/Login/LoginPage"; import { PatientPage } from "../../pageobject/Patient/PatientCreation"; -import FacilityPage from "../../pageobject/Facility/FacilityCreation"; -import { generatePhoneNumber } from "../../pageobject/utils/constants"; -import PatientTransfer from "../../pageobject/Patient/PatientTransfer"; import PatientInsurance from "../../pageobject/Patient/PatientInsurance"; import PatientMedicalHistory from "../../pageobject/Patient/PatientMedicalHistory"; +import PatientTransfer from "../../pageobject/Patient/PatientTransfer"; +import { generatePhoneNumber } from "../../pageobject/utils/constants"; const yearOfBirth = "2001"; const isHCXEnabled = Cypress.env("ENABLE_HCX"); diff --git a/cypress/e2e/resource_spec/ResourcesHomepage.cy.ts b/cypress/e2e/resource_spec/ResourcesHomepage.cy.ts index 8dc526a68c3..299d753d720 100644 --- a/cypress/e2e/resource_spec/ResourcesHomepage.cy.ts +++ b/cypress/e2e/resource_spec/ResourcesHomepage.cy.ts @@ -1,6 +1,6 @@ +import FacilityPage from "../../pageobject/Facility/FacilityCreation"; import LoginPage from "../../pageobject/Login/LoginPage"; import ResourcePage from "../../pageobject/Resource/ResourcePage"; -import FacilityPage from "../../pageobject/Facility/FacilityCreation"; describe("Resource Page", () => { let createdResource: string; diff --git a/cypress/e2e/users_spec/UsersCreation.cy.ts b/cypress/e2e/users_spec/UsersCreation.cy.ts index 683a2131b2f..f495a136d97 100644 --- a/cypress/e2e/users_spec/UsersCreation.cy.ts +++ b/cypress/e2e/users_spec/UsersCreation.cy.ts @@ -1,11 +1,11 @@ -import LoginPage from "../../pageobject/Login/LoginPage"; import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; import FacilityPage from "../../pageobject/Facility/FacilityCreation"; -import { UserPage } from "../../pageobject/Users/UserSearch"; +import LoginPage from "../../pageobject/Login/LoginPage"; import { UserCreationPage } from "../../pageobject/Users/UserCreation"; +import { UserPage } from "../../pageobject/Users/UserSearch"; import { - generatePhoneNumber, generateEmergencyPhoneNumber, + generatePhoneNumber, } from "../../pageobject/utils/constants"; describe("User Creation", () => { diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index 98c2d564f6d..9ed4fe34ec7 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -1,7 +1,7 @@ import LoginPage from "../../pageobject/Login/LoginPage"; -import { UserPage } from "../../pageobject/Users/UserSearch"; import ManageUserPage from "../../pageobject/Users/ManageUserPage"; import { UserCreationPage } from "../../pageobject/Users/UserCreation"; +import { UserPage } from "../../pageobject/Users/UserSearch"; describe("Manage User", () => { const loginPage = new LoginPage(); diff --git a/src/components/Common/UserAutocompleteFormField.tsx b/src/components/Common/UserAutocompleteFormField.tsx index f6e10e14870..47381414221 100644 --- a/src/components/Common/UserAutocompleteFormField.tsx +++ b/src/components/Common/UserAutocompleteFormField.tsx @@ -19,6 +19,8 @@ import { mergeQueryOptions, } from "@/Utils/utils"; +import { Avatar } from "./Avatar"; + type BaseProps = FormFieldBaseProps & { placeholder?: string; userType?: UserRole; @@ -67,6 +69,16 @@ export default function UserAutocomplete(props: UserSearchProps) { } }, [loading, field.required, data?.results, props.noResultsError]); + const getAvatar = (option: UserBareMinimum) => { + return ( + + ); + }; + return ( `${option.user_type} - ${option.username}` } diff --git a/src/components/Form/FormFields/Autocomplete.tsx b/src/components/Form/FormFields/Autocomplete.tsx index f66eafe6e36..37486974881 100644 --- a/src/components/Form/FormFields/Autocomplete.tsx +++ b/src/components/Form/FormFields/Autocomplete.tsx @@ -5,7 +5,7 @@ import { ComboboxOption, ComboboxOptions, } from "@headlessui/react"; -import { useEffect, useState } from "react"; +import { ReactNode, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import CareIcon from "@/CAREUI/icons/CareIcon"; @@ -29,6 +29,7 @@ type AutocompleteFormFieldProps = FormFieldBaseProps & { optionValue?: OptionCallback; optionDescription?: OptionCallback; optionIcon?: OptionCallback; + optionImage?: OptionCallback; optionDisabled?: OptionCallback; minQueryLength?: number; onQuery?: (query: string) => void; @@ -55,6 +56,7 @@ const AutocompleteFormField = ( placeholder={props.placeholder} optionLabel={props.optionLabel} optionIcon={props.optionIcon} + optionImage={props.optionImage} optionValue={props.optionValue} optionDescription={props.optionDescription} optionDisabled={props.optionDisabled} @@ -79,6 +81,7 @@ type AutocompleteProps = { placeholder?: string; optionLabel: OptionCallback; optionIcon?: OptionCallback; + optionImage?: OptionCallback; optionValue?: OptionCallback; optionDescription?: OptionCallback; optionDisabled?: OptionCallback; @@ -89,7 +92,6 @@ type AutocompleteProps = { isLoading?: boolean; allowRawInput?: boolean; error?: string; - avatar?: boolean; } & ( | { required?: false; @@ -124,6 +126,7 @@ export const Autocomplete = (props: AutocompleteProps) => { description, search: label.toLowerCase(), icon: props.optionIcon?.(option), + image: props.optionImage?.(option), value: props.optionValue ? props.optionValue(option) : option, disabled: props.optionDisabled?.(option), }; @@ -143,6 +146,7 @@ export const Autocomplete = (props: AutocompleteProps) => { description: undefined, search: query.toLowerCase(), icon: , + image: undefined, value: query, disabled: undefined, }, @@ -241,25 +245,28 @@ export const Autocomplete = (props: AutocompleteProps) => { disabled={option.disabled} > {({ focus }) => ( -
-
- {option.label} - {option.icon} -
- {option.description && ( -
- {option.description} +
+ {option?.image} +
+
+ {option.label} + {option.icon}
- )} + {option.description && ( +
+ {option.description} +
+ )} +
)} From 84fdffeaf67fe94eddfefee361ad0d60fc86c039 Mon Sep 17 00:00:00 2001 From: JavidSumra <112365664+JavidSumra@users.noreply.github.com> Date: Sat, 9 Nov 2024 11:13:04 +0530 Subject: [PATCH 2/2] fix locale sort's path and fix format script to sort cypress dir (#9070) Co-authored-by: rithviknishad --- cypress/e2e/facility_spec/FacilityLocation.cy.ts | 9 +++++---- cypress/e2e/users_spec/UsersProfile.cy.ts | 2 +- cypress/pageobject/Patient/PatientPredefined.ts | 5 ++--- cypress/tsconfig.json | 15 ++++++++++++--- package.json | 6 +++--- scripts/sort-locales.js | 2 +- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/cypress/e2e/facility_spec/FacilityLocation.cy.ts b/cypress/e2e/facility_spec/FacilityLocation.cy.ts index d29ee95e873..b700f5c75ae 100644 --- a/cypress/e2e/facility_spec/FacilityLocation.cy.ts +++ b/cypress/e2e/facility_spec/FacilityLocation.cy.ts @@ -1,10 +1,11 @@ +import { v4 as uuidv4 } from "uuid"; + import { AssetPage } from "../../pageobject/Asset/AssetCreation"; -import { UserCreationPage } from "../../pageobject/Users/UserCreation"; -import FacilityPage from "../../pageobject/Facility/FacilityCreation"; -import FacilityLocation from "../../pageobject/Facility/FacilityLocation"; import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; +import FacilityPage from "../../pageobject/Facility/FacilityCreation"; import FacilityHome from "../../pageobject/Facility/FacilityHome"; -import { v4 as uuidv4 } from "uuid"; +import FacilityLocation from "../../pageobject/Facility/FacilityLocation"; +import { UserCreationPage } from "../../pageobject/Users/UserCreation"; describe("Location Management Section", () => { const assetPage = new AssetPage(); diff --git a/cypress/e2e/users_spec/UsersProfile.cy.ts b/cypress/e2e/users_spec/UsersProfile.cy.ts index 3073cebe7ce..35771024180 100644 --- a/cypress/e2e/users_spec/UsersProfile.cy.ts +++ b/cypress/e2e/users_spec/UsersProfile.cy.ts @@ -1,6 +1,6 @@ import LoginPage from "../../pageobject/Login/LoginPage"; -import UserProfilePage from "../../pageobject/Users/UserProfilePage"; import ManageUserPage from "../../pageobject/Users/ManageUserPage"; +import UserProfilePage from "../../pageobject/Users/UserProfilePage"; describe("Manage User Profile", () => { const loginPage = new LoginPage(); diff --git a/cypress/pageobject/Patient/PatientPredefined.ts b/cypress/pageobject/Patient/PatientPredefined.ts index f0a005ec97b..a3eb41cb86c 100644 --- a/cypress/pageobject/Patient/PatientPredefined.ts +++ b/cypress/pageobject/Patient/PatientPredefined.ts @@ -1,11 +1,10 @@ // PatientPredefined.js - -import { PatientPage } from "../../pageobject/Patient/PatientCreation"; import FacilityPage from "../../pageobject/Facility/FacilityCreation"; +import { PatientPage } from "../../pageobject/Patient/PatientCreation"; import PatientMedicalHistory from "../../pageobject/Patient/PatientMedicalHistory"; import { - generatePhoneNumber, generateEmergencyPhoneNumber, + generatePhoneNumber, } from "../utils/constants"; class PatientPredefined { diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json index 114000b60f0..3fbb7b08f69 100644 --- a/cypress/tsconfig.json +++ b/cypress/tsconfig.json @@ -2,9 +2,18 @@ "compilerOptions": { "baseUrl": "./", "target": "es5", - "lib": ["es5", "dom", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020"], + "lib": [ + "es5", + "dom", + "es2015", + "es2016", + "es2017", + "es2018", + "es2019", + "es2020" + ], "typeRoots": ["./support"], "resolveJsonModule": true }, - "include": ["**/*.cy.ts", "support/commands.ts","**/*.ts"], -} \ No newline at end of file + "include": ["**/*.cy.ts", "support/commands.ts", "**/*.ts"] +} diff --git a/package.json b/package.json index cc088dd125f..6b2273e341f 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "prepare": "husky", "lint": "eslint ./src", "lint-fix": "eslint ./src --fix", - "format": "prettier ./src --write", + "format": "prettier ./src ./cypress --write", "sort-locales": "node ./scripts/sort-locales.js" }, "dependencies": { @@ -166,7 +166,7 @@ "eslint --fix", "git update-index --again" ], - "src/Locale/*.json": [ + "public/locale/*.json": [ "npm run sort-locales" ] }, @@ -174,4 +174,4 @@ "node": ">=22.11.0" }, "packageManager": "npm@10.9.0" -} +} \ No newline at end of file diff --git a/scripts/sort-locales.js b/scripts/sort-locales.js index adff586a93b..62c3e3d8ba1 100644 --- a/scripts/sort-locales.js +++ b/scripts/sort-locales.js @@ -1,7 +1,7 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires const fs = require("fs"); -const file = "src/Locale/en.json"; +const file = "public/locale/en.json"; const data = JSON.parse(fs.readFileSync(file, "utf8"));