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

Only show Blank Street toggle for organizers, not offers #947

Merged
merged 7 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
20 changes: 11 additions & 9 deletions src/pages/steps/LocationStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export const BlankStreetToggle = ({

return (
<RadioButtonWithLabel
id={'blank_address'}
data-testid={'blank_address'}
Anahkiasen marked this conversation as resolved.
Show resolved Hide resolved
name={'blank_address'}
label={
<Text className={'ml-1'}>
Expand Down Expand Up @@ -708,14 +708,16 @@ const LocationStep = ({
t('location.add_modal.errors.streetAndNumber')
}
info={
<BlankStreetToggle
onChange={(streetAndNumber) =>
onFieldChange({
streetAndNumber,
location: { streetAndNumber },
})
}
/>
scope === ScopeTypes.ORGANIZERS && (
<BlankStreetToggle
onChange={(streetAndNumber) =>
onFieldChange({
streetAndNumber,
location: { streetAndNumber },
})
}
/>
)
}
/>
</Stack>
Expand Down
1 change: 1 addition & 0 deletions src/test/e2e/create-place.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ test('create a place', async ({ baseURL, page }) => {
await page
.getByRole('option', { name: dummyPlace.address.municipality })
.click();
await expect(page.getByTestId('blank_address')).not.toBeVisible();
await page.getByLabel('Straat en nummer').nth(0).click();
await page
.getByLabel('Straat en nummer')
Expand Down
2 changes: 1 addition & 1 deletion src/ui/Inline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const inlinePropTypes = [
const getInlineProps = (props: UnknownProps) =>
pickBy(props, (_value, key) => {
// pass aria attributes to the DOM element
if (key.startsWith('aria-')) {
if (key.startsWith('aria-') || key.startsWith('data-')) {
Anahkiasen marked this conversation as resolved.
Show resolved Hide resolved
return true;
}

Expand Down
Loading