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

fix: correcting submission button bug for MRF #7232

Merged
merged 2 commits into from
Apr 3, 2024
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v6.114.1](https://github.com/opengovsg/FormSG/compare/v6.114.0...v6.114.1)

- build: release v6.114.0 [`#7226`](https://github.com/opengovsg/FormSG/pull/7226)
- fix: correcting submission button bug for MRF [`7342138`](https://github.com/opengovsg/FormSG/commit/73421387daf8f3a33c0030a43c81bb11190ee198)
- ref: genericize EndPageBlock [`017cfb3`](https://github.com/opengovsg/FormSG/commit/017cfb36457cbe293360c963f3d66257e5172907)

#### [v6.114.0](https://github.com/opengovsg/FormSG/compare/v6.113.0...v6.114.0)

> 2 April 2024

- fix: prefill myinfo dropdown field options when faking sample submission data [`#7225`](https://github.com/opengovsg/FormSG/pull/7225)
- feat(mrf): attachments [`#7181`](https://github.com/opengovsg/FormSG/pull/7181)
- fix(mrf): design review add workflow page [`#7218`](https://github.com/opengovsg/FormSG/pull/7218)
Expand Down Expand Up @@ -55,6 +63,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix(deps): bump the npm_and_yarn group group with 2 updates [`#7151`](https://github.com/opengovsg/FormSG/pull/7151)
- chore(deps): bump fast-xml-parser, @aws-sdk/client-secrets-manager and @aws-sdk/client-ssm in /functions/form-payment-reconciliation [`#6490`](https://github.com/opengovsg/FormSG/pull/6490)
- build: release v6.113.0 [`#7148`](https://github.com/opengovsg/FormSG/pull/7148)
- chore: bump version to v6.114.0 [`993e31e`](https://github.com/opengovsg/FormSG/commit/993e31eabdcd9884933cab15d9fd46acc8705aec)

#### [v6.113.0](https://github.com/opengovsg/FormSG/compare/v6.112.0...v6.113.0)

Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "form-frontend",
"version": "6.114.0",
"version": "6.114.1",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { Container, Flex, Stack, StackDivider } from '@chakra-ui/react'

import { FormColorTheme, FormDto } from '~shared/types/form'

import { SubmissionData } from '~features/public-form/PublicFormContext'
import {
SubmissionData,
usePublicFormContext,
} from '~features/public-form/PublicFormContext'

import { EndPageBlock } from './components/EndPageBlock'
import { FeedbackBlock, FeedbackFormInput } from './components/FeedbackBlock'
Expand All @@ -23,6 +26,8 @@ export const FormEndPage = ({
colorTheme,
...endPageProps
}: FormEndPageProps): JSX.Element => {
const { previousSubmissionId } = usePublicFormContext()

return (
<Container w="42.5rem" maxW="100%" p={0}>
<Flex flexDir="column" align="center">
Expand All @@ -39,6 +44,7 @@ export const FormEndPage = ({
focusOnMount
{...endPageProps}
colorTheme={colorTheme}
isButtonHidden={!!previousSubmissionId}
/>
{isFeedbackSectionHidden ? null : (
<FeedbackBlock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ import { useMdComponents } from '~hooks/useMdComponents'
import Button from '~components/Button'
import { MarkdownText } from '~components/MarkdownText'

import {
SubmissionData,
usePublicFormContext,
} from '~features/public-form/PublicFormContext'
import { SubmissionData } from '~features/public-form/PublicFormContext'

export interface EndPageBlockProps {
formTitle: FormDto['title'] | undefined
endPage: FormDto['endPage']
submissionData: SubmissionData
colorTheme?: FormColorTheme
focusOnMount?: boolean
isButtonHidden?: boolean
}

export const EndPageBlock = ({
Expand All @@ -27,6 +25,7 @@ export const EndPageBlock = ({
submissionData,
colorTheme = FormColorTheme.Blue,
focusOnMount,
isButtonHidden,
}: EndPageBlockProps): JSX.Element => {
const focusRef = useRef<HTMLDivElement>(null)
useEffect(() => {
Expand Down Expand Up @@ -56,9 +55,6 @@ export const EndPageBlock = ({
return 'You have successfully submitted your response.'
}, [formTitle])

const { previousSubmissionId } = usePublicFormContext()
const disableSubmitResponseButton = !!previousSubmissionId //disable for MRF 2nd respondent onwards

return (
<>
<Box ref={focusRef}>
Expand Down Expand Up @@ -86,7 +82,7 @@ export const EndPageBlock = ({
</Text>
</Box>
<Box mt="2.25rem">
{disableSubmitResponseButton || (
{isButtonHidden || (
<Button
as="a"
href={endPage.buttonLink || window.location.href}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "FormSG",
"description": "Form Manager for Government",
"version": "6.114.0",
"version": "6.114.1",
"homepage": "https://form.gov.sg",
"authors": [
"FormSG <[email protected]>"
Expand Down
Loading