From bf944b3ac8a3b9d637e03d47bdcef37cedad2505 Mon Sep 17 00:00:00 2001 From: Jared White Date: Wed, 29 Nov 2023 12:28:06 -0800 Subject: [PATCH] feat: seeds button uptake (#3677) * feat: uptake Grid component from Seeds * feat: finish Grid component uptake * feat: update recent changes from main * fix: mangled syntax * fix: switch prop to class name * chore: address linting issues * fix: typo * fix: make sure old UIC labels look more modern * test: use new seeds classes in test selector * test: resolve issue with grid and Cypress selector * test: fix bad ids * feat: first round of uptake of Seeds Button * fix: grid and form layouts based on feedback * feat: add local Hero which uses Seeds system * chore: update StatusItem is with Button/Link * fix: remove old GridCell, tighten up spacing on Partners aside * feat: more replacements of Button and Link * feat: swap Button to use Seeds * fix: prettier * test: update tests to use button IDs * feat: update loading spinners to use new Button feature * chore: fix linking issues * test: fix some E2E test cases * test: fix submission issues with new buttons * test: add another type submit * test: finish fixing public E2E tests * test: button fixes in partners * test: add another type submit * test: use more generic button selectors * fix: preference grid and sign in button types * fix: missing gap between Edit and Delete * fix: clean up button color and preferences drawer * fix: preferences drawer columns * test: fix partners textarea issue * fix: other textarea issue * fix: more Cypress tests * fix: button scopes * fix: unit test --- shared-helpers/package.json | 3 +- shared-helpers/src/auth/Timeout.tsx | 8 +- .../forgot-password/FormForgotPassword.tsx | 9 +- .../src/views/sign-in/FormSignIn.tsx | 19 +- .../views/sign-in/ResendConfirmationModal.tsx | 26 +- .../__tests__/pages/settings/index.test.tsx | 4 +- .../cypress/e2e/default/03-listing.spec.ts | 180 ++++----- .../e2e/default/05-paperApplication.spec.ts | 2 +- .../default/06-admin-user-mangement.spec.ts | 16 +- ...risdictional-admin-user-management.spec.ts | 8 +- .../default/08-preference-management.spec.ts | 24 +- .../listings-approval.spec.ts | 22 +- sites/partners/cypress/support/commands.js | 20 +- sites/partners/package.json | 2 +- .../locale_overrides/general.json | 1 + .../src/components/applications/Aside.tsx | 60 +-- .../DetailsMemberDrawer.tsx | 6 +- .../sections/DetailsHouseholdMembers.tsx | 8 +- .../PaperApplicationForm/FormMember.tsx | 10 +- .../sections/FormHouseholdMembers.tsx | 35 +- .../listings/ListingFormActions.tsx | 111 +++--- .../PaperListingDetails/DetailsUnitDrawer.tsx | 6 +- .../sections/DetailApplicationDates.tsx | 29 +- .../sections/DetailUnits.tsx | 8 +- .../PaperListingForm/OpenHouseForm.tsx | 19 +- .../PaperListingForm/RequestChangesModal.tsx | 19 +- .../listings/PaperListingForm/UnitForm.tsx | 41 +- .../listings/PaperListingForm/index.tsx | 41 +- .../sections/ApplicationDates.tsx | 43 +-- .../sections/ApplicationTypes.tsx | 21 +- .../sections/BuildingSelectionCriteria.tsx | 35 +- .../sections/ListingPhotos.tsx | 22 +- .../sections/LotteryResults.tsx | 16 +- .../sections/SelectAndOrder.tsx | 32 +- .../PaperListingForm/sections/Units.tsx | 28 +- .../settings/PreferenceDeleteModal.tsx | 35 +- .../components/settings/PreferenceDrawer.tsx | 358 +++++++++--------- .../components/users/FormSignInAddPhone.tsx | 8 +- .../components/users/FormSignInMFACode.tsx | 11 +- .../components/users/FormSignInMFAType.tsx | 14 +- .../src/components/users/FormTerms.tsx | 14 +- .../src/components/users/FormUserConfirm.tsx | 7 +- .../src/components/users/FormUserManage.tsx | 39 +- .../users/ReRequestConfirmation.tsx | 10 +- .../src/pages/application/[id]/review.tsx | 27 +- sites/partners/src/pages/index.tsx | 37 +- .../listings/[id]/applications/index.tsx | 28 +- sites/partners/src/pages/reset-password.tsx | 5 +- sites/partners/src/pages/settings/index.tsx | 21 +- sites/partners/src/pages/sign-in.tsx | 2 +- sites/partners/src/pages/users/index.tsx | 16 +- sites/partners/styles/overrides.scss | 14 +- sites/public/cypress/e2e/navigation.spec.ts | 2 +- .../pages/application/contact/address.spec.ts | 2 +- .../application/household/add-members.spec.ts | 4 +- .../application/household/member.spec.ts | 4 +- .../application/review/confirmation.spec.ts | 2 +- .../pages/application/review/terms.spec.ts | 2 +- sites/public/cypress/support/commands.js | 46 ++- sites/public/cypress/support/index.d.ts | 1 + sites/public/next.config.js | 78 ++-- sites/public/package.json | 3 +- .../locale_overrides/general.json | 4 +- sites/public/postcss.config.js | 9 +- .../components/account/ConfirmationModal.tsx | 20 +- .../components/account/StatusItem.module.scss | 8 +- .../src/components/account/StatusItem.tsx | 13 +- .../ApplicationMultiselectQuestionStep.tsx | 19 +- .../components/applications/FormBackLink.tsx | 19 +- .../applications/HouseholdMemberForm.tsx | 12 +- .../applications/ValidateAddress.tsx | 9 +- .../src/components/listing/GetApplication.tsx | 38 +- .../src/components/page/Hero.module.scss | 80 ++++ sites/public/src/components/page/Hero.tsx | 24 ++ sites/public/src/pages/404.tsx | 7 +- sites/public/src/pages/_app.tsx | 51 ++- sites/public/src/pages/_error.tsx | 7 +- .../public/src/pages/account/applications.tsx | 14 +- sites/public/src/pages/account/edit.tsx | 18 +- .../pages/applications/contact/address.tsx | 12 +- .../contact/alternate-contact-contact.tsx | 11 +- .../contact/alternate-contact-name.tsx | 11 +- .../contact/alternate-contact-type.tsx | 9 +- .../src/pages/applications/contact/name.tsx | 11 +- .../pages/applications/financial/income.tsx | 11 +- .../pages/applications/financial/vouchers.tsx | 8 +- .../src/pages/applications/household/ada.tsx | 11 +- .../applications/household/add-members.tsx | 19 +- .../pages/applications/household/changes.tsx | 8 +- .../applications/household/live-alone.tsx | 21 +- .../pages/applications/household/member.tsx | 13 +- .../applications/household/members-info.tsx | 17 +- .../household/preferred-units.tsx | 5 +- .../pages/applications/household/student.tsx | 8 +- .../applications/preferences/general.tsx | 19 +- .../applications/review/confirmation.tsx | 13 +- .../applications/review/demographics.tsx | 5 +- .../src/pages/applications/review/summary.tsx | 10 +- .../src/pages/applications/review/terms.tsx | 9 +- .../src/pages/applications/start/autofill.tsx | 21 +- .../applications/start/choose-language.tsx | 24 +- .../applications/start/what-to-expect.tsx | 16 +- sites/public/src/pages/create-account.tsx | 18 +- sites/public/src/pages/index.tsx | 55 ++- sites/public/src/pages/reset-password.tsx | 5 +- sites/public/src/pages/sign-in.tsx | 2 +- sites/public/styles/overrides.scss | 5 + yarn.lock | 8 +- 108 files changed, 1175 insertions(+), 1286 deletions(-) create mode 100644 sites/public/src/components/page/Hero.module.scss create mode 100644 sites/public/src/components/page/Hero.tsx create mode 100644 sites/public/styles/overrides.scss diff --git a/shared-helpers/package.json b/shared-helpers/package.json index 439a29f16d..7c5aaf56e0 100644 --- a/shared-helpers/package.json +++ b/shared-helpers/package.json @@ -17,7 +17,8 @@ }, "dependencies": { "@bloom-housing/backend-core": "^7.13.0", - "@bloom-housing/ui-components": "12.0.21", + "@bloom-housing/ui-components": "12.0.29", + "@bloom-housing/ui-seeds": "^1.12.0", "axios-cookiejar-support": "4.0.6", "tough-cookie": "4.1.3" }, diff --git a/shared-helpers/src/auth/Timeout.tsx b/shared-helpers/src/auth/Timeout.tsx index 7e6e98a531..0fc0194ad5 100644 --- a/shared-helpers/src/auth/Timeout.tsx +++ b/shared-helpers/src/auth/Timeout.tsx @@ -1,15 +1,13 @@ import React, { createElement, FunctionComponent, useContext, useEffect, useState } from "react" import { AuthContext } from "./AuthContext" import { ConfigContext } from "./ConfigContext" +import { Button } from "@bloom-housing/ui-seeds" import { NavigationContext, - Button, Modal, setSiteAlertMessage, AlertTypes, t, - AppearanceStyleType, - AppearanceSizeType, } from "@bloom-housing/ui-components" const PROMPT_TIMEOUT = 60000 @@ -85,12 +83,12 @@ export const IdleTimeout: FunctionComponent = ({ const modalActions = [ , diff --git a/shared-helpers/src/views/forgot-password/FormForgotPassword.tsx b/shared-helpers/src/views/forgot-password/FormForgotPassword.tsx index e2c4ec256a..19dd9930c1 100644 --- a/shared-helpers/src/views/forgot-password/FormForgotPassword.tsx +++ b/shared-helpers/src/views/forgot-password/FormForgotPassword.tsx @@ -1,7 +1,6 @@ import React, { useContext } from "react" +import { Button } from "@bloom-housing/ui-seeds" import { - AppearanceStyleType, - Button, Field, Form, FormCard, @@ -90,12 +89,10 @@ const FormForgotPassword = ({ />
- +
-
diff --git a/shared-helpers/src/views/sign-in/FormSignIn.tsx b/shared-helpers/src/views/sign-in/FormSignIn.tsx index f6518ae42e..cd2c62bdb4 100644 --- a/shared-helpers/src/views/sign-in/FormSignIn.tsx +++ b/shared-helpers/src/views/sign-in/FormSignIn.tsx @@ -1,15 +1,6 @@ import React, { useContext } from "react" -import { - AppearanceStyleType, - Button, - Field, - Form, - FormCard, - Icon, - LinkButton, - NavigationContext, - t, -} from "@bloom-housing/ui-components" +import { Field, Form, FormCard, Icon, NavigationContext, t } from "@bloom-housing/ui-components" +import { Button } from "@bloom-housing/ui-seeds" import { FormSignInErrorBox } from "./FormSignInErrorBox" import { NetworkStatus } from "../../auth/catchNetworkError" import type { UseFormMethods } from "react-hook-form" @@ -87,7 +78,7 @@ const FormSignIn = ({ />
-
@@ -97,7 +88,9 @@ const FormSignIn = ({

{t("authentication.createAccount.noAccount")}

- {t("account.createAccount")} +
)} diff --git a/shared-helpers/src/views/sign-in/ResendConfirmationModal.tsx b/shared-helpers/src/views/sign-in/ResendConfirmationModal.tsx index 6a1e4e1319..7ffab88bc2 100644 --- a/shared-helpers/src/views/sign-in/ResendConfirmationModal.tsx +++ b/shared-helpers/src/views/sign-in/ResendConfirmationModal.tsx @@ -1,13 +1,5 @@ -import { - AppearanceStyleType, - Button, - Modal, - t, - Form, - Field, - emailRegex, - AppearanceSizeType, -} from "@bloom-housing/ui-components" +import { Modal, t, Form, Field, Icon, emailRegex } from "@bloom-housing/ui-components" +import { Button } from "@bloom-housing/ui-seeds" import React, { useEffect, useMemo } from "react" import { useForm } from "react-hook-form" @@ -16,7 +8,7 @@ export type ResendConfirmationModalProps = { initialEmailValue: string onClose: () => void onSubmit: (email: string) => void - loading: boolean + loadingMessage?: string } export type ResendConfirmationModalForm = { @@ -26,7 +18,7 @@ export type ResendConfirmationModalForm = { const ResendConfirmationModal = ({ isOpen, initialEmailValue, - loading, + loadingMessage, onClose, onSubmit, }: ResendConfirmationModalProps) => { @@ -65,21 +57,21 @@ const ResendConfirmationModal = ({ actions={[ , , diff --git a/sites/partners/__tests__/pages/settings/index.test.tsx b/sites/partners/__tests__/pages/settings/index.test.tsx index 2000cf8057..b443046694 100644 --- a/sites/partners/__tests__/pages/settings/index.test.tsx +++ b/sites/partners/__tests__/pages/settings/index.test.tsx @@ -177,7 +177,7 @@ describe("settings", () => { await findByText(multiselectQuestionPreference.text) // Add a preference - fireEvent.click(getByTestId("preference-add-item")) + fireEvent.click(getByText("Add item")) expect(getByText("Add Preference")).toBeInTheDocument() // Add a preference option @@ -222,7 +222,7 @@ describe("settings", () => { await findByText(multiselectQuestionPreference.text) // Add a preference - fireEvent.click(getByTestId("preference-add-item")) + fireEvent.click(getByText("Add item")) expect(getByText("Add Preference")).toBeInTheDocument() // Add a preference option diff --git a/sites/partners/cypress/e2e/default/03-listing.spec.ts b/sites/partners/cypress/e2e/default/03-listing.spec.ts index 22936abaeb..a0087e0483 100644 --- a/sites/partners/cypress/e2e/default/03-listing.spec.ts +++ b/sites/partners/cypress/e2e/default/03-listing.spec.ts @@ -9,7 +9,7 @@ describe("Listing Management Tests", () => { it("full listing publish", () => { cy.visit("/") - cy.get("a > .button").contains("Add Listing").click() + cy.get("a").contains("Add Listing").click() cy.contains("New Listing") cy.fixture("listing").then((listing) => { fillOutListing(cy, listing) @@ -21,10 +21,10 @@ describe("Listing Management Tests", () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any function fillOutListing(cy: Cypress.cy, listing: any): void { cy.getByID("jurisdiction.id").select(listing["jurisdiction.id"]) - cy.get("#name").type(listing["name"]) - cy.get("#developer").type(listing["developer"]) + cy.getByID("name").type(listing["name"]) + cy.getByID("developer").type(listing["developer"]) // Test photo upload - cy.getByTestId("add-photos-button").contains("Add Photo").click() + cy.getByID("add-photos-button").contains("Add Photo").click() cy.getByTestId("dropzone-input").attachFile( "cypress-automated-image-upload-071e2ab9-5a52-4f34-85f0-e41f696f4b96.jpeg", { @@ -35,13 +35,13 @@ describe("Listing Management Tests", () => { .find("img") .should("have.attr", "src") .should("include", "cypress-automated-image-upload-071e2ab9-5a52-4f34-85f0-e41f696f4b96") - cy.getByTestId("listing-photo-uploaded").contains("Save").click() + cy.getByID("listing-photo-uploaded").contains("Save").click() cy.getByTestId("photos-table") .find("img") .should("have.attr", "src") .should("include", "cypress-automated-image-upload-071e2ab9-5a52-4f34-85f0-e41f696f4b96") - cy.getByTestId("add-photos-button").contains("Edit Photos").click() + cy.getByID("add-photos-button").contains("Edit Photos").click() cy.getByTestId("dropzone-input").attachFile( "cypress-automated-image-upload-46806882-b98d-49d7-ac83-8016ab4b2f08.jpg", { @@ -53,7 +53,7 @@ describe("Listing Management Tests", () => { .eq(1) .should("have.attr", "src") .should("include", "cypress-automated-image-upload-46806882-b98d-49d7-ac83-8016ab4b2f08") - cy.getByTestId("listing-photo-uploaded").contains("Save").click() + cy.getByID("listing-photo-uploaded").contains("Save").click() cy.getByTestId("photos-table") .find("img") .eq(1) @@ -74,7 +74,7 @@ describe("Listing Management Tests", () => { cy.getByID("reservedCommunityDescription").type(listing["reservedCommunityDescription"]) cy.getByTestId("unit-types").check() cy.getByTestId("listingAvailability.availableUnits").check() - cy.get("#addUnitsButton").contains("Add Unit").click() + cy.getByID("addUnitsButton").contains("Add Unit").click() cy.getByID("number").type(listing["number"]) cy.getByID("unitType.id").select(listing["unitType.id"]) cy.getByID("numBathrooms").select(listing["numBathrooms"]) @@ -82,21 +82,21 @@ describe("Listing Management Tests", () => { cy.getByID("sqFeet").type(listing["sqFeet"]) cy.getByID("minOccupancy").select(listing["minOccupancy"]) cy.getByID("maxOccupancy").select(listing["maxOccupancy"]) - cy.get("#fixed").check() + cy.getByID("fixed").check() cy.getByID("monthlyIncomeMin").type(listing["monthlyIncomeMin"]) cy.getByID("monthlyRent").type(listing["monthlyRent"]) cy.getByID("priorityType.id").select(listing["priorityType.id"]) - cy.get(".mt-6 > .is-primary").contains("Save & Exit").click() - cy.get("#add-preferences-button").contains("Add Preference").click() - cy.get(".border > .button").contains("Select Preferences").click() + cy.get("button").contains("Save & Exit").click() + cy.getByID("add-preferences-button").contains("Add Preference").click() + cy.get(".border > button").contains("Select Preferences").click() cy.get( ":nth-child(1) > .seeds-grid > .seeds-grid-row > .seeds-grid-cell > .field > div > .label" ) .contains("Live/Work in County") .click() - cy.get("#addPreferenceSaveButton").contains("Save").click() + cy.getByID("addPreferenceSaveButton").contains("Save").click() - cy.get(".drawer__content > .is-primary").contains("Save").click() + cy.get(".drawer__content > button").contains("Save").click() cy.getByID("applicationFee").type(listing["applicationFee"]) cy.getByID("depositMin").type(listing["depositMin"]) cy.getByID("depositMax").type(listing["depositMax"]) @@ -114,29 +114,29 @@ describe("Listing Management Tests", () => { cy.getByID("creditHistory").type(listing["creditHistory"]) cy.getByID("rentalHistory").type(listing["rentalHistory"]) cy.getByID("criminalBackground").type(listing["criminalBackground"]) - cy.get("#addBuildingSelectionCriteriaButton") + cy.getByID("addBuildingSelectionCriteriaButton") .contains("Add Building Selection Criteria") .click() - cy.get("#criteriaAttachTypeURL").check() + cy.getByID("criteriaAttachTypeURL").check() cy.getByID("buildingSelectionCriteriaURL").type(listing["buildingSelectionCriteriaURL"]) - cy.get(".p-4 > .is-primary").contains("Save").click() + cy.get(".drawer button").contains("Save").click() cy.getByID("requiredDocuments").type(listing["requiredDocuments"]) cy.getByID("programRules").type(listing["programRules"]) cy.getByID("specialNotes").type(listing["specialNotes"]) - cy.get(".text-right > .button").contains("Application Process").click() - cy.get("#reviewOrderFCFS").check() - cy.get("#dueDateQuestionNo").check() - cy.get("#waitlistOpenNo").check() + cy.get("button").contains("Application Process").click() + cy.getByID("reviewOrderFCFS").check() + cy.getByID("dueDateQuestionNo").check() + cy.getByID("waitlistOpenNo").check() cy.getByID("leasingAgentName").type(listing["leasingAgentName"]) cy.getByID("leasingAgentEmail").type(listing["leasingAgentEmail"]) cy.getByID("leasingAgentPhone").type(listing["leasingAgentPhone"]) cy.getByID("leasingAgentTitle").type(listing["leasingAgentTitle"]) cy.getByID("leasingAgentOfficeHours").type(listing["leasingAgentOfficeHours"]) - cy.get("#digitalApplicationChoiceYes").check() - cy.get("#commonDigitalApplicationChoiceNo").check() - cy.get("#customOnlineApplicationUrl").type(listing["url"]) - cy.get("#paperApplicationNo").check() - cy.get("#referralOpportunityNo").check() + cy.getByID("digitalApplicationChoiceYes").check() + cy.getByID("commonDigitalApplicationChoiceNo").check() + cy.getByID("customOnlineApplicationUrl").type(listing["url"]) + cy.getByID("paperApplicationNo").check() + cy.getByID("referralOpportunityNo").check() cy.getByID("leasingAgentAddress.street").type(listing["leasingAgentAddress.street"]) cy.getByID("leasingAgentAddress.street2").type(listing["leasingAgentAddress.street2"]) @@ -144,17 +144,17 @@ describe("Listing Management Tests", () => { cy.getByID("leasingAgentAddress.zipCode").type(listing["leasingAgentAddress.zipCode"]) cy.getByID("leasingAgentAddress.state").select(listing["leasingAgentAddress.state"]) - cy.get("#applicationsMailedInYes").check() - cy.get("#mailInAnotherAddress").check() + cy.getByID("applicationsMailedInYes").check() + cy.getByID("mailInAnotherAddress").check() cy.getByTestId("mailing-address-street").type(listing["leasingAgentAddress.street"]) cy.getByTestId("mailing-address-street2").type(listing["leasingAgentAddress.street2"]) cy.getByTestId("mailing-address-city").type(listing["leasingAgentAddress.city"]) cy.getByTestId("mailing-address-zip").type(listing["leasingAgentAddress.zipCode"]) cy.getByTestId("mailing-address-state").select(listing["leasingAgentAddress.state"]) - cy.get("#applicationsPickedUpNo").check() - cy.get("#applicationsDroppedOffNo").check() - cy.get("#postmarksConsideredYes").check() + cy.getByID("applicationsPickedUpNo").check() + cy.getByID("applicationsDroppedOffNo").check() + cy.getByID("postmarksConsideredYes").check() cy.getByTestId("postmark-date-field-month").type("12") cy.getByTestId("postmark-date-field-day").type("17") cy.getByTestId("postmark-date-field-year").type("2022") @@ -165,7 +165,7 @@ describe("Listing Management Tests", () => { listing["additionalApplicationSubmissionNotes"] ) - cy.get("#addOpenHouseButton").contains("Add Open House").click() + cy.getByID("addOpenHouseButton").contains("Add Open House").click() cy.getByID("date.month").type(listing["date.month"]) cy.getByID("date.day").type(listing["date.day"]) @@ -179,10 +179,10 @@ describe("Listing Management Tests", () => { cy.getByID("note").type(listing["note"]) cy.getByID("startTime.period").select("AM") cy.getByID("endTime.period").select("PM") - cy.get("form > .button").contains("Save").click() - cy.get("#publishButton").contains("Publish").click() + cy.get(".drawer button").contains("Save").click() + cy.getByID("publishButton").contains("Publish").click() - cy.get("#publishButtonConfirm").contains("Publish").click() + cy.getByID("publishButtonConfirm").contains("Publish").click() cy.get("[data-testid=page-header]").should("be.visible") cy.getByTestId("page-header").should("have.text", listing["name"]) } @@ -193,69 +193,69 @@ describe("Listing Management Tests", () => { cy.getByTestId("ag-search-input").type(listing["name"]) cy.getByTestId(listing["name"]).first().click() cy.getByID("jurisdiction.name").contains(listing["jurisdiction.id"]) - cy.get("#name").contains(listing["name"]) - cy.get("#developer").contains(listing["developer"]) + cy.getByID("name").contains(listing["name"]) + cy.getByID("developer").contains(listing["developer"]) cy.get('[data-label="Preview"]') .find("img") .should("have.attr", "src") .should("include", "cypress-automated-image-upload-071e2ab9-5a52-4f34-85f0-e41f696f4b96") cy.getByID("buildingAddress.street").contains(listing["buildingAddress.street"]) - cy.get("#neighborhood").contains(listing.neighborhood) - cy.get("#neighborhood").contains(listing.neighborhood) + cy.getByID("neighborhood").contains(listing.neighborhood) + cy.getByID("neighborhood").contains(listing.neighborhood) cy.getByID("buildingAddress.city").contains(listing["buildingAddress.city"]) cy.getByID("buildingAddress.state").contains("CA") cy.getByID("buildingAddress.zipCode").contains(listing["buildingAddress.zipCode"]) - cy.get("#yearBuilt").contains(listing["yearBuilt"]) - cy.get("#longitude").contains("-122.40078") - cy.get("#latitude").contains("37.79006") - cy.get("#reservedCommunityType").contains(listing["reservedCommunityType.id"]) - cy.get("#reservedCommunityDescription").contains(listing["reservedCommunityDescription"]) + cy.getByID("yearBuilt").contains(listing["yearBuilt"]) + cy.getByID("longitude").contains("-122.40078") + cy.getByID("latitude").contains("37.79006") + cy.getByID("reservedCommunityType").contains(listing["reservedCommunityType.id"]) + cy.getByID("reservedCommunityDescription").contains(listing["reservedCommunityDescription"]) cy.getByTestId("unit-types-or-individual").contains("Unit Types") cy.getByTestId("listing-availability-question").contains("Available Units") - cy.get("#unitTable").contains(listing["number"]) - cy.get("#unitTable").contains(listing["monthlyRent"]) - cy.get("#unitTable").contains(listing["sqFeet"]) - cy.get("#unitTable").contains(listing["priorityType.id"]) - cy.get("#preferenceTable").contains("1") - cy.get("#preferenceTable").contains("Live/Work in County") - cy.get("#preferenceTable").contains("At least one household member lives or works in County") - cy.get("#applicationFee").contains(listing["applicationFee"]) - cy.get("#applicationFee").contains(listing["applicationFee"]) - cy.get("#applicationFee").contains(listing["applicationFee"]) - cy.get("#depositMin").contains(listing["depositMin"]) - cy.get("#depositMax").contains(listing["depositMax"]) - cy.get("#costsNotIncluded").contains(listing["costsNotIncluded"]) - cy.get("#amenities").contains(listing["amenities"]) - cy.get("#unitAmenities").contains(listing["unitAmenities"]) - cy.get("#accessibility").contains(listing["accessibility"]) - cy.get("#smokingPolicy").contains(listing["smokingPolicy"]) - cy.get("#petPolicy").contains(listing["petPolicy"]) - cy.get("#servicesOffered").contains(listing["servicesOffered"]) - cy.get("#creditHistory").contains(listing["creditHistory"]) - cy.get("#rentalHistory").contains(listing["rentalHistory"]) - cy.get("#criminalBackground").contains(listing["criminalBackground"]) - cy.get("#rentalAssistance").contains( + cy.getByID("unitTable").contains(listing["number"]) + cy.getByID("unitTable").contains(listing["monthlyRent"]) + cy.getByID("unitTable").contains(listing["sqFeet"]) + cy.getByID("unitTable").contains(listing["priorityType.id"]) + cy.getByID("preferenceTable").contains("1") + cy.getByID("preferenceTable").contains("Live/Work in County") + cy.getByID("preferenceTable").contains("At least one household member lives or works in County") + cy.getByID("applicationFee").contains(listing["applicationFee"]) + cy.getByID("applicationFee").contains(listing["applicationFee"]) + cy.getByID("applicationFee").contains(listing["applicationFee"]) + cy.getByID("depositMin").contains(listing["depositMin"]) + cy.getByID("depositMax").contains(listing["depositMax"]) + cy.getByID("costsNotIncluded").contains(listing["costsNotIncluded"]) + cy.getByID("amenities").contains(listing["amenities"]) + cy.getByID("unitAmenities").contains(listing["unitAmenities"]) + cy.getByID("accessibility").contains(listing["accessibility"]) + cy.getByID("smokingPolicy").contains(listing["smokingPolicy"]) + cy.getByID("petPolicy").contains(listing["petPolicy"]) + cy.getByID("servicesOffered").contains(listing["servicesOffered"]) + cy.getByID("creditHistory").contains(listing["creditHistory"]) + cy.getByID("rentalHistory").contains(listing["rentalHistory"]) + cy.getByID("criminalBackground").contains(listing["criminalBackground"]) + cy.getByID("rentalAssistance").contains( "Housing Choice Vouchers, Section 8 and other valid rental assistance programs will be considered for this property. In the case of a valid rental subsidy, the required minimum income will be based on the portion of the rent that the tenant pays after use of the subsidy." ) - cy.get("#buildingSelectionCriteriaTable").contains(listing["buildingSelectionCriteriaURL"]) - cy.get("#requiredDocuments").contains(listing["requiredDocuments"]) - cy.get("#programRules").contains(listing["programRules"]) - cy.get("#specialNotes").contains(listing["specialNotes"]) - cy.get("#reviewOrderQuestion").contains("First come first serve") - cy.get("#dueDateQuestion").contains("No") - cy.get("#whatToExpect").contains( + cy.getByID("buildingSelectionCriteriaTable").contains(listing["buildingSelectionCriteriaURL"]) + cy.getByID("requiredDocuments").contains(listing["requiredDocuments"]) + cy.getByID("programRules").contains(listing["programRules"]) + cy.getByID("specialNotes").contains(listing["specialNotes"]) + cy.getByID("reviewOrderQuestion").contains("First come first serve") + cy.getByID("dueDateQuestion").contains("No") + cy.getByID("whatToExpect").contains( "Applicants will be contacted by the property agent in rank order until vacancies are filled. All of the information that you have provided will be verified and your eligibility confirmed. Your application will be removed from the waitlist if you have made any fraudulent statements. If we cannot verify a housing preference that you have claimed, you will not receive the preference but will not be otherwise penalized. Should your application be chosen, be prepared to fill out a more detailed application and provide required supporting documents." ) - cy.get("#leasingAgentName").contains(listing["leasingAgentName"]) - cy.get("#leasingAgentEmail").contains(listing["leasingAgentEmail"].toLowerCase()) - cy.get("#leasingAgentPhone").contains("(520) 245-8811") - cy.get("#leasingAgentOfficeHours").contains(listing["leasingAgentOfficeHours"]) - cy.get("#leasingAgentTitle").contains(listing["leasingAgentTitle"]) - cy.get("#digitalApplication").contains("Yes") + cy.getByID("leasingAgentName").contains(listing["leasingAgentName"]) + cy.getByID("leasingAgentEmail").contains(listing["leasingAgentEmail"].toLowerCase()) + cy.getByID("leasingAgentPhone").contains("(520) 245-8811") + cy.getByID("leasingAgentOfficeHours").contains(listing["leasingAgentOfficeHours"]) + cy.getByID("leasingAgentTitle").contains(listing["leasingAgentTitle"]) + cy.getByID("digitalApplication").contains("Yes") cy.getByID("digitalMethod.type").contains("No") - cy.get("#customOnlineApplicationUrl").contains(listing["url"]) - cy.get("#paperApplication").contains("No") - cy.get("#referralOpportunity").contains("No") + cy.getByID("customOnlineApplicationUrl").contains(listing["url"]) + cy.getByID("paperApplication").contains("No") + cy.getByID("referralOpportunity").contains("No") cy.getByID("leasingAgentAddress.street").contains(listing["leasingAgentAddress.street"]) cy.getByID("leasingAgentAddress.street2").contains(listing["leasingAgentAddress.street2"]) cy.getByID("leasingAgentAddress.city").contains(listing["leasingAgentAddress.city"]) @@ -274,15 +274,15 @@ describe("Listing Management Tests", () => { listing["leasingAgentAddress.zipCode"] ) cy.getByTestId("applicationMailingAddress.state").contains("CA") - cy.get("#applicationDropOffQuestion").contains("No") - cy.get("#postmarksConsideredQuestion").contains("Yes") + cy.getByID("applicationDropOffQuestion").contains("No") + cy.getByID("postmarksConsideredQuestion").contains("Yes") cy.getByTestId("postmark-date").contains("12") cy.getByTestId("postmark-date").contains("17") cy.getByTestId("postmark-date").contains("2022") cy.getByTestId("postmark-time").contains("5") cy.getByTestId("postmark-time").contains("45") cy.getByTestId("postmark-time").contains("PM") - cy.get("#additionalApplicationSubmissionNotes").contains( + cy.getByID("additionalApplicationSubmissionNotes").contains( listing["additionalApplicationSubmissionNotes"] ) cy.getByID("openhouseHeader").contains("10/04/2022") @@ -295,15 +295,15 @@ describe("Listing Management Tests", () => { cy.visit("/") cy.getByTestId("ag-search-input").type(listing["name"]) cy.getByTestId(listing["name"]).first().click() - cy.getByTestId("listingEditButton").contains("Edit").click() + cy.getByID("listingEditButton").contains("Edit").click() cy.getByTestId("nameField") .should("be.visible") .click() .clear() .clear() .type(listing["editedName"]) - cy.getByTestId("saveAndExitButton").contains("Save & Exit").click() - cy.getByTestId("listingIsAlreadyLiveButton").contains("Save").click() + cy.getByID("saveAndExitButton").contains("Save & Exit").click() + cy.getByID("saveAlreadyLiveListingButtonConfirm").contains("Save").click() cy.getByTestId("page-header").should("have.text", listing["editedName"]) } it("as admin user, should be able to download listings export zip", () => { @@ -311,7 +311,7 @@ describe("Listing Management Tests", () => { return value < 10 ? `0${value}` : `${value}` } cy.visit("/") - cy.getByTestId("export-listings").click() + cy.getByID("export-listings").click() const now = new Date() const dateString = `${now.getFullYear()}-${convertToString( now.getMonth() + 1 diff --git a/sites/partners/cypress/e2e/default/05-paperApplication.spec.ts b/sites/partners/cypress/e2e/default/05-paperApplication.spec.ts index 107e884a9c..5b10e5f660 100644 --- a/sites/partners/cypress/e2e/default/05-paperApplication.spec.ts +++ b/sites/partners/cypress/e2e/default/05-paperApplication.spec.ts @@ -3,7 +3,7 @@ describe("Paper Application Tests", () => { cy.login() cy.visit("/") cy.getByTestId("listing-status-cell").eq(1).click() - cy.getByTestId("addApplicationButton").contains("Add Application").click() + cy.getByID("addApplicationButton").contains("Add Application").click() }) afterEach(() => { diff --git a/sites/partners/cypress/e2e/default/06-admin-user-mangement.spec.ts b/sites/partners/cypress/e2e/default/06-admin-user-mangement.spec.ts index 9facffaaeb..8e4b4408ba 100644 --- a/sites/partners/cypress/e2e/default/06-admin-user-mangement.spec.ts +++ b/sites/partners/cypress/e2e/default/06-admin-user-mangement.spec.ts @@ -7,7 +7,7 @@ describe("Admin User Mangement Tests", () => { cy.signOut() }) - it("as admin user, should show all users regadless of jurisdiction", () => { + it("as admin user, should show all users regardless of jurisdiction", () => { cy.visit("/") cy.getByTestId("Users-1").click() const rolesArray = ["Partner", "Administrator", "Jurisdictional Admin"] @@ -23,7 +23,7 @@ describe("Admin User Mangement Tests", () => { it("as admin user, should be able to download export", () => { cy.visit("/") cy.getByTestId("Users-1").click() - cy.getByTestId("export-users").click() + cy.getByID("export-users").click() const convertToString = (value: number) => { return value < 10 ? `0${value}` : `${value}` } @@ -39,7 +39,7 @@ describe("Admin User Mangement Tests", () => { it("as admin user, should be able to create new admin", () => { cy.visit("/") cy.getByTestId("Users-1").click() - cy.getByTestId("add-user").click() + cy.getByID("add-user").click() cy.fixture("createAdminUser").then((obj) => { cy.fillFields( obj, @@ -67,14 +67,14 @@ describe("Admin User Mangement Tests", () => { [] ) }) - cy.getByTestId("invite-user").click() + cy.getByID("invite-user").click() cy.getByTestId("alert-box").contains("Invite sent").should("have.text", "Invite sent") }) it("as admin user, should be able to create new jurisidictional admin", () => { cy.visit("/") cy.getByTestId("Users-1").click() - cy.getByTestId("add-user").click() + cy.getByID("add-user").click() cy.fixture("createJurisdictionalAdminUser").then((obj) => { cy.fillFields( obj, @@ -106,14 +106,14 @@ describe("Admin User Mangement Tests", () => { [] ) }) - cy.getByTestId("invite-user").click() + cy.getByID("invite-user").click() cy.getByTestId("alert-box").contains("Invite sent").should("have.text", "Invite sent") }) it("as admin user, should be able to create new partner", () => { cy.visit("/") cy.getByTestId("Users-1").click() - cy.getByTestId("add-user").click() + cy.getByID("add-user").click() cy.fixture("createPartnerUser").then((obj) => { cy.fillFields( obj, @@ -144,7 +144,7 @@ describe("Admin User Mangement Tests", () => { cy.getByTestId("jurisdictions").first().click() cy.getByTestId("listings_Alameda").first().click() cy.getByTestId("listings_Alameda").last().click() - cy.getByTestId("invite-user").click() + cy.getByID("invite-user").click() cy.getByTestId("alert-box").contains("Invite sent").should("have.text", "Invite sent") }) }) diff --git a/sites/partners/cypress/e2e/default/07-jurisdictional-admin-user-management.spec.ts b/sites/partners/cypress/e2e/default/07-jurisdictional-admin-user-management.spec.ts index 72951d8a7a..bc3275205d 100644 --- a/sites/partners/cypress/e2e/default/07-jurisdictional-admin-user-management.spec.ts +++ b/sites/partners/cypress/e2e/default/07-jurisdictional-admin-user-management.spec.ts @@ -21,7 +21,7 @@ describe("Jurisdictional Admin User Mangement Tests", () => { }) it("as jurisdictional admin user, should be able to create new jurisidictional admin", () => { - cy.getByTestId("add-user").click() + cy.getByID("add-user").click() cy.fixture("createJurisdictionalAdminUser2").then((obj) => { cy.fillFields( obj, @@ -49,12 +49,12 @@ describe("Jurisdictional Admin User Mangement Tests", () => { [] ) }) - cy.getByTestId("invite-user").click() + cy.getByID("invite-user").click() cy.getByTestId("alert-box").contains("Invite sent").should("have.text", "Invite sent") }) it("as jurisdictional admin user, should be able to create new partner", () => { - cy.getByTestId("add-user").click() + cy.getByID("add-user").click() cy.fixture("createPartnerUser2").then((obj) => { cy.fillFields( obj, @@ -84,7 +84,7 @@ describe("Jurisdictional Admin User Mangement Tests", () => { }) cy.getByTestId("listings_Alameda").first().click() cy.getByTestId("listings_Alameda").last().click() - cy.getByTestId("invite-user").click() + cy.getByID("invite-user").click() cy.getByTestId("alert-box").contains("Invite sent").should("have.text", "Invite sent") }) }) diff --git a/sites/partners/cypress/e2e/default/08-preference-management.spec.ts b/sites/partners/cypress/e2e/default/08-preference-management.spec.ts index af5425f9cb..5bbd08aa4f 100644 --- a/sites/partners/cypress/e2e/default/08-preference-management.spec.ts +++ b/sites/partners/cypress/e2e/default/08-preference-management.spec.ts @@ -15,32 +15,36 @@ describe("Preference Management Tests", () => { it("should be able to create a new preference", () => { //Create - cy.getByTestId("preference-add-item").should("be.enabled") - cy.getByTestId("preference-add-item").click() + cy.getByID("preference-add-item").should("be.enabled") + cy.getByID("preference-add-item").click() cy.getByTestId("preference-title").type("Preference Title") - cy.getByTestId("preference-description").type("Preference Description") + cy.getByTestId("preference-description").type("Preference Description", { + force: true, // we're not sure why, but without this Cypress claims the textarea is covered and can't be used + }) cy.getByTestId("preference-link").type("https://www.example.com") cy.getByTestId("preference-link-title").type("Preference Link Title") - cy.getByTestId("preference-add-option-button").click() + cy.getByID("preference-add-option-button").click() cy.getByTestId("preference-option-title").type("Preference Option Title") - cy.getByTestId("preference-option-description").type("Preference Option Description") + cy.getByTestId("preference-option-description").type("Preference Option Description", { + force: true, // we're not sure why, but without this Cypress claims the textarea is covered and can't be used + }) cy.getByTestId("preference-option-link").type("https://www.example2.com") cy.getByTestId("preference-option-link-title").type("Preference Option Link Title") cy.getByTestId("collect-address-yes").click() cy.getByTestId("exclusive-question-exclusive").check() - cy.getByTestId("preference-option-save").click() + cy.getByID("preference-option-save").click() cy.getByTestId("validation-method-radius").click() cy.getByTestId("preference-option-radius-size").type("100") cy.getByTestId("collect-name-yes").click() cy.getByTestId("collect-relationship-yes").click() - cy.getByTestId("preference-option-save").click() + cy.getByID("preference-option-save").click() cy.getByTestId("preference-opt-out-label").clear() cy.getByTestId("preference-opt-out-label").type("Preference Opt Out Label") cy.getByTestId("preference-jurisdiction").select("Alameda") - cy.getByTestId("preference-save-button").click() + cy.getByID("preference-save-button").click() cy.getByTestId("alert-box") .contains("Preference Created") .should("have.text", "Preference Created") @@ -72,11 +76,11 @@ describe("Preference Management Tests", () => { cy.getByTestId("collect-name-yes").should("be.checked") cy.getByTestId("collect-relationship-yes").should("be.checked") cy.getByTestId("exclusive-question-exclusive").should("have.value", "exclusive") - cy.getByTestId("preference-option-save").click() + cy.getByID("preference-option-save").click() cy.getByTestId("preference-opt-out-label").should("have.value", "Preference Opt Out Label") cy.getByTestId("show-on-listing-question-yes").should("have.value", "yes") cy.getByTestId("preference-jurisdiction").contains("Alameda") - cy.getByTestId("preference-save-button").click() + cy.getByID("preference-save-button").click() }) }) diff --git a/sites/partners/cypress/e2e/listings-approval/listings-approval.spec.ts b/sites/partners/cypress/e2e/listings-approval/listings-approval.spec.ts index 58bf4c8265..49cf1893fd 100644 --- a/sites/partners/cypress/e2e/listings-approval/listings-approval.spec.ts +++ b/sites/partners/cypress/e2e/listings-approval/listings-approval.spec.ts @@ -5,7 +5,7 @@ describe("Listings approval feature", () => { // Partner: Submit a listing for approval cy.login("jurisdictionalAdminUser") cy.visit("/") - cy.getByTestId("addListingButton").contains("Add Listing").click() + cy.getByID("addListingButton").contains("Add Listing").click() cy.contains("New Listing") cy.fixture("minimalListing").then((listing) => { fillOutMinimalListing(cy, listing) @@ -17,7 +17,7 @@ describe("Listings approval feature", () => { cy.loginAndAcceptTerms("user") searchAndOpenListing(cy, uniqueListingName) cy.getByID("listing-status-pending-review").should("be.visible") - cy.getByTestId("listingEditButton").click() + cy.getByID("listingEditButton").click() cy.getByID("requestChangesButton").click() cy.getByTestId("requestedChanges").type("Requested changes test summary") cy.getByID("requestChangesButtonConfirm").click() @@ -29,18 +29,18 @@ describe("Listings approval feature", () => { searchAndOpenListing(cy, uniqueListingName) cy.getByID("listing-status-changes-requested").should("be.visible") cy.getByID("requestedChanges").contains("Requested changes test summary") - cy.getByTestId("listingEditButton").click() + cy.getByID("listingEditButton").click() cy.getByTestId("nameField").should("be.visible").click().clear().type(uniqueListingNameEdited) cy.getByID("submitButton").contains("Submit").click() - cy.getByTestId("submitForApprovalButton").contains("Submit").click() + cy.getByID("submitListingForApprovalButtonConfirm").contains("Submit").click() cy.getByTestId("page-header").should("have.text", uniqueListingNameEdited) cy.signOut() // Admin: Approve and publish cy.login("user") searchAndOpenListing(cy, uniqueListingNameEdited) - cy.getByTestId("listingEditButton").click() - cy.getByTestId("saveAndExitButton").should("be.visible") + cy.getByID("listingEditButton").click() + cy.getByID("saveAndExitButton").should("be.visible") cy.getByID("listing-status-pending-review").should("be.visible") cy.getByID("approveAndPublishButton").click() cy.getByID("listing-status-active").should("be.visible") @@ -57,7 +57,7 @@ describe("Listings approval feature", () => { cy.getByID("name").type(uniqueListingName) cy.getByID("developer").type(listing["developer"]) // Test photo upload - cy.getByTestId("add-photos-button").contains("Add Photo").click() + cy.getByID("add-photos-button").contains("Add Photo").click() cy.getByTestId("dropzone-input").attachFile( "cypress-automated-image-upload-071e2ab9-5a52-4f34-85f0-e41f696f4b96.jpeg", { @@ -68,7 +68,7 @@ describe("Listings approval feature", () => { .find("img") .should("have.attr", "src") .should("include", "cypress-automated-image-upload-071e2ab9-5a52-4f34-85f0-e41f696f4b96") - cy.getByTestId("listing-photo-uploaded").contains("Save").click() + cy.getByID("listing-photo-uploaded").contains("Save").click() cy.getByID("buildingAddress.street").type(listing["buildingAddress.street"]) cy.getByID("neighborhood").type(listing["neighborhood"]) @@ -79,8 +79,8 @@ describe("Listings approval feature", () => { cy.getByID("addUnitsButton").contains("Add Unit").click() cy.getByID("number").type(listing["number"]) cy.getByID("unitType.id").select(listing["unitType.id"]) - cy.getByTestId("unitFormSaveAndExitButton").contains("Save & Exit").click() - cy.get(".text-right > .button").contains("Application Process").click() + cy.getByID("unitFormSaveAndExitButton").contains("Save & Exit").click() + cy.get("button").contains("Application Process").click() cy.getByID("leasingAgentName").type(listing["leasingAgentName"]) cy.getByID("leasingAgentEmail").type(listing["leasingAgentEmail"]) @@ -92,7 +92,7 @@ describe("Listings approval feature", () => { cy.getByID("submitButton").contains("Submit").click() - cy.getByTestId("submitForApprovalButton").contains("Submit").click() + cy.getByID("submitListingForApprovalButtonConfirm").contains("Submit").click() cy.getByTestId("page-header").should("be.visible") cy.getByTestId("page-header").should("have.text", uniqueListingName) } diff --git a/sites/partners/cypress/support/commands.js b/sites/partners/cypress/support/commands.js index 630b0e23f2..e212a75539 100644 --- a/sites/partners/cypress/support/commands.js +++ b/sites/partners/cypress/support/commands.js @@ -28,7 +28,7 @@ import "cypress-file-upload" Cypress.Commands.add("getByID", (id, ...args) => { - return cy.get(`#${CSS.escape(id)}`, ...args) + return cy.get(`[id="${CSS.escape(id)}"]`, ...args) }) Cypress.Commands.add("getByTestId", (testId) => { @@ -40,9 +40,9 @@ Cypress.Commands.add("loginAndAcceptTerms", (fix = "user") => { cy.fixture(fix).then((user) => { cy.get("input#email").type(user.email) cy.get("input#password").type(user.password) - cy.get(".button").contains("Sign In").click() + cy.get("button").contains("Sign In").click() cy.getByTestId("agree").check() - cy.getByTestId("form-submit").click() + cy.getByID("form-submit").click() cy.contains("Listings") }) }) @@ -52,7 +52,7 @@ Cypress.Commands.add("login", (fix = "user") => { cy.fixture(fix).then((user) => { cy.get("input#email").type(user.email) cy.get("input#password").type(user.password) - cy.get(".button").contains("Sign In").click() + cy.get("button").contains("Sign In").click() cy.contains("Listings") }) }) @@ -62,10 +62,10 @@ Cypress.Commands.add("loginWithMfa", () => { cy.fixture("mfaUser").then((user) => { cy.get("input#email").type(user.email) cy.get("input#password").type(user.password) - cy.get(".button").contains("Sign In").click() - cy.getByTestId("verify-by-email").click() + cy.get("button").contains("Sign In").click() + cy.getByID("verify-by-email").click() cy.getByTestId("sign-in-mfa-code-field").type(user.mfaCode) - cy.getByTestId("verify-and-sign-in").click() + cy.getByID("verify-and-sign-in").click() cy.contains("Listings") }) }) @@ -188,7 +188,7 @@ Cypress.Commands.add("fillAlternateContact", (application, fieldsToSkip = []) => }) Cypress.Commands.add("fillHouseholdMember", (application, fieldsToSkip = []) => { - cy.getByTestId("addHouseholdMemberButton").click() + cy.getByID("addHouseholdMemberButton").click() const fieldsToType = [ { id: "firstName", fieldKey: "firstName" }, @@ -218,7 +218,7 @@ Cypress.Commands.add("fillHouseholdMember", (application, fieldsToSkip = []) => cy.getByTestId("dob-field-year").eq(1).type(application["dob-field-year"]) } - cy.getByTestId("submitAddMemberForm").click() + cy.getByID("submitAddMemberForm").click() }) Cypress.Commands.add("fillHouseholdDetails", (application, fieldsToSkip = []) => { @@ -282,7 +282,7 @@ Cypress.Commands.add("fillMailingAddress", (application, fieldsToSkip = []) => { Cypress.Commands.add("fillTerms", (application, submit) => { cy.getByID(`application.acceptedTerms${application["acceptedTerms"]}`).click() if (submit) { - cy.getByTestId("submitApplicationButton").click() + cy.getByID("submitApplicationButton").click() } }) diff --git a/sites/partners/package.json b/sites/partners/package.json index 7e7d6bc152..9bd9d80f80 100644 --- a/sites/partners/package.json +++ b/sites/partners/package.json @@ -28,7 +28,7 @@ "dependencies": { "@bloom-housing/backend-core": "^7.13.0", "@bloom-housing/shared-helpers": "^7.7.1", - "@bloom-housing/ui-components": "12.0.21", + "@bloom-housing/ui-components": "12.0.29", "@bloom-housing/ui-seeds": "^1.12.0", "@mapbox/mapbox-sdk": "^0.13.0", "ag-grid-community": "^26.0.0", diff --git a/sites/partners/page_content/locale_overrides/general.json b/sites/partners/page_content/locale_overrides/general.json index 8a444f24e5..fd4c8db3b7 100644 --- a/sites/partners/page_content/locale_overrides/general.json +++ b/sites/partners/page_content/locale_overrides/general.json @@ -389,6 +389,7 @@ "t.exportToCSV": "Export to CSV", "t.fileName": "File Name", "t.filter": "Filter", + "t.formSubmitted": "Submitting form, wait", "t.hide": "hide", "t.invite": "Invite", "t.jurisdiction": "Jurisdiction", diff --git a/sites/partners/src/components/applications/Aside.tsx b/sites/partners/src/components/applications/Aside.tsx index eed1a985c9..8738511cdb 100644 --- a/sites/partners/src/components/applications/Aside.tsx +++ b/sites/partners/src/components/applications/Aside.tsx @@ -1,16 +1,7 @@ import React, { useContext, useMemo, useState } from "react" import dayjs from "dayjs" -import { - t, - Button, - AppearanceStyleType, - StatusMessages, - LocalizedLink, - Modal, - LinkButton, - AppearanceSizeType, -} from "@bloom-housing/ui-components" -import { Grid } from "@bloom-housing/ui-seeds" +import { t, StatusMessages, Modal } from "@bloom-housing/ui-components" +import { Button, Grid, Link } from "@bloom-housing/ui-seeds" import { ApplicationContext } from "./ApplicationContext" import { StatusAside } from "../shared/StatusAside" @@ -42,33 +33,21 @@ const Aside = ({ listingId, type, onDelete, triggerSubmitAndRedirect }: AsidePro const cancel = ( - + {t("t.cancel")} - + ) if (type === "details") { elements.push( - - - + , - @@ -79,10 +58,11 @@ const Aside = ({ listingId, type, onDelete, triggerSubmitAndRedirect }: AsidePro elements.push( @@ -94,8 +74,8 @@ const Aside = ({ listingId, type, onDelete, triggerSubmitAndRedirect }: AsidePro , , diff --git a/sites/partners/src/components/applications/PaperApplicationDetails/DetailsMemberDrawer.tsx b/sites/partners/src/components/applications/PaperApplicationDetails/DetailsMemberDrawer.tsx index 0267feb24c..c41d53f8fc 100644 --- a/sites/partners/src/components/applications/PaperApplicationDetails/DetailsMemberDrawer.tsx +++ b/sites/partners/src/components/applications/PaperApplicationDetails/DetailsMemberDrawer.tsx @@ -1,6 +1,6 @@ import React from "react" -import { AppearanceStyleType, t, Button, Drawer } from "@bloom-housing/ui-components" -import { Card, FieldValue, Grid } from "@bloom-housing/ui-seeds" +import { t, Drawer } from "@bloom-housing/ui-components" +import { Button, Card, FieldValue, Grid } from "@bloom-housing/ui-seeds" import { AddressColsType, DetailsAddressColumns } from "./DetailsAddressColumns" import { Application, HouseholdMemberUpdate } from "@bloom-housing/backend-core/types" import { YesNoAnswer } from "../../../lib/helpers" @@ -119,7 +119,7 @@ const DetailsMemberDrawer = ({ - diff --git a/sites/partners/src/components/applications/PaperApplicationDetails/sections/DetailsHouseholdMembers.tsx b/sites/partners/src/components/applications/PaperApplicationDetails/sections/DetailsHouseholdMembers.tsx index f262b4b3f4..47f7720ae3 100644 --- a/sites/partners/src/components/applications/PaperApplicationDetails/sections/DetailsHouseholdMembers.tsx +++ b/sites/partners/src/components/applications/PaperApplicationDetails/sections/DetailsHouseholdMembers.tsx @@ -1,6 +1,6 @@ import React, { useContext, useMemo } from "react" -import { t, MinimalTable, Button } from "@bloom-housing/ui-components" -import { FieldValue } from "@bloom-housing/ui-seeds" +import { t, MinimalTable } from "@bloom-housing/ui-components" +import { Button, FieldValue } from "@bloom-housing/ui-seeds" import { ApplicationContext } from "../../ApplicationContext" import { MembersDrawer } from "../DetailsMemberDrawer" import { YesNoAnswer } from "../../../../lib/helpers" @@ -51,9 +51,9 @@ const DetailsHouseholdMembers = ({ setMembersDrawer }: DetailsHouseholdMembersPr content: ( diff --git a/sites/partners/src/components/applications/PaperApplicationForm/FormMember.tsx b/sites/partners/src/components/applications/PaperApplicationForm/FormMember.tsx index 93fd326185..2c5cc12518 100644 --- a/sites/partners/src/components/applications/PaperApplicationForm/FormMember.tsx +++ b/sites/partners/src/components/applications/PaperApplicationForm/FormMember.tsx @@ -5,13 +5,11 @@ import { DOBField, Field, Select, - AppearanceStyleType, FieldGroup, - Button, Form, FormAddress, } from "@bloom-housing/ui-components" -import { Card, Grid } from "@bloom-housing/ui-seeds" +import { Button, Card, Grid } from "@bloom-housing/ui-seeds" import { relationshipKeys, stateKeys } from "@bloom-housing/shared-helpers" import { useForm } from "react-hook-form" import { YesNoAnswer } from "../../../lib/helpers" @@ -220,13 +218,13 @@ const FormMember = ({ onSubmit, onClose, members, editedMemberId }: ApplicationF - diff --git a/sites/partners/src/components/applications/PaperApplicationForm/sections/FormHouseholdMembers.tsx b/sites/partners/src/components/applications/PaperApplicationForm/sections/FormHouseholdMembers.tsx index 474b7bb96e..c288560530 100644 --- a/sites/partners/src/components/applications/PaperApplicationForm/sections/FormHouseholdMembers.tsx +++ b/sites/partners/src/components/applications/PaperApplicationForm/sections/FormHouseholdMembers.tsx @@ -1,13 +1,6 @@ import React, { useState, useMemo, useCallback } from "react" -import { - t, - MinimalTable, - Button, - AppearanceSizeType, - Drawer, - Modal, - AppearanceStyleType, -} from "@bloom-housing/ui-components" +import { t, MinimalTable, Drawer, Modal } from "@bloom-housing/ui-components" +import { Button } from "@bloom-housing/ui-seeds" import { HouseholdMember } from "@bloom-housing/backend-core/types" import { YesNoAnswer } from "../../../../lib/helpers" import { FormMember } from "../FormMember" @@ -108,20 +101,20 @@ const FormHouseholdMembers = ({ workInRegion: { content: chooseAddressStatus(workInRegion) }, action: { content: ( -
+
@@ -144,9 +137,10 @@ const FormHouseholdMembers = ({ @@ -172,18 +166,15 @@ const FormHouseholdMembers = ({ ariaDescription={t("application.deleteMemberDescription")} onClose={() => setMembersDeleteModal(null)} actions={[ - , , diff --git a/sites/partners/src/components/listings/ListingFormActions.tsx b/sites/partners/src/components/listings/ListingFormActions.tsx index 5e5e87fcc4..faba335797 100644 --- a/sites/partners/src/components/listings/ListingFormActions.tsx +++ b/sites/partners/src/components/listings/ListingFormActions.tsx @@ -1,18 +1,8 @@ import React, { useContext, useMemo } from "react" import { useRouter } from "next/router" import dayjs from "dayjs" -import { - t, - Button, - AppearanceStyleType, - AppearanceBorderType, - StatusMessages, - LocalizedLink, - LinkButton, - Icon, - setSiteAlertMessage, -} from "@bloom-housing/ui-components" -import { Grid } from "@bloom-housing/ui-seeds" +import { t, StatusMessages, Icon, setSiteAlertMessage } from "@bloom-housing/ui-components" +import { Button, Link, Grid } from "@bloom-housing/ui-seeds" import { pdfUrlFromListingEvents, AuthContext } from "@bloom-housing/shared-helpers" import { ListingContext } from "./ListingContext" import { @@ -75,31 +65,25 @@ const ListingFormActions = ({ const actions = useMemo(() => { const cancelButton = ( - {t("t.cancel")} - + ) const editFromDetailButton = ( - - - + ) @@ -107,9 +91,9 @@ const ListingFormActions = ({ @@ -149,7 +133,8 @@ const ListingFormActions = ({ @@ -175,14 +159,13 @@ const ListingFormActions = ({ ) @@ -191,7 +174,8 @@ const ListingFormActions = ({ - + {t("listings.actions.preview")} + ) const viewPostedResultsButton = (eventUrl: string) => ( - - - + } + className="w-full justify-center p-3" + > + {t("listings.actions.previewLotteryResults")}{" "} + ) @@ -227,9 +211,8 @@ const ListingFormActions = ({ diff --git a/sites/partners/src/components/listings/PaperListingDetails/sections/DetailApplicationDates.tsx b/sites/partners/src/components/listings/PaperListingDetails/sections/DetailApplicationDates.tsx index 7bccffb92b..92e17c40fa 100644 --- a/sites/partners/src/components/listings/PaperListingDetails/sections/DetailApplicationDates.tsx +++ b/sites/partners/src/components/listings/PaperListingDetails/sections/DetailApplicationDates.tsx @@ -1,14 +1,7 @@ import React, { useContext, useMemo, useState } from "react" import dayjs from "dayjs" -import { - t, - MinimalTable, - Button, - Drawer, - AppearanceStyleType, - LinkButton, -} from "@bloom-housing/ui-components" -import { Card, FieldValue, Grid } from "@bloom-housing/ui-seeds" +import { t, MinimalTable, Drawer } from "@bloom-housing/ui-components" +import { Button, Card, FieldValue, Grid, Link } from "@bloom-housing/ui-seeds" import { ListingContext } from "../../ListingContext" import { getDetailFieldDate, getDetailFieldTime } from "./helpers" import { ListingEvent, ListingEventType } from "@bloom-housing/backend-core/types" @@ -40,22 +33,16 @@ const DetailApplicationDates = () => { startTime: { content: startTime && getDetailFieldTime(startTime) }, endTime: { content: endTime && getDetailFieldTime(endTime) }, url: { - content: url ? ( - - {t("t.url")} - - ) : ( - t("t.n/a") - ), + content: url ? {t("t.url")} : t("t.n/a"), }, view: { content: (
@@ -117,9 +104,9 @@ const DetailApplicationDates = () => { {drawer?.url ? ( - + {drawer?.label ?? t("t.url")} - + ) : ( t("t.n/a") )} @@ -135,7 +122,7 @@ const DetailApplicationDates = () => { - diff --git a/sites/partners/src/components/listings/PaperListingDetails/sections/DetailUnits.tsx b/sites/partners/src/components/listings/PaperListingDetails/sections/DetailUnits.tsx index aaf59c655b..27753cf3c4 100644 --- a/sites/partners/src/components/listings/PaperListingDetails/sections/DetailUnits.tsx +++ b/sites/partners/src/components/listings/PaperListingDetails/sections/DetailUnits.tsx @@ -1,6 +1,6 @@ import React, { useContext, useMemo } from "react" -import { t, MinimalTable, Button } from "@bloom-housing/ui-components" -import { FieldValue, Grid } from "@bloom-housing/ui-seeds" +import { t, MinimalTable } from "@bloom-housing/ui-components" +import { Button, FieldValue, Grid } from "@bloom-housing/ui-seeds" import { ListingContext } from "../../ListingContext" import { UnitDrawer } from "../DetailsUnitDrawer" import { ListingReviewOrder } from "@bloom-housing/backend-core" @@ -36,9 +36,9 @@ const DetailUnits = ({ setUnitDrawer }: DetailUnitsProps) => { content: ( diff --git a/sites/partners/src/components/listings/PaperListingForm/OpenHouseForm.tsx b/sites/partners/src/components/listings/PaperListingForm/OpenHouseForm.tsx index 5c9a1c748d..896a88819a 100644 --- a/sites/partners/src/components/listings/PaperListingForm/OpenHouseForm.tsx +++ b/sites/partners/src/components/listings/PaperListingForm/OpenHouseForm.tsx @@ -2,8 +2,6 @@ import React from "react" import { useForm } from "react-hook-form" import { nanoid } from "nanoid" import { - Button, - AppearanceStyleType, t, Field, Textarea, @@ -14,7 +12,7 @@ import { TimeFieldValues, formatDateToTimeField, } from "@bloom-housing/ui-components" -import { Card, Grid } from "@bloom-housing/ui-seeds" +import { Button, Card, Grid } from "@bloom-housing/ui-seeds" import { TempEvent } from "../../../lib/listings/formTypes" import { createDate, createTime } from "../../../lib/helpers" import dayjs from "dayjs" @@ -149,7 +147,8 @@ const OpenHouseForm = ({ onSubmit, currentEvent }: OpenHouseFormProps) => { register={register} /> - + + { } /> - - + + +