diff --git a/.env b/.env index fcabed6db34..38fd950b0d8 100644 --- a/.env +++ b/.env @@ -1,11 +1,10 @@ # Whitelabelling envs -REACT_APP_TITLE="CARE" -REACT_APP_META_DESCRIPTION="CoronaSafe Network is an open-source public utility designed by a multi-disciplinary team of innovators and volunteers. CoronaSafe Care is a Digital Public Good recognised by United Nations." +REACT_APP_TITLE=CARE +REACT_APP_META_DESCRIPTION=CoronaSafe Network is an open-source public utility designed by a multi-disciplinary team of innovators and volunteers. CoronaSafe Care is a Digital Public Good recognised by United Nations. REACT_APP_COVER_IMAGE=https://cdn.coronasafe.network/care_logo.svg REACT_APP_COVER_IMAGE_ALT=https://cdn.coronasafe.network/care_logo.svg -REACT_APP_CONFIG="" -REACT_PUBLIC_URL="https://care.coronasafe.in" +REACT_PUBLIC_URL=https://care.coronasafe.in # Dev envs ESLINT_NO_DEV_ERRORS=true diff --git a/.eslintrc.json b/.eslintrc.json index 018ae8270ee..c47227870ea 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,6 +18,21 @@ "plugin:i18next/recommended", "plugin:tailwindcss/recommended" ], + "overrides": [ + { + "files": [ + "**/*.mdx" + ], + "extends": [ + "plugin:react/recommended", + "plugin:mdx/recommended" + ], + "rules": { + "react/jsx-no-target-blank": "off", + "i18next/no-literal-string": "off" + } + } + ], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { @@ -72,7 +87,6 @@ "*.res", "*.css", "*.csv", - "*.stories.mdx", "Dockerfile" ] } diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index 4f23fbe4937..f04045d0c72 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -14,6 +14,10 @@ jobs: permissions: write-all if: github.repository == 'coronasafe/care_fe' runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + containers: [1,2,3,4,5,6,7,8] steps: - name: Checkout 📥 uses: actions/checkout@v3 @@ -24,13 +28,22 @@ jobs: repository: coronasafe/care path: care - - name: Run docker compose up on care 🐳 - run: cd care && touch .env && make docker_config_file=docker-compose.pre-built.yaml up && cd .. && sleep 60s - # Voluntarily kept 60 seconds delay to wait for migrations to complete. + - name: Start care docker containers 🐳 + run: | + cd care + make docker_config_file=docker-compose.pre-built.yaml up + while docker compose exec backend bash -c "python manage.py showmigrations 2>/dev/null | cat | grep -q '\[ \]'"; do + >&2 echo "Migrations are not yet applied - sleeping" + sleep 5 + done + echo "Migrations are applied" + cd .. - - name: Run Django collectstatic and load dummy data on care 🐍 + - name: Load dummy data into care backend 📂 run: | - docker exec care python manage.py load_dummy_data + cd care + docker compose exec backend bash -c "python manage.py load_dummy_data" + cd .. - name: Check care is up ♻ run: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:9000 @@ -51,39 +64,14 @@ jobs: wait-on-timeout: 300 browser: chrome record: true + parallel: true env: CARE_API: http://localhost:9000 CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_OPTIONS: --max_old_space_size=4096 - - - name: Remove cypress passed label on failure 🏷️ - uses: actions-ecosystem/action-remove-labels@v1 - if: failure() - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - labels: cypress passed - - - name: Add cypress passed label on success 🏷️ - uses: actions-ecosystem/action-add-labels@v1 - if: success() - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - labels: cypress passed - - - name: Remove cypress failed label on success 🏷️ - uses: actions-ecosystem/action-remove-labels@v1 - if: success() - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - labels: cypress failed - - - name: Add cypress failed label on failure 🏷️ - uses: actions-ecosystem/action-add-labels@v1 - if: failure() - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - labels: cypress failed + COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}} + COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}} - name: Upload cypress screenshots on failure 📸 uses: actions/upload-artifact@v3 @@ -92,10 +80,3 @@ jobs: name: cypress-screenshots path: cypress/screenshots - # Test run video was always captured, so this action uses "always()" condition - - name: Upload cypress videos 📹 - uses: actions/upload-artifact@v3 - if: always() - with: - name: cypress-videos - path: cypress/videos diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 06b1cf8eff0..67628d414c8 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -180,6 +180,48 @@ jobs: rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache + deploy-staging-gcp: + needs: build-staging + name: Deploy to staging GCP cluster + runs-on: ubuntu-latest + environment: + 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 + + # 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.0 + 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: build-production name: Deploy to GKE Manipur @@ -389,3 +431,45 @@ jobs: 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: build-production + 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 + + # 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.0 + 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 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 00000000000..ce4bd271cf7 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,31 @@ +name: Lint Code Base + +on: + pull_request: + branches: + - develop + - master + merge_group: + +jobs: + lint: + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "18" + + - name: Install dependencies + run: npm ci + + - name: Run lint + run: npm run lint -- --quiet diff --git a/.gitignore b/.gitignore index b97356ed20f..4ca589aab39 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ public/build-meta.json # Using NPM yarn.lock pnpm-lock.yaml +bun.lockb # Cypress cypress/downloads diff --git a/cypress.config.ts b/cypress.config.ts index 014eb1f4d07..66915f8a11b 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -19,7 +19,6 @@ export default defineConfig({ return null; }, }); - return config; }, baseUrl: "http://localhost:4000", diff --git a/cypress/e2e/assets_spec/asset_homepage.cy.ts b/cypress/e2e/assets_spec/asset_homepage.cy.ts new file mode 100644 index 00000000000..61f7d8a52c0 --- /dev/null +++ b/cypress/e2e/assets_spec/asset_homepage.cy.ts @@ -0,0 +1,113 @@ +/// + +import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; +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 { AssetPage } from "../../pageobject/Asset/AssetCreation"; +import LoginPage from "../../pageobject/Login/LoginPage"; +import { v4 as uuidv4 } from "uuid"; + +describe("Asset Tab", () => { + const assetSearchPage = new AssetSearchPage(); + const assetQRScanPage = new AssetQRScanPage(); + const assetPagination = new AssetPagination(); + const assetFilters = new AssetFilters(); + const assetPage = new AssetPage(); + const loginPage = new LoginPage(); + const assetName = "Dummy Camera 10"; + const qrCode = uuidv4(); + const serialNumber = Math.floor(Math.random() * 10 ** 10).toString(); + + before(() => { + loginPage.loginAsDisctrictAdmin(); + cy.saveLocalStorage(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); + cy.awaitUrl("/assets"); + }); + + // search for a element + + it("Search Asset Name/QR_ID/Serial_number", () => { + assetSearchPage.typeSearchKeyword(assetName); + assetSearchPage.pressEnter(); + assetSearchPage.verifyBadgeContent(assetName); + assetSearchPage.clickAssetByName(assetName); + assetSearchPage.clickUpdateButton(); + assetSearchPage.clearAndTypeQRCode(qrCode); + assetSearchPage.clearAndTypeSerialNumber(serialNumber); + assetSearchPage.clickAssetSubmitButton(); + assetSearchPage.visitAssetsPage(); + assetSearchPage.typeSearchKeyword(qrCode); + assetSearchPage.pressEnter(); + assetSearchPage.verifyAssetListContains(assetName); + assetSearchPage.verifyBadgeContent(qrCode); + assetSearchPage.typeSearchKeyword(serialNumber); + assetSearchPage.verifyAssetListContains(assetName); + assetSearchPage.verifyBadgeContent(serialNumber); + }); + + // scan a asset qr code + + it("Scan Asset QR", () => { + assetQRScanPage.scanAssetQR(); + }); + + // filter the asset and verify the badges are there + + it("Filter Asset", () => { + assetFilters.filterAssets( + "Dummy Facility 1", + "INTERNAL", + "ACTIVE", + "ONVIF Camera", + "Camera Loc" + ); + assetFilters.clickadvancefilter(); + assetFilters.clickslideoverbackbutton(); // to verify the back button doesn't clear applied filters + assetFilters.assertFacilityText("Dummy Facility 1"); + assetFilters.assertAssetTypeText("INTERNAL"); + assetFilters.assertAssetClassText("ONVIF"); + assetFilters.assertStatusText("ACTIVE"); + assetFilters.assertLocationText("Camera Loc"); + assetFilters.clickadvancefilter(); + assetFilters.clearFilters(); + }); + + // Verify the pagination in the page + + it("Next/Previous Page", () => { + assetPagination.navigateToNextPage(); + assetPagination.navigateToPreviousPage(); + }); + + it("Import new asset", () => { + assetPage.selectassetimportbutton(); + assetPage.selectImportOption(); + assetPage.selectImportFacility("Dummy Facility 1"); + assetPage.importAssetFile(); + assetPage.selectImportLocation("Camera Locations"); + assetPage.clickImportAsset(); + }); + + it("verify imported asset", () => { + assetSearchPage.typeSearchKeyword("New Test Asset"); + assetSearchPage.pressEnter(); + assetSearchPage.verifyAssetIsPresent("New Test Asset"); + }); + + it("Export asset", () => { + assetPage.selectassetimportbutton(); + assetPage.selectjsonexportbutton(); + assetPage.selectassetimportbutton(); + assetPage.selectcsvexportbutton(); + }); + + afterEach(() => { + cy.saveLocalStorage(); + }); +}); diff --git a/cypress/e2e/assets_spec/asset_tab.cy.ts b/cypress/e2e/assets_spec/asset_tab.cy.ts deleted file mode 100644 index 0abf11fcaf0..00000000000 --- a/cypress/e2e/assets_spec/asset_tab.cy.ts +++ /dev/null @@ -1,61 +0,0 @@ -/// - -import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; -import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; -import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan"; -import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; -import { AssetFilters } from "../../pageobject/Asset/AssetFilters"; - -describe("Asset Tab", () => { - const assetSearchPage = new AssetSearchPage(); - const assetQRScanPage = new AssetQRScanPage(); - const assetPagination = new AssetPagination(); - const assetFilters = new AssetFilters(); - - before(() => { - cy.loginByApi("devdistrictadmin", "Coronasafe@123"); - cy.saveLocalStorage(); - }); - - beforeEach(() => { - cy.restoreLocalStorage(); - cy.awaitUrl("/assets"); - }); - - // search for a element - - it("Search Asset Name", () => { - const initialUrl = cy.url(); - assetSearchPage.typeSearchKeyword("dummy camera 30"); - assetSearchPage.pressEnter(); - assetSearchPage.verifyUrlChanged(initialUrl); - }); - - // scan a asset qr code - - it("Scan Asset QR", () => { - assetQRScanPage.scanAssetQR(); - }); - - // filter the asset and verify the badges are there - - it("Filter Asset", () => { - assetFilters.filterAssets( - "Dummy Facility 1", - "INTERNAL", - "ACTIVE", - "ONVIF Camera" - ); - }); - - // Verify the pagination in the page - - it("Next/Previous Page", () => { - assetPagination.navigateToNextPage(); - assetPagination.navigateToPreviousPage(); - }); - - afterEach(() => { - cy.saveLocalStorage(); - }); -}); diff --git a/cypress/e2e/assets_spec/assets_creation.cy.ts b/cypress/e2e/assets_spec/assets_creation.cy.ts new file mode 100644 index 00000000000..3e7b24eeca6 --- /dev/null +++ b/cypress/e2e/assets_spec/assets_creation.cy.ts @@ -0,0 +1,178 @@ +/// +import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; +import { AssetPage } from "../../pageobject/Asset/AssetCreation"; +import { v4 as uuidv4 } from "uuid"; +import LoginPage from "../../pageobject/Login/LoginPage"; +import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; + +describe("Asset", () => { + const assetPage = new AssetPage(); + const assetSearchPage = new AssetSearchPage(); + const loginPage = new LoginPage(); + const phone_number = "9999999999"; + const serialNumber = Math.floor(Math.random() * 10 ** 10).toString(); + + before(() => { + loginPage.loginAsDisctrictAdmin(); + cy.saveLocalStorage(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); + cy.awaitUrl("/assets"); + }); + + it("Verify asset creation fields throws error if empty", () => { + assetPage.createAsset(); + assetPage.selectFacility("Dummy Facility 1"); + assetPage.clickCreateAsset(); + + assetPage.verifyEmptyAssetNameError(); + assetPage.verifyEmptyAssetTypeError(); + assetPage.verifyEmptyLocationError(); + assetPage.verifyEmptyStatusError(); + assetPage.verifyEmptyPhoneError(); + }); + + //Create an asset + + it("Create an Asset", () => { + assetPage.createAsset(); + assetPage.selectFacility("Dummy Facility 1"); + assetPage.selectLocation("Camera Loc"); + assetPage.selectAssetType("Internal"); + assetPage.selectAssetClass("ONVIF Camera"); + + const qr_id_1 = uuidv4(); + + assetPage.enterAssetDetails( + "New Test Asset 1", + "Test Description", + "Working", + qr_id_1, + "Manufacturer's Name", + "2025-12-25", + "Customer Support's Name", + phone_number, + "email@support.com", + "Vendor's Name", + serialNumber, + "25122021", + "Test note for asset creation!" + ); + + assetPage.clickCreateAddMore(); + assetPage.verifySuccessNotification("Asset created successfully"); + + const qr_id_2 = uuidv4(); + + assetPage.selectLocation("Camera Loc"); + assetPage.selectAssetType("Internal"); + assetPage.selectAssetClass("ONVIF Camera"); + assetPage.enterAssetDetails( + "New Test Asset 2", + "Test Description", + "Working", + qr_id_2, + "Manufacturer's Name", + "2025-12-25", + "Customer Support's Name", + phone_number, + "email@support.com", + "Vendor's Name", + serialNumber, + "25122021", + "Test note for asset creation!" + ); + + assetPage.interceptAssetCreation(); + assetPage.clickCreateAsset(); + assetPage.verifyAssetCreation(); + assetPage.verifySuccessNotification("Asset created successfully"); + + assetSearchPage.typeSearchKeyword("New Test Asset 2"); + assetSearchPage.pressEnter(); + assetSearchPage.verifyAssetIsPresent("New Test Asset 2"); + }); + + it("Edit an Asset", () => { + assetPage.openCreatedAsset(); + + const qr_id = uuidv4(); + + assetPage.editAssetDetails( + "New Test Asset Edited", + "Test Description Edited", + qr_id, + "Manufacturer's Name Edited", + "Customer Support's Name Edited", + "Vendor's Name Edited", + "Test note for asset creation edited!", + "25122021" + ); + + assetPage.clickUpdateAsset(); + + assetPage.verifySuccessNotification("Asset updated successfully"); + }); + + it("Verify Editted Asset", () => { + assetSearchPage.typeSearchKeyword("New Test Asset Edited"); + assetSearchPage.pressEnter(); + assetSearchPage.verifyAssetIsPresent("New Test Asset Edited"); + }); + + it("Configure an asset", () => { + assetPage.openCreatedAsset(); + assetPage.spyAssetConfigureApi(); + assetPage.configureAsset( + "Host name", + "192.168.1.64", + "remote_user", + "2jCkrCRSeahzKEU", + "d5694af2-21e2-4a39-9bad-2fb98d9818bd" + ); + assetPage.clickConfigureAsset(); + assetPage.verifyAssetConfiguration(200); + }); + + it("Add an vital monitor asset and configure it", () => { + assetPage.createAsset(); + assetPage.selectFacility("Dummy Facility 1"); + assetPage.selectLocation("Camera Loc"); + assetPage.selectAssetType("Internal"); + assetPage.selectAssetClass("HL7 Vitals Monitor"); + + const qr_id_1 = uuidv4(); + + assetPage.enterAssetDetails( + "New Test Asset Vital", + "Test Description", + "Working", + qr_id_1, + "Manufacturer's Name", + "2025-12-25", + "Customer Support's Name", + phone_number, + "email@support.com", + "Vendor's Name", + serialNumber, + "25122021", + "Test note for asset creation!" + ); + assetPage.interceptAssetCreation(); + assetPage.clickCreateAsset(); + assetPage.verifyAssetCreation(); + + assetSearchPage.typeSearchKeyword("New Test Asset Vital"); + assetSearchPage.pressEnter(); + + assetPage.openCreatedAsset(); + assetPage.configureVitalAsset("Host name", "192.168.1.64"); + assetPage.clickConfigureVital(); + }); + + afterEach(() => { + cy.saveLocalStorage(); + }); +}); diff --git a/cypress/e2e/assets_spec/assets_manage.cy.ts b/cypress/e2e/assets_spec/assets_manage.cy.ts index d04a7733c0d..164bc239253 100644 --- a/cypress/e2e/assets_spec/assets_manage.cy.ts +++ b/cypress/e2e/assets_spec/assets_manage.cy.ts @@ -1,15 +1,26 @@ -/// +import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; import { AssetPage } from "../../pageobject/Asset/AssetCreation"; -import { v4 as uuidv4 } from "uuid"; import LoginPage from "../../pageobject/Login/LoginPage"; import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; +import FacilityPage from "../../pageobject/Facility/FacilityCreation"; +import { AssetFilters } from "../../pageobject/Asset/AssetFilters"; + +function addDaysToDate(numberOfDays: number) { + const inputDate = new Date(); + inputDate.setDate(inputDate.getDate() + numberOfDays); + return inputDate.toISOString().split("T")[0]; +} describe("Asset", () => { const assetPage = new AssetPage(); - const assetSearchPage = new AssetSearchPage(); const loginPage = new LoginPage(); - const phone_number = "9999999999"; - const serialNumber = Math.floor(Math.random() * 10 ** 10).toString(); + const facilityPage = new FacilityPage(); + const assetSearchPage = new AssetSearchPage(); + const assetFilters = new AssetFilters(); + const fillFacilityName = "Dummy Facility 1"; + const assetname = "Dummy Camera"; + const locationName = "Dummy Location 1"; + const initiallocationName = "Camera Location"; before(() => { loginPage.loginAsDisctrictAdmin(); @@ -21,102 +32,89 @@ describe("Asset", () => { cy.awaitUrl("/assets"); }); - it("Verify asset creation fields throws error if empty", () => { - assetPage.createAsset(); - assetPage.selectFacility("Dummy Facility 1"); - assetPage.clickCreateAsset(); - - assetPage.verifyEmptyAssetNameError(); - assetPage.verifyEmptyAssetTypeError(); - assetPage.verifyEmptyLocationError(); - assetPage.verifyEmptyStatusError(); - assetPage.verifyEmptyPhoneError(); + it("Verify Asset Warranty Expiry Label", () => { + assetSearchPage.typeSearchKeyword(assetname); + assetSearchPage.pressEnter(); + assetSearchPage.verifyBadgeContent(assetname); + assetSearchPage.clickAssetByName(assetname); + assetPage.clickupdatedetailbutton(); + assetPage.scrollintoWarrantyDetails(); + assetPage.enterWarrantyExpiryDate(addDaysToDate(100)); // greater than 3 months + assetPage.clickassetupdatebutton(); + assetPage.verifyWarrantyExpiryLabel(""); + assetPage.clickupdatedetailbutton(); + assetPage.scrollintoWarrantyDetails(); + assetPage.enterWarrantyExpiryDate(addDaysToDate(80)); // less than 3 months + assetPage.clickassetupdatebutton(); + assetPage.verifyWarrantyExpiryLabel("3 months"); + assetPage.clickupdatedetailbutton(); + assetPage.scrollintoWarrantyDetails(); + assetPage.enterWarrantyExpiryDate(addDaysToDate(20)); // less than 1 month + assetPage.clickassetupdatebutton(); + assetPage.verifyWarrantyExpiryLabel("1 month"); + assetPage.clickupdatedetailbutton(); + assetPage.scrollintoWarrantyDetails(); + assetPage.enterWarrantyExpiryDate(addDaysToDate(100)); // check for greater than 3 months again to verify the label is removed + assetPage.clickassetupdatebutton(); + assetPage.verifyWarrantyExpiryLabel(""); }); - //Create an asset - - it("Create an Asset", () => { - assetPage.createAsset(); - assetPage.selectFacility("Dummy Facility 1"); - assetPage.selectLocation("Camera Loc"); - assetPage.selectAssetType("Internal"); - assetPage.selectAssetClass("ONVIF Camera"); - - const qr_id_1 = uuidv4(); - - assetPage.enterAssetDetails( - "New Test Asset 1", - "Test Description", - "Working", - qr_id_1, - "Manufacturer's Name", - "2025-12-25", - "Customer Support's Name", - phone_number, - "email@support.com", - "Vendor's Name", - serialNumber, - "25122021", - "Test note for asset creation!" - ); - - assetPage.clickCreateAddMore(); - assetPage.verifySuccessNotification("Asset created successfully"); - - const qr_id_2 = uuidv4(); - - assetPage.selectLocation("Camera Loc"); - assetPage.selectAssetType("Internal"); - assetPage.selectAssetClass("ONVIF Camera"); - assetPage.enterAssetDetails( - "New Test Asset 2", - "Test Description", - "Working", - qr_id_2, - "Manufacturer's Name", - "2025-12-25", - "Customer Support's Name", - phone_number, - "email@support.com", - "Vendor's Name", - serialNumber, - "25122021", - "Test note for asset creation!" - ); - - assetPage.clickCreateAsset(); - assetPage.verifySuccessNotification("Asset created successfully"); - - assetSearchPage.typeSearchKeyword("New Test Asset 2"); + it("Create & Edit a service history and verify reflection", () => { + assetSearchPage.typeSearchKeyword(assetname); assetSearchPage.pressEnter(); - assetSearchPage.verifyAssetIsPresent("New Test Asset 2"); + assetSearchPage.verifyBadgeContent(assetname); + assetSearchPage.clickAssetByName(assetname); + assetPage.clickupdatedetailbutton(); + assetPage.scrollintonotes(); + assetPage.enterAssetNotes("Dummy Notes"); + assetPage.enterAssetservicedate("01092023"); + assetPage.clickassetupdatebutton(); + assetPage.scrollintoservicehistory(); + assetPage.clickedithistorybutton(); + assetPage.scrollintonotes(); + assetPage.enterAssetNotes("Dummy Notes Editted"); + assetPage.clickassetupdatebutton(); + assetPage.scrollintoservicehistory(); + assetPage.viewassetservicehistorybutton(); + assetPage.openassetservicehistory(); + assetPage.verifyassetupdateservicehistory(); + assetPage.viewassetservicehistorybutton(); }); - it("Edit an Asset", () => { - assetPage.openCreatedAsset(); - - const qr_id = uuidv4(); - - assetPage.editAssetDetails( - "New Test Asset Edited", - "Test Description Edited", - qr_id, - "Manufacturer's Name Edited", - "Customer Support's Name Edited", - "Vendor's Name Edited", - "Test note for asset creation edited!" - ); - + it("Create a asset transaction and verify history", () => { + assetSearchPage.typeSearchKeyword(assetname); + assetSearchPage.pressEnter(); + assetSearchPage.verifyBadgeContent(assetname); + assetSearchPage.clickAssetByName(assetname); + assetPage.clickupdatedetailbutton(); + assetPage.clickassetlocation(locationName); assetPage.clickUpdateAsset(); + assetPage.verifyassetlocation(locationName); + assetPage.verifytransactionStatus(initiallocationName, locationName); + }); - assetPage.verifySuccessNotification("Asset updated successfully"); + it("Verify Facility Asset Page Redirection", () => { + cy.visit("/facility"); + assetSearchPage.typeSearchKeyword(fillFacilityName); + assetSearchPage.pressEnter(); + facilityPage.verifyFacilityBadgeContent(fillFacilityName); + facilityPage.visitAlreadyCreatedFacility(); + facilityPage.clickManageFacilityDropdown(); + facilityPage.clickCreateAssetFacilityOption(); + facilityPage.verifyfacilitycreateassetredirection(); + facilityPage.verifyassetfacilitybackredirection(); + facilityPage.clickManageFacilityDropdown(); + facilityPage.clickviewAssetFacilityOption(); + facilityPage.verifyfacilityviewassetredirection(); + assetFilters.assertFacilityText(fillFacilityName); + facilityPage.verifyassetfacilitybackredirection(); }); it("Delete an Asset", () => { assetPage.openCreatedAsset(); + assetPage.interceptDeleteAssetApi(); assetPage.deleteAsset(); - - assetPage.verifySuccessNotification("Asset deleted successfully"); + assetPage.verifyDeleteStatus(); }); afterEach(() => { diff --git a/cypress/e2e/facility_spec/facility.cy.ts b/cypress/e2e/facility_spec/facility.cy.ts index f2e555bb58a..f2ff847c9d9 100644 --- a/cypress/e2e/facility_spec/facility.cy.ts +++ b/cypress/e2e/facility_spec/facility.cy.ts @@ -1,12 +1,15 @@ // FacilityCreation +import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; import FacilityPage from "../../pageobject/Facility/FacilityCreation"; +import LoginPage from "../../pageobject/Login/LoginPage"; describe("Facility Creation", () => { let facilityUrl: string; const facilityPage = new FacilityPage(); + const loginPage = new LoginPage(); before(() => { - cy.loginByApi("devdistrictadmin", "Coronasafe@123"); + loginPage.loginAsDisctrictAdmin(); cy.saveLocalStorage(); }); @@ -36,14 +39,9 @@ describe("Facility Creation", () => { facilityPage.selectAreaOfSpecialization("General Medicine"); facilityPage.fillDoctorCount("5"); facilityPage.saveAndExitDoctorForm(); - - cy.url().then((initialUrl) => { - cy.get("button#save-and-exit").should("not.exist"); - cy.url() - .should("not.equal", initialUrl) - .then((newUrl) => { - facilityUrl = newUrl; - }); + facilityPage.verifyfacilitynewurl(); + cy.url().then((newUrl) => { + facilityUrl = newUrl; }); }); @@ -51,6 +49,7 @@ describe("Facility Creation", () => { facilityPage.visitUpdateFacilityPage(facilityUrl); facilityPage.clickManageFacilityDropdown(); facilityPage.clickUpdateFacilityOption(); + facilityPage.clickUpdateFacilityType(); facilityPage.fillFacilityName("cypress facility updated"); facilityPage.fillAddress("Cypress Facility Updated Address"); facilityPage.fillOxygenCapacity("100"); @@ -61,6 +60,22 @@ describe("Facility Creation", () => { cy.url().should("not.include", "/update"); }); + it("Configure the existing facility", () => { + facilityPage.visitUpdateFacilityPage(facilityUrl); + facilityPage.clickManageFacilityDropdown(); + facilityPage.clickConfigureFacilityOption(); + facilityPage.fillMiddleWareAddress("dev_middleware.coronasafe.live"); + facilityPage.clickupdateMiddleWare(); + facilityPage.verifySuccessNotification("Facility updated successfully"); + }); + + it("Delete a facility", () => { + facilityPage.visitUpdateFacilityPage(facilityUrl); + facilityPage.clickManageFacilityDropdown(); + facilityPage.clickDeleteFacilityOption(); + facilityPage.confirmDeleteFacility(); + }); + afterEach(() => { cy.saveLocalStorage(); }); diff --git a/cypress/e2e/facility_spec/inventory.cy.ts b/cypress/e2e/facility_spec/inventory.cy.ts index 91c6d36466f..c28035dd885 100644 --- a/cypress/e2e/facility_spec/inventory.cy.ts +++ b/cypress/e2e/facility_spec/inventory.cy.ts @@ -1,8 +1,13 @@ import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; +import FacilityPage from "../../pageobject/Facility/FacilityCreation"; +import LoginPage from "../../pageobject/Login/LoginPage"; describe("Inventory Management Section", () => { + const facilityPage = new FacilityPage(); + const loginPage = new LoginPage(); + before(() => { - cy.loginByApi("devdistrictadmin", "Coronasafe@123"); + loginPage.loginAsDisctrictAdmin(); cy.saveLocalStorage(); }); @@ -10,23 +15,16 @@ describe("Inventory Management Section", () => { cy.restoreLocalStorage(); cy.awaitUrl("/"); cy.viewport(1280, 720); - cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities"); - cy.get("[id='facility-details']").first().click(); - cy.wait("@getFacilities").its("response.statusCode").should("eq", 200); - cy.get("#manage-facility-dropdown button").should("be.visible"); - cy.get("[id='manage-facility-dropdown']").scrollIntoView().click(); - cy.get("[id=inventory-management]").click(); }); it("Adds Inventory", () => { - cy.contains("Manage Inventory").click(); - cy.get("div#id").click(); - cy.get("div#id ul li").contains("Liquid Oxygen").click(); - cy.get("div#isIncoming").click(); - cy.get("div#isIncoming ul li").contains("Add Stock").click(); - cy.get("[name='quantity']").type("120"); - cy.get("button").contains("Add/Update Inventory").click(); - cy.verifyNotification("Inventory created successfully"); + facilityPage.visitAlreadyCreatedFacility(); + facilityPage.clickManageFacilityDropdown(); + facilityPage.clickInventoryManagementOption(); + facilityPage.clickManageInventory(); + facilityPage.fillInventoryDetails("Liquid Oxygen", "Add Stock", "120"); + facilityPage.clickAddInventory(); + facilityPage.verifySuccessNotification("Inventory created successfully"); }); afterEach(() => { diff --git a/cypress/e2e/facility_spec/locations.cy.ts b/cypress/e2e/facility_spec/locations.cy.ts index d5b3cc9990f..cac9adbdde1 100644 --- a/cypress/e2e/facility_spec/locations.cy.ts +++ b/cypress/e2e/facility_spec/locations.cy.ts @@ -13,6 +13,7 @@ describe("Location Management Section", () => { cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities"); cy.get("[id='facility-details']").first().click(); cy.wait("@getFacilities").its("response.statusCode").should("eq", 200); + cy.get("h1.text-3xl.font-bold", { timeout: 10000 }).should("be.visible"); cy.get("#manage-facility-dropdown button").should("be.visible"); cy.get("[id='manage-facility-dropdown']").scrollIntoView().click(); cy.get("[id=location-management]").click(); diff --git a/cypress/e2e/patient_spec/patient_crud.cy.ts b/cypress/e2e/patient_spec/patient_crud.cy.ts index b9e03851897..4fef861aeab 100644 --- a/cypress/e2e/patient_spec/patient_crud.cy.ts +++ b/cypress/e2e/patient_spec/patient_crud.cy.ts @@ -1,12 +1,13 @@ import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; - -const username = "devdistrictadmin"; -const password = "Coronasafe@123"; -const phone_number = "9" + Math.floor(100000000 + Math.random() * 900000000); -const emergency_phone_number = - "9" + Math.floor(100000000 + Math.random() * 900000000); +import LoginPage from "../../pageobject/Login/LoginPage"; +import { PatientPage } from "../../pageobject/Patient/PatientCreation"; +import { UpdatePatientPage } from "../../pageobject/Patient/PatientUpdate"; +import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation"; +import { + emergency_phone_number, + phone_number, +} from "../../pageobject/constants"; const yearOfBirth = "2023"; -let patient_url = ""; const calculateAge = () => { const currentYear = new Date().getFullYear(); @@ -14,8 +15,13 @@ const calculateAge = () => { }; describe("Patient Creation with consultation", () => { + const loginPage = new LoginPage(); + const patientPage = new PatientPage(); + const updatePatientPage = new UpdatePatientPage(); + const patientConsultationPage = new PatientConsultationPage(); + before(() => { - cy.loginByApi(username, password); + loginPage.loginAsDisctrictAdmin(); cy.saveLocalStorage(); }); @@ -25,199 +31,124 @@ describe("Patient Creation with consultation", () => { }); it("Create a new patient with no consultation", () => { - cy.get("#add-patient-details").should("be.visible"); - cy.get("#add-patient-details").click(); - cy.get("input[name='facilities']") - .type("dummy facility") - .then(() => { - cy.get("[role='option']").first().click(); - }); - cy.get("button").should("contain", "Select"); - cy.get("button").get("#submit").click(); - cy.get("#phone_number-div").type(phone_number); - cy.get("#emergency_phone_number-div").type(emergency_phone_number); - cy.get("#date_of_birth").should("be.visible").click(); - cy.get("#date-input").click().type("01082023"); - cy.get("[data-testid=name] input").type("Test E2E User"); - cy.get("[data-testid=Gender] button") - .click() - .then(() => { - cy.get("[role='option']").contains("Male").click(); - }); - cy.get("[data-testid=current-address] textarea").type( - "Test Patient Address" + patientPage.createPatient(); + patientPage.selectFacility("dummy facility"); + patientPage.patientformvisibility(); + patientPage.enterPatientDetails( + phone_number, + emergency_phone_number, + "Test E2E User", + "Male", + "Test Patient Address", + "682001", + "1: PAZHAMTHOTTAM", + "O+", + "01012001" ); - cy.get("[data-testid=permanent-address] input").check(); - cy.get("#pincode").type("682001"); - cy.get("[data-testid=localbody] button") - .click() - .then(() => { - cy.get("[role='option']").first().click(); - }); - cy.get("[data-testid=ward-respective-lsgi] button") - .click() - .then(() => { - cy.get("[role='option']").contains("1: PAZHAMTHOTTAM").click(); - }); - cy.get("[name=medical_history_check_1]").check(); - cy.get("[data-testid=blood-group] button") - .click() - .then(() => { - cy.get("[role='option']").contains("O+").click(); - }); - cy.get("button[data-testid='submit-button']").click(); - - cy.get("h2").should("contain", "Create Consultation"); - cy.url().should("include", "/patient"); - cy.url().then((url) => { - cy.log(url); - patient_url = url.split("/").slice(0, -1).join("/"); - cy.log(patient_url); - }); + patientPage.clickCreatePatient(); + + patientPage.verifyPatientIsCreated(); + patientPage.saveCreatedPatientUrl(); }); it("Patient Detail verification post registration", () => { - cy.log(patient_url); - cy.awaitUrl(patient_url); - cy.url().should("include", "/facility/"); - cy.get("[data-testid=patient-dashboard]").should("contain", calculateAge()); - cy.get("[data-testid=patient-dashboard]").should( - "contain", - "Test E2E User" + patientPage.interceptFacilities(); + patientPage.visitCreatedPatient(); + patientPage.verifyStatusCode(); + const age = calculateAge(); + patientPage.verifyPatientDetails( + age, + "Test E2E User", + phone_number, + emergency_phone_number, + yearOfBirth, + "O+" ); - cy.get("[data-testid=patient-dashboard]").should("contain", phone_number); - cy.get("[data-testid=patient-dashboard]").should( - "contain", - emergency_phone_number - ); - cy.get("[data-testid=patient-dashboard]").should("contain", yearOfBirth); - cy.get("[data-testid=patient-dashboard]").should("contain", "O+"); }); it("Edit the patient details", () => { - cy.intercept("GET", "**/facility/*/patient/**").as("getFacilities"); - cy.awaitUrl(patient_url + "/update"); - cy.wait("@getFacilities").its("response.statusCode").should("eq", 200); - cy.wait(10000); - cy.get("#address").scrollIntoView(); - cy.get("#address").should("be.visible"); - cy.get("#address").type("Test Patient Address Edited"); - cy.get("[data-testid=name] input").clear(); - cy.get("[data-testid=name] input").type("Test E2E User Edited"); - cy.get("#phone_number-div").clear(); - cy.get("#phone_number-div").type("+91").type(phone_number); - cy.get("#emergency_phone_number-div").clear(); - cy.get("#emergency_phone_number-div") - .type("+91") - .type(emergency_phone_number); - cy.get("#present_health").type("Severe Cough"); - cy.get("#ongoing_medication").type("Paracetamol"); - cy.get("#allergies").type("Dust"); - cy.get("[name=medical_history_check_1]").uncheck(); - cy.get("[name=medical_history_check_2]").check(); - cy.get("#medical_history_2").type("2 months ago"); - cy.get("[name=medical_history_check_3]").check(); - cy.get("#medical_history_3").type("1 month ago"); - cy.get("button").get("[data-testid=add-insurance-button]").click(); - cy.get("#subscriber_id").type("SUB123"); - cy.get("#policy_id").type("P123"); - cy.get("#insurer_id").type("GICOFINDIA"); - cy.get("#insurer_name").type("GICOFINDIA"); - cy.get("[data-testid=blood-group] button") - .click() - .then(() => { - cy.get("[role='option']").contains("O+").click(); - }); - cy.get("button[data-testid='submit-button']").click(); - cy.url().should("include", "/patient"); - cy.url().then((url) => { - cy.log(url); - patient_url = url.split("/").slice(0, -1).join("/"); - cy.log(patient_url); - }); + patientPage.interceptFacilities(); + patientPage.visitUpdatePatientUrl(); + patientPage.verifyStatusCode(); + patientPage.patientformvisibility(); + updatePatientPage.enterPatientDetails( + "Test E2E User Edited", + "O+", + phone_number, + emergency_phone_number, + "Test Patient Address Edited", + "Severe Cough", + "Paracetamol", + "Dust", + ["2 months ago", "1 month ago"], + "SUB123", + "P123", + "GICOFINDIA", + "GICOFINDIA" + ); + updatePatientPage.clickUpdatePatient(); + + updatePatientPage.verifyPatientUpdated(); + updatePatientPage.saveUpdatedPatientUrl(); }); it("Patient Detail verification post edit", () => { - cy.log(patient_url); - cy.awaitUrl(patient_url); - cy.url().should("include", "/facility/"); - cy.get("[data-testid=patient-dashboard]").should( - "contain", - "Test E2E User Edited" - ); - cy.get("[data-testid=patient-dashboard]").should("contain", phone_number); - const patientDetails_values: string[] = [ + patientPage.interceptFacilities(); + updatePatientPage.visitUpdatedPatient(); + patientPage.verifyStatusCode(); + + updatePatientPage.verifyPatientDetails( + "Test E2E User Edited", + phone_number, "Severe Cough", "Paracetamol", - "Dust", - "Diabetes", - "2 months ago", - "Heart Disease", - "1 month ago", - ]; - - patientDetails_values.forEach((value) => { - cy.get("[data-testid=patient-details]").should("contain", value); - }); + "Dust" + ); }); it("Create a New consultation to existing patient", () => { - cy.intercept("GET", "**/api/v1/patient/**").as("getFacilities"); - cy.visit(patient_url + "/consultation"); - cy.wait("@getFacilities").its("response.statusCode").should("eq", 200); - cy.get("#history_of_present_illness").scrollIntoView; - cy.get("#history_of_present_illness").should("be.visible"); - cy.get("#history_of_present_illness").click().type("histroy"); - cy.get("#consultation_status") - .click() - .then(() => { - cy.get("[role='option']").contains("Out-patient (walk in)").click(); - }); - cy.get("#symptoms") - .click() - .then(() => { - cy.get("[role='option']").contains("ASYMPTOMATIC").click(); - }); - cy.get("#symptoms").click(); - - cy.get("#examination_details") - .click() - .type("Examination details and Clinical conditions"); - cy.get("#weight").click().type("70"); - cy.get("#height").click().type("170"); - cy.get("#patient_no").type("IP007"); - cy.get( - "#icd11_diagnoses_object input[placeholder='Select'][role='combobox']" - ) - .click() - .type("1A"); - cy.wait(1000); - cy.get("#icd11_diagnoses_object [role='option']") - .contains("1A03 Intestinal infections due to Escherichia coli") - .click(); - cy.get("#consultation_notes").click().type("generalnote"); - cy.get("#verified_by").click().type("generalnote"); - cy.get("#submit").click(); + patientPage.interceptFacilities(); + updatePatientPage.visitConsultationPage(); + patientPage.verifyStatusCode(); + patientConsultationPage.fillIllnessHistory("history"); + patientConsultationPage.selectConsultationStatus("Out-patient (walk in)"); + patientConsultationPage.selectSymptoms("ASYMPTOMATIC"); + + patientConsultationPage.enterConsultationDetails( + "Stable", + "Examination details and Clinical conditions", + "70", + "170", + "IP007", + "generalnote", + "Dev Doctor" + ); + patientConsultationPage.submitConsultation(); + // Below code for the prescription module only present while creating a new consultation - cy.contains("button", "Add Prescription Medication") - .should("be.visible") - .click(); - cy.intercept("GET", "**/api/v1/medibase/**").as("getFacilities"); - cy.get( - "div#medicine_object input[placeholder='Select'][role='combobox']" - ).click(); - cy.wait("@getFacilities").its("response.statusCode").should("eq", 200); - cy.get("div#medicine_object input[placeholder='Select'][role='combobox']") - .click() - .type("dolo{enter}"); - cy.get("#dosage").type("3", { force: true }); - cy.get("#frequency") - .click() - .then(() => { - cy.get("div#frequency [role='option']").contains("Twice daily").click(); - }); - cy.get("button#submit").should("be.visible").click(); - cy.get("[data-testid='return-to-patient-dashboard']").click(); + patientConsultationPage.clickAddPrescription(); + patientConsultationPage.interceptMediaBase(); + patientConsultationPage.selectMedicinebox(); + patientConsultationPage.waitForMediabaseStatusCode(); + patientConsultationPage.prescribefirstMedicine(); + patientConsultationPage.enterDosage("3"); + patientConsultationPage.selectDosageFrequency("Twice daily"); + patientConsultationPage.submitPrescriptionAndReturn(); + }); + + it("Edit created consultation to existing patient", () => { + updatePatientPage.visitUpdatedPatient(); + patientConsultationPage.visitEditConsultationPage(); + patientConsultationPage.fillIllnessHistory("editted"); + patientConsultationPage.selectConsultationStatus( + "Referred from other hospital" + ); + patientConsultationPage.updateSymptoms("FEVER"); + patientConsultationPage.setSymptomsDate("01082023"); + patientConsultationPage.updateConsultation(); + patientConsultationPage.verifySuccessNotification( + "Consultation updated successfully" + ); }); afterEach(() => { diff --git a/cypress/e2e/patient_spec/patient_manage.cy.ts b/cypress/e2e/patient_spec/patient_manage.cy.ts new file mode 100644 index 00000000000..e8d381286aa --- /dev/null +++ b/cypress/e2e/patient_spec/patient_manage.cy.ts @@ -0,0 +1,78 @@ +import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; +import LoginPage from "../../pageobject/Login/LoginPage"; +import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation"; +import { PatientPage } from "../../pageobject/Patient/PatientCreation"; + +describe("Patient", () => { + const loginPage = new LoginPage(); + const patientPage = new PatientPage(); + const patientConsultationPage = new PatientConsultationPage(); + + before(() => { + loginPage.loginAsDisctrictAdmin(); + cy.saveLocalStorage(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); + cy.awaitUrl("/patients"); + }); + + // it("Create Patient shift requests.", () => { + // patientPage.visitPatient(); + // patientConsultationPage.visitShiftRequestPage(); + // patientConsultationPage.enterPatientShiftDetails( + // "Test User", + // phone_number, + // "Dummy Shifting", + // "Reason" + // ); + // patientConsultationPage.createShiftRequest(); + // patientConsultationPage.verifySuccessNotification( + // "Shift request created successfully" + // ); + // }); + // commented out the shifting request, as logic need to be re-visited + + it("Post doctor notes for an already created patient", () => { + patientPage.visitPatient(); + patientConsultationPage.visitDoctorNotesPage(); + patientConsultationPage.addDoctorsNotes("Test Doctor Notes"); + patientConsultationPage.postDoctorNotes(); + patientConsultationPage.verifySuccessNotification( + "Note added successfully" + ); + }); + + it("Edit prescription for an already created patient", () => { + patientPage.visitPatient(); + patientConsultationPage.visitEditPrescriptionPage(); + patientConsultationPage.clickAddPrescription(); + patientConsultationPage.interceptMediaBase(); + patientConsultationPage.selectMedicinebox(); + patientConsultationPage.waitForMediabaseStatusCode(); + patientConsultationPage.prescribesecondMedicine(); + patientConsultationPage.enterDosage("4"); + patientConsultationPage.selectDosageFrequency("Twice daily"); + patientConsultationPage.submitPrescription(); + }); + + it("Upload consultations file ", () => { + patientPage.visitPatient(); + patientConsultationPage.visitFilesPage(); + patientConsultationPage.uploadFile(); + patientConsultationPage.clickUploadFile(); + }); + + it("Discharge a patient", () => { + patientPage.visitPatient(); + patientConsultationPage.clickDischargePatient(); + patientConsultationPage.selectDischargeReason("Recovered"); + patientConsultationPage.addDischargeNotes("Discharge notes"); + patientConsultationPage.confirmDischarge(); + }); + + afterEach(() => { + cy.saveLocalStorage(); + }); +}); diff --git a/cypress/e2e/resource_spec/resources.cy.ts b/cypress/e2e/resource_spec/resources.cy.ts index 099e782277a..acf179db120 100644 --- a/cypress/e2e/resource_spec/resources.cy.ts +++ b/cypress/e2e/resource_spec/resources.cy.ts @@ -1,8 +1,17 @@ import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; +import LoginPage from "../../pageobject/Login/LoginPage"; +import ResourcePage from "../../pageobject/Resource/ResourcePage"; +import FacilityPage from "../../pageobject/Facility/FacilityCreation"; describe("Resource Page", () => { + let createdResource: string; + const loginPage = new LoginPage(); + const resourcePage = new ResourcePage(); + const facilityPage = new FacilityPage(); + const phone_number = "9999999999"; + before(() => { - cy.loginByApi("devdistrictadmin", "Coronasafe@123"); + loginPage.loginAsDisctrictAdmin(); cy.saveLocalStorage(); }); @@ -11,36 +20,65 @@ describe("Resource Page", () => { cy.awaitUrl("/resource"); }); - it("checks if all download button works", () => { - cy.get("svg.care-svg-icon__baseline.care-l-export").each(($button) => { - cy.intercept(/\/api\/v1\/resource/).as("resource_download"); - cy.wrap($button).click({ force: true }); - cy.wait("@resource_download").then((interception) => { - expect(interception.response.statusCode).to.equal(200); - }); - }); + it("Checks if all download button works", () => { + resourcePage.verifyDownloadButtonWorks(); }); - it("switch between active/completed", () => { - cy.intercept(/\/api\/v1\/resource/).as("resource"); - cy.contains("Completed").click(); - cy.wait("@resource").then((interception) => { - expect(interception.response.statusCode).to.equal(200); - }); - cy.contains("Active").should("have.class", "text-primary-500"); - cy.contains("Completed").should("have.class", "text-white"); - cy.intercept(/\/api\/v1\/resource/).as("resource"); - cy.contains("Active").click(); - cy.wait("@resource").then((interception) => { - expect(interception.response.statusCode).to.equal(200); + it("Switch between active/completed", () => { + resourcePage.spyResourceApi(); + resourcePage.clickCompletedResources(); + resourcePage.verifyCompletedResources(); + resourcePage.spyResourceApi(); + resourcePage.clickActiveResources(); + resourcePage.verifyActiveResources(); + }); + + it("Switch between list view and board view", () => { + resourcePage.clickListViewButton(); + resourcePage.clickBoardViewButton(); + }); + + it("Create a resource request", () => { + cy.visit("/facility"); + cy.get("#search").click().type("dummy facility 1"); + cy.intercept("GET", "**/api/v1/facility/**").as("loadFacilities"); + cy.get("#facility-details").click(); + cy.wait("@loadFacilities").its("response.statusCode").should("eq", 200); + facilityPage.clickManageFacilityDropdown(); + facilityPage.clickResourceRequestOption(); + facilityPage.fillResourceRequestDetails( + "Test User", + phone_number, + "Dummy", + "Test title", + "10", + "Test description" + ); + facilityPage.clickSubmitRequestButton(); + facilityPage.verifySuccessNotification( + "Resource request created successfully" + ); + facilityPage.verifyresourcenewurl(); + cy.url().then((url) => { + createdResource = url; }); - cy.contains("Active").should("have.class", "text-white"); - cy.contains("Completed").should("have.class", "text-primary-500"); }); - it("switch between list view and board view", () => { - cy.contains("List View").click(); - cy.contains("Board View").click(); + it("Update the status of resource", () => { + cy.visit(createdResource); + resourcePage.clickUpdateStatus(); + resourcePage.updateStatus("APPROVED"); + resourcePage.clickSubmitButton(); + resourcePage.verifySuccessNotification( + "Resource request updated successfully" + ); + }); + + it("Post comment for a resource", () => { + cy.visit(createdResource); + resourcePage.addCommentForResource("Test comment"); + resourcePage.clickPostCommentButton(); + resourcePage.verifySuccessNotification("Comment added successfully"); }); afterEach(() => { diff --git a/cypress/e2e/shifting_spec/filter.cy.ts b/cypress/e2e/shifting_spec/filter.cy.ts index f1068f7c53a..3790198a4db 100644 --- a/cypress/e2e/shifting_spec/filter.cy.ts +++ b/cypress/e2e/shifting_spec/filter.cy.ts @@ -19,7 +19,7 @@ describe("Shifting section filter", () => { shiftingPage.filterByFacility( "Dummy Shifting", "Dummy Shifting", - "District Admin" + "District" ); shiftingPage.facilityAssignedBadge().should("exist"); diff --git a/cypress/e2e/users_spec/user_creation.cy.ts b/cypress/e2e/users_spec/user_creation.cy.ts new file mode 100644 index 00000000000..9090f72505a --- /dev/null +++ b/cypress/e2e/users_spec/user_creation.cy.ts @@ -0,0 +1,199 @@ +import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; +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 { UserCreationPage } from "../../pageobject/Users/UserCreation"; +import { + emergency_phone_number, + phone_number, +} from "../../pageobject/constants"; + +describe("User Creation", () => { + const userPage = new UserPage(); + const loginPage = new LoginPage(); + const userCreationPage = new UserCreationPage(); + const facilityPage = new FacilityPage(); + const assetSearchPage = new AssetSearchPage(); + const fillFacilityName = "Dummy Facility 1"; + const makeid = (length: number) => { + let result = ""; + const characters = "abcdefghijklmnopqrstuvwxyz0123456789"; + const charactersLength = characters.length; + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; + }; + const username = makeid(25); + const alreadylinkedusersviews = [ + "devdoctor", + "devstaff2", + "devdistrictadmin", + ]; + const EXPECTED_ERROR_MESSAGES = [ + "Please select the User Type", + "Please enter valid phone number", + "Please enter the username", + "Please enter date in YYYY/MM/DD format", + "Please enter the password", + "Confirm password is required", + "First Name is required", + "Last Name is required", + "Please enter a valid email address", + "Please select the Gender", + "Please select the state", + "Please select the district", + "Please select the local body", + ]; + + const EXPECTED_PROFILE_ERROR_MESSAGES = [ + "Field is required", + "Field is required", + "This field is required", + "Please enter valid phone number", + "This field is required", + "This field is required", + ]; + + before(() => { + loginPage.loginAsDisctrictAdmin(); + cy.saveLocalStorage(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); + cy.awaitUrl("/users"); + }); + + it("Update the existing user profile and verify its reflection", () => { + userCreationPage.clickElementById("profilenamelink"); + userCreationPage.verifyElementContainsText( + "username-profile-details", + "devdistrictadmin" + ); + userCreationPage.clickElementById("edit-cancel-profile-button"); + userCreationPage.typeIntoElementByIdPostClear( + "firstName", + "District Editted" + ); + userCreationPage.typeIntoElementByIdPostClear("lastName", "Cypress"); + userCreationPage.typeIntoElementByIdPostClear("age", "22"); + userCreationPage.selectDropdownOption("gender", "Male"); + userCreationPage.typeIntoElementByIdPostClear( + "phoneNumber", + "+91" + phone_number + ); + userCreationPage.typeIntoElementByIdPostClear( + "altPhoneNumber", + "+91" + emergency_phone_number + ); + userCreationPage.typeIntoElementByIdPostClear("email", "test@test.com"); + userCreationPage.typeIntoElementByIdPostClear("weekly_working_hours", "14"); + userCreationPage.clickElementById("submit"); + userCreationPage.verifyElementContainsText( + "contactno-profile-details", + "+91" + phone_number + ); + userCreationPage.verifyElementContainsText( + "whatsapp-profile-details", + "+91" + emergency_phone_number + ); + userCreationPage.verifyElementContainsText( + "firstname-profile-details", + "District Editted" + ); + userCreationPage.verifyElementContainsText( + "lastname-profile-details", + "Cypress" + ); + userCreationPage.verifyElementContainsText("age-profile-details", "22"); + userCreationPage.verifyElementContainsText( + "emailid-profile-details", + "test@test.com" + ); + userCreationPage.verifyElementContainsText( + "gender-profile-details", + "Male" + ); + userCreationPage.verifyElementContainsText( + "averageworkinghour-profile-details", + "14" + ); + }); + + it("Update the existing user profile Form Mandatory File Error", () => { + userCreationPage.clickElementById("profilenamelink"); + userCreationPage.clickElementById("edit-cancel-profile-button"); + userCreationPage.clearIntoElementById("firstName"); + userCreationPage.clearIntoElementById("lastName"); + userCreationPage.clearIntoElementById("age"); + userCreationPage.clearIntoElementById("phoneNumber"); + userCreationPage.clearIntoElementById("altPhoneNumber"); + userCreationPage.clearIntoElementById("weekly_working_hours"); + userCreationPage.clickElementById("submit"); + userCreationPage.verifyErrorMessages(EXPECTED_PROFILE_ERROR_MESSAGES); + }); + + it("create new user and verify reflection", () => { + userCreationPage.clickElementById("addUserButton"); + userCreationPage.selectFacility("Dummy Shifting Center"); + userCreationPage.typeIntoElementById("username", username); + userCreationPage.typeIntoElementById("password", "Test@123"); + userCreationPage.selectHomeFacility("Dummy Shifting Center"); + userCreationPage.typeIntoElementById("phone_number", phone_number); + userCreationPage.setInputDate("date_of_birth", "date-input", "25081999"); + userCreationPage.selectDropdownOption("user_type", "Doctor"); + userCreationPage.typeIntoElementById("c_password", "Test@123"); + userCreationPage.typeIntoElementById("doctor_qualification", "MBBS"); + userCreationPage.typeIntoElementById("doctor_experience_commenced_on", "2"); + userCreationPage.typeIntoElementById( + "doctor_medical_council_registration", + "123456789" + ); + userCreationPage.typeIntoElementById("first_name", "cypress test"); + userCreationPage.typeIntoElementById("last_name", "staff user"); + userCreationPage.typeIntoElementById("email", "test@test.com"); + userCreationPage.selectDropdownOption("gender", "Male"); + userCreationPage.selectDropdownOption("state", "Kerala"); + userCreationPage.selectDropdownOption("district", "Ernakulam"); + userCreationPage.clickElementById("submit"); + userCreationPage.verifyNotification("User added successfully"); + userPage.typeInSearchInput(username); + userPage.checkUsernameText(username); + userCreationPage.verifyElementContainsText("name", "cypress test"); + userCreationPage.verifyElementContainsText("role", "Doctor"); + userCreationPage.verifyElementContainsText("district", "Ernakulam"); + userCreationPage.verifyElementContainsText( + "home_facility", + "Dummy Shifting Center" + ); + userCreationPage.verifyElementContainsText("doctor-qualification", "MBBS"); + userCreationPage.verifyElementContainsText("doctor-experience", "2"); + userCreationPage.verifyElementContainsText( + "medical-council-registration", + "123456789" + ); + }); + + it("create new user form throwing mandatory field error", () => { + userCreationPage.clickElementById("addUserButton"); + userCreationPage.clickElementById("submit"); + userCreationPage.verifyErrorMessages(EXPECTED_ERROR_MESSAGES); + }); + + it("view user redirection from facility page", () => { + cy.visit("/facility"); + assetSearchPage.typeSearchKeyword(fillFacilityName); + assetSearchPage.pressEnter(); + facilityPage.verifyFacilityBadgeContent(fillFacilityName); + facilityPage.visitAlreadyCreatedFacility(); + facilityPage.clickManageFacilityDropdown(); + facilityPage.clickViewUsersOption(); + userPage.verifyMultipleBadgesWithSameId(alreadylinkedusersviews); + }); + + afterEach(() => { + cy.saveLocalStorage(); + }); +}); diff --git a/cypress/e2e/users_spec/user_crud.cy.ts b/cypress/e2e/users_spec/user_crud.cy.ts deleted file mode 100644 index 41a12a891a8..00000000000 --- a/cypress/e2e/users_spec/user_crud.cy.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; - -const makeid = (length: number) => { - let result = ""; - const characters = "abcdefghijklmnopqrstuvwxyz0123456789"; - const charactersLength = characters.length; - for (let i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; -}; - -const username = makeid(25); -const phone_number = 9999999999; -const alt_phone_number = 9999999999; - -describe("User management", () => { - before(() => { - cy.loginByApi("devdistrictadmin", "Coronasafe@123"); - cy.saveLocalStorage(); - }); - - beforeEach(() => { - cy.restoreLocalStorage(); - cy.awaitUrl("/user"); - }); - - it("create user", () => { - cy.contains("Add New User").click(); - cy.get("[id='user_type'] > div > button").click(); - cy.get("div").contains("Ward Admin").click(); - cy.get("[id='state'] > div > button").click(); - cy.get("div").contains("Kerala").click(); - cy.get("[id='district'] > div > button").click(); - cy.get("div").contains("Ernakulam").click(); - cy.get("[id='local_body'] > div > button").click(); - cy.get("div").contains("Aikaranad").click(); - cy.intercept(/\/api\/v1\/facility/).as("facility"); - cy.get("[name='facilities']") - .click() - .type("Dummy Facility 1") - .wait("@facility"); - cy.get("li[role='option']").first().click(); - cy.get("input[type='checkbox']").click(); - cy.get("[name='phone_number']").type(phone_number); - cy.get("[name='alt_phone_number']").type(alt_phone_number); - cy.intercept(/users/).as("check_availability"); - cy.get("#date_of_birth").should("be.visible").click(); - cy.get("#date-input").click().type("25081999"); - cy.get("[name='username']").type(username); - cy.wait("@check_availability").its("response.statusCode").should("eq", 200); - cy.get("[name='password']").type("#@Cypress_test123"); - cy.get("[name='c_password']").type("#@Cypress_test123"); - cy.get("[name='first_name']").type("Cypress Test"); - cy.get("[name='last_name']").type("Tester"); - cy.get("[name='email']").type("cypress@tester.com"); - cy.get("[id='gender'] > div > button").click(); - cy.get("div").contains("Male").click(); - cy.get("button[id='submit']").contains("Save User").click(); - cy.verifyNotification("User added successfully"); - }); - - it("view user and verify details", () => { - cy.contains("Advanced Filters").click(); - cy.get("[name='first_name']").type("Cypress Test"); - cy.get("[name='last_name']").type("Tester"); - cy.get("#role button").click(); - cy.contains("#role li", "Ward Admin").click(); - cy.get("input[name='district']").click(); - cy.get("input[name='district']").type("Ernakulam"); - cy.get("li[id^='headlessui-combobox-option']") - .contains("Ernakulam") - .click(); - cy.get("[placeholder='Phone Number']").click(); - cy.get("[placeholder='Phone Number']").type(phone_number); - cy.get("[placeholder='WhatsApp Phone Number']").type(alt_phone_number); - cy.contains("Apply").click(); - cy.intercept(/\/api\/v1\/users/).as("getUsers"); - cy.wait(1000); - cy.get("[name='username']").type(username); - cy.wait("@getUsers"); - cy.get("dd[id='count']").contains(/^1$/).click(); - cy.get("div[id='usr_0']").within(() => { - cy.intercept(`/api/v1/users/${username}/get_facilities/`).as( - "userFacility" - ); - cy.get("div[id='role']").contains(/^WardAdmin$/); - cy.get("div[id='name']").contains("Cypress Test Tester"); - cy.get("div[id='district']").contains(/^Ernakulam$/); - cy.get("div[id='local_body']").contains("Aikaranad"); - cy.get("div[id='created_by']").contains(/^devdistrictadmin$/); - cy.get("div[id='home_facility']").contains("No Home Facility"); - cy.get("button[id='facilities']").click(); - cy.wait("@userFacility") - .getAttached("div[id=facility_0] > div > span") - .contains("Dummy Facility 1"); - }); - }); - - it("link facility for user", () => { - cy.contains("Linked Facilities").click(); - cy.intercept(/\/api\/v1\/facility/).as("getFacilities"); - cy.get("[name='facility']") - .click() - .type("Dummy Facility 1") - .wait("@getFacilities"); - cy.get("li[role='option']").first().click(); - cy.intercept(/\/api\/v1\/users\/\w+\/add_facility\//).as("addFacility"); - cy.get("button[id='link-facility']").click(); - cy.wait("@addFacility") - // .its("response.statusCode") - // .should("eq", 201) - .get("span") - .contains("Facility - User Already has permission to this facility"); - }); - - it("Next/Previous Page", () => { - // only works for desktop mode - cy.get("button#next-pages").click(); - cy.url().should("include", "page=2"); - cy.get("button#prev-pages").click(); - cy.url().should("include", "page=1"); - }); - - afterEach(() => { - cy.saveLocalStorage(); - }); -}); - -describe("Edit User Profile & Error Validation", () => { - before(() => { - cy.loginByApi(username, "#@Cypress_test123"); - cy.saveLocalStorage(); - }); - - beforeEach(() => { - cy.restoreLocalStorage(); - cy.awaitUrl("/user/profile"); - cy.contains("button", "Edit User Profile").click(); - }); - - it("First name Field Updation " + username, () => { - cy.get("input[name=firstName]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should("contain", "Field is required"); - cy.get("input[name=firstName]").type("firstName updated"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Last name Field Updation " + username, () => { - cy.get("input[name=lastName]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should("contain", "Field is required"); - cy.get("input[name=lastName]").type("lastName updated"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Age Field Updation " + username, () => { - cy.get("input[name=age]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should("contain", "This field is required"); - cy.get("input[name=age]").type("11"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Phone number Field Updation " + username, () => { - cy.get("input[name=phoneNumber]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should( - "contain", - "Please enter valid phone number" - ); - cy.get("input[name=phoneNumber]").type("+919999999999"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Whatsapp number Field Updation " + username, () => { - cy.get("input[name=altPhoneNumber]").clear(); - cy.get("input[name=altPhoneNumber]").type("+919999999999"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Email Field Updation " + username, () => { - cy.get("input[name=email]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should("contain", "This field is required"); - cy.get("input[name=email]").type("test@test.com"); - cy.contains("button[type='submit']", "Update").click(); - }); - - afterEach(() => { - cy.saveLocalStorage(); - }); -}); - -// describe("Delete User", () => { district admin wont be able to delete user -// it("deletes user", () => { -// cy.loginByApi("devdistrictadmin", "Coronasafe@123"); -// cy.awaitUrl("/user"); -// cy.get("[name='username']").type(username); -// cy.get("button") -// .should("contain", "Delete") -// .contains("Delete") -// .click(); -// cy.get("button.font-medium.btn.btn-danger").click(); -// }); -// }); diff --git a/cypress/e2e/users_spec/user_homepage.cy.ts b/cypress/e2e/users_spec/user_homepage.cy.ts new file mode 100644 index 00000000000..060132105e6 --- /dev/null +++ b/cypress/e2e/users_spec/user_homepage.cy.ts @@ -0,0 +1,82 @@ +/// + +import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; +import LoginPage from "../../pageobject/Login/LoginPage"; +import { UserPage } from "../../pageobject/Users/UserSearch"; + +describe("User Homepage", () => { + const userPage = new UserPage(); + const usernameToTest = "devdoctor"; + const currentuser = "devdistrictadmin"; + const loginPage = new LoginPage(); + const phone_number = "9876543219"; + const alt_phone_number = "9876543219"; + + before(() => { + loginPage.loginAsDisctrictAdmin(); + cy.saveLocalStorage(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); + cy.awaitUrl("/users"); + }); + + it("User advance filter functionality", () => { + userPage.clickAdvancedFilters(); + userPage.typeInFirstName("Dev"); + userPage.typeInLastName("Doctor"); + userPage.selectRole("Doctor"); + userPage.selectDistrict("Ernakulam"); + userPage.typeInPhoneNumber(phone_number); + userPage.typeInAltPhoneNumber(alt_phone_number); + userPage.applyFilter(); + userPage.verifyUrlafteradvancefilter(); + userPage.checkUsernameText(usernameToTest); + userPage.verifyDataTestIdText("First Name", "First Name: Dev"); + userPage.verifyDataTestIdText("Last Name", "Last Name: Doctor"); + userPage.verifyDataTestIdText( + "Phone Number", + "Phone Number: +919876543219" + ); + userPage.verifyDataTestIdText( + "WhatsApp no.", + "WhatsApp no.: +919876543219" + ); + userPage.verifyDataTestIdText("Role", "Role: Doctor"); + userPage.verifyDataTestIdText("District", "District: Ernakulam"); + userPage.clearFilters(); + userPage.verifyDataTestIdNotVisible("First Name"); + userPage.verifyDataTestIdNotVisible("Last Name"); + userPage.verifyDataTestIdNotVisible("Phone Number"); + userPage.verifyDataTestIdNotVisible("WhatsApp no."); + userPage.verifyDataTestIdNotVisible("Role"); + userPage.verifyDataTestIdNotVisible("District"); + }); + + it("Search by username", () => { + userPage.checkSearchInputVisibility(); + userPage.typeInSearchInput(usernameToTest); + userPage.checkUrlForUsername(usernameToTest); + userPage.checkUsernameText(usernameToTest); + userPage.checkUsernameBadgeVisibility(true); + userPage.clearSearchInput(); + userPage.checkUsernameBadgeVisibility(false); + userPage.typeInSearchInput(usernameToTest); + userPage.checkUsernameText(usernameToTest); + userPage.clickRemoveIcon(); + userPage.checkUsernameBadgeVisibility(false); + userPage.checkUsernameText(currentuser); + }); + + it("Next/Previous Page Navigation", () => { + userPage.navigateToNextPage(); + userPage.verifyCurrentPageNumber(2); + userPage.navigateToPreviousPage(); + userPage.verifyCurrentPageNumber(1); + }); + + afterEach(() => { + cy.saveLocalStorage(); + }); +}); diff --git a/cypress/e2e/users_spec/user_manage.cy.ts b/cypress/e2e/users_spec/user_manage.cy.ts new file mode 100644 index 00000000000..9fe3aea75f9 --- /dev/null +++ b/cypress/e2e/users_spec/user_manage.cy.ts @@ -0,0 +1,155 @@ +import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; +import LoginPage from "../../pageobject/Login/LoginPage"; +import { UserPage } from "../../pageobject/Users/UserSearch"; +import ManageUserPage from "../../pageobject/Users/ManageUserPage"; +import { UserCreationPage } from "../../pageobject/Users/UserCreation"; + +describe("Manage User", () => { + const loginPage = new LoginPage(); + const userPage = new UserPage(); + const manageUserPage = new ManageUserPage(); + const usernametolinkfacilitydoc1 = "dummydoctor4"; + const usernametolinkfacilitydoc2 = "dummydoctor5"; + const usernametolinkfacilitydoc3 = "dummydoctor6"; + const usernametolinkskill = "devdoctor"; + const userCreationPage = new UserCreationPage(); + const usernameforworkinghour = "devdistrictadmin"; + const usernamerealname = "Dummy Doctor"; + const facilitytolinkusername = "Dummy Shifting Center"; + const facilitytolinkskill = "Dummy Facility 1"; + const workinghour = "23"; + const linkedskill = "General Medicine"; + + before(() => { + loginPage.loginAsDisctrictAdmin(); + cy.saveLocalStorage(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); + cy.awaitUrl("/users"); + }); + + it("linking skills for a users and verify its reflection in profile", () => { + // select the district user and select one skill link and verify its profile reflection + userPage.typeInSearchInput(usernameforworkinghour); + userPage.checkUsernameText(usernameforworkinghour); + manageUserPage.clicklinkedskillbutton(); + manageUserPage.typeSkill(linkedskill); + manageUserPage.selectFacilityFromDropdown(linkedskill); + manageUserPage.clickAddSkillButton(); + manageUserPage.clickCloseSlideOver(); + cy.wait(5000); + manageUserPage.clicklinkedskillbutton(); + manageUserPage.assertSkillInAddedUserSkills(linkedskill); + manageUserPage.clickCloseSlideOver(); + cy.wait(5000); + manageUserPage.navigateToProfile(); + userCreationPage.verifyElementContainsText( + "username-profile-details", + usernameforworkinghour + ); + manageUserPage.assertSkillInAlreadyLinkedSkills(linkedskill); + }); + + it("linking skills for a doctor users and verify its reflection in doctor connect", () => { + // select a doctor user and link and unlink same skill twice and verify the badge is only shown once in doctor connect + userPage.typeInSearchInput(usernametolinkskill); + userPage.checkUsernameText(usernametolinkskill); + manageUserPage.clicklinkedskillbutton(); + manageUserPage.typeSkill(linkedskill); + manageUserPage.selectFacilityFromDropdown(linkedskill); + manageUserPage.clickAddSkillButton(); + manageUserPage.clickCloseSlideOver(); + cy.wait(5000); // temporary hack to fix the failure + manageUserPage.clicklinkedskillbutton(); + manageUserPage.assertSkillInAddedUserSkills(linkedskill); + manageUserPage.clickUnlinkSkill(); + manageUserPage.clickSubmit(); + manageUserPage.typeSkill(linkedskill); + manageUserPage.selectFacilityFromDropdown(linkedskill); + manageUserPage.clickAddSkillButton(); + manageUserPage.clickCloseSlideOver(); + // verifying the doctor connect + manageUserPage.navigateToFacility(); + manageUserPage.typeFacilitySearch(facilitytolinkskill); + manageUserPage.assertFacilityInCard(facilitytolinkskill); + manageUserPage.clickFacilityPatients(); + manageUserPage.clickDoctorConnectButton(); + manageUserPage.assertSkillIndoctorconnect(linkedskill); + }); + + it("add working hour for a user and verify its reflection in card and user profile", () => { + // verify mandatory field error and select working hour for a user + userPage.typeInSearchInput(usernameforworkinghour); + userPage.checkUsernameText(usernameforworkinghour); + manageUserPage.clicksetaveragehourbutton(); + manageUserPage.clearweeklyhourfield(); + manageUserPage.clickSubmit(); + manageUserPage.verifyErrorText("Value should be between 0 and 168"); + // verify the data is reflected in user card and profile page + manageUserPage.typeInWeeklyWorkingHours(workinghour); + manageUserPage.clickSubmit(); + manageUserPage.verifyWorkingHours(workinghour); + manageUserPage.navigateToProfile(); + manageUserPage.verifyProfileWorkingHours(workinghour); + }); + + it("linking and unlinking facility for multiple users, and confirm reflection in user cards and doctor connect", () => { + // verify the user doesn't have any home facility + userPage.typeInSearchInput(usernametolinkfacilitydoc1); + userPage.checkUsernameText(usernametolinkfacilitydoc1); + manageUserPage.assertHomeFacility("No Home Facility"); + // Link a new facility and ensure it is under linked facility - doctor username (1) + manageUserPage.clickFacilitiesTab(); + manageUserPage.typeFacilityName(facilitytolinkusername); + manageUserPage.selectFacilityFromDropdown(facilitytolinkusername); + manageUserPage.clickLinkFacility(); + manageUserPage.assertLinkedFacility(facilitytolinkusername); + // Verify in the already linked facility are not present in droplist + manageUserPage.assertFacilityNotInDropdown(facilitytolinkusername); + manageUserPage.clickCloseSlideOver(); + // Link a new facility and ensure it is under home facility - doctor username (2) + userPage.clearSearchInput(); + userPage.typeInSearchInput(usernametolinkfacilitydoc2); + userPage.checkUsernameText(usernametolinkfacilitydoc2); + manageUserPage.clickFacilitiesTab(); + manageUserPage.typeFacilityName(facilitytolinkusername); + manageUserPage.selectFacilityFromDropdown(facilitytolinkusername); + manageUserPage.clickLinkFacility(); + manageUserPage.clickHomeFacilityIcon(); + manageUserPage.assertnotLinkedFacility(facilitytolinkusername); + manageUserPage.assertHomeFacilitylink(facilitytolinkusername); + manageUserPage.clickCloseSlideOver(); + // verify the home facility doctor id have reflection in user card + userPage.clearSearchInput(); + userPage.typeInSearchInput(usernametolinkfacilitydoc2); + userPage.checkUsernameText(usernametolinkfacilitydoc2); + manageUserPage.assertHomeFacility(facilitytolinkusername); + // Link a new facility and unlink the facility from the doctor username (3) + userPage.clearSearchInput(); + userPage.typeInSearchInput(usernametolinkfacilitydoc3); + userPage.checkUsernameText(usernametolinkfacilitydoc3); + manageUserPage.clickFacilitiesTab(); + manageUserPage.typeFacilityName(facilitytolinkusername); + manageUserPage.selectFacilityFromDropdown(facilitytolinkusername); + manageUserPage.clickLinkFacility(); + manageUserPage.clickUnlinkFacilityButton(); + manageUserPage.clickSubmit(); + manageUserPage.assertnotLinkedFacility; + manageUserPage.linkedfacilitylistnotvisible(); + manageUserPage.clickCloseSlideOver(); + // Go to particular facility doctor connect and all user-id are reflected based on there access + // Path will be facility page to patient page then doctor connect button + manageUserPage.navigateToFacility(); + manageUserPage.typeFacilitySearch(facilitytolinkusername); + manageUserPage.assertFacilityInCard(facilitytolinkusername); + manageUserPage.clickFacilityPatients(); + manageUserPage.clickDoctorConnectButton(); + manageUserPage.assertDoctorConnectVisibility(usernamerealname); + }); + + afterEach(() => { + cy.saveLocalStorage(); + }); +}); diff --git a/cypress/fixtures/sampleAsset.xlsx b/cypress/fixtures/sampleAsset.xlsx new file mode 100644 index 00000000000..49421f62bac Binary files /dev/null and b/cypress/fixtures/sampleAsset.xlsx differ diff --git a/cypress/pageobject/Asset/AssetCreation.ts b/cypress/pageobject/Asset/AssetCreation.ts index d24c93d0197..93bbc87c9ab 100644 --- a/cypress/pageobject/Asset/AssetCreation.ts +++ b/cypress/pageobject/Asset/AssetCreation.ts @@ -1,4 +1,5 @@ // assetPage.ts +import { cy, expect } from "local-cypress"; export class AssetPage { createAsset() { @@ -74,6 +75,14 @@ export class AssetPage { cy.get("[data-testid=asset-notes-input] textarea").type(notes); } + interceptAssetCreation() { + cy.intercept("POST", "**/api/v1/asset/").as("createAsset"); + } + + verifyAssetCreation() { + cy.wait("@createAsset").its("response.statusCode").should("eq", 201); + } + clickCreateAsset() { cy.get("#submit").contains("Create Asset").click(); } @@ -87,7 +96,9 @@ export class AssetPage { } openCreatedAsset() { + cy.intercept("GET", "**/api/v1/asset/**").as("getAsset"); cy.get("[data-testid=created-asset-list]").first().click(); + cy.wait("@getAsset").its("response.statusCode").should("eq", 200); } editAssetDetails( @@ -97,7 +108,8 @@ export class AssetPage { manufacturer: string, supportName: string, vendorName: string, - notes: string + notes: string, + lastServicedOn: string ) { cy.get("[data-testid=asset-update-button]").click(); cy.get("[data-testid=asset-name-input] input").clear().type(name); @@ -114,18 +126,71 @@ export class AssetPage { cy.get("[data-testid=asset-vendor-name-input] input") .clear() .type(vendorName); + cy.get( + "[data-testid=asset-last-serviced-on-input] input[type='text']" + ).click(); + cy.get("#date-input").click().type(lastServicedOn); cy.get("[data-testid=asset-notes-input] textarea").clear().type(notes); } + configureAsset( + hostName: string, + localIp: string, + userName: string, + password: string, + streamUuid: string + ) { + cy.get("[data-testid=asset-configure-button]").click(); + cy.get("[name=middleware_hostname]").type(hostName); + cy.get("[name=camera_address]").type(localIp); + cy.get("[name=username]").type(userName); + cy.get("[name=password]").type(password); + cy.get("[name=stream_uuid]").type(streamUuid); + } + + configureVitalAsset(hostName: string, localIp: string) { + cy.get("[data-testid=asset-configure-button]").click(); + cy.get("#middleware_hostname").type(hostName); + cy.get("#localipAddress").type(localIp); + } + + spyAssetConfigureApi() { + cy.intercept(/\/api\/v1\/asset/).as("asset"); + } + + verifyAssetConfiguration(statusCode: number) { + cy.wait("@asset").then((interception) => { + expect(interception.response.statusCode).to.equal(statusCode); + }); + } + + clickConfigureAsset() { + cy.get("#submit").contains("Set Configuration").click(); + } + + clickConfigureVital() { + cy.intercept("PATCH", "**/api/v1/asset/**").as("postConfiguration"); + cy.get("#submit").contains("Save Configuration").click(); + cy.wait("@postConfiguration").its("response.statusCode").should("eq", 200); + } + clickUpdateAsset() { cy.get("#submit").contains("Update").click(); } + interceptDeleteAssetApi() { + cy.intercept("DELETE", "**/api/v1/asset/**").as("deleteAsset"); + } + deleteAsset() { cy.get("[data-testid=asset-delete-button]").click(); cy.get("#submit").contains("Confirm").click(); } + verifyDeleteStatus() { + cy.wait("@deleteAsset").its("response.statusCode").should("eq", 204); + } + verifyEmptyAssetNameError() { cy.get("[data-testid=asset-name-input] span").should( "contain", @@ -160,4 +225,152 @@ export class AssetPage { "Please enter valid phone number" ); } + + selectImportFacility(facilityName: string) { + cy.get("input[name='facilities']") + .type(facilityName) + .then(() => { + cy.get("[role='option']").contains(facilityName).click(); + }); + } + + selectassetimportbutton() { + cy.get("[data-testid=import-asset-button]").click(); + } + + selectjsonexportbutton() { + cy.intercept("GET", "**/api/v1/asset/?json=true**").as("getJsonexport"); + cy.get("#export-json-option").click(); + cy.wait("@getJsonexport").then(({ request, response }) => { + expect(response.statusCode).to.eq(200); + expect(request.url).to.include("json=true"); + }); + } + + selectcsvexportbutton() { + cy.intercept("GET", "**/api/v1/asset/?csv=true**").as("getCsvexport"); + cy.get("#export-csv-option").click(); + cy.wait("@getCsvexport").then(({ request, response }) => { + expect(response.statusCode).to.eq(200); + expect(request.url).to.include("csv=true"); + }); + } + + selectImportOption() { + cy.get(".import-assets-button").click(); + } + + importAssetFile() { + cy.get("[data-testid=import-asset-file]") + .selectFile("cypress/fixtures/sampleAsset.xlsx", { force: true }) + .wait(100); + } + + selectImportLocation(locationName: string) { + cy.get("[data-testid=select-import-location]").click(); + cy.get("li[role=option]").contains(locationName).click(); + } + + clickImportAsset() { + cy.intercept("POST", "**/api/v1/asset/").as("importAsset"); + cy.get("#submit").contains("Import").click(); + cy.wait("@importAsset").its("response.statusCode").should("eq", 201); + } + + clickupdatedetailbutton() { + cy.get("[data-testid=asset-update-button]").click(); + } + + scrollintonotes() { + cy.get("#notes").scrollIntoView(); + } + + enterAssetNotes(text: string) { + cy.get("#notes").click().clear(); + cy.get("#notes").click().type(text); + } + + enterAssetservicedate(text: string) { + cy.get("input[name='last_serviced_on']").click(); + cy.get("#date-input").click().type(text); + } + + scrollintoWarrantyDetails() { + cy.get("#warranty-details").scrollIntoView(); + } + + enterWarrantyExpiryDate(text: string) { + cy.get("#WarrantyAMCExpiry").click(); + cy.get("#WarrantyAMCExpiry").click().type(text); + } + + verifyWarrantyExpiryLabel(duration: string) { + if (duration === "") { + cy.get("#warranty-amc-expired-red").should("not.exist"); + cy.get("#warranty-amc-expiring-soon-orange").should("not.exist"); + cy.get("#warranty-amc-expiring-soon-yellow").should("not.exist"); + } else if (duration === "expired") { + cy.get("#warranty-amc-expired-red").should("be.visible"); + } else if (duration === "1 month") { + cy.get("#warranty-amc-expiring-soon-orange").should("be.visible"); + } else if (duration === "3 months") { + cy.get("#warranty-amc-expiring-soon-yellow").should("be.visible"); + } + } + + clickassetupdatebutton() { + cy.get("#submit").click(); + } + + viewassetservicehistorybutton() { + cy.get("#view-service-history").should("be.visible"); + } + + openassetservicehistory() { + cy.get("#view-service-history").click(); + cy.get("#view-asset-edit-history").first().click(); + } + + verifyassetupdateservicehistory() { + cy.get("#edit-history-asset-servicedon").should("have.text", "01/09/2023"); + cy.get("#edit-history-asset-note").should( + "have.text", + "Dummy Notes Editted" + ); + cy.get("#view-history-back-button").contains("Back").click(); + cy.get("#view-history-back-button").contains("Close").click(); + } + + scrollintoservicehistory() { + cy.get("#service-history").scrollIntoView(); + } + + clickedithistorybutton() { + cy.get("#edit-service-history").click(); + } + + verifytransactionStatus(initiallocationName: string, locationName: string) { + cy.get("#transaction-history").scrollIntoView(); + cy.get("#transaction-history table tbody tr:first-child td:eq(0)").should( + "contain", + initiallocationName + ); + cy.get("#transaction-history table tbody tr:first-child td:eq(1)").should( + "contain", + locationName + ); + } + + verifyassetlocation(locationName: string) { + cy.get("#asset-current-location").should("contain", locationName); + } + + clickassetlocation(locationName: string) { + cy.get("#clear-button").click(); + cy.get("[data-testid=asset-location-input] button").click(); + cy.get("[data-testid=asset-location-input] button") + .click() + .type(locationName); + cy.get("[role='option']").contains(locationName).click(); + } } diff --git a/cypress/pageobject/Asset/AssetFilters.ts b/cypress/pageobject/Asset/AssetFilters.ts index 57cc893bdb7..a16b61f4fc5 100644 --- a/cypress/pageobject/Asset/AssetFilters.ts +++ b/cypress/pageobject/Asset/AssetFilters.ts @@ -3,7 +3,8 @@ export class AssetFilters { facilityName: string, assetType: string, assetStatus: string, - assetClass: string + assetClass: string, + assetLocation: string ) { cy.contains("Advanced Filters").click(); cy.get("input[name='Facilities']") @@ -27,6 +28,42 @@ export class AssetFilters { .then(() => { cy.get("[role='option']").contains(assetClass).click(); }); + cy.get("#Facilities-location") + .click() + .type(assetLocation) + .then(() => { + cy.get("[role='option']").contains(assetLocation).click(); + }); cy.contains("Apply").click(); } + clearFilters() { + cy.intercept("GET", "**/api/v1/asset/**").as("clearAssets"); + cy.get("#clear-filter").click(); + cy.wait("@clearAssets").its("response.statusCode").should("eq", 200); + cy.url().should("match", /\/assets$/); + } + clickadvancefilter() { + cy.intercept("GET", "**/api/v1/getallfacilities/**").as("advancefilter"); + cy.get("#advanced-filter").click(); + cy.wait("@advancefilter").its("response.statusCode").should("eq", 200); + } + clickslideoverbackbutton() { + cy.get("#close-slide-over").click(); + } + // Assertions + assertFacilityText(text) { + cy.get("[data-testid=Facility]").should("contain", text); + } + assertAssetTypeText(text) { + cy.get("[data-testid='Asset Type']").should("contain", text); + } + assertAssetClassText(text) { + cy.get("[data-testid='Asset Class']").should("contain", text); + } + assertStatusText(text) { + cy.get("[data-testid=Status]").should("contain", text); + } + assertLocationText(text) { + cy.get("[data-testid=Location]").should("contain", text); + } } diff --git a/cypress/pageobject/Asset/AssetSearch.ts b/cypress/pageobject/Asset/AssetSearch.ts index 315a414a62b..b1ccb2f71c9 100644 --- a/cypress/pageobject/Asset/AssetSearch.ts +++ b/cypress/pageobject/Asset/AssetSearch.ts @@ -1,16 +1,24 @@ export class AssetSearchPage { typeSearchKeyword(keyword: string) { - cy.get("[name='search']").type(keyword); + cy.get("#search").click().clear(); + cy.get("#search").click().type(keyword); } pressEnter() { cy.get("[name='search']").type("{enter}"); } - verifyUrlChanged(initialUrl: string) { - cy.url().should((currentUrl) => { - expect(currentUrl).not.to.equal(initialUrl); - }); + clickAssetByName(assetName: string) { + cy.intercept("GET", "**/api/v1/asset/**").as("clearAssets"); + cy.get("[data-testid='created-asset-list']").contains(assetName).click(); + cy.wait("@clearAssets").its("response.statusCode").should("eq", 200); + } + + verifyBadgeContent(expectedText: string) { + cy.get("[data-testid='Name/Serial No./QR ID']").should( + "contain", + expectedText + ); } verifyAssetIsPresent(assetName: string) { @@ -18,4 +26,35 @@ export class AssetSearchPage { .first() .should("contain", assetName); } + + clickUpdateButton() { + cy.get("[data-testid='asset-update-button']").contains("Update").click(); + } + + clearAndTypeQRCode(qrCode: string) { + cy.get("#qr_code_id").clear(); + cy.get("#qr_code_id").click().type(qrCode); + } + + clearAndTypeSerialNumber(serialNumber: string) { + cy.get("#serial-number").clear(); + cy.get("#serial-number").click().type(serialNumber); + } + + clickAssetSubmitButton() { + cy.intercept("GET", "**/api/v1/asset/**").as("getAssets"); + cy.get("#submit").click(); + cy.wait("@getAssets").its("response.statusCode").should("eq", 200); + } + + visitAssetsPage() { + cy.visit("/assets"); + } + + verifyAssetListContains(dummyCameraText: string) { + cy.get("[data-testid='created-asset-list']").should( + "contain", + dummyCameraText + ); + } } diff --git a/cypress/pageobject/Facility/FacilityCreation.ts b/cypress/pageobject/Facility/FacilityCreation.ts index ab958a49810..d27433f04e7 100644 --- a/cypress/pageobject/Facility/FacilityCreation.ts +++ b/cypress/pageobject/Facility/FacilityCreation.ts @@ -1,7 +1,13 @@ // FacilityPage.ts +import { cy } from "local-cypress"; + class FacilityPage { visitCreateFacilityPage() { + cy.intercept("GET", "**/facility/create").as("getCreateFacilities"); cy.visit("/facility/create"); + cy.wait("@getCreateFacilities") + .its("response.statusCode") + .should("eq", 200); } visitUpdateFacilityPage(url: string) { @@ -11,6 +17,14 @@ class FacilityPage { cy.get("#manage-facility-dropdown button").should("be.visible"); } + clickUpdateFacilityType() { + cy.get("#facility_type") + .click() + .then(() => { + cy.get("[role='option']").contains("Request Approving Center").click(); + }); + } + fillFacilityName(name: string) { cy.get("#name").clear().type(name); } @@ -86,10 +100,14 @@ class FacilityPage { } saveAndExitDoctorForm() { + cy.intercept("GET", "**/api/v1/facility/**").as("createFacilities"); cy.get("button#save-and-exit").click(); + cy.wait("@createFacilities").its("response.statusCode").should("eq", 200); } clickManageFacilityDropdown() { + cy.get("h1.text-3xl.font-bold", { timeout: 20000 }).should("be.visible"); + cy.get("#manage-facility-dropdown button").scrollIntoView(); cy.get("#manage-facility-dropdown button") .contains("Manage Facility") .click(); @@ -99,6 +117,49 @@ class FacilityPage { cy.get("#update-facility").contains("Update Facility").click(); } + clickConfigureFacilityOption() { + cy.get("#configure-facility").contains("Configure Facility").click(); + } + + clickCreateAssetFacilityOption() { + cy.get("#create-assets").contains("Create Asset").click(); + } + + clickviewAssetFacilityOption() { + cy.get("#view-assets").contains("View Assets").click(); + } + + clickViewUsersOption() { + cy.get("#view-users").click(); + } + + clickInventoryManagementOption() { + cy.get("#inventory-management", { timeout: 10000 }).should("be.visible"); + cy.get("#inventory-management").click(); + } + + clickResourceRequestOption() { + cy.get("#resource-request").contains("Resource Request").click(); + } + + clickDeleteFacilityOption() { + cy.get("#delete-facility").contains("Delete Facility").click(); + } + + verifyfacilitynewurl() { + cy.url().should("match", /facility\/[a-z\d-]+/); + } + + verifyresourcenewurl() { + cy.url().should("match", /resource\/[a-z\d-]+/); + } + + confirmDeleteFacility() { + cy.intercept("DELETE", "**/api/v1/facility/**").as("deleteFacility"); + cy.get("#submit").contains("Delete").click(); + cy.wait("@deleteFacility").its("response.statusCode").should("eq", 403); + } + selectLocation(location: string) { cy.get("span > svg.care-svg-icon__baseline.care-l-map-marker").click(); cy.intercept("https://maps.googleapis.com/maps/api/mapsjs/*").as("mapApi"); @@ -106,6 +167,95 @@ class FacilityPage { cy.get("input#pac-input").type(location).type("{enter}"); cy.get("div#map-close").click(); } + + fillMiddleWareAddress(url: string) { + cy.get("#middleware_address").type(url); + } + + clickupdateMiddleWare() { + cy.intercept("PATCH", "**/api/v1/facility/**").as("updateMiddleWare"); + cy.get("button#submit").first().click(); + cy.wait("@updateMiddleWare").its("response.statusCode").should("eq", 200); + } + + verifySuccessNotification(message: string) { + cy.verifyNotification(message); + } + + visitAlreadyCreatedFacility() { + cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities"); + cy.get("[id='facility-details']").first().click(); + cy.wait("@getFacilities").its("response.statusCode").should("eq", 200); + } + + verifyFacilityBadgeContent(expectedText: string) { + cy.get("[data-testid='Facility/District Name']").should( + "contain", + expectedText + ); + } + + verifyfacilitycreateassetredirection() { + cy.url().should("include", "/assets/new"); + } + + verifyassetfacilitybackredirection() { + cy.intercept("GET", "**/api/v1/facility/**").as("getManagePage"); + cy.go("back"); + cy.wait("@getManagePage").its("response.statusCode").should("eq", 200); + } + + verifyfacilityviewassetredirection() { + cy.url().should("include", "/assets?facility="); + } + + clickManageInventory() { + cy.contains("Manage Inventory").click(); + } + + fillInventoryDetails(name: string, status: string, quantity: string) { + cy.get("div#id").click(); + cy.get("div#id ul li").contains(name).click(); + cy.get("div#isIncoming").click(); + cy.get("div#isIncoming ul li").contains(status).click(); + cy.get("[name='quantity']").type(quantity); + } + + clickAddInventory() { + cy.intercept("POST", "**/api/v1/facility/*/inventory/").as( + "createInventory" + ); + cy.get("button").contains("Add/Update Inventory").click(); + cy.wait("@createInventory").its("response.statusCode").should("eq", 201); + } + + fillResourceRequestDetails( + name: string, + phone_number: string, + facility: string, + title: string, + quantity: string, + description: string + ) { + cy.get("#refering_facility_contact_name").type(name); + cy.get("#refering_facility_contact_number").type(phone_number); + cy.get("[name='approving_facility']") + .type(facility) + .then(() => { + cy.get("[role='option']").first().click(); + }); + cy.get("#title").type(title); + cy.get("#requested_quantity").type(quantity); + cy.get("#reason").type(description); + } + + clickSubmitRequestButton() { + cy.intercept("POST", "**/api/v1/resource/").as("createResourceRequest"); + cy.get("button").contains("Submit").click(); + cy.wait("@createResourceRequest") + .its("response.statusCode") + .should("eq", 201); + } } export default FacilityPage; diff --git a/cypress/pageobject/Login/LoginPage.ts b/cypress/pageobject/Login/LoginPage.ts index e75524ad3f4..f691d5f9e15 100644 --- a/cypress/pageobject/Login/LoginPage.ts +++ b/cypress/pageobject/Login/LoginPage.ts @@ -1,4 +1,6 @@ // LoginPage.ts +import { cy } from "local-cypress"; + class LoginPage { loginAsDisctrictAdmin(): void { cy.loginByApi("devdistrictadmin", "Coronasafe@123"); diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts new file mode 100644 index 00000000000..ce1fdc1e393 --- /dev/null +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -0,0 +1,261 @@ +export class PatientConsultationPage { + selectConsultationStatus(status: string) { + cy.get("#consultation_status").scrollIntoView(); + cy.get("#consultation_status").should("be.visible"); + cy.get("#consultation_status") + .click() + .then(() => { + cy.get("[role='option']").contains(status).click(); + }); + } + + selectSymptoms(symptoms: string) { + cy.get("#symptoms") + .click() + .then(() => { + cy.get("[role='option']").contains(symptoms).click(); + }); + } + + fillIllnessHistory(history: string) { + cy.wait(5000); + cy.get("#history_of_present_illness").scrollIntoView(); + cy.get("#history_of_present_illness").should("be.visible"); + cy.get("#history_of_present_illness").click().type(history); + } + + enterConsultationDetails( + category: string, + examinationDetails: string, + weight: string, + height: string, + ipNumber: string, + consulationNotes: string, + verificationBy: string + ) { + cy.get("#symptoms").click(); + cy.get("#category") + .click() + .then(() => { + cy.get("[role='option']").contains(category).click(); + }); + cy.get("#examination_details").click().type(examinationDetails); + cy.get("#weight").click().type(height); + cy.get("#height").click().type(weight); + cy.get("#patient_no").type(ipNumber); + cy.intercept("GET", "**/icd/**").as("getIcdResults"); + cy.get("#icd11-search input[role='combobox']") + .scrollIntoView() + .click() + .type("1A"); + cy.get("#icd11-search [role='option']") + .contains("1A00 Cholera") + .scrollIntoView() + .click(); + cy.get("#condition-verification-status-menu").click(); + cy.get("#add-icd11-diagnosis-as-confirmed").click(); + cy.wait("@getIcdResults").its("response.statusCode").should("eq", 200); + + cy.get("#principal-diagnosis-select").click(); + cy.get("#principal-diagnosis-select [role='option']").first().click(); + + cy.get("#consultation_notes").click().type(consulationNotes); + cy.get("#verified_by") + .click() + .type(verificationBy) + .then(() => { + cy.get("[role='option']").contains("Dev Doctor").click(); + }); + } + + submitConsultation() { + cy.get("#submit").click(); + } + + clickAddPrescription() { + cy.contains("button", "Add Prescription Medication") + .should("be.visible") + .click(); + } + + interceptMediaBase() { + cy.intercept("GET", "**/api/v1/medibase/**").as("getMediaBase"); + } + + prescribefirstMedicine() { + cy.get("div#medicine_object input[placeholder='Select'][role='combobox']") + .click() + .type("dolo") + .type("{downarrow}{enter}"); + } + + prescribesecondMedicine() { + cy.get("div#medicine_object input[placeholder='Select'][role='combobox']") + .click() + .type("dolo") + .type("{downarrow}{downarrow}{enter}"); + } + + selectMedicinebox() { + cy.get( + "div#medicine_object input[placeholder='Select'][role='combobox']" + ).click(); + } + + visitFilesPage() { + cy.get("a").contains("Files").click(); + } + + uploadFile() { + cy.get("#file_upload_patient").selectFile( + "cypress/fixtures/sampleAsset.xlsx", + { force: true } + ); + } + + clickUploadFile() { + cy.intercept("POST", "**/api/v1/files/").as("uploadFile"); + cy.get("#upload_file_button").click(); + cy.wait("@uploadFile").its("response.statusCode").should("eq", 201); + } + + waitForMediabaseStatusCode() { + cy.wait("@getMediaBase").its("response.statusCode").should("eq", 200); + } + + enterDosage(doseAmount: string) { + cy.get("#dosage").type(doseAmount, { force: true }); + } + + selectDosageFrequency(frequency: string) { + cy.get("#frequency") + .click() + .then(() => { + cy.get("div#frequency [role='option']").contains(frequency).click(); + }); + } + + submitPrescriptionAndReturn() { + cy.intercept("POST", "**/api/v1/consultation/*/prescriptions/").as( + "submitPrescription" + ); + cy.get("button#submit").should("be.visible").click(); + cy.get("[data-testid='return-to-patient-dashboard']").click(); + cy.wait("@submitPrescription").its("response.statusCode").should("eq", 201); + } + + visitEditConsultationPage() { + cy.get("#view_consulation_updates").click(); + cy.get("button").contains("Edit Consultation Details").click(); + } + + setSymptomsDate(date: string) { + cy.get("#symptoms_onset_date") + .click() + .then(() => { + cy.get("[placeholder='DD/MM/YYYY']").type(date); + }); + } + + updateConsultation() { + cy.intercept("PUT", "**/api/v1/consultation/**").as("updateConsultation"); + cy.get("#submit").contains("Update Consultation").click(); + cy.wait("@updateConsultation").its("response.statusCode").should("eq", 200); + } + + verifySuccessNotification(message: string) { + cy.verifyNotification(message); + } + + updateSymptoms(symptoms: string) { + this.selectSymptoms(symptoms); + cy.get("#symptoms").click(); + } + + visitShiftRequestPage() { + cy.get("#create_shift_request").click(); + } + + enterPatientShiftDetails( + name: string, + phone_number: string, + facilityName: string, + reason: string + ) { + cy.get("#refering_facility_contact_name").type(name); + cy.get("#refering_facility_contact_number").type(phone_number); + cy.get("input[name='assigned_facility']") + .type(facilityName) + .then(() => { + cy.get("[role='option']").first().click(); + }); + cy.get("#reason").type(reason); + } + + createShiftRequest() { + cy.intercept("POST", "**/api/v1/shift/").as("createShiftRequest"); + cy.get("#submit").click(); + cy.wait("@createShiftRequest").its("response.statusCode").should("eq", 201); + } + + visitDoctorNotesPage() { + cy.get("#patient_doctor_notes").click(); + } + + addDoctorsNotes(notes: string) { + cy.get("#doctor_notes_textarea").type(notes); + } + + postDoctorNotes() { + cy.intercept("POST", "**/api/v1/patient/*/notes").as("postDoctorNotes"); + cy.get("#submit").contains("Post Your Note").click(); + cy.wait("@postDoctorNotes").its("response.statusCode").should("eq", 201); + } + + clickDischargePatient() { + cy.get("#discharge_patient_from_care").click(); + } + + selectDischargeReason(reason: string) { + cy.get("#discharge_reason") + .click() + .then(() => { + cy.get("[role='option']").contains(reason).click(); + }); + } + + addDischargeNotes(notes: string) { + cy.get("#discharge_notes").type(notes); + } + + confirmDischarge() { + cy.intercept("POST", "**/api/v1/consultation/*/discharge_patient/").as( + "dischargePatient" + ); + cy.get("#submit").contains("Confirm Discharge").click(); + cy.wait("@dischargePatient").its("response.statusCode").should("eq", 200); + } + + discontinuePreviousPrescription() { + cy.intercept( + "POST", + "**/api/v1/consultation/*/prescriptions/*/discontinue/" + ).as("deletePrescription"); + cy.get("button").contains("Discontinue").click(); + cy.get("#submit").contains("Discontinue").click(); + cy.wait("@deletePrescription").its("response.statusCode").should("eq", 200); + } + + visitEditPrescriptionPage() { + cy.get("#consultation_tab_nav").contains("Medicines").click(); + cy.get("a[href='prescriptions']").first().click(); + } + + submitPrescription() { + cy.intercept("POST", "**/api/v1/consultation/*/prescriptions/").as( + "submitPrescription" + ); + cy.get("#submit").contains("Submit").click(); + cy.wait("@submitPrescription").its("response.statusCode").should("eq", 201); + } +} diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts new file mode 100644 index 00000000000..47bf9c913ad --- /dev/null +++ b/cypress/pageobject/Patient/PatientCreation.ts @@ -0,0 +1,137 @@ +// PatientPage.ts + +let patient_url = ""; + +export class PatientPage { + createPatient() { + cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities"); + cy.get("#add-patient-details").should("be.visible"); + cy.get("#add-patient-details").click(); + cy.wait("@getFacilities").its("response.statusCode").should("eq", 200); + } + + visitPatient() { + cy.intercept("GET", "**/api/v1/consultation/**").as("getPatient"); + cy.get("[data-cy='patient']").first().click(); + cy.wait("@getPatient").its("response.statusCode").should("eq", 200); + } + + selectFacility(facilityName: string) { + cy.get("input[name='facilities']") + .type(facilityName) + .then(() => { + cy.get("[role='option']").first().click(); + }); + cy.get("button").should("contain", "Select"); + cy.get("button").get("#submit").click(); + } + + interceptCreatePatientAPI() { + cy.intercept("GET", "**/facility/*/patient/**").as("createPatient"); + } + + verifyCreatedPatientResponse() { + cy.wait("@createPatient").its("response.statusCode").should("eq", 200); + } + + enterPatientDetails( + phoneNumber: string, + emergencyPhoneNumber: string, + patientName: string, + gender: string, + address: string, + pincode: string, + wardName: string, + bloodGroup: string, + dateOfBirth: string + ) { + cy.get("#phone_number-div").type(phoneNumber); + cy.get("#emergency_phone_number-div").type(emergencyPhoneNumber); + cy.get("#date_of_birth").should("be.visible").click(); + cy.get("#date-input").click().type(dateOfBirth); + cy.get("[data-testid=name] input").type(patientName); + cy.get("[data-testid=Gender] button") + .click() + .then(() => { + cy.get("[role='option']").contains(gender).click(); + }); + cy.get("[data-testid=current-address] textarea").type(address); + cy.get("[data-testid=permanent-address] input").check(); + cy.get("#pincode").type(pincode); + cy.get("[data-testid=localbody] button") + .click() + .then(() => { + cy.get("[role='option']").first().click(); + }); + cy.get("[data-testid=ward-respective-lsgi] button") + .click() + .then(() => { + cy.get("[role='option']").contains(wardName).click(); + }); + cy.get("[name=medical_history_check_1]").check(); + cy.get("[data-testid=blood-group] button") + .click() + .then(() => { + cy.get("[role='option']").contains(bloodGroup).click(); + }); + } + + clickCreatePatient() { + cy.intercept("POST", "**/api/v1/patient/").as("createPatient"); + cy.get("button[data-testid='submit-button']").click(); + cy.wait("@createPatient").its("response.statusCode").should("eq", 201); + } + + verifyPatientIsCreated() { + cy.get("h2").should("contain", "Create Consultation"); + cy.url().should("include", "/patient"); + } + + saveCreatedPatientUrl() { + cy.url().then((url) => { + cy.log(url); + patient_url = url.split("/").slice(0, -1).join("/"); + cy.log(patient_url); + }); + } + + visitCreatedPatient() { + cy.awaitUrl(patient_url); + } + + verifyPatientDetails( + age: number, + patientName: string, + phoneNumber: string, + emergencyPhoneNumber: string, + yearOfBirth: string, + bloodGroup: string + ) { + cy.url().should("include", "/facility/"); + cy.get("[data-testid=patient-dashboard]").should("contain", age); + cy.get("[data-testid=patient-dashboard]").should("contain", patientName); + cy.get("[data-testid=patient-dashboard]").should("contain", phoneNumber); + cy.get("[data-testid=patient-dashboard]").should( + "contain", + emergencyPhoneNumber + ); + cy.get("[data-testid=patient-dashboard]").should("contain", yearOfBirth); + cy.get("[data-testid=patient-dashboard]").should("contain", bloodGroup); + } + + visitUpdatePatientUrl() { + cy.awaitUrl(patient_url + "/update"); + } + + interceptFacilities() { + cy.intercept("GET", "**/facility/*/patient/**").as("getFacilities"); + } + + verifyStatusCode() { + cy.wait("@getFacilities").its("response.statusCode").should("eq", 200); + } + + patientformvisibility() { + cy.get("[data-testid='current-address']").scrollIntoView(); + } +} diff --git a/cypress/pageobject/Patient/PatientUpdate.ts b/cypress/pageobject/Patient/PatientUpdate.ts new file mode 100644 index 00000000000..b26ef678679 --- /dev/null +++ b/cypress/pageobject/Patient/PatientUpdate.ts @@ -0,0 +1,97 @@ +let patient_url = ""; + +export class UpdatePatientPage { + enterPatientDetails( + patientName: string, + bloodGroup: string, + phoneNumber: string, + emergencyPhoneNumber: string, + address: string, + currentHealthCondition: string, + ongoingMedication: string, + allergies: string, + medicalHistory: string[], + subscriberId: string, + policyId: string, + insuranceId: string, + insuranceName: string + ) { + cy.wait(10000); + cy.get("#address").scrollIntoView(); + cy.get("#address").should("be.visible"); + cy.get("#address").type(address); + cy.get("[data-testid=name] input").clear(); + cy.get("[data-testid=name] input").type(patientName); + cy.get("#phone_number-div").clear(); + cy.get("#phone_number-div").type("+91").type(phoneNumber); + cy.get("#emergency_phone_number-div").clear(); + cy.get("#emergency_phone_number-div") + .type("+91") + .type(emergencyPhoneNumber); + cy.get("#present_health").type(currentHealthCondition); + cy.get("#ongoing_medication").type(ongoingMedication); + cy.get("#allergies").type(allergies); + cy.get("[name=medical_history_check_1]").uncheck(); + cy.get("[name=medical_history_check_2]").check(); + cy.get("#medical_history_2").type(medicalHistory[0]); + cy.get("[name=medical_history_check_3]").check(); + cy.get("#medical_history_3").type(medicalHistory[1]); + cy.get("button").get("[data-testid=add-insurance-button]").click(); + cy.get("#subscriber_id").type(subscriberId); + cy.get("#policy_id").type(policyId); + cy.get("#insurer_id").type(insuranceId); + cy.get("#insurer_name").type(insuranceName); + cy.get("[data-testid=blood-group] button") + .click() + .then(() => { + cy.get("[role='option']").contains(bloodGroup).click(); + }); + } + + clickUpdatePatient() { + cy.intercept("PUT", "**/api/v1/patient/**").as("updatePatient"); + cy.get("button").get("[data-testid=submit-button]").click(); + cy.wait("@updatePatient").its("response.statusCode").should("eq", 200); + } + + verifyPatientUpdated() { + cy.url().should("include", "/patient"); + } + + saveUpdatedPatientUrl() { + cy.url().then((url) => { + cy.log(url); + patient_url = url.split("/").slice(0, -1).join("/"); + cy.log(patient_url); + }); + } + + visitUpdatedPatient() { + cy.awaitUrl(patient_url); + } + + verifyPatientDetails( + patientName: string, + phoneNumber: string, + presentHealth: string, + ongoingMedication: string, + allergies: string + ) { + cy.url().should("include", "/facility/"); + cy.get("[data-testid=patient-dashboard]").should("contain", patientName); + cy.get("[data-testid=patient-dashboard]").should("contain", phoneNumber); + cy.get("[data-testid=patient-present-health]").should( + "contain", + presentHealth + ); + cy.get("[data-testid=patient-ongoing-medication]").should( + "contain", + ongoingMedication + ); + cy.get("[data-testid=patient-allergies]").should("contain", allergies); + } + + visitConsultationPage() { + cy.visit(patient_url + "/consultation"); + } +} diff --git a/cypress/pageobject/Resource/ResourcePage.ts b/cypress/pageobject/Resource/ResourcePage.ts new file mode 100644 index 00000000000..f7feac925bf --- /dev/null +++ b/cypress/pageobject/Resource/ResourcePage.ts @@ -0,0 +1,79 @@ +// ResoucrePage.ts +class ResourcePage { + verifyDownloadButtonWorks() { + cy.get("svg.care-svg-icon__baseline.care-l-export").each(($button) => { + cy.intercept(/\/api\/v1\/resource/).as("resource_download"); + cy.wrap($button).click({ force: true }); + cy.wait("@resource_download").then((interception) => { + expect(interception.response.statusCode).to.equal(200); + }); + }); + } + + spyResourceApi() { + cy.intercept(/\/api\/v1\/resource/).as("resource"); + } + + clickCompletedResources() { + cy.contains("Completed").click(); + } + + verifyCompletedResources() { + cy.wait("@resource").then((interception) => { + expect(interception.response.statusCode).to.equal(200); + }); + cy.contains("Active").should("have.class", "text-primary-500"); + cy.contains("Completed").should("have.class", "text-white"); + } + + clickActiveResources() { + cy.contains("Active").click(); + } + + verifyActiveResources() { + cy.wait("@resource").then((interception) => { + expect(interception.response.statusCode).to.equal(200); + }); + cy.contains("Active").should("have.class", "text-white"); + cy.contains("Completed").should("have.class", "text-primary-500"); + } + + clickListViewButton() { + cy.contains("List View").click(); + } + + clickBoardViewButton() { + cy.contains("Board View").click(); + } + + clickUpdateStatus() { + cy.get("[data-testid='update-status']").click(); + } + + updateStatus(status: string) { + cy.get("#status").click(); + cy.get("[role='option']").contains(status).click(); + } + + clickSubmitButton() { + cy.intercept("PUT", "**/api/v1/resource/**/").as("updateResource"); + cy.get("#submit").contains("Submit").click(); + cy.wait("@updateResource").its("response.statusCode").should("eq", 200); + } + + verifySuccessNotification(message: string) { + cy.verifyNotification(message); + } + + addCommentForResource(comment: string) { + cy.get("#comment").type(comment); + } + + clickPostCommentButton() { + cy.intercept("POST", "**/api/v1/resource/*/comment/").as("postComment"); + cy.contains("Post Your Comment").click(); + cy.wait("@postComment").its("response.statusCode").should("eq", 201); + } +} + +export default ResourcePage; diff --git a/cypress/pageobject/Users/ManageUserPage.ts b/cypress/pageobject/Users/ManageUserPage.ts new file mode 100644 index 00000000000..b79b96447f0 --- /dev/null +++ b/cypress/pageobject/Users/ManageUserPage.ts @@ -0,0 +1,152 @@ +export class ManageUserPage { + assertHomeFacility(expectedText) { + cy.get("#home_facility").should("contain.text", expectedText); + } + + clickFacilitiesTab() { + cy.get("#facilities").click(); + } + + typeFacilityName(facilityName) { + cy.get("input[name='facility']").click().type(facilityName); + } + + selectFacilityFromDropdown(facilityName) { + cy.get("[role='option']").contains(facilityName).click(); + } + + clickLinkFacility() { + cy.get("#link-facility").click(); + } + + assertLinkedFacility(facilityName) { + cy.get("#linked-facility-list").should("contain.text", facilityName); + } + + assertnotLinkedFacility(facilityName) { + cy.get("#linked-facility-list").should("not.contain", facilityName); + } + + linkedfacilitylistnotvisible() { + cy.get("#linked-facility-list").should("not.exist"); + } + + assertHomeFacilitylink(facilityName) { + cy.get("#home-facility").should("contain.text", facilityName); + } + + assertFacilityNotInDropdown(facilityName) { + this.typeFacilityName(facilityName); + cy.get("[role='option']").should("not.exist"); + } + + clickCloseSlideOver() { + cy.get("#close-slide-over").click(); + } + + clickHomeFacilityIcon() { + cy.get("#home-facility-icon").click(); + } + + clickUnlinkFacilityButton() { + cy.get("#unlink-facility-button").click(); + } + + clickSubmit() { + cy.get("#submit").click(); + } + + clicksetaveragehourbutton() { + cy.get("#avg-workinghour").click(); + } + + clearweeklyhourfield() { + cy.get("#weekly_working_hours").click().clear(); + } + + verifyErrorText(expectedError: string) { + cy.get(".error-text").should("contain", expectedError).and("be.visible"); + } + + typeInWeeklyWorkingHours(hours: string) { + cy.get("#weekly_working_hours").click().type(hours); + } + + navigateToProfile() { + cy.intercept("GET", "**/api/v1/users/**").as("getUsers"); + cy.get("#profilenamelink").click(); + cy.wait("@getUsers").its("response.statusCode").should("eq", 200); + } + + verifyWorkingHours(expectedHours: string) { + cy.get("#working-hours").should("contain", `${expectedHours} hours`); + } + + verifyProfileWorkingHours(expectedHours: string) { + cy.get("#averageworkinghour-profile-details").should( + "contain", + expectedHours + ); + } + + navigateToFacility() { + cy.visit("/facility"); + } + + typeFacilitySearch(facilityName) { + cy.get("#search").click().type(facilityName); + } + + assertFacilityInCard(facilityName) { + cy.get("#facility-name-card").should("contain", facilityName); + } + + clickFacilityPatients() { + cy.get("#facility-patients").click(); + } + + clicklinkedskillbutton() { + cy.get("#skills").click(); + } + + clickAddSkillButton() { + cy.intercept("GET", "**/api/v1/skill/**").as("getSkills"); + cy.get("#add-skill-button").click(); + cy.wait("@getSkills").its("response.statusCode").should("eq", 200); + } + + assertSkillInAlreadyLinkedSkills(skillName) { + cy.get("#already-linked-skills") + .contains(skillName) + .should("have.length", 1); + } + + assertSkillIndoctorconnect(skillName) { + cy.get("#doctor-connect-home-doctor") + .contains(skillName) + .should("have.length", 1); + } + + typeSkill(skillName) { + cy.get("#select-skill").click().type(skillName); + } + + clickDoctorConnectButton() { + cy.get("#doctor-connect-patient-button").click(); + } + + clickUnlinkSkill() { + cy.get("#unlink-skill").click(); + } + + assertSkillInAddedUserSkills(skillName) { + cy.get("#added-user-skills").should("contain", skillName); + } + + assertDoctorConnectVisibility(realName) { + cy.get("#doctor-connect-home-doctor").should("contain.text", realName); + cy.get("#doctor-connect-remote-doctor").should("contain.text", realName); + } +} + +export default ManageUserPage; diff --git a/cypress/pageobject/Users/UserCreation.ts b/cypress/pageobject/Users/UserCreation.ts new file mode 100644 index 00000000000..32127ffcb90 --- /dev/null +++ b/cypress/pageobject/Users/UserCreation.ts @@ -0,0 +1,79 @@ +// UserCreation.ts +export class UserCreationPage { + clickElementById(elementId: string) { + cy.get("#" + elementId).click(); + } + + typeIntoElementById(elementId: string, value: string) { + cy.get("#" + elementId) + .click() + .type(value); + } + + typeIntoElementByIdPostClear(elementId: string, value: string) { + cy.get("#" + elementId) + .click() + .clear() + .click() + .type(value); + } + + clearIntoElementById(elementId: string) { + cy.get("#" + elementId) + .click() + .clear(); + } + + typeIntoInputByName(inputName: string, value: string) { + cy.get("input[name='" + inputName + "']") + .click() + .type(value); + } + + selectOptionContainingText(text: string) { + cy.get("[role='option']").contains(text).click(); + } + + verifyNotification(message: string) { + cy.verifyNotification(message); + } + + selectFacility(name: string) { + this.typeIntoInputByName("facilities", name); + this.selectOptionContainingText(name); + } + + selectHomeFacility(name: string) { + this.clickElementById("home_facility"); + this.selectOptionContainingText(name); + } + + setInputDate( + dateElementId: string, + inputElementId: string, + dateValue: string + ) { + this.clickElementById(dateElementId); + this.typeIntoElementById(inputElementId, dateValue); + } + + selectDropdownOption(dropdownId: string, optionText: string) { + this.clickElementById(dropdownId); + this.selectOptionContainingText(optionText); + } + + verifyElementContainsText(elementId: string, expectedText: string) { + cy.get("#" + elementId).should("contain.text", expectedText); + } + + verifyErrorMessages(errorMessages: string[]) { + cy.get(".error-text").then(($errors) => { + const displayedErrorMessages = $errors + .map((_, el) => Cypress.$(el).text()) + .get(); + errorMessages.forEach((errorMessage) => { + expect(displayedErrorMessages).to.include(errorMessage); + }); + }); + } +} diff --git a/cypress/pageobject/Users/UserSearch.ts b/cypress/pageobject/Users/UserSearch.ts new file mode 100644 index 00000000000..4956532277f --- /dev/null +++ b/cypress/pageobject/Users/UserSearch.ts @@ -0,0 +1,112 @@ +// UserPage.ts +export class UserPage { + // Element selectors + searchByUsernameInput = "#search-by-username"; + usernameText = "#username"; + usernameBadge = "[data-testid='Username']"; + removeIcon = "#removeicon"; + + checkSearchInputVisibility() { + cy.get(this.searchByUsernameInput).should("be.visible"); + } + + typeInSearchInput(text: string) { + cy.get(this.searchByUsernameInput).click().type(text); + } + + clearSearchInput() { + cy.get(this.searchByUsernameInput).click().clear(); + } + + checkUrlForUsername(username: string) { + cy.url().should("include", `username=${username}`); + } + + verifyUrlafteradvancefilter() { + cy.url() + .should("include", "first_name=Dev") + .and("include", "last_name=Doctor") + .and("include", "phone_number=%2B919876543219") + .and("include", "alt_phone_number=%2B919876543219") + .and("include", "user_type=Doctor") + .and("include", "district_id=7"); + } + + checkUsernameText(username: string) { + cy.get(this.usernameText).should("have.text", username); + } + + checkUsernameBadgeVisibility(shouldBeVisible: boolean) { + const assertion = shouldBeVisible ? "be.visible" : "not.be.visible"; + cy.get(this.usernameBadge).should(assertion); + } + + clickRemoveIcon() { + cy.get(this.removeIcon).click(); + } + + clickAdvancedFilters() { + cy.get("#advanced-filter").contains("Advanced Filters").click(); + } + + typeInFirstName(firstName: string) { + cy.get("#first_name").click().type(firstName); + } + + typeInLastName(lastName: string) { + cy.get("#last_name").click().type(lastName); + } + + selectRole(role: string) { + cy.get("#role button").click(); + cy.get("[role='option']").contains(role).click(); + } + + selectDistrict(district: string) { + cy.get("input[name='district']").click().type(district); + cy.get("[role='option']").contains(district).click(); + } + + typeInPhoneNumber(phone: string) { + cy.get("#phone_number").click().type(phone); + } + + typeInAltPhoneNumber(altPhone: string) { + cy.get("#alt_phone_number").click().type(altPhone); + } + + applyFilter() { + cy.get("#apply-filter").click(); + } + + verifyDataTestIdText(testId: string, text: string) { + cy.get(`[data-testid="${testId}"]`).contains(text).should("be.visible"); + } + + clearFilters() { + this.clickAdvancedFilters(); + cy.get("#clear-filter").contains("Clear").click(); + } + + verifyDataTestIdNotVisible(testId: string) { + cy.get(`[data-testid="${testId}"]`).should("not.be.visible"); + } + + navigateToNextPage() { + cy.get("button#next-pages").click(); + } + + navigateToPreviousPage() { + cy.get("button#prev-pages").click(); + } + + verifyCurrentPageNumber(pageNumber: number) { + cy.url().should("include", `page=${pageNumber}`); + } + + verifyMultipleBadgesWithSameId(expectedContents: string[]) { + cy.get("#user-view-name").each((el, index) => { + expect(el.text().trim()).to.equal(expectedContents[index]); + }); + } +} diff --git a/cypress/pageobject/constants.ts b/cypress/pageobject/constants.ts new file mode 100644 index 00000000000..72e0d31c662 --- /dev/null +++ b/cypress/pageobject/constants.ts @@ -0,0 +1,4 @@ +export const phone_number = + "9" + Math.floor(100000000 + Math.random() * 900000000); +export const emergency_phone_number = + "9" + Math.floor(100000000 + Math.random() * 900000000); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 7f5484564fc..2dd8c477233 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -81,7 +81,7 @@ Cypress.Commands.add( Cypress.Commands.add("verifyNotification", (text) => { cy.get(".pnotify-container").should("exist").contains(text); - return cy.get(".pnotify-container").click({ force: true }); + return cy.get(".pnotify-container").contains(text).click({ force: true }); }); Cypress.on("uncaught:exception", () => { diff --git a/package-lock.json b/package-lock.json index dda8ac9dd79..d65f617ec05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,11 +29,11 @@ "dayjs": "^1.11.9", "echarts": "^5.4.2", "echarts-for-react": "^3.0.2", + "eslint-mdx": "^2.2.0", "events": "^3.3.0", "i18next": "^23.2.7", "i18next-browser-languagedetector": "^7.1.0", - "libphonenumber-js": "^1.10.37", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "postcss-loader": "^7.3.3", "qrcode.react": "^3.1.0", "raviger": "^4.1.2", @@ -47,10 +47,9 @@ "react-google-recaptcha": "^3.1.0", "react-i18next": "^13.0.1", "react-markdown": "^8.0.7", - "react-player": "^2.12.0", + "react-player": "^2.13.0", "react-qr-reader": "^2.2.1", "react-redux": "^8.1.1", - "react-swipeable-views": "^0.14.0", "react-transition-group": "^4.4.5", "react-webcam": "^7.1.1", "read-excel-file": "^5.6.1", @@ -59,7 +58,7 @@ "rehype-raw": "^6.1.1", "rescript-webapi": "^0.8.0", "use-keyboard-shortcut": "^1.1.6", - "uuid": "^9.0.0" + "uuid": "^9.0.1" }, "devDependencies": { "@storybook/addon-essentials": "^7.0.26", @@ -75,7 +74,7 @@ "@types/cypress": "^1.1.3", "@types/echarts": "^4.9.18", "@types/google.maps": "^3.53.4", - "@types/lodash": "^4.14.195", + "@types/lodash-es": "^4.17.9", "@types/lodash.get": "^4.4.7", "@types/node": "^20.4.0", "@types/prop-types": "*", @@ -86,13 +85,12 @@ "@types/react-dom": "^18.2.6", "@types/react-google-recaptcha": "^2.1.5", "@types/react-qr-reader": "^2.1.4", - "@types/react-swipeable-views": "^0.13.2", "@types/react-transition-group": "^4.4.6", "@typescript-eslint/eslint-plugin": "^5.61.0", "@typescript-eslint/parser": "^5.61.0", "@vitejs/plugin-react-swc": "^3.3.2", "autoprefixer": "^10.4.14", - "cypress": "^13.1.0", + "cypress": "^13.5.0", "cypress-localstorage-commands": "^2.2.3", "eslint": "^8.44.0", "eslint-config-prettier": "^8.8.0", @@ -100,6 +98,7 @@ "eslint-plugin-i18next": "^6.0.3", "eslint-plugin-import": "^2.27.5", "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-mdx": "^2.2.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-prettier": "^4.2.1", @@ -3237,7 +3236,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -3250,7 +3248,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, "engines": { "node": ">= 8" } @@ -3259,7 +3256,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -3268,6 +3264,106 @@ "node": ">= 8" } }, + "node_modules/@npmcli/config": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-6.4.0.tgz", + "integrity": "sha512-/fQjIbuNVIT/PbXvw178Tm97bxV0E0nVUFKHivMKtSI2pcs8xKdaWkHJxf9dTI0G/y5hp/KuCvgcUu5HwAtI1w==", + "dependencies": { + "@npmcli/map-workspaces": "^3.0.2", + "ci-info": "^3.8.0", + "ini": "^4.1.0", + "nopt": "^7.0.0", + "proc-log": "^3.0.0", + "read-package-json-fast": "^3.0.2", + "semver": "^7.3.5", + "walk-up-path": "^3.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/config/node_modules/ini": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/config/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/config/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/config/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/@npmcli/map-workspaces": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-3.0.4.tgz", + "integrity": "sha512-Z0TbvXkRbacjFFLpVpV0e2mheCh+WzQpcqL+4xp49uNJOxOnIAPZyXtUxZ5Qn3QBTGKA11Exjd9a5411rBrhDg==", + "dependencies": { + "@npmcli/name-from-folder": "^2.0.0", + "glob": "^10.2.2", + "minimatch": "^9.0.0", + "read-package-json-fast": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@npmcli/name-from-folder": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-2.0.0.tgz", + "integrity": "sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -3277,6 +3373,53 @@ "node": ">=14" } }, + "node_modules/@pkgr/utils": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", + "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==", + "dependencies": { + "cross-spawn": "^7.0.3", + "fast-glob": "^3.3.0", + "is-glob": "^4.0.3", + "open": "^9.1.0", + "picocolors": "^1.0.0", + "tslib": "^2.6.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@pkgr/utils/node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@pkgr/utils/node_modules/open": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz", + "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==", + "dependencies": { + "default-browser": "^4.0.0", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@pnotify/core": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@pnotify/core/-/core-5.2.0.tgz", @@ -5238,6 +5381,14 @@ "@testing-library/dom": ">=7.21.4" } }, + "node_modules/@types/acorn": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz", + "integrity": "sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/@types/aria-query": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.1.tgz", @@ -5290,6 +5441,14 @@ "@types/node": "*" } }, + "node_modules/@types/concat-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-2.0.1.tgz", + "integrity": "sha512-v5HP9ZsRbzFq5XRo2liUZPKzwbGK5SuGVMWZjE6iJOm/JNdESk3/rkfcPe0lcal0C32PTLVlYUYqGpMGNdDsDg==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", @@ -5367,8 +5526,15 @@ "node_modules/@types/estree": { "version": "0.0.51", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", - "dev": true + "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==" + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.2.tgz", + "integrity": "sha512-GNBWlGBMjiiiL5TSkvPtOteuXsiVitw5MYGY1UYlrAq0SKyczsls6sCD7TZ8fsjRsvCVxml7EbyjJezPb3DrSA==", + "dependencies": { + "@types/estree": "*" + } }, "node_modules/@types/express": { "version": "4.17.17", @@ -5444,6 +5610,11 @@ "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.1.tgz", "integrity": "sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==" }, + "node_modules/@types/is-empty": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/is-empty/-/is-empty-1.2.2.tgz", + "integrity": "sha512-BmFyKRHSsE+LFmOUQIYMg/8UJ+fNX3fxev0/OXGKWxUldHD8/bQYhXsTF7wR8woS0h8CWdLK39REjQ/Fxm6bFg==" + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", @@ -5486,6 +5657,15 @@ "integrity": "sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==", "dev": true }, + "node_modules/@types/lodash-es": { + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.9.tgz", + "integrity": "sha512-ZTcmhiI3NNU7dEvWLZJkzG6ao49zOIjEgIE0RgV7wbPxU0f2xT3VSAHw2gmst8swH6V0YkLRGp4qPlX/6I90MQ==", + "dev": true, + "dependencies": { + "@types/lodash": "*" + } + }, "node_modules/@types/lodash.get": { "version": "4.4.7", "resolved": "https://registry.npmjs.org/@types/lodash.get/-/lodash.get-4.4.7.tgz", @@ -5640,15 +5820,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-swipeable-views": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@types/react-swipeable-views/-/react-swipeable-views-0.13.2.tgz", - "integrity": "sha512-FiszBm9M0JicAgzO/IwDqpfHQRUEjPZA88UexYsVD6qHJBf5LrbGjR5Mw4+yZbf8ZxJneNqOsZbe4WGjOYG7iQ==", - "dev": true, - "dependencies": { - "@types/react": "*" - } - }, "node_modules/@types/react-transition-group": { "version": "4.4.6", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.6.tgz", @@ -5709,6 +5880,11 @@ "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", "dev": true }, + "node_modules/@types/supports-color": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@types/supports-color/-/supports-color-8.1.2.tgz", + "integrity": "sha512-nhs1D8NjNueBqRBhBTsc81g90g7VBD4wnMTMy9oP+QIldHuJkE655QTL2D1jkj3LyCd+Q5Y69oOpfxN1l0eCMA==" + }, "node_modules/@types/trusted-types": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.3.tgz", @@ -6152,6 +6328,14 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "node_modules/abbrev": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", + "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -6180,7 +6364,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -6896,7 +7079,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", - "dev": true, "dependencies": { "big-integer": "^1.6.44" }, @@ -7023,8 +7205,7 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "node_modules/buffer-indexof-polyfill": { "version": "1.0.2", @@ -7054,6 +7235,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bundle-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", + "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==", + "dependencies": { + "run-applescript": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -7174,6 +7369,15 @@ "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "dev": true }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chainsaw": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", @@ -7209,6 +7413,33 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/check-more-types": { "version": "2.24.0", "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", @@ -7268,7 +7499,6 @@ "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", - "dev": true, "funding": [ { "type": "github", @@ -7789,15 +8019,15 @@ "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "node_modules/cypress": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.1.0.tgz", - "integrity": "sha512-LUKxCYlB973QBFls1Up4FAE9QIYobT+2I8NvvAwMfQS2YwsWbr6yx7y9hmsk97iqbHkKwZW3MRjoK1RToBFVdQ==", + "version": "13.5.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.5.0.tgz", + "integrity": "sha512-oh6U7h9w8wwHfzNDJQ6wVcAeXu31DlIYlNOBvfd6U4CcB8oe4akawQmH+QJVOMZlM42eBoCne015+svVqdwdRQ==", "dev": true, "hasInstallScript": true, "dependencies": { "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^16.18.39", + "@types/node": "^18.17.5", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", @@ -7859,10 +8089,13 @@ } }, "node_modules/cypress/node_modules/@types/node": { - "version": "16.18.42", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.42.tgz", - "integrity": "sha512-IrFfX/1oxDFQNpQzgt/BoP/hbMuQT68DPsNwzJmw8y3K8lfnPp0XymVN9GLFz+LobFmJGZ/peRzq+9wXYfCCtw==", - "dev": true + "version": "18.18.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.9.tgz", + "integrity": "sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/cypress/node_modules/fs-extra": { "version": "9.1.0", @@ -8050,11 +8283,27 @@ "node": ">=0.10.0" } }, + "node_modules/default-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz", + "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==", + "dependencies": { + "bundle-name": "^3.0.0", + "default-browser-id": "^3.0.0", + "execa": "^7.1.1", + "titleize": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/default-browser-id": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz", "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==", - "dev": true, "dependencies": { "bplist-parser": "^0.2.0", "untildify": "^4.0.0" @@ -8066,42 +8315,155 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/defaults": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", - "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "node_modules/default-browser/node_modules/execa": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", + "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", "dependencies": { - "clone": "^1.0.2" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/default-browser/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "engines": { + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "dev": true, + "node_modules/default-browser/node_modules/human-signals": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", "engines": { - "node": ">=8" + "node": ">=14.18.0" } }, - "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, + "node_modules/default-browser/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "engines": { - "node": ">= 0.4" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/defu": { + "node_modules/default-browser/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/define-properties": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/defu": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.2.tgz", "integrity": "sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==", @@ -8889,6 +9251,48 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-mdx": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eslint-mdx/-/eslint-mdx-2.2.0.tgz", + "integrity": "sha512-AriN6lCW6KhWQ9GEiXapR1DokKHefOUqKvCmHxnE9puCWYhWiycU2SNKH8jmrasDBreZ+RtJDLi+RcUNLJatjg==", + "dependencies": { + "acorn": "^8.10.0", + "acorn-jsx": "^5.3.2", + "espree": "^9.6.1", + "estree-util-visit": "^1.2.1", + "remark-mdx": "^2.3.0", + "remark-parse": "^10.0.2", + "remark-stringify": "^10.0.3", + "synckit": "^0.8.5", + "tslib": "^2.6.1", + "unified": "^10.1.2", + "unified-engine": "^10.1.0", + "unist-util-visit": "^4.1.2", + "uvu": "^0.5.6", + "vfile": "^5.3.7" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "eslint": ">=8.0.0" + } + }, + "node_modules/eslint-mdx/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/eslint-module-utils": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", @@ -9027,6 +9431,199 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" } }, + "node_modules/eslint-plugin-markdown": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-3.0.1.tgz", + "integrity": "sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==", + "dev": true, + "dependencies": { + "mdast-util-from-markdown": "^0.8.5" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/character-entities": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", + "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/character-entities-legacy": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", + "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/character-reference-invalid": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", + "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/is-alphabetical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", + "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/is-alphanumerical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", + "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "dev": true, + "dependencies": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/is-decimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", + "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/is-hexadecimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", + "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/mdast-util-from-markdown": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", + "integrity": "sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-string": "^2.0.0", + "micromark": "~2.11.0", + "parse-entities": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/mdast-util-to-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", + "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/parse-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "dev": true, + "dependencies": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/eslint-plugin-markdown/node_modules/unist-util-stringify-position": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/eslint-plugin-mdx": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mdx/-/eslint-plugin-mdx-2.2.0.tgz", + "integrity": "sha512-OseoMXUIr8iy3E0me+wJLVAxuB0kxHP1plxuYAJDynzorzOj2OKv8Fhr+rIOJ32zfl3bnEWsqFnUiCnyznr1JQ==", + "dev": true, + "dependencies": { + "eslint-mdx": "^2.2.0", + "eslint-plugin-markdown": "^3.0.1", + "remark-mdx": "^2.3.0", + "remark-parse": "^10.0.2", + "remark-stringify": "^10.0.3", + "tslib": "^2.6.1", + "unified": "^10.1.2", + "vfile": "^5.3.7" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "eslint": ">=8.0.0" + } + }, "node_modules/eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -9225,7 +9822,6 @@ "version": "3.4.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -9298,7 +9894,6 @@ "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", @@ -9315,7 +9910,6 @@ "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -9382,6 +9976,28 @@ "node": ">=8.3.0" } }, + "node_modules/estree-util-is-identifier-name": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-2.1.0.tgz", + "integrity": "sha512-bEN9VHRyXAUOjkKVQVvArFym08BTWB0aJPppZZr0UNyAqWsLaVfAqP7hbaTJjzHifmB5ebnR8Wm7r7yGN/HonQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-visit": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-1.2.1.tgz", + "integrity": "sha512-xbgqcrkIVbIG+lI/gzbvd9SGTJL4zqJKBFttUl5pP27KhAjtMKbX/mQXJ7qgyXpMgVy/zvpm0xoQQaGL8OloOw==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -9571,7 +10187,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -9587,7 +10202,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -9611,11 +10225,22 @@ "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, "dependencies": { "reusify": "^1.0.4" } }, + "node_modules/fault": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", + "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", + "dependencies": { + "format": "^0.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -9954,6 +10579,14 @@ "node": ">= 6" } }, + "node_modules/format": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", + "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==", + "engines": { + "node": ">=0.4.x" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -10889,7 +11522,6 @@ "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, "engines": { "node": ">= 4" } @@ -10917,6 +11549,15 @@ "node": ">=4" } }, + "node_modules/import-meta-resolve": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-2.2.2.tgz", + "integrity": "sha512-f8KcQ1D80V7RnqVm+/lirO9zkOxjGxhaTC1IPrBGd3MEfNgmNG67tSUO9gTi2F3Blr2Az6g1vocaxzkVnWl9MA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -11008,6 +11649,28 @@ "node": ">=8" } }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -11127,9 +11790,9 @@ } }, "node_modules/is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -11153,6 +11816,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-deflate": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-deflate/-/is-deflate-1.0.0.tgz", @@ -11163,7 +11835,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, "bin": { "is-docker": "cli.js" }, @@ -11174,6 +11845,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-empty": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-empty/-/is-empty-1.2.0.tgz", + "integrity": "sha512-F2FnH/otLNJv0J6wc73A5Xo7oHLNnqplYqZhUu01tD54DIPvxIRSTSLkrUB/M0nHO4vo1O9PDfN4KoTxCzLh/w==" + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -11228,6 +11904,46 @@ "node": ">=0.10.0" } }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container/node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", @@ -11415,7 +12131,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, "engines": { "node": ">=8" }, @@ -11523,7 +12238,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, "dependencies": { "is-docker": "^2.0.0" }, @@ -11997,11 +12711,6 @@ "node": ">=4.0" } }, - "node_modules/keycode": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/keycode/-/keycode-2.2.1.tgz", - "integrity": "sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg==" - }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -12079,11 +12788,6 @@ "node": ">= 0.8.0" } }, - "node_modules/libphonenumber-js": { - "version": "1.10.37", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.37.tgz", - "integrity": "sha512-Z10PCaOCiAxbUxLyR31DNeeNugSVP6iv/m7UrSKS5JHziEMApJtgku4e9Q69pzzSC9LnQiM09sqsGf2ticZnMw==" - }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -12442,6 +13146,19 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/load-plugin": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/load-plugin/-/load-plugin-5.1.0.tgz", + "integrity": "sha512-Lg1CZa1CFj2CbNaxijTL6PCbzd4qGTlZov+iH2p5Xwy/ApcZJh+i6jMN2cYePouTfjJfrNu3nXFdEw8LvbjPFQ==", + "dependencies": { + "@npmcli/config": "^6.0.0", + "import-meta-resolve": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/load-script": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/load-script/-/load-script-1.0.0.tgz", @@ -12476,6 +13193,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, "node_modules/lodash.castarray": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", @@ -12591,6 +13313,15 @@ "node": ">=8" } }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -12760,6 +13491,90 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-mdx": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-2.0.1.tgz", + "integrity": "sha512-38w5y+r8nyKlGvNjSEqWrhG0w5PmnRA+wnBvm+ulYCct7nsGYhFVb0lljS9bQav4psDAS1eGkP2LMVcZBi/aqw==", + "dependencies": { + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-mdx-expression": "^1.0.0", + "mdast-util-mdx-jsx": "^2.0.0", + "mdast-util-mdxjs-esm": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.3.2.tgz", + "integrity": "sha512-xIPmR5ReJDu/DHH1OoIT1HkuybIfRGYRywC+gJtI7qHjCJp/M9jrmBEJW22O8lskDWm562BX2W8TiAwRTb0rKA==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-2.1.4.tgz", + "integrity": "sha512-DtMn9CmVhVzZx3f+optVDF8yFgQVt7FghCRNdlIaS3X5Bnym3hZwPbg/XW86vdpKjlc1PVj26SpnLGeJBXD3JA==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "ccount": "^2.0.0", + "mdast-util-from-markdown": "^1.1.0", + "mdast-util-to-markdown": "^1.3.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-remove-position": "^4.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-1.3.1.tgz", + "integrity": "sha512-SXqglS0HrEvSdUEfoXFtcg7DRl7S2cwOXc7jkuusG472Mmjag34DUDeOJUZtl+BVnyeO1frIgVpHlNRWc2gk/w==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-3.0.1.tgz", + "integrity": "sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==", + "dependencies": { + "@types/mdast": "^3.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-hast": { "version": "12.3.0", "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz", @@ -12793,6 +13608,25 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-to-markdown": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz", + "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^3.0.0", + "mdast-util-to-string": "^3.0.0", + "micromark-util-decode-string": "^1.0.0", + "unist-util-visit": "^4.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", @@ -12834,14 +13668,12 @@ "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "engines": { "node": ">= 8" } @@ -12869,29 +13701,185 @@ } ], "dependencies": { - "@types/debug": "^4.0.0", - "debug": "^4.0.0", - "decode-named-character-reference": "^1.0.0", - "micromark-core-commonmark": "^1.0.1", - "micromark-factory-space": "^1.0.0", + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "micromark-core-commonmark": "^1.0.1", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-encode": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz", + "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-factory-destination": "^1.0.0", + "micromark-factory-label": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-factory-title": "^1.0.0", + "micromark-factory-whitespace": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-classify-character": "^1.0.0", + "micromark-util-html-tag-name": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "node_modules/micromark-extension-mdx-expression": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-1.0.8.tgz", + "integrity": "sha512-zZpeQtc5wfWKdzDsHRBY003H2Smg+PUi2REhqgIhdzAa5xonhP03FcXxqFSerFiNUr5AWmHpaNPQTBVOS4lrXw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/estree": "^1.0.0", + "micromark-factory-mdx-expression": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-events-to-acorn": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "node_modules/micromark-extension-mdx-expression/node_modules/@types/estree": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", + "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==" + }, + "node_modules/micromark-extension-mdx-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-1.0.5.tgz", + "integrity": "sha512-gPH+9ZdmDflbu19Xkb8+gheqEDqkSpdCEubQyxuz/Hn8DOXiXvrXeikOoBA71+e8Pfi0/UYmU3wW3H58kr7akA==", + "dependencies": { + "@types/acorn": "^4.0.0", + "@types/estree": "^1.0.0", + "estree-util-is-identifier-name": "^2.0.0", + "micromark-factory-mdx-expression": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdx-jsx/node_modules/@types/estree": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", + "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==" + }, + "node_modules/micromark-extension-mdx-md": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-1.0.1.tgz", + "integrity": "sha512-7MSuj2S7xjOQXAjjkbjBsHkMtb+mDGVW6uI2dBL9snOBCbZmoNgDAeZ0nSn9j3T42UE/g2xVNMn18PJxZvkBEA==", + "dependencies": { + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-1.0.1.tgz", + "integrity": "sha512-7YA7hF6i5eKOfFUzZ+0z6avRG52GpWR8DL+kN47y3f2KhxbBZMhmxe7auOeaTBrW2DenbbZTf1ea9tA2hDpC2Q==", + "dependencies": { + "acorn": "^8.0.0", + "acorn-jsx": "^5.0.0", + "micromark-extension-mdx-expression": "^1.0.0", + "micromark-extension-mdx-jsx": "^1.0.0", + "micromark-extension-mdx-md": "^1.0.0", + "micromark-extension-mdxjs-esm": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs-esm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-1.0.5.tgz", + "integrity": "sha512-xNRBw4aoURcyz/S69B19WnZAkWJMxHMT5hE36GtDAyhoyn/8TuAeqjFJQlwk+MKQsUD7b3l7kFX+vlfVWgcX1w==", + "dependencies": { + "@types/estree": "^1.0.0", + "micromark-core-commonmark": "^1.0.0", "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-combine-extensions": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", + "micromark-util-events-to-acorn": "^1.0.0", "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "micromark-util-types": "^1.0.0", + "unist-util-position-from-estree": "^1.1.0", + "uvu": "^0.5.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/micromark-core-commonmark": { + "node_modules/micromark-extension-mdxjs-esm/node_modules/@types/estree": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", + "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==" + }, + "node_modules/micromark-extension-mdxjs/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/micromark-factory-destination": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz", - "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", + "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==", "funding": [ { "type": "GitHub Sponsors", @@ -12903,28 +13891,15 @@ } ], "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-factory-destination": "^1.0.0", - "micromark-factory-label": "^1.0.0", - "micromark-factory-space": "^1.0.0", - "micromark-factory-title": "^1.0.0", - "micromark-factory-whitespace": "^1.0.0", "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-classify-character": "^1.0.0", - "micromark-util-html-tag-name": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" + "micromark-util-types": "^1.0.0" } }, - "node_modules/micromark-factory-destination": { + "node_modules/micromark-factory-label": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", - "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz", + "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==", "funding": [ { "type": "GitHub Sponsors", @@ -12938,13 +13913,14 @@ "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" } }, - "node_modules/micromark-factory-label": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz", - "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==", + "node_modules/micromark-factory-mdx-expression": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-1.0.9.tgz", + "integrity": "sha512-jGIWzSmNfdnkJq05c7b0+Wv0Kfz3NJ3N4cBjnbO4zjXIlxJr+f8lk+5ZmwFvqdAbUy2q6B5rCY//g0QAAaXDWA==", "funding": [ { "type": "GitHub Sponsors", @@ -12956,12 +13932,21 @@ } ], "dependencies": { + "@types/estree": "^1.0.0", "micromark-util-character": "^1.0.0", + "micromark-util-events-to-acorn": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" + "unist-util-position-from-estree": "^1.0.0", + "uvu": "^0.5.0", + "vfile-message": "^3.0.0" } }, + "node_modules/micromark-factory-mdx-expression/node_modules/@types/estree": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", + "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==" + }, "node_modules/micromark-factory-space": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", @@ -13153,6 +14138,36 @@ } ] }, + "node_modules/micromark-util-events-to-acorn": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-1.2.3.tgz", + "integrity": "sha512-ij4X7Wuc4fED6UoLWkmo0xJQhsktfNh1J0m8g4PbIMPlx+ek/4YdW5mvbye8z/aZvAPUoxgXHrwVlXAPKMRp1w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/acorn": "^4.0.0", + "@types/estree": "^1.0.0", + "@types/unist": "^2.0.0", + "estree-util-visit": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0", + "vfile-message": "^3.0.0" + } + }, + "node_modules/micromark-util-events-to-acorn/node_modules/@types/estree": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", + "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==" + }, "node_modules/micromark-util-html-tag-name": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz", @@ -13279,7 +14294,6 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -13322,7 +14336,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, "engines": { "node": ">=6" } @@ -13537,6 +14550,20 @@ "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", "dev": true }, + "node_modules/nopt": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz", + "integrity": "sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==", + "dependencies": { + "abbrev": "^2.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -13728,11 +14755,18 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", + "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, "dependencies": { "path-key": "^3.0.0" }, @@ -17058,7 +18092,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -17205,6 +18238,25 @@ "node": ">=6" } }, + "node_modules/parse-entities": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", + "integrity": "sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -17332,8 +18384,7 @@ "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -17756,6 +18807,14 @@ "node": ">= 0.8" } }, + "node_modules/proc-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", + "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -18044,7 +19103,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, "funding": [ { "type": "github", @@ -18303,19 +19361,6 @@ "integrity": "sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg==", "dev": true }, - "node_modules/react-event-listener": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/react-event-listener/-/react-event-listener-0.6.6.tgz", - "integrity": "sha512-+hCNqfy7o9wvO6UgjqFmBzARJS7qrNoda0VqzvOuioEpoEXKutiKuv92dSz6kP7rYLmyHPyYNLesi5t/aH1gfw==", - "dependencies": { - "@babel/runtime": "^7.2.0", - "prop-types": "^15.6.0", - "warning": "^4.0.1" - }, - "peerDependencies": { - "react": "^16.3.0" - } - }, "node_modules/react-fast-compare": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz", @@ -18404,9 +19449,9 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, "node_modules/react-player": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/react-player/-/react-player-2.12.0.tgz", - "integrity": "sha512-rymLRz/2GJJD+Wc01S7S+i9pGMFYnNmQibR2gVE3KmHJCBNN8BhPAlOPTGZtn1uKpJ6p4RPLlzPQ1OLreXd8gw==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/react-player/-/react-player-2.13.0.tgz", + "integrity": "sha512-gkY7ZdbVFztlKFFhCPcnDrFQm+L399b8fhWsKatZ+b2wpKJwfUHBXQFMRxqYQGT0ic1/wQ7D7EZEWy7ZBqk2pw==", "dependencies": { "deepmerge": "^4.0.0", "load-script": "^1.0.0", @@ -18484,91 +19529,6 @@ "node": ">=0.10.0" } }, - "node_modules/react-swipeable-views": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/react-swipeable-views/-/react-swipeable-views-0.14.0.tgz", - "integrity": "sha512-wrTT6bi2nC3JbmyNAsPXffUXLn0DVT9SbbcFr36gKpbaCgEp7rX/OFxsu5hPc/NBsUhHyoSRGvwqJNNrWTwCww==", - "dependencies": { - "@babel/runtime": "7.0.0", - "prop-types": "^15.5.4", - "react-swipeable-views-core": "^0.14.0", - "react-swipeable-views-utils": "^0.14.0", - "warning": "^4.0.1" - }, - "engines": { - "node": ">=6.0.0" - }, - "peerDependencies": { - "react": "^15.3.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/react-swipeable-views-core": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/react-swipeable-views-core/-/react-swipeable-views-core-0.14.0.tgz", - "integrity": "sha512-0W/e9uPweNEOSPjmYtuKSC/SvKKg1sfo+WtPdnxeLF3t2L82h7jjszuOHz9C23fzkvLfdgkaOmcbAxE9w2GEjA==", - "dependencies": { - "@babel/runtime": "7.0.0", - "warning": "^4.0.1" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/react-swipeable-views-core/node_modules/@babel/runtime": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0.tgz", - "integrity": "sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA==", - "dependencies": { - "regenerator-runtime": "^0.12.0" - } - }, - "node_modules/react-swipeable-views-core/node_modules/regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" - }, - "node_modules/react-swipeable-views-utils": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/react-swipeable-views-utils/-/react-swipeable-views-utils-0.14.0.tgz", - "integrity": "sha512-W+fXBOsDqgFK1/g7MzRMVcDurp3LqO3ksC8UgInh2P/tKgb5DusuuB1geKHFc6o1wKl+4oyER4Zh3Lxmr8xbXA==", - "dependencies": { - "@babel/runtime": "7.0.0", - "keycode": "^2.1.7", - "prop-types": "^15.6.0", - "react-event-listener": "^0.6.0", - "react-swipeable-views-core": "^0.14.0", - "shallow-equal": "^1.2.1" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/react-swipeable-views-utils/node_modules/@babel/runtime": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0.tgz", - "integrity": "sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA==", - "dependencies": { - "regenerator-runtime": "^0.12.0" - } - }, - "node_modules/react-swipeable-views-utils/node_modules/regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" - }, - "node_modules/react-swipeable-views/node_modules/@babel/runtime": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0.tgz", - "integrity": "sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA==", - "dependencies": { - "regenerator-runtime": "^0.12.0" - } - }, - "node_modules/react-swipeable-views/node_modules/regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" - }, "node_modules/react-transition-group": { "version": "4.4.5", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", @@ -18612,6 +19572,26 @@ "unzipper": "^0.10.11" } }, + "node_modules/read-package-json-fast": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", + "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", + "dependencies": { + "json-parse-even-better-errors": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json-fast/node_modules/json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -18718,7 +19698,6 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -18965,6 +19944,19 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-mdx": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-2.3.0.tgz", + "integrity": "sha512-g53hMkpM0I98MU266IzDFMrTD980gNF3BJnkyFcmN+dD873mQeD5rdMO3Y2X+x8umQfbSE0PcoEDl7ledSA+2g==", + "dependencies": { + "mdast-util-mdx": "^2.0.0", + "micromark-extension-mdxjs": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-parse": { "version": "10.0.2", "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.2.tgz", @@ -19053,6 +20045,20 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-stringify": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-10.0.3.tgz", + "integrity": "sha512-koyOzCMYoUHudypbj4XpnAKFbkddRMYZHwghnxd7ue5210WzGw6kOBwauJTRUMq16jsovXx8dYNvSSWP89kZ3A==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/request-progress": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", @@ -19114,12 +20120,12 @@ "integrity": "sha512-PdjHqho8+kI7AIC3DlLgD99H8zzHphzpIhyv2skVtWaSJGK819+ZqWMC3mHEtSjlcFoYaLXliNt8sb6Taa2Mpg==" }, "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", "dev": true, "dependencies": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -19155,7 +20161,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -19264,29 +20269,83 @@ "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/rtcpeerconnection-shim": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/rtcpeerconnection-shim/-/rtcpeerconnection-shim-1.2.15.tgz", + "integrity": "sha512-C6DxhXt7bssQ1nHb154lqeL0SXz5Dx4RczXZu2Aa/L1NJFnEVDxFwCBo3fqtuljhHIGceg5JKBV4XJ0gW5JKyw==", + "dependencies": { + "sdp": "^2.6.0" + }, + "engines": { + "node": ">=6.0.0", + "npm": ">=3.10.0" + } + }, + "node_modules/run-applescript": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", + "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==", + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" }, "engines": { - "node": ">= 10.13.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/rtcpeerconnection-shim": { - "version": "1.2.15", - "resolved": "https://registry.npmjs.org/rtcpeerconnection-shim/-/rtcpeerconnection-shim-1.2.15.tgz", - "integrity": "sha512-C6DxhXt7bssQ1nHb154lqeL0SXz5Dx4RczXZu2Aa/L1NJFnEVDxFwCBo3fqtuljhHIGceg5JKBV4XJ0gW5JKyw==", - "dependencies": { - "sdp": "^2.6.0" + "node_modules/run-applescript/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "engines": { + "node": ">=10" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "engines": { - "node": ">=6.0.0", - "npm": ">=3.10.0" + "node": ">=10.17.0" } }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -19549,11 +20608,6 @@ "node": ">=8" } }, - "node_modules/shallow-equal": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/shallow-equal/-/shallow-equal-1.2.1.tgz", - "integrity": "sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==" - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -19589,8 +20643,7 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/simple-update-notifier": { "version": "1.1.0", @@ -19837,7 +20890,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -19968,6 +21020,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/stringify-entities": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz", + "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/stringify-object": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", @@ -20027,7 +21092,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, "engines": { "node": ">=6" } @@ -20143,6 +21207,21 @@ "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.17.tgz", "integrity": "sha512-AsS729u2RHUfEra9xJrE39peJcc2stq2+poBXX8bcM08Y6g9j/i/PUzwNQqkaJde7Ntg1TO7bSREbR5sdosQ+g==" }, + "node_modules/synckit": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", + "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", + "dependencies": { + "@pkgr/utils": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/tailwindcss": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz", @@ -20511,6 +21590,17 @@ "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" }, + "node_modules/titleize": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", + "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", @@ -20548,6 +21638,19 @@ "node": ">=8.0" } }, + "node_modules/to-vfile": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-7.2.4.tgz", + "integrity": "sha512-2eQ+rJ2qGbyw3senPI0qjuM7aut8IYXK6AEoOWb+fJx/mQYzviTckm1wDjq91QYHAPBTYzmdJXxMFA6Mk14mdw==", + "dependencies": { + "is-buffer": "^2.0.0", + "vfile": "^5.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/tocbot": { "version": "4.21.0", "resolved": "https://registry.npmjs.org/tocbot/-/tocbot-4.21.0.tgz", @@ -20807,8 +21910,7 @@ "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "dev": true + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typescript": { "version": "5.1.6", @@ -20850,6 +21952,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -20908,6 +22016,120 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unified-engine": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified-engine/-/unified-engine-10.1.0.tgz", + "integrity": "sha512-5+JDIs4hqKfHnJcVCxTid1yBoI/++FfF/1PFdSMpaftZZZY+qg2JFruRbf7PaIwa9KgLotXQV3gSjtY0IdcFGQ==", + "dependencies": { + "@types/concat-stream": "^2.0.0", + "@types/debug": "^4.0.0", + "@types/is-empty": "^1.0.0", + "@types/node": "^18.0.0", + "@types/unist": "^2.0.0", + "concat-stream": "^2.0.0", + "debug": "^4.0.0", + "fault": "^2.0.0", + "glob": "^8.0.0", + "ignore": "^5.0.0", + "is-buffer": "^2.0.0", + "is-empty": "^1.0.0", + "is-plain-obj": "^4.0.0", + "load-plugin": "^5.0.0", + "parse-json": "^6.0.0", + "to-vfile": "^7.0.0", + "trough": "^2.0.0", + "unist-util-inspect": "^7.0.0", + "vfile-message": "^3.0.0", + "vfile-reporter": "^7.0.0", + "vfile-statistics": "^2.0.0", + "yaml": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-engine/node_modules/@types/node": { + "version": "18.18.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", + "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==" + }, + "node_modules/unified-engine/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/unified-engine/node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/unified-engine/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/unified-engine/node_modules/lines-and-columns": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", + "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/unified-engine/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/unified-engine/node_modules/parse-json": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-6.0.2.tgz", + "integrity": "sha512-SA5aMiaIjXkAiBrW/yPgLgQAQg42f7K3ACO+2l/zOvtQBwX58DMUsFJXelW2fx3yMBmWOVkR6j1MGsdSbCA4UA==", + "dependencies": { + "@babel/code-frame": "^7.16.0", + "error-ex": "^1.3.2", + "json-parse-even-better-errors": "^2.3.1", + "lines-and-columns": "^2.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/unique-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", @@ -20929,6 +22151,18 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unist-util-inspect": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/unist-util-inspect/-/unist-util-inspect-7.0.2.tgz", + "integrity": "sha512-Op0XnmHUl6C2zo/yJCwhXQSm/SmW22eDZdWP2qdf4WpGrgO1ZxFodq+5zFyeRGasFjJotAnLgfuD1jkcKqiH1Q==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/unist-util-is": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", @@ -20953,6 +22187,31 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unist-util-position-from-estree": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-1.1.2.tgz", + "integrity": "sha512-poZa0eXpS+/XpoQwGwl79UUdea4ol2ZuCYguVaJS4qzIOMDzbqz8a3erUCOmubSZkaOuGamb3tX790iwOIROww==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-remove-position": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-4.0.2.tgz", + "integrity": "sha512-TkBb0HABNmxzAcfLf4qsIbFbaPDvMO6wa3b3j4VcEzFVaw1LBKwnW4/sRJ/atSLSzoIg41JWEdnE7N6DIhGDGQ==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/unist-util-stringify-position": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", @@ -21034,7 +22293,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "dev": true, "engines": { "node": ">=8" } @@ -21208,9 +22466,13 @@ } }, "node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } @@ -21338,6 +22600,103 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/vfile-reporter": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-7.0.5.tgz", + "integrity": "sha512-NdWWXkv6gcd7AZMvDomlQbK3MqFWL1RlGzMn++/O2TI+68+nqxCPTvLugdOtfSzXmjh+xUyhp07HhlrbJjT+mw==", + "dependencies": { + "@types/supports-color": "^8.0.0", + "string-width": "^5.0.0", + "supports-color": "^9.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile": "^5.0.0", + "vfile-message": "^3.0.0", + "vfile-sort": "^3.0.0", + "vfile-statistics": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-reporter/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/vfile-reporter/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/vfile-reporter/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/vfile-reporter/node_modules/supports-color": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", + "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/vfile-sort": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/vfile-sort/-/vfile-sort-3.0.1.tgz", + "integrity": "sha512-1os1733XY6y0D5x0ugqSeaVJm9lYgj0j5qdcZQFyxlZOSy1jYarL77lLyb5gK4Wqr1d5OxmuyflSO3zKyFnTFw==", + "dependencies": { + "vfile": "^5.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-statistics": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/vfile-statistics/-/vfile-statistics-2.0.1.tgz", + "integrity": "sha512-W6dkECZmP32EG/l+dp2jCLdYzmnDBIw6jwiLZSER81oR5AHRcVqL+k3Z+pfH1R73le6ayDkJRMk0sutj1bMVeg==", + "dependencies": { + "vfile": "^5.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/vite": { "version": "4.4.7", "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.7.tgz", @@ -21437,6 +22796,11 @@ "node": ">=0.10.0" } }, + "node_modules/walk-up-path": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-3.0.1.tgz", + "integrity": "sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA==" + }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -21446,14 +22810,6 @@ "makeerror": "1.0.12" } }, - "node_modules/warning": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", - "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -22076,7 +23432,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", - "dev": true, "engines": { "node": ">= 14" } diff --git a/package.json b/package.json index 2e894f22288..ca3f6920a12 100644 --- a/package.json +++ b/package.json @@ -69,11 +69,11 @@ "dayjs": "^1.11.9", "echarts": "^5.4.2", "echarts-for-react": "^3.0.2", + "eslint-mdx": "^2.2.0", "events": "^3.3.0", "i18next": "^23.2.7", "i18next-browser-languagedetector": "^7.1.0", - "libphonenumber-js": "^1.10.37", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "postcss-loader": "^7.3.3", "qrcode.react": "^3.1.0", "raviger": "^4.1.2", @@ -87,10 +87,9 @@ "react-google-recaptcha": "^3.1.0", "react-i18next": "^13.0.1", "react-markdown": "^8.0.7", - "react-player": "^2.12.0", + "react-player": "^2.13.0", "react-qr-reader": "^2.2.1", "react-redux": "^8.1.1", - "react-swipeable-views": "^0.14.0", "react-transition-group": "^4.4.5", "react-webcam": "^7.1.1", "read-excel-file": "^5.6.1", @@ -99,7 +98,7 @@ "rehype-raw": "^6.1.1", "rescript-webapi": "^0.8.0", "use-keyboard-shortcut": "^1.1.6", - "uuid": "^9.0.0" + "uuid": "^9.0.1" }, "devDependencies": { "@storybook/addon-essentials": "^7.0.26", @@ -115,7 +114,7 @@ "@types/cypress": "^1.1.3", "@types/echarts": "^4.9.18", "@types/google.maps": "^3.53.4", - "@types/lodash": "^4.14.195", + "@types/lodash-es": "^4.17.9", "@types/lodash.get": "^4.4.7", "@types/node": "^20.4.0", "@types/prop-types": "*", @@ -126,13 +125,12 @@ "@types/react-dom": "^18.2.6", "@types/react-google-recaptcha": "^2.1.5", "@types/react-qr-reader": "^2.1.4", - "@types/react-swipeable-views": "^0.13.2", "@types/react-transition-group": "^4.4.6", "@typescript-eslint/eslint-plugin": "^5.61.0", "@typescript-eslint/parser": "^5.61.0", "@vitejs/plugin-react-swc": "^3.3.2", "autoprefixer": "^10.4.14", - "cypress": "^13.1.0", + "cypress": "^13.5.0", "cypress-localstorage-commands": "^2.2.3", "eslint": "^8.44.0", "eslint-config-prettier": "^8.8.0", @@ -140,6 +138,7 @@ "eslint-plugin-i18next": "^6.0.3", "eslint-plugin-import": "^2.27.5", "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-mdx": "^2.2.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-only-warn": "^1.1.0", "eslint-plugin-prettier": "^4.2.1", @@ -185,21 +184,6 @@ "git update-index --again" ] }, - "eslintConfig": { - "extends": [ - "react-app" - ], - "overrides": [ - { - "files": [ - "**/*.stories.*" - ], - "rules": { - "import/no-anonymous-default-export": "off" - } - } - ] - }, "engines": { "node": "18.x" } diff --git a/public/config.json b/public/config.json index 8bb0dab3b57..444362cfb20 100644 --- a/public/config.json +++ b/public/config.json @@ -5,12 +5,12 @@ "site_url": "care.coronasafe.in", "analytics_server_url": "https://plausible.10bedicu.in", "header_logo": { - "light":"https://cdn.coronasafe.network/header_logo.png", - "dark":"https://cdn.coronasafe.network/header_logo.png" + "light": "https://cdn.coronasafe.network/header_logo.png", + "dark": "https://cdn.coronasafe.network/header_logo.png" }, "main_logo": { - "light":"https://cdn.coronasafe.network/light-logo.svg", - "dark":"https://cdn.coronasafe.network/black-logo.svg" + "light": "https://cdn.coronasafe.network/light-logo.svg", + "dark": "https://cdn.coronasafe.network/black-logo.svg" }, "gmaps_api_key": "AIzaSyDsBAc3y7deI5ZO3NtK5GuzKwtUzQNJNUk", "gov_data_api_key": "579b464db66ec23bdd000001cdd3946e44ce4aad7209ff7b23ac571b", diff --git a/src/App.tsx b/src/App.tsx index e00ca18f652..f89dfd11e74 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,111 +1,28 @@ -import * as Sentry from "@sentry/browser"; - -import { FC, Suspense, lazy, useEffect, useState } from "react"; -import { getConfig, getCurrentUser } from "./Redux/actions"; -import { statusType, useAbortableEffect } from "./Common/utils"; -import { useDispatch, useSelector } from "react-redux"; - -import AppRouter from "./Router/AppRouter"; -import { HistoryAPIProvider } from "./CAREUI/misc/HistoryAPIProvider"; -import { AppConfigContext, IConfig } from "./Common/hooks/useConfig"; -import { LocalStorageKeys } from "./Common/constants"; -import Plausible from "./Components/Common/Plausible"; -import SessionRouter from "./Router/SessionRouter"; -import axios from "axios"; -import { AuthUserContext } from "./Common/hooks/useAuthUser"; - -const Loading = lazy(() => import("./Components/Common/Loading")); - -const App: FC = () => { - const dispatch: any = useDispatch(); - const state: any = useSelector((state) => state); - const { currentUser, config } = state; - const [user, setUser] = useState(null); - - useAbortableEffect(async () => { - const res = await dispatch(getConfig()); - if (res.data && res.status < 400) { - const config = res.data as IConfig; - - if (config?.sentry_dsn && import.meta.env.PROD) { - Sentry.init({ - environment: config.sentry_environment, - dsn: config.sentry_dsn, - }); - } - - localStorage.setItem("config", JSON.stringify(config)); - } - }, [dispatch]); - - const updateRefreshToken = () => { - const refresh = localStorage.getItem(LocalStorageKeys.refreshToken); - // const access = localStorage.getItem(LocalStorageKeys.accessToken); - // if (!access && refresh) { - // localStorage.removeItem(LocalStorageKeys.refreshToken); - // document.location.reload(); - // return; - // } - if (!refresh) { - return; - } - axios - .post("/api/v1/auth/token/refresh/", { - refresh, - }) - .then((resp) => { - localStorage.setItem(LocalStorageKeys.accessToken, resp.data.access); - localStorage.setItem(LocalStorageKeys.refreshToken, resp.data.refresh); - }); - }; - useEffect(() => { - updateRefreshToken(); - setInterval(updateRefreshToken, 5 * 60 * 1000); - }, [user]); - - useAbortableEffect( - async (status: statusType) => { - const res = await dispatch(getCurrentUser()); - if (!status.aborted && res && res.statusCode === 200) { - setUser(res.data); - } - }, - [dispatch] - ); - - useEffect(() => { - const darkThemeMq = window.matchMedia("(prefers-color-scheme: dark)"); - const favicon: any = document.querySelector("link[rel~='icon']"); - if (darkThemeMq.matches) { - favicon.href = "/favicon-light.ico"; - } else { - favicon.href = "/favicon.ico"; - } - }, []); - - if ( - !currentUser || - currentUser.isFetching || - !config || - config.isFetching || - !config.data - ) { - return ; - } - +import { Suspense } from "react"; +import Routers from "./Routers"; +import { + AppConfigProvider, + AuthUserProvider, + HistoryAPIProvider, +} from "./Providers"; +import ThemedFavicon from "./CAREUI/misc/ThemedFavicon"; +import Intergrations from "./Integrations"; +import Loading from "./Components/Common/Loading"; + +const App = () => { return ( }> + - - {currentUser?.data ? ( - - - - ) : ( - - )} - - + + }> + + + + {/* Integrations */} + + + ); diff --git a/src/CAREUI/display/Chip.tsx b/src/CAREUI/display/Chip.tsx index abc21711551..7bcbd6078e4 100644 --- a/src/CAREUI/display/Chip.tsx +++ b/src/CAREUI/display/Chip.tsx @@ -11,6 +11,7 @@ interface Props { text: string; tooltip?: string; className?: string; + id?: string; } export default function Chip({ @@ -21,6 +22,7 @@ export default function Chip({ }: Props) { return ( { > {`${name}: ${value}`} diff --git a/src/CAREUI/display/RecordMeta.tsx b/src/CAREUI/display/RecordMeta.tsx index 83928f1f23a..944ddf27c8f 100644 --- a/src/CAREUI/display/RecordMeta.tsx +++ b/src/CAREUI/display/RecordMeta.tsx @@ -1,5 +1,10 @@ import CareIcon from "../icons/CareIcon"; -import { formatDateTime, isUserOnline, relativeTime } from "../../Utils/utils"; +import { + formatDateTime, + formatName, + isUserOnline, + relativeTime, +} from "../../Utils/utils"; import { ReactNode } from "react"; interface Props { @@ -11,13 +16,14 @@ interface Props { last_name: string; last_login: string | undefined; }; + inlineUser?: boolean; } /** * A generic component to display relative time along with a tooltip and a user * if provided. */ -const RecordMeta = ({ time, user, prefix, className }: Props) => { +const RecordMeta = ({ time, user, prefix, className, inlineUser }: Props) => { const isOnline = user && isUserOnline(user); let child = ( @@ -25,14 +31,15 @@ const RecordMeta = ({ time, user, prefix, className }: Props) => { {relativeTime(time)} {formatDateTime(time)} - {user && ( - <> + {user && !inlineUser && ( + + by - {user.first_name} {user.last_name} + {formatName(user)} {isOnline && ( -
+
)} - + )}
@@ -43,7 +50,11 @@ const RecordMeta = ({ time, user, prefix, className }: Props) => {
{prefix} {child} + {user && inlineUser && by} {user && } + {user && inlineUser && ( + {formatName(user)} + )}
); } diff --git a/src/CAREUI/display/Timeline.tsx b/src/CAREUI/display/Timeline.tsx new file mode 100644 index 00000000000..7549fbfd69f --- /dev/null +++ b/src/CAREUI/display/Timeline.tsx @@ -0,0 +1,158 @@ +import { createContext, useContext } from "react"; +import { PerformedByModel } from "../../Components/HCX/misc"; +import { classNames, formatName } from "../../Utils/utils"; +import CareIcon, { IconName } from "../icons/CareIcon"; +import RecordMeta from "./RecordMeta"; + +export interface TimelineEvent { + type: TType; + timestamp: string; + by: PerformedByModel | undefined; + icon: IconName; + notes?: string; + cancelled?: boolean; +} + +interface TimelineProps { + className: string; + children: React.ReactNode | React.ReactNode[]; + name: string; +} + +const TimelineContext = createContext(""); + +export default function Timeline({ className, children, name }: TimelineProps) { + return ( +
+
    + + {children} + +
+
+ ); +} + +interface TimelineNodeProps { + event: TimelineEvent; + title?: React.ReactNode; + /** + * Used to add a suffix to the auto-generated title. Will be ignored if `title` is provided. + */ + titleSuffix?: React.ReactNode; + actions?: React.ReactNode; + className?: string; + children?: React.ReactNode; + name?: string; + isLast: boolean; +} + +export const TimelineNode = (props: TimelineNodeProps) => { + const name = useContext(TimelineContext); + + return ( +
  • +
    +
    +
    + +
    +
    +
    + {props.title || ( + +

    + {props.event.by && ( + + {formatName(props.event.by)}{" "} + + )} + {props.titleSuffix + ? props.titleSuffix + : `${props.event.type} the ${props.name || name}.`} +

    + {props.actions && ( + {props.actions} + )} + +
    + )} +
    +
    + +
    + {props.event.notes} + {props.children} +
    +
    +
  • + ); +}; + +interface TimelineNodeTitleProps { + children: React.ReactNode | React.ReactNode[]; + event: TimelineEvent; +} + +export const TimelineNodeTitle = (props: TimelineNodeTitleProps) => { + return ( + <> +
    +
    + +
    + {props.children} +
    + + ); +}; + +export const TimelineNodeActions = (props: { + children: React.ReactNode | React.ReactNode[]; +}) => { + return
    {props.children}
    ; +}; + +interface TimelineNodeNotesProps { + children?: React.ReactNode | React.ReactNode[]; + icon?: IconName; +} + +export const TimelineNodeNotes = ({ + children, + icon = "l-notes", +}: TimelineNodeNotesProps) => { + if (!children) { + return; + } + + return ( +
    + +
    {children}
    +
    + ); +}; diff --git a/src/CAREUI/interactive/FiltersSlideover.tsx b/src/CAREUI/interactive/FiltersSlideover.tsx index f396f03da79..9b2e5a29c29 100644 --- a/src/CAREUI/interactive/FiltersSlideover.tsx +++ b/src/CAREUI/interactive/FiltersSlideover.tsx @@ -3,11 +3,12 @@ import useFilters from "../../Common/hooks/useFilters"; import ButtonV2 from "../../Components/Common/components/ButtonV2"; import CareIcon from "../icons/CareIcon"; import SlideOver from "./SlideOver"; +import { ReactNode } from "react"; type AdvancedFilter = ReturnType["advancedFilter"]; interface Props { - children: any; + children: ReactNode | ReactNode[]; advancedFilter: AdvancedFilter; onClear?: () => void; onApply?: () => void; diff --git a/src/CAREUI/interactive/ScrollOverlay.tsx b/src/CAREUI/interactive/ScrollOverlay.tsx new file mode 100644 index 00000000000..c49f7223149 --- /dev/null +++ b/src/CAREUI/interactive/ScrollOverlay.tsx @@ -0,0 +1,30 @@ +import useVisibility from "../../Utils/useVisibility"; +import { classNames } from "../../Utils/utils"; + +interface Props { + className?: string; + children: React.ReactNode; + overlay: React.ReactNode; + disableOverlay?: boolean; +} + +export default function ScrollOverlay(props: Props) { + const [bottomIsVisible, ref] = useVisibility(); + const hasScrollContent = !props.disableOverlay && !bottomIsVisible; + + return ( +
    + {props.children} + +
    +
    + {hasScrollContent && props.overlay} +
    +
    + ); +} diff --git a/src/CAREUI/interactive/SlideOver.tsx b/src/CAREUI/interactive/SlideOver.tsx index 3eae13869cb..9fae2588fca 100644 --- a/src/CAREUI/interactive/SlideOver.tsx +++ b/src/CAREUI/interactive/SlideOver.tsx @@ -61,7 +61,7 @@ export default function SlideOver({ {}} > @@ -109,6 +109,7 @@ export default function SlideOver({ >