Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Apr 17, 2024
1 parent c472ea9 commit 781f050
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface PickOSAddressProps {
setShowPostcodeError: React.Dispatch<React.SetStateAction<boolean>>;
initialSelectedAddress?: Option;
showAddressSelectError: boolean;
setShowAddressSelectError: React.Dispatch<React.SetStateAction<boolean>>;
id?: string;
description?: string;
}
Expand Down Expand Up @@ -186,8 +187,17 @@ export default function PickOSAddress(props: PickOSAddressProps): FCReturn {
/>
</InputLabel>
{sanitizedPostcode && (
<ErrorWrapperRoot error={!selectedOption && props.showAddressSelectError ? "Select an address to continue" : undefined} role="alert" data-testid="autocomplete-error-wrapper">
{/* @ts-ignore */
<ErrorWrapperRoot
error={
!selectedOption && props.showAddressSelectError
? "Select an address to continue"
: undefined
}
role="alert"
data-testid="autocomplete-error-wrapper"
>
{
/* @ts-ignore */
<address-autocomplete
id="address-autocomplete"
data-testid="address-autocomplete-web-component"
Expand All @@ -196,7 +206,8 @@ export default function PickOSAddress(props: PickOSAddressProps): FCReturn {
osProxyEndpoint={`${process.env.REACT_APP_API_URL}/proxy/ordnance-survey`}
arrowStyle="light"
labelStyle="static"
/>}
/>
}
</ErrorWrapperRoot>
)}
</AutocompleteWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ function Component(props: Props) {
const [boundary, setBoundary] = useState<GeoJSONObject | undefined>();

const [showPostcodeError, setShowPostcodeError] = useState<boolean>(false);
const [showAddressSelectError, setShowAddressSelectError] = useState<boolean>(false);
const [showDataFetchingError, setShowDataFetchingError] = useState<boolean>(false);
const [showAddressSelectError, setShowAddressSelectError] =
useState<boolean>(false);
const [showDataFetchingError, setShowDataFetchingError] =
useState<boolean>(false);
const [showMapError, setShowMapError] = useState<boolean>(false);
const [showSiteDescriptionError, setShowSiteDescriptionError] = useState<boolean>(false);
const [showSiteDescriptionError, setShowSiteDescriptionError] =
useState<boolean>(false);

const teamSettings = useStore((state) => state.teamSettings);

Expand Down Expand Up @@ -174,6 +177,7 @@ function Component(props: Props) {
previouslySubmittedData?._address
}
showAddressSelectError={showAddressSelectError}
setShowAddressSelectError={setShowAddressSelectError}
id={props.id}
description={props.description || ""}
/>
Expand Down

0 comments on commit 781f050

Please sign in to comment.