Skip to content

Commit

Permalink
Merge pull request #6846 from opengovsg/release_v6.84.0
Browse files Browse the repository at this point in the history
build: release v6.84.0
  • Loading branch information
wanlingt committed Oct 26, 2023
2 parents 78cd2b3 + 916bf22 commit 470a046
Show file tree
Hide file tree
Showing 13 changed files with 346 additions and 223 deletions.
29 changes: 22 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,32 @@ 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.83.0](https://github.com/opengovsg/FormSG/compare/v6.83.0...v6.83.0)

- fix(sgid-login): add graceful handling of errors when work email is invalid [`#6819`](https://github.com/opengovsg/FormSG/pull/6819)
- test: fix error message for InvalidFileKeyError [`#6821`](https://github.com/opengovsg/FormSG/pull/6821)
- chore: update serverless package.json [`#6820`](https://github.com/opengovsg/FormSG/pull/6820)
- fix(storybook): build crash, and missing NumberField customVal [`#6808`](https://github.com/opengovsg/FormSG/pull/6808)
#### [v6.84.0](https://github.com/opengovsg/FormSG/compare/v6.83.0...v6.84.0)

- revert: "feat(workspaces): folders (#6639)" [`#6844`](https://github.com/opengovsg/FormSG/pull/6844)
- fix: mobileno is always editable [`#6841`](https://github.com/opengovsg/FormSG/pull/6841)
- feat(workspaces): folders [`#6639`](https://github.com/opengovsg/FormSG/pull/6639)
- chore(deps-dev): bump @types/lodash from 4.14.197 to 4.14.200 in /shared [`#6833`](https://github.com/opengovsg/FormSG/pull/6833)
- fix(transferownershipmodal): remove linting errors [`#6802`](https://github.com/opengovsg/FormSG/pull/6802)
- feat(login): add large width for lg screen [`#6828`](https://github.com/opengovsg/FormSG/pull/6828)
- fix(deps): bump zod from 3.22.3 to 3.22.4 in /shared [`#6830`](https://github.com/opengovsg/FormSG/pull/6830)
- build: merge release v6.83.0 into develop [`#6824`](https://github.com/opengovsg/FormSG/pull/6824)
- feat: change infobox back to payments [`#6797`](https://github.com/opengovsg/FormSG/pull/6797)
- fix(deps): bump type-fest from 4.4.0 to 4.5.0 in /shared [`#6827`](https://github.com/opengovsg/FormSG/pull/6827)
- chore(deps-dev): bump maildev from from 2.0.5 to 2.1.0 [`#6826`](https://github.com/opengovsg/FormSG/pull/6826)
- fix(deps): bump libphonenumber-js from 1.10.45 to 1.10.48 in /shared [`#6805`](https://github.com/opengovsg/FormSG/pull/6805)
- chore(deps): [Snyk] Upgrade bson from 5.1.0 to 5.4.0 [`#6661`](https://github.com/opengovsg/FormSG/pull/6661)
- chore(deps-dev): bump @babel/traverse from 7.22.5 to 7.23.2 [`#6811`](https://github.com/opengovsg/FormSG/pull/6811)
- build: release v6.83.0 [`#6823`](https://github.com/opengovsg/FormSG/pull/6823)

#### [v6.83.0](https://github.com/opengovsg/FormSG/compare/v6.82.0...v6.83.0)

> 19 October 2023

- fix(sgid-login): add graceful handling of errors when work email is invalid [`#6819`](https://github.com/opengovsg/FormSG/pull/6819)
- test: fix error message for InvalidFileKeyError [`#6821`](https://github.com/opengovsg/FormSG/pull/6821)
- chore: update serverless package.json [`#6820`](https://github.com/opengovsg/FormSG/pull/6820)
- fix(storybook): build crash, and missing NumberField customVal [`#6808`](https://github.com/opengovsg/FormSG/pull/6808)
- chore: increase hot lambda to 10 [`#6815`](https://github.com/opengovsg/FormSG/pull/6815)
- feat(sgid-myinfo): add even more sgid myinfo fields [`#6807`](https://github.com/opengovsg/FormSG/pull/6807)
- chore(deps-dev): bump @babel/traverse from 7.22.11 to 7.23.2 in /serverless/virus-scanner [`#6809`](https://github.com/opengovsg/FormSG/pull/6809)
Expand All @@ -23,7 +38,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- feat(sgid-login): general availability and multi-employment [`#6763`](https://github.com/opengovsg/FormSG/pull/6763)
- feat: add more myinfo sgid fields [`#6766`](https://github.com/opengovsg/FormSG/pull/6766)
- build: release v6.82.0 [`#6800`](https://github.com/opengovsg/FormSG/pull/6800)
- chore: bump version to v6.83.0 [`0e9c4bc`](https://github.com/opengovsg/FormSG/commit/0e9c4bc2b154d9d8e77e9e36a2105ef7d85d209b)
- chore: bump version to v6.83.0 [`5f1ae2d`](https://github.com/opengovsg/FormSG/commit/5f1ae2dca9f4b4a80ca9bbe1132041b0152314de)

#### [v6.82.0](https://github.com/opengovsg/FormSG/compare/v6.81.0...v6.82.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.83.0",
"version": "6.84.0",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/features/login/SelectProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const SelectProfilePage = (): JSX.Element => {
return (
<Flex flex={1} justify="center" align="center" background="primary.100">
<Stack
maxWidth="24.5rem"
width={{ base: '24.5rem', lg: '42.5rem' }}
padding="2rem"
borderRadius="0.5rem"
border="1px"
Expand Down Expand Up @@ -211,7 +211,7 @@ const ProfileItem = ({
}) => {
return (
<Flex align="center" cursor="pointer" onClick={onClick}>
<Box>
<Box flexGrow={1}>
<Text
textStyle="subhead-2"
color="secondary.700"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { useCallback, useEffect, useState } from 'react'
import { SubmitHandler, useForm } from 'react-hook-form'
import {
SubmitHandler,
useForm,
UseFormReset,
UseFormTrigger,
} from 'react-hook-form'
import {
Button,
ButtonGroup,
Expand Down Expand Up @@ -38,7 +43,24 @@ type TransferOwnershipInputs = {
email: string
}

const useModalState = ({ onClose, reset, trigger }) => {
type UseModalStateReturn = {
page: number
email: string
isOwnEmail: (value: string) => boolean
resetModal: () => void
onNext: SubmitHandler<TransferOwnershipInputs>
onConfirm: () => void
}

const useModalState = ({
onClose,
reset,
trigger,
}: {
onClose: () => void
reset: UseFormReset<TransferOwnershipInputs>
trigger: UseFormTrigger<TransferOwnershipInputs>
}): UseModalStateReturn => {
const { refetch } = useWorkspace()

const [page, setPage] = useState(0)
Expand All @@ -49,7 +71,7 @@ const useModalState = ({ onClose, reset, trigger }) => {

const isOwnEmail = useCallback(
(value: string) => {
return user?.email && value.toLowerCase() === user.email
return user?.email ? value.toLowerCase() === user.email : false
},
[user?.email],
)
Expand All @@ -59,14 +81,14 @@ const useModalState = ({ onClose, reset, trigger }) => {
reset()
trigger()
onClose()
}, [page, email])
}, [reset, trigger, onClose])

const onNext: SubmitHandler<TransferOwnershipInputs> = useCallback(
({ email }) => {
setEmail(email)
setPage(1)
},
[page, email],
[],
)

const onConfirm = useCallback(() => {
Expand All @@ -80,16 +102,13 @@ const useModalState = ({ onClose, reset, trigger }) => {
},
},
)
}, [page, email, user])
}, [user, transferOwnershipMutation, email, resetModal, refetch])

useEffect(() => {
trigger()
}, [])
}, [trigger])

return [
{ page, email },
{ isOwnEmail, resetModal, onNext, onConfirm },
]
return { page, email, isOwnEmail, resetModal, onNext, onConfirm }
}

export const TransferOwnershipModal = ({
Expand All @@ -105,7 +124,7 @@ export const TransferOwnershipModal = ({
} = useForm<TransferOwnershipInputs>({
mode: 'onChange',
})
const [{ page, email }, { isOwnEmail, resetModal, onNext, onConfirm }] =
const { page, email, isOwnEmail, resetModal, onNext, onConfirm } =
useModalState({
onClose,
reset,
Expand All @@ -119,14 +138,14 @@ export const TransferOwnershipModal = ({
})

return (
<Modal size={modalSize} isOpen={isOpen} onClose={resetModal!}>
<Modal size={modalSize} isOpen={isOpen} onClose={resetModal}>
<ModalOverlay />
<ModalContent>
<ModalCloseButton />
<ModalHeader color="secondary.700">Transfer all forms</ModalHeader>
<ModalBody whiteSpace="pre-wrap" pb="3.25rem">
{page === 0 && (
<form onSubmit={handleSubmit(onNext!)}>
<form onSubmit={handleSubmit(onNext)}>
<FormControl isInvalid={!!errors['email']}>
<FormLabel>
Transfer ownership of all forms
Expand All @@ -145,7 +164,7 @@ export const TransferOwnershipModal = ({
return INVALID_EMAIL_ERROR
}
return (
!isOwnEmail!(value) || CANNOT_TRANSFER_OWNERSHIP_TO_SELF
!isOwnEmail(value) || CANNOT_TRANSFER_OWNERSHIP_TO_SELF
)
},
})}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo } from 'react'
import { Box, Container, Grid } from '@chakra-ui/react'

import { GUIDE_ENCRYPTION_BOUNDARY_SHIFT } from '~constants/links'
import { GUIDE_PAYMENTS_ENTRY } from '~constants/links'
import { ROLLOUT_ANNOUNCEMENT_KEY_PREFIX } from '~constants/localStorage'
import { useLocalStorage } from '~hooks/useLocalStorage'
import InlineMessage from '~components/InlineMessage'
Expand Down Expand Up @@ -41,7 +41,7 @@ export const WorkspacePageContent = ({
)

// TODO: change dashboard message to env var
const dashboardMessage = `FormSG encryption is changing to make it more secure. This won't affect data/security classifications, and no action is needed from you. [Learn more](${GUIDE_ENCRYPTION_BOUNDARY_SHIFT})`
const dashboardMessage = `Introducing payments! Respondents can now pay for fees and services directly on your form. [Learn more](${GUIDE_PAYMENTS_ENTRY})`

return totalFormsCount === 0 ? (
<EmptyWorkspace
Expand Down
1 change: 1 addition & 0 deletions frontend/src/services/ApiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const processFetchResponse = async (response: Response) => {
const data = await response.json()
return data
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
// No guarantee that error is an Error object
datadogLogs.logger.warn(`Fetch error: ${error.message}`, {
Expand Down
Loading

0 comments on commit 470a046

Please sign in to comment.