Skip to content

Commit

Permalink
chore: update default copy for FindProperty plot a new address (#2853)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Mar 1, 2024
1 parent 3b60c74 commit 6627374
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
13 changes: 4 additions & 9 deletions editor.planx.uk/src/@planx/components/FindProperty/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

import type { FindProperty } from "./model";
import {
DEFAULT_NEW_ADDRESS_LABEL,
DEFAULT_NEW_ADDRESS_TITLE,
DEFAULT_TITLE,
parseFindProperty,
} from "./model";
import { parseFindProperty } from "./model";

export type Props = EditorProps<TYPES.FindProperty, FindProperty>;

Expand All @@ -48,7 +43,7 @@ function FindPropertyComponent(props: Props) {
<InputRow>
<Input
format="large"
placeholder={DEFAULT_TITLE}
placeholder="Title"
name="title"
value={formik.values.title}
onChange={formik.handleChange}
Expand Down Expand Up @@ -82,7 +77,7 @@ function FindPropertyComponent(props: Props) {
<InputRow>
<Input
format="large"
placeholder={DEFAULT_NEW_ADDRESS_TITLE}
placeholder="Title"
name="newAddressTitle"
value={formik.values.newAddressTitle}
onChange={formik.handleChange}
Expand All @@ -101,7 +96,7 @@ function FindPropertyComponent(props: Props) {
<InputRowItem width="100%">
<Input
id="new-address-description-label"
placeholder={DEFAULT_NEW_ADDRESS_LABEL}
placeholder="Label"
name="newAddressDescriptionLabel"
value={formik.values.newAddressDescriptionLabel}
onChange={formik.handleChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ import ExternalPlanningSiteDialog, {
DialogPurpose,
} from "ui/public/ExternalPlanningSiteDialog";

import {
DEFAULT_NEW_ADDRESS_TITLE,
DEFAULT_TITLE,
FindProperty,
SiteAddress,
} from "../model";
import { FindProperty, SiteAddress } from "../model";
import PickOSAddress from "./Autocomplete";
import PlotNewAddress from "./Map";

Expand Down Expand Up @@ -133,7 +128,7 @@ function Component(props: Props) {
return (
<>
<QuestionHeader
title={props.newAddressTitle || DEFAULT_NEW_ADDRESS_TITLE}
title={props.newAddressTitle}
description={props.newAddressDescription || ""}
/>
<PlotNewAddress
Expand All @@ -155,7 +150,7 @@ function Component(props: Props) {
return (
<>
<QuestionHeader
title={props.title || DEFAULT_TITLE}
title={props.title}
description={props.description || ""}
/>
<PickOSAddress
Expand Down
15 changes: 10 additions & 5 deletions editor.planx.uk/src/@planx/components/FindProperty/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ export interface FindProperty extends MoreInformation {
export const parseFindProperty = (
data: Record<string, any> | undefined,
): FindProperty => ({
title: data?.title || "",
title: data?.title || DEFAULT_TITLE,
description: data?.description || "",
allowNewAddresses: data?.allowNewAddresses || false,
newAddressTitle: data?.newAddressTitle || "",
newAddressDescription: data?.newAddressDescription || "",
newAddressDescriptionLabel: data?.newAddressDescriptionLabel || "",
newAddressTitle: data?.newAddressTitle || DEFAULT_NEW_ADDRESS_TITLE,
newAddressDescription:
data?.newAddressDescription || DEFAULT_NEW_ADDRESS_DESCRIPTION,
newAddressDescriptionLabel:
data?.newAddressDescriptionLabel || DEFAULT_NEW_ADDRESS_LABEL,
...parseMoreInformation(data),
});

Expand Down Expand Up @@ -54,5 +56,8 @@ export interface SiteAddress extends MinimumSiteAddress {
}

export const DEFAULT_TITLE = "Find the property" as const;
export const DEFAULT_NEW_ADDRESS_TITLE = "Propose a new address" as const;
export const DEFAULT_NEW_ADDRESS_TITLE =
"Click or tap at where the property is on the map and name it below" as const;
export const DEFAULT_NEW_ADDRESS_DESCRIPTION =
"You will need to select a location and provide a name to continue" as const;
export const DEFAULT_NEW_ADDRESS_LABEL = "Name the site" as const;

0 comments on commit 6627374

Please sign in to comment.