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

build: release v6.103.0 #7040

Merged
merged 5 commits into from
Jan 24, 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
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,25 @@ 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.103.0](https://github.com/opengovsg/FormSG/compare/v6.103.0...v6.103.0)

- build: merge release v6.102.0 into develop [`#7039`](https://github.com/opengovsg/FormSG/pull/7039)
- build: release v6.102.0 [`#7023`](https://github.com/opengovsg/FormSG/pull/7023)
- chore: bump version to v6.102.0 [`f0dccf3`](https://github.com/opengovsg/FormSG/commit/f0dccf347309b60884dd0b4fd1091170cbbad416)

#### [v6.103.0](https://github.com/opengovsg/FormSG/compare/v6.102.0...v6.103.0)

> 24 January 2024

- fix: add patch to feed default ValidationOptions on table shorttext [`#7029`](https://github.com/opengovsg/FormSG/pull/7029)
- build: merge release v6.102.0 into develop [`#7028`](https://github.com/opengovsg/FormSG/pull/7028)
- chore: update architecture docs [`#7033`](https://github.com/opengovsg/FormSG/pull/7033)
- chore: bump version to v6.103.0 [`2ada612`](https://github.com/opengovsg/FormSG/commit/2ada612987e7aa8f0fe4607f305c707a09ad531f)

#### [v6.102.0](https://github.com/opengovsg/FormSG/compare/v6.101.0...v6.102.0)

> 15 January 2024

- fix: force mongodb connection to direct on localdev [`#7022`](https://github.com/opengovsg/FormSG/pull/7022)
- build: merge release v6.101.0 into develop [`#7019`](https://github.com/opengovsg/FormSG/pull/7019)
- build: release v6.101.0 [`#7013`](https://github.com/opengovsg/FormSG/pull/7013)
Expand All @@ -17,7 +34,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- build: merge v6.99.0 into develop [`#7007`](https://github.com/opengovsg/FormSG/pull/7007)
- fix: update package-lock.json [`0a277d3`](https://github.com/opengovsg/FormSG/commit/0a277d32596ed8e4bdc743c2190dd97ba8ae55bb)
- chore: upgrade myinfo-gov-client and axios [`a51cb8c`](https://github.com/opengovsg/FormSG/commit/a51cb8cfb240c8ad8c1dfec42f1c55f93a9d2e9c)
- chore: bump version to 6.101.0 [`1bc479f`](https://github.com/opengovsg/FormSG/commit/1bc479f1f655db5e8e092566f6892c99b2745b35)
- chore: bump version to v6.102.0 [`f0dccf3`](https://github.com/opengovsg/FormSG/commit/f0dccf347309b60884dd0b4fd1091170cbbad416)

#### [v6.101.0](https://github.com/opengovsg/FormSG/compare/v6.100.0...v6.101.0)

Expand Down
2 changes: 1 addition & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ relative to external systems and in terms of how the codebase is organised

## Overview

FormSG runs on Amazon Web Services and is built on top of express.js and AngularJS.
FormSG runs on Amazon Web Services and is built on top of express.js and ReactJS.
It relies on MongoDB Atlas and AWS EFS for storage, AWS SES to dispatch e-mails and
is deployed on Docker containers running on top of Elastic Beanstalk. Optionally, FormSG
can also talk to Government-hosted systems - SingPass/CorpPass/MyInfo to retrieve form-filler
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.100.0",
"version": "6.101.0",
"homepage": ".",
"private": true,
"dependencies": {
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.102.0",
"version": "6.103.0",
"homepage": "https://form.gov.sg",
"authors": [
"FormSG <[email protected]>"
Expand Down
5 changes: 4 additions & 1 deletion src/app/modules/form/admin-form/admin-form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import {
checkIsApiSecretKeyName,
generateTwilioCredSecretKeyName,
getUpdatedFormFields,
insertTableShortTextColumnDefaultValidationOptions,
processDuplicateOverrideProps,
} from './admin-form.utils'

Expand Down Expand Up @@ -652,8 +653,10 @@ export const updateFormField = (
fieldId: string,
newField: FieldUpdateDto,
): ResultAsync<FormFieldSchema, PossibleDatabaseError | FieldNotFoundError> => {
const _newField = insertTableShortTextColumnDefaultValidationOptions(newField)

return ResultAsync.fromPromise(
form.updateFormFieldById(fieldId, newField),
form.updateFormFieldById(fieldId, _newField),
(error) => {
logger.error({
message: 'Error encountered while updating form field',
Expand Down
36 changes: 36 additions & 0 deletions src/app/modules/form/admin-form/admin-form.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import { err, ok, Result } from 'neverthrow'
import { v4 as uuidv4 } from 'uuid'

import {
BasicField,
DuplicateFormBodyDto,
FieldUpdateDto,
FormResponseMode,
FormStatus,
TextValidationOptions,
} from '../../../../../shared/types'
import {
reorder,
Expand Down Expand Up @@ -586,3 +589,36 @@ export const mapGoGovErrors = (error: AxiosError): GoGovError => {
)
}
}

// TODO: remove once we upgrade to Mongoose 7.x
/**
* Manually insert default validation options for short text columns in tables.
* Due to a bug in Mongoose 6.x, default values are not inherited for discriminators.
*
* See https://github.com/Automattic/mongoose/issues/12135
*
* Fixed in Mongoose 7.x
* @param newField
* @returns
*/

export const insertTableShortTextColumnDefaultValidationOptions = (
newField: FieldUpdateDto,
) => {
if (newField.fieldType === BasicField.Table) {
const defaultValidationOptions: TextValidationOptions = {
customVal: null,
selectedValidation: null,
}
newField.columns.map((column) => {
if (column.columnType === BasicField.ShortText) {
column.ValidationOptions = {
...defaultValidationOptions,
...column.ValidationOptions,
}
}
return column
})
}
return newField
}
Loading