From 9cf45940d027175607799a30f7879fd112275092 Mon Sep 17 00:00:00 2001 From: Ken Lee Shu Ming Date: Wed, 8 Nov 2023 19:12:07 +0800 Subject: [PATCH 1/3] fix(datepicker): webkit-related stylings (#6875) * fix: prevent unused outer aria from affecting webkit-related styles * fix: css when disabled * chore: remove unused props * fix: calendar button having red border when input is invalid * fix: remove border glitches when button is active * fix: remove border glitches when input has error * chore: add storybook cases for error and prefilled --- .../DatePicker/DatePicker.stories.tsx | 11 +++++ .../src/components/DatePicker/DatePicker.tsx | 2 - .../DatePicker/components/CalendarButton.tsx | 5 +- .../DatePicker/components/DatePickerInput.tsx | 49 +++++++++++-------- .../components/DatePickerWrapper.tsx | 20 +------- frontend/src/theme/components/Button.ts | 2 + 6 files changed, 46 insertions(+), 43 deletions(-) diff --git a/frontend/src/components/DatePicker/DatePicker.stories.tsx b/frontend/src/components/DatePicker/DatePicker.stories.tsx index 772f315750..887b55c902 100644 --- a/frontend/src/components/DatePicker/DatePicker.stories.tsx +++ b/frontend/src/components/DatePicker/DatePicker.stories.tsx @@ -29,3 +29,14 @@ DatePickerDisallowManualInput.args = { export const Mobile = Template.bind({}) Mobile.parameters = getMobileViewParameters() + +export const Prefilled = Template.bind({}) +Prefilled.args = { + defaultValue: new Date('2021-09-13'), + isDisabled: true, +} + +export const Error = Template.bind({}) +Error.args = { + isInvalid: true, +} diff --git a/frontend/src/components/DatePicker/DatePicker.tsx b/frontend/src/components/DatePicker/DatePicker.tsx index 2a1b20b182..819aad93d6 100644 --- a/frontend/src/components/DatePicker/DatePicker.tsx +++ b/frontend/src/components/DatePicker/DatePicker.tsx @@ -2,7 +2,6 @@ import { forwardRef } from '@chakra-ui/react' import { CalendarProps } from '~components/Calendar' -import { CalendarButton } from './components/CalendarButton' import { DatePickerCalendar } from './components/DatePickerCalendar' import { DatePickerContent } from './components/DatePickerContent' import { DatePickerWrapper } from './components/DatePickerWrapper' @@ -25,7 +24,6 @@ export const DatePicker = forwardRef((props, ref) => { return ( - diff --git a/frontend/src/components/DatePicker/components/CalendarButton.tsx b/frontend/src/components/DatePicker/components/CalendarButton.tsx index ae93d405da..dadfb949bc 100644 --- a/frontend/src/components/DatePicker/components/CalendarButton.tsx +++ b/frontend/src/components/DatePicker/components/CalendarButton.tsx @@ -6,18 +6,17 @@ import { useDatePicker } from '../DatePickerContext' export const CalendarButton = (): JSX.Element => { const { disclosureProps: { onOpen, isOpen }, - colorScheme, calendarButtonAria, fcProps: { isDisabled, isReadOnly }, } = useDatePicker() return ( } variant="inputAttached" - borderRadius={0} + borderLeftColor={'transparent'} + borderLeftRadius={0} isActive={isOpen} isDisabled={isDisabled || isReadOnly} /> diff --git a/frontend/src/components/DatePicker/components/DatePickerInput.tsx b/frontend/src/components/DatePicker/components/DatePickerInput.tsx index c86c1d52d2..954f73eb55 100644 --- a/frontend/src/components/DatePicker/components/DatePickerInput.tsx +++ b/frontend/src/components/DatePicker/components/DatePickerInput.tsx @@ -1,15 +1,21 @@ import { useMemo } from 'react' import ReactInputMask from 'react-input-mask' -import { forwardRef, useMergeRefs, VisuallyHidden } from '@chakra-ui/react' +import { + forwardRef, + InputGroup, + InputRightAddon, + useMergeRefs, + VisuallyHidden, +} from '@chakra-ui/react' import Input from '~components/Input' +import { CalendarButton } from '../components/CalendarButton' import { useDatePicker } from '../DatePickerContext' // eslint-disable-next-line @typescript-eslint/ban-types export const DatePickerInput = forwardRef<{}, 'input'>((_props, ref) => { const { - styles, internalInputValue, handleInputChange, handleInputBlur, @@ -36,24 +42,27 @@ export const DatePickerInput = forwardRef<{}, 'input'>((_props, ref) => { {selectedDateAriaLiveText} - + + + + + + ) }) diff --git a/frontend/src/components/DatePicker/components/DatePickerWrapper.tsx b/frontend/src/components/DatePicker/components/DatePickerWrapper.tsx index 272fde6f2f..e6f4c82668 100644 --- a/frontend/src/components/DatePicker/components/DatePickerWrapper.tsx +++ b/frontend/src/components/DatePicker/components/DatePickerWrapper.tsx @@ -8,25 +8,16 @@ import { DatePickerInput } from './DatePickerInput' export const DatePickerWrapper = forwardRef<{}, 'input'>( ({ children }, ref) => { const { - styles, disclosureProps, initialFocusRef, closeCalendarOnChange, isMobile, - fcProps: { isDisabled, isInvalid, isReadOnly }, } = useDatePicker() if (isMobile) { return ( - - - + {children} ) @@ -43,14 +34,7 @@ export const DatePickerWrapper = forwardRef<{}, 'input'>( {...disclosureProps} > - - - + {children} diff --git a/frontend/src/theme/components/Button.ts b/frontend/src/theme/components/Button.ts index 9314c2a70a..b01c374fa2 100644 --- a/frontend/src/theme/components/Button.ts +++ b/frontend/src/theme/components/Button.ts @@ -245,8 +245,10 @@ const variantInputAttached: SystemStyleFunction = (props) => { ml: '-1px', borderColor: 'neutral.400', borderRadius: 0, + borderLeftColor: 'transparent', _hover: { bg: 'neutral.100', + borderLeftColor: `neutral.400`, }, _active: { borderColor: getColor(theme, fc), From 42b172a58352ad8dad5ba69177d876955fcbdcae Mon Sep 17 00:00:00 2001 From: tshuli <63710093+tshuli@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:06:38 +0800 Subject: [PATCH 2/3] chore: add note to update guide to sync with file exts (#6876) --- shared/utils/file-validation.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/utils/file-validation.ts b/shared/utils/file-validation.ts index a0159bc13c..cbdf076b30 100644 --- a/shared/utils/file-validation.ts +++ b/shared/utils/file-validation.ts @@ -2,6 +2,8 @@ import JSZip from 'jszip' import flattenDeep from 'lodash/flattenDeep' import uniq from 'lodash/uniq' +// Note: Guide should be updated if the list of valid extensions is changed. +// https://guide.form.gov.sg/faq/faq/attachments export const VALID_EXTENSIONS = [ '.asc', '.avi', From 352ae5c49ed30d73450364f8b4d6048e21f72ee2 Mon Sep 17 00:00:00 2001 From: wanlingt Date: Thu, 9 Nov 2023 13:08:27 +0800 Subject: [PATCH 3/3] chore: bump version to v6.88.0 --- CHANGELOG.md | 15 +++++++++++++-- frontend/package-lock.json | 4 ++-- frontend/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fdb3f265c..0572f78013 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,19 +4,30 @@ 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.88.0](https://github.com/opengovsg/FormSG/compare/v6.87.0...v6.88.0) + +- chore: add note to update guide to sync with file exts [`#6876`](https://github.com/opengovsg/FormSG/pull/6876) +- fix(datepicker): webkit-related stylings [`#6875`](https://github.com/opengovsg/FormSG/pull/6875) +- build: merge release 6.87.0 into develop [`#6879`](https://github.com/opengovsg/FormSG/pull/6879) +- build: release v6.87.0 [`#6878`](https://github.com/opengovsg/FormSG/pull/6878) + #### [v6.87.0](https://github.com/opengovsg/FormSG/compare/v6.86.0...v6.87.0) +> 8 November 2023 + - fix: encode product name and log error [`#6877`](https://github.com/opengovsg/FormSG/pull/6877) - fix: format Announcement Modal [`#6868`](https://github.com/opengovsg/FormSG/pull/6868) - fix: add case for SGID MyInfo when field value is missing [`#6874`](https://github.com/opengovsg/FormSG/pull/6874) - build: merge release v6.86.0 into develop [`#6873`](https://github.com/opengovsg/FormSG/pull/6873) - build: release v6.86.0 [`#6866`](https://github.com/opengovsg/FormSG/pull/6866) +- chore: use non-testing branch for font-wqy-zenhei [`#6867`](https://github.com/opengovsg/FormSG/pull/6867) +- chore: bump version to v6.86.0 [`1eec9b6`](https://github.com/opengovsg/FormSG/commit/1eec9b63c914b56b7b10adffd03554e07fde0f3a) +- chore: bump version to v6.87.0 [`5054803`](https://github.com/opengovsg/FormSG/commit/50548038804b03f30ce6d23b4d43b7a8cf7d9620) #### [v6.86.0](https://github.com/opengovsg/FormSG/compare/v6.85.1...v6.86.0) > 6 November 2023 -- chore: use non-testing branch for font-wqy-zenhei [`#6867`](https://github.com/opengovsg/FormSG/pull/6867) - chore: update credits and terms of use [`#6865`](https://github.com/opengovsg/FormSG/pull/6865) - fix: add cloudflareinsights as allowable csp [`#6864`](https://github.com/opengovsg/FormSG/pull/6864) - feat: optimise submission query [`#6863`](https://github.com/opengovsg/FormSG/pull/6863) @@ -24,7 +35,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: only render delete button if owner [`#6837`](https://github.com/opengovsg/FormSG/pull/6837) - build: merge release v6.85.1 into develop [`#6861`](https://github.com/opengovsg/FormSG/pull/6861) - fix: hotfix v6.85.1 to prevent creation of SGID_MyInfo storage mode forms [`#6860`](https://github.com/opengovsg/FormSG/pull/6860) -- chore: bump version to v6.86.0 [`1eec9b6`](https://github.com/opengovsg/FormSG/commit/1eec9b63c914b56b7b10adffd03554e07fde0f3a) +- chore: bump version to v6.86.0 [`1c827cd`](https://github.com/opengovsg/FormSG/commit/1c827cd11844649ca303bb5dc9987db5367637c9) #### [v6.85.1](https://github.com/opengovsg/FormSG/compare/v6.85.0...v6.85.1) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 17d743719f..f2e12da404 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "form-frontend", - "version": "6.87.0", + "version": "6.88.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "form-frontend", - "version": "6.87.0", + "version": "6.88.0", "hasInstallScript": true, "dependencies": { "@chakra-ui/react": "^1.8.6", diff --git a/frontend/package.json b/frontend/package.json index e8d4f633a8..74bd289e2b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "form-frontend", - "version": "6.87.0", + "version": "6.88.0", "homepage": ".", "private": true, "dependencies": { diff --git a/package-lock.json b/package-lock.json index f7d8cea2fe..bf836c7b5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "FormSG", - "version": "6.87.0", + "version": "6.88.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "FormSG", - "version": "6.87.0", + "version": "6.88.0", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudwatch-logs": "^3.347.1", diff --git a/package.json b/package.json index d941d94aa2..331c1b3531 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "FormSG", "description": "Form Manager for Government", - "version": "6.87.0", + "version": "6.88.0", "homepage": "https://form.gov.sg", "authors": [ "FormSG "