Skip to content

Commit

Permalink
Merge pull request #7637 from opengovsg/release_v6.145.0
Browse files Browse the repository at this point in the history
build: release v6.145.0
  • Loading branch information
kevin9foong committed Sep 2, 2024
2 parents 13eae1f + a498d4b commit ec0d95f
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 47 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ 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.145.0](https://github.com/opengovsg/FormSG/compare/v6.144.0...v6.145.0)

- feat(form-issue): add rate-limit [`#7633`](https://github.com/opengovsg/FormSG/pull/7633)
- fix: set disable props on field [`#7634`](https://github.com/opengovsg/FormSG/pull/7634)
- fix(deps): bump type-fest from 4.25.0 to 4.26.0 in /shared [`#7632`](https://github.com/opengovsg/FormSG/pull/7632)
- chore(deps-dev): bump @types/http-errors from 2.0.1 to 2.0.4 [`#7627`](https://github.com/opengovsg/FormSG/pull/7627)
- build: merge release v6.144.0 to develop [`#7624`](https://github.com/opengovsg/FormSG/pull/7624)
- docs: remove angular from CREDITS.md [`#7577`](https://github.com/opengovsg/FormSG/pull/7577)
- build: release v6.144.0 [`#7623`](https://github.com/opengovsg/FormSG/pull/7623)

#### [v6.144.0](https://github.com/opengovsg/FormSG/compare/v6.143.1...v6.144.0)

> 26 August 2024

- feat(nric): remove override flag [`#7620`](https://github.com/opengovsg/FormSG/pull/7620)
- chore(nric): remove nric collection description [`#7621`](https://github.com/opengovsg/FormSG/pull/7621)
- feat(nric): set default to false [`#7619`](https://github.com/opengovsg/FormSG/pull/7619)
Expand All @@ -16,6 +28,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore(deps-dev): bump core-js from 3.28.0 to 3.38.1 [`#7613`](https://github.com/opengovsg/FormSG/pull/7613)
- fix(deps): bump jwk-to-pem from 2.0.5 to 2.0.6 [`#7612`](https://github.com/opengovsg/FormSG/pull/7612)
- chore(deps-dev): bump @types/bluebird from 3.5.38 to 3.5.42 [`#7611`](https://github.com/opengovsg/FormSG/pull/7611)
- chore: bump version to v6.144.0 [`65b1b25`](https://github.com/opengovsg/FormSG/commit/65b1b25e197bcea55c034c103bd1096b01d7a625)

#### [v6.143.1](https://github.com/opengovsg/FormSG/compare/v6.143.0...v6.143.1)

Expand Down
31 changes: 0 additions & 31 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5382,37 +5382,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


-------------------------------------------------------------------------------

## Project
ui-select

### Source
https://github.com/angular-ui/ui-select

### License
The MIT License (MIT)

Copyright (c) 2013-2014 AngularUI

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


-------------------------------------------------------------------------------

## Project
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.144.0",
"version": "6.145.0",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/Radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export const Radio = forwardRef<RadioProps, 'input'>(

const handleSelect = useCallback(
(e: SyntheticEvent) => {
if (props.isDisabled) return
if (isChecked && allowDeselect) {
e.preventDefault()
// Toggle off if onChange is given.
Expand All @@ -161,17 +162,18 @@ export const Radio = forwardRef<RadioProps, 'input'>(
onChange?.({ target: { value: '' } })
}
},
[allowDeselect, isChecked, onChange],
[allowDeselect, isChecked, onChange, props.isDisabled],
)

const handleSpacebar = useCallback(
(e: KeyboardEvent<HTMLInputElement>) => {
if (props.isDisabled) return
if (e.key !== ' ') return
if (isChecked && allowDeselect) {
handleSelect(e)
}
},
[allowDeselect, handleSelect, isChecked],
[allowDeselect, handleSelect, isChecked, props.isDisabled],
)

// Update labelProps to include props to allow deselection of radio value if
Expand Down
1 change: 1 addition & 0 deletions frontend/src/templates/Field/Radio/RadioField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export const RadioField = ({
{...(idx === 0 ? { ref } : {})}
// Required should apply to radio group rather than individual radio.
isRequired={false}
isDisabled={schema.disabled}
>
{option}
</Radio>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/theme/components/Radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const Radio: ComponentMultiStyleConfig<typeof parts> = {
_disabled: {
borderColor: 'neutral.500',
bg: 'white',
cursor: 'not-allowed',
_checked: {
borderColor: 'neutral.500',
color: 'neutral.500',
Expand Down
13 changes: 7 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions 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.144.0",
"version": "6.145.0",
"homepage": "https://form.gov.sg",
"authors": [
"FormSG <[email protected]>"
Expand Down Expand Up @@ -181,7 +181,7 @@
"@types/express-session": "^1.18.0",
"@types/helmet": "4.0.0",
"@types/html-escaper": "^3.0.2",
"@types/http-errors": "^2.0.1",
"@types/http-errors": "^2.0.4",
"@types/ip": "^1.1.0",
"@types/jest": "^29.5.1",
"@types/json-stringify-safe": "^5.0.3",
Expand Down
6 changes: 3 additions & 3 deletions shared/package-lock.json

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

6 changes: 6 additions & 0 deletions src/app/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ export const optionalVarsSchema: Schema<IOptionalVarsSchema> = {
default: 60,
env: 'SEND_AUTH_OTP_RATE_LIMIT',
},
publicFormIssueFeedback: {
doc: 'Per-minute, per-IP, per form request limit for public form issue feedback endpoints',
format: 'int',
default: 3,
env: 'PUBLIC_FORM_ISSUE_FEEDBACK_RATE_LIMIT',
},
downloadPaymentReceipt: {
doc: 'Per-minute, per-IP request limit to download the payment receipt from Stripe',
format: 'int',
Expand Down
3 changes: 3 additions & 0 deletions src/app/routes/api/v3/forms/public-forms.issue.routes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Router } from 'express'

import { rateLimitConfig } from '../../../../config/config'
import * as IssueController from '../../../../modules/issue/issue.controller'
import { limitRate } from '../../../../utils/limit-rate'

export const PublicFormsIssueRouter = Router()

Expand All @@ -19,5 +21,6 @@ export const PublicFormsIssueRouter = Router()
* @returns 500 if database error occurs
*/
PublicFormsIssueRouter.route('/:formId([a-fA-F0-9]{24})/issue').post(
limitRate({ max: rateLimitConfig.publicFormIssueFeedback }),
IssueController.handleSubmitFormIssue,
)
2 changes: 2 additions & 0 deletions src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export type MailConfig = {
export type RateLimitConfig = {
submissions: number
sendAuthOtp: number
publicFormIssueFeedback: number
downloadPaymentReceipt: number
downloadFormWhitelist: number
uploadFormWhitelist: number
Expand Down Expand Up @@ -190,6 +191,7 @@ export interface IOptionalVarsSchema {
rateLimit: {
submissions: number
sendAuthOtp: number
publicFormIssueFeedback: number
downloadPaymentReceipt: number
downloadFormWhitelist: number
uploadFormWhitelist: number
Expand Down

0 comments on commit ec0d95f

Please sign in to comment.