Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1349/leasing agent section, listings management #1376

Merged
merged 3 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ All notable changes to this project will be documented in this file. The format
- Created duplicates pages ([#1132](https://github.com/bloom-housing/bloom/pull/1132)) (Dominik Barcikowski)
- Add Additional Details section to listing management ([#1338](https://github.com/bloom-housing/bloom/pull/1338)) (Emily Jablonski)
- Add Additional Eligibility section to listing management ([#1374](https://github.com/bloom-housing/bloom/pull/1374)) (Emily Jablonski)
- Add Leasing Agent section to listing management ([#1349](https://github.com/bloom-housing/bloom/pull/1349)) (Emily Jablonski)

- Fixed:

Expand Down
2 changes: 2 additions & 0 deletions sites/partners/pages/listings/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import DetailProperty from "../../../src/listings/PaperListingDetails/sections/D
import DetailApplication from "../../../src/listings/PaperListingDetails/sections/DetailApplication"
import DetailAdditionalDetails from "../../../src/listings/PaperListingDetails/sections/DetailAdditionalDetails"
import DetailAdditionalEligibility from "../../../src/listings/PaperListingDetails/sections/DetailAdditionalEligibility"
import DetailLeasingAgent from "../../../src/listings/PaperListingDetails/sections/DetailLeasingAgent"

export default function ApplicationsList() {
const router = useRouter()
Expand Down Expand Up @@ -104,6 +105,7 @@ export default function ApplicationsList() {
<DetailApplication />
<DetailAdditionalEligibility />
<DetailAdditionalDetails />
<DetailLeasingAgent />
</div>

<div className="md:w-3/12 pl-6">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React, { useContext } from "react"
import { t, GridSection, ViewItem, GridCell } from "@bloom-housing/ui-components"
import { ListingContext } from "../../ListingContext"

const DetailLeasingAgent = () => {
const listing = useContext(ListingContext)

return (
<GridSection
className="bg-primary-ligher"
title={t("listings.sections.leasingAgentTitle")}
grid={false}
inset
>
<GridSection columns={3}>
<GridCell>
<ViewItem label={t("leasingAgent.name")}>{listing.leasingAgentName}</ViewItem>
</GridCell>
<GridCell>
<ViewItem label={t("t.email")}>{listing.leasingAgentEmail}</ViewItem>
</GridCell>
<GridCell>
<ViewItem label={t("t.phone")}>{listing.leasingAgentPhone}</ViewItem>
</GridCell>
</GridSection>
Comment on lines +15 to +25
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just something for us to think about. It's looking like we might benefit from a component that could make these go a little faster. It could take something like
{ columns: number, fields: { label: string, value: T }[] }[]

<GridSection columns={2}>
<GridCell>
<ViewItem label={t("leasingAgent.title")}>{listing.leasingAgentTitle}</ViewItem>
</GridCell>
<GridCell>
<ViewItem label={t("leasingAgent.officeHours")}>
{listing.leasingAgentOfficeHours}
</ViewItem>
</GridCell>
</GridSection>
</GridSection>
)
}

export default DetailLeasingAgent
2 changes: 2 additions & 0 deletions sites/partners/src/listings/PaperListingForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Aside from "../Aside"
import FormListingData from "./sections/FormListingData"
import AdditionalDetails from "./sections/AdditionalDetails"
import AdditionalEligibility from "./sections/AdditionalEligibility"
import LeasingAgent from "./sections/LeasingAgent"

type FormListing = ListingCreate & ListingUpdate

Expand Down Expand Up @@ -203,6 +204,7 @@ const ListingForm = ({ listing, editMode }: ListingFormProps) => {
<FormListingData />
<AdditionalEligibility />
<AdditionalDetails />
<LeasingAgent />
</div>

<aside className="md:w-3/12 md:pl-6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const FormListingData = () => {
<Field
id="property.id"
name="property.id"
label="Property ID (can't save without this for now)"
label="Property ID (required for now)"
placeholder="Property ID"
register={register}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React from "react"
import { useFormContext } from "react-hook-form"
import { t, GridSection, Textarea, Field, PhoneField } from "@bloom-housing/ui-components"

const LeasingAgent = () => {
const formMethods = useFormContext()

// eslint-disable-next-line @typescript-eslint/unbound-method
const { register, control } = formMethods

return (
<div>
<GridSection grid={false} separator>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do something similar here to my comment on the detail pages for the detail forms too.

<span className="form-section__title">{t("listings.sections.leasingAgentTitle")}</span>
<span className="form-section__description">
{t("listings.sections.leasingAgentSubtitle")}
</span>
<GridSection columns={3}>
<Field
label={t("leasingAgent.name")}
name={"leasingAgentName"}
id={"leasingAgentName"}
placeholder={t("leasingAgent.namePlaceholder")}
register={register}
/>
<Field
label={t("t.email")}
name={"leasingAgentEmail"}
id={"leasingAgentEmail"}
placeholder={t("t.emailAddressPlaceholder")}
register={register}
/>
<PhoneField
label={t("t.phone")}
name={"leasingAgentPhone"}
id={"leasingAgentPhone"}
placeholder={t("t.phoneNumberPlaceholder")}
control={control}
controlClassName={"control"}
/>
</GridSection>
<GridSection columns={2}>
<Field
label={t("leasingAgent.title")}
name={"leasingAgentTitle"}
id={"leasingAgentTitle"}
placeholder={t("leasingAgent.title")}
register={register}
/>
<Textarea
label={t("leasingAgent.officeHours")}
name={"leasingAgentOfficeHours"}
id={"leasingAgentOfficeHours"}
fullWidth={true}
placeholder={t("leasingAgent.officeHoursPlaceholder")}
register={register}
/>
</GridSection>
</GridSection>
</div>
)
}

export default LeasingAgent
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default () => {
name="emailAddress"
label={t("application.alternateContact.contact.emailAddressFormLabel")}
readerOnly={true}
placeholder={t("application.alternateContact.contact.emailAddressFormPlaceHolder")}
placeholder={t("t.emailAddressPlaceHolder")}
defaultValue={application.alternateContact.emailAddress || null}
register={register}
/>
Expand Down
5 changes: 3 additions & 2 deletions ui-components/src/blocks/ViewItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

.view-item__label {
@apply text-gray-750;
@apply text-gray-800;
@apply font-sans;
@apply text-tiny;
@apply block;
Expand All @@ -44,7 +44,8 @@
}

// do not change font-family for inputs
.field .control .input, .error-message {
.field .control .input,
.error-message {
@apply font-sans;
@apply font-normal;
}
Expand Down
5 changes: 3 additions & 2 deletions ui-components/src/forms/Textarea.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
@apply border;
@apply border-gray-500;
@apply p-2;
@apply text-tiny;
@apply text-gray-750;
@apply text-gray-900;
@apply bg-gray-200;
font-size: 1rem;
}

.textarea-resize-off {
Expand Down
14 changes: 7 additions & 7 deletions ui-components/src/global/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

label,
.label {
@apply text-gray-750;
@apply font-semibold;
font-size: 0.875rem;
@apply pb-2;
@apply text-tiny;
@apply text-gray-800;
}

label + .control {
Expand All @@ -34,7 +34,7 @@

.input {
@apply border;
@apply border-gray-450;
@apply border-gray-500;
@apply bg-gray-200;
@apply rounded;
@apply w-full;
Expand Down Expand Up @@ -149,7 +149,7 @@
@apply text-gray-900;
@apply rounded;
@apply border;
@apply border-gray-450;
@apply border-gray-500;
@apply bg-gray-200;
@apply text-gray-900;
@apply leading-tight;
Expand Down Expand Up @@ -251,9 +251,9 @@ input[type="number"] {
}

.field-label {
@apply text-gray-750;
@apply pb-2;
@apply text-tiny;
@apply font-semibold;
@apply text-gray-800;
}

.field-label--caps {
Expand Down
2 changes: 1 addition & 1 deletion ui-components/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"description": "Solo utilizaremos esta información para ponernos en contacto con él o ella en relación con su solicitud.",
"phoneNumberFormLabel": "Número telefónico del contacto",
"emailAddressFormLabel": "Dirección de email del contacto",
"emailAddressFormPlaceHolder": "you@myemail.com",
"contactMailingAddressLabel": "Dirección postal del contacto",
"contactMailingAddressHelperText": "Elija una dirección en donde su contacto pueda recibir información actualizada y materiales relacionados con su solicitud"
}
Expand Down Expand Up @@ -673,6 +672,7 @@
"deposit": "Depósito",
"edit": "Editar",
"email": "Email",
"emailAddressPlaceHolder": "you@myemail.com",
"floor": "piso",
"floors": "pisos",
"getDirections": "Obtener instrucciones para llegar",
Expand Down
10 changes: 8 additions & 2 deletions ui-components/src/locales/general.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@
"description": "We'll only use this information to contact them about your application.",
"phoneNumberFormLabel": "Contact phone number",
"emailAddressFormLabel": "Contact email address",
"emailAddressFormPlaceHolder": "you@myemail.com",
"contactMailingAddressLabel": "Contact mailing address",
"contactMailingAddressHelperText": "Choose an address where they can receive updates and materials about your application"
}
Expand Down Expand Up @@ -703,7 +702,11 @@
"leasingAgent": {
"contact": "Contact Leasing Agent",
"dueToHighCallVolume": "Due to high call volume you may hear a message.",
"officeHours": "Office Hours"
"name": "Leasing Agent Name",
"namePlaceholder": "Full Name",
"title": "Leasing Agent Title",
"officeHours": "Office Hours",
"officeHoursPlaceholder": "ex: 9:00am - 5:00pm, Monday to Friday"
},
"listings": {
"active": "Accepting Applications",
Expand Down Expand Up @@ -841,6 +844,8 @@
"featuresTitle": "Features",
"housingPreferencesSubtitle": "Preference holders will be given highest ranking.",
"housingPreferencesTitle": "Housing Preferences",
"leasingAgentSubtitle": "Provide details about the leasing agent who will be managing the application process.",
"leasingAgentTitle": "Leasing Agent",
"neighborhoodSubtitle": "Location and transportation",
"neighborhoodTitle": "Neighborhood",
"processSubtitle": "Important dates and contact information",
Expand Down Expand Up @@ -1009,6 +1014,7 @@
"deposit": "Deposit",
"done": "Done",
"description": "Enter Description",
"emailAddressPlaceholder": "you@myemail.com",
"export": "Export",
"enterAmount": "Enter amount",
"filter": "Filter",
Expand Down
2 changes: 1 addition & 1 deletion ui-components/src/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"description": "Chúng tôi sẽ chỉ sử dụng thông tin này để liên lạc với họ về đơn ghi danh của quý vị.",
"phoneNumberFormLabel": "Số điện thoại của người liên lạc",
"emailAddressFormLabel": "Địa chỉ email của người liên lạc",
"emailAddressFormPlaceHolder": "you@myemail.com",
"contactMailingAddressLabel": "Địa chỉ thư bưu điện của người liên lạc",
"contactMailingAddressHelperText": "Chọn một địa chỉ nơi họ có thể nhận các thông tin cập nhật và tài liệu về đơn ghi danh của quý vị"
}
Expand Down Expand Up @@ -673,6 +672,7 @@
"deposit": "Đặt cọc",
"edit": "Hiệu đính",
"email": "Email",
"emailAddressPlaceHolder": "you@myemail.com",
"floor": "sàn",
"floors": "các sàn",
"getDirections": "Lấy hướng dẫn chỉ đường",
Expand Down
2 changes: 1 addition & 1 deletion ui-components/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"description": "我們只會為您的申請事宜使用此資料聯絡他們。",
"phoneNumberFormLabel": "聯絡人電話號碼",
"emailAddressFormLabel": "聯絡人電郵地址",
"emailAddressFormPlaceHolder": "you@myemail.com",
"contactMailingAddressLabel": "聯絡人郵寄地址",
"contactMailingAddressHelperText": "請選擇一個他們可收到您最新申請消息和資料的地址"
}
Expand Down Expand Up @@ -673,6 +672,7 @@
"deposit": "訂金",
"edit": "編輯",
"email": "電子郵件",
"emailAddressPlaceHolder": "you@myemail.com",
"floor": "樓層",
"floors": "樓層",
"getDirections": "取得路線",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,29 @@ const LeasingAgent = (props: LeasingAgentProps) => {
<section className="aside-block">
<h4 className="text-caps-underline">{t("leasingAgent.contact")}</h4>

<p className="text-xl">{listing.leasingAgentName}</p>
<p className="text-gray-700">{listing.leasingAgentTitle}</p>

<p className="mt-5">
<a href={phoneNumber}>
<Icon symbol="phone" size="medium" fill={IconFillColors.primary} /> {t("t.call")}{" "}
{listing.leasingAgentPhone}
</a>
</p>
<p className="text-sm text-gray-700">{t("leasingAgent.dueToHighCallVolume")}</p>

<p className="my-5">
<a href={`mailto:${listing.leasingAgentEmail}`}>
<Icon symbol="mail" size="medium" fill={IconFillColors.primary} /> {t("t.email")}
</a>
</p>
{listing.leasingAgentName && <p className="text-xl">{listing.leasingAgentName}</p>}
{listing.leasingAgentTitle && <p className="text-gray-700">{listing.leasingAgentTitle}</p>}

{listing.leasingAgentPhone && (
<>
<p className="mt-5">
<a href={phoneNumber}>
<Icon symbol="phone" size="medium" fill={IconFillColors.primary} /> {t("t.call")}{" "}
{listing.leasingAgentPhone}
</a>
</p>
<p className="text-sm text-gray-700">{t("leasingAgent.dueToHighCallVolume")}</p>
</>
)}

{listing.leasingAgentEmail && (
<p className="my-5">
<a href={`mailto:${listing.leasingAgentEmail}`}>
<Icon symbol="mail" size="medium" fill={IconFillColors.primary} /> {t("t.email")}
</a>
</p>
)}

<SidebarAddress
address={listing.leasingAgentAddress}
officeHours={listing.leasingAgentOfficeHours}
Expand Down