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

[feat-6155]: Change reaction asked notification #3109

Merged
merged 12 commits into from
Mar 11, 2025
28 changes: 24 additions & 4 deletions src/signals/incident/components/ReplyForm/Notice/Notice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,49 @@
import {
Column,
Heading,
Link,
Paragraph,
Row,
themeSpacing,
} from '@amsterdam/asc-ui'
import ReactMarkdown from 'react-markdown'
import styled from 'styled-components'

const StyledHeading = styled(Heading)`
margin-top: ${themeSpacing(10)};
margin-bottom: ${themeSpacing(5)};
`

const Wrapper = styled.div`
a,
p {
font-size: 1rem;
line-height: 1.5rem;
}
`

interface NoticeProps {
title: string
content: string
}

const Notice = ({ content, title }: NoticeProps) => (
<Row>
<Column span={12}>
<div>
<Column span={8}>
<Wrapper>
<StyledHeading>{title}</StyledHeading>
<Paragraph>{content}</Paragraph>
</div>
<ReactMarkdown
skipHtml
allowedElements={['a', 'p']}
components={{
a: ({ node, ...props }) => <Link variant="inline" {...props} />,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
p: ({ node, color, ...props }) => <Paragraph {...props} />,
}}
>
{content}
</ReactMarkdown>
</Wrapper>
</Column>
</Row>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ describe('IncidentReplyContainer', () => {

await waitFor(() => {
screen.getByRole('heading', { name: constants.INACCESSIBLE_TITLE })
screen.getByText(constants.INACCESSIBLE_CONTENT)
screen.getByText(
'U hebt hierover een e-mail ontvangen of u krijgt deze binnenkort nog.'
)
screen.getByRole('link', { name: 'een nieuwe melding maken' })
screen.getByText(
/. Geef alstublieft zoveel mogelijk details van de situatie. En stuur als dat kan een foto mee./
)
})
})
})
Expand Down Expand Up @@ -219,7 +225,13 @@ describe('IncidentReplyContainer', () => {
screen.getByRole('heading', {
name: constants.INACCESSIBLE_TITLE,
})
screen.getByText(constants.INACCESSIBLE_CONTENT)
screen.getByText(
'U hebt hierover een e-mail ontvangen of u krijgt deze binnenkort nog.'
)
screen.getByRole('link', { name: 'een nieuwe melding maken' })
screen.getByText(
/. Geef alstublieft zoveel mogelijk details van de situatie. En stuur als dat kan een foto mee./
)
})
})
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (C) 2021 Gemeente Amsterdam

/**
* Possible responses
*/
Expand All @@ -16,8 +17,11 @@ export const SUBMITTED_PREVIOUSLY_DETAIL = 'Already used!'
* Notices
*/
export const INACCESSIBLE_TITLE = 'U kunt niet meer reageren op onze vragen'
export const INACCESSIBLE_CONTENT =
'U hebt hierover een email ontvangen of u krijgt deze binnenkort nog.'
export const INACCESSIBLE_CONTENT = `
U hebt hierover een e-mail ontvangen of u krijgt deze binnenkort nog.

Wilt u dat wij toch nog iets doen? Dan kunt u [een nieuwe melding maken](https:meldingen.amsterdam.nl/incident/beschrijf). Geef alstublieft zoveel mogelijk details van de situatie. En stuur als dat kan een foto mee.
`

export const SUBMITTED_PREVIOUSLY_TITLE =
'U hebt onze vragen al eerder beantwoord'
Expand Down
Loading