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

[master] Release 4.30.4 #153

Merged
merged 33 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ed6b3e0
refactor: add _id to all model interfaces (#75)
mantariksh Aug 5, 2020
21b83da
feat(FormSchema): Document new indexes for form dashboard (#77)
liangyuanruo Aug 5, 2020
a8ea798
feat: remove allowSms beta flag (#73)
mantariksh Aug 5, 2020
6f184fd
chore: add dependabot.yml (#82)
karrui Aug 5, 2020
3037223
fix: update dependabot config to use v2 syntax (#85)
karrui Aug 5, 2020
f4601ef
refactor(logic): typescriptify (#81)
mantariksh Aug 6, 2020
56190ca
fix(deps): bump lodash from 4.17.15 to 4.17.19 (#91)
dependabot[bot] Aug 6, 2020
a95abd9
chore(deps-dev): bump @babel/preset-env from 7.10.2 to 7.11.0 (#87)
dependabot[bot] Aug 6, 2020
7b4496e
chore(deps-dev): bump jasmine-spec-reporter from 4.2.1 to 5.0.2 (#89)
dependabot[bot] Aug 6, 2020
3c29cd5
fix(deps): bump uuid from 8.2.0 to 8.3.0 (#96)
dependabot[bot] Aug 6, 2020
b50cf6b
Merge pull request #79 from opengovsg/release-4.30.0
mantariksh Aug 7, 2020
7d70fdb
Merge pull request #80 from opengovsg/release-4.30.1
mantariksh Aug 7, 2020
a2a2b80
fix: phone validation now only accepts 8 digit #s starting with 8 or …
karrui Aug 7, 2020
04627d5
refactor: migrate `utils/request` to Typescript (#98)
karrui Aug 7, 2020
9e45440
chore(deps-dev): bump url-loader from 1.1.2 to 4.1.0 (#90)
dependabot[bot] Aug 7, 2020
69bca74
test: add tests for verification model (#99)
mantariksh Aug 7, 2020
c59e220
docs: updated docs for open source (#95)
r00dgirl Aug 7, 2020
827a1d5
chore(deps-dev): bump angular from 1.7.9 to 1.8.0 (#10)
dependabot[bot] Aug 7, 2020
3ed9dbb
fix(deps): bump angular-cookies from 1.7.9 to 1.8.0 (#104)
dependabot[bot] Aug 7, 2020
eaef2eb
feat: Filter Storage Mode Responses by Submission Id (#71)
Aug 11, 2020
53f7e14
chore(deps-dev): bump webpack-cli from 3.3.11 to 3.3.12 (#105)
dependabot[bot] Aug 11, 2020
2facecf
feat: add getQuestion instance method to form field schema (#103)
karrui Aug 11, 2020
e536946
docs(readme): point build status image to new repo (#112)
liangyuanruo Aug 11, 2020
1d2ee6b
fix: fix myInfoError typo (#115)
mantariksh Aug 11, 2020
56e9b89
chore: setup jest for use with Typescript tests (#106)
karrui Aug 11, 2020
74234aa
docs: updating contributing, readme, license for open source (#86)
r00dgirl Aug 11, 2020
61a3229
refactor: remove unused mongoTimestamp plugin (#120)
karrui Aug 11, 2020
61c02ba
Merge pull request #114 from opengovsg/release-4.30.2
liangyuanruo Aug 12, 2020
4169133
feat: show error upon FileReader failure (#121)
mantariksh Aug 12, 2020
4e97a48
Bump version to 4.30.3
Aug 12, 2020
e081673
fix: Revert url loader (#125)
arshadali172 Aug 12, 2020
ffe4218
Revert "feat: Filter Storage Mode Responses by Submission Id (#71)"
mantariksh Aug 14, 2020
35d68de
chore: bump version to 4.30.4
mantariksh Aug 14, 2020
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
20 changes: 19 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,25 @@ module.exports = {
plugins: ['@typescript-eslint', 'import', 'simple-import-sort'],
rules: {
// Rules for auto sort of imports
'simple-import-sort/sort': 'error',
'simple-import-sort/sort': [
'error',
{
groups: [
// Side effect imports.
['^\\u0000'],
// Packages.
// Things that start with a letter (or digit or underscore), or
// `@` followed by a letter.
['^@?\\w'],
// Root imports
['^(src)(/.*|$)'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
],
},
],
'sort-imports': 'off',
'import/order': 'off',
'import/first': 'error',
Expand Down
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
commit-message:
prefix: "fix"
prefix-development: "chore"
include: "scope"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@ tmp/
!.elasticbeanstalk/*.global.yml

# Localstack
# =======
.localstack

# @shelf/jest-mongodb generated file
# =======
globalConfig.json
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing to FormSG

Welcome to FormSG! The following are guidelines for contribution. Use your best judgment, and feel free to propose changes to this document in an issue.

## How can I contribute?

When contributing to this repository, **please first discuss the change you wish to make via issue**, email, or any other method with the repository owners before making the change.

## Bug reports and feature requests

The following guidelines help maintainers and the community understand your report, reproduce the behavior, and find related reports.

Before submitting bug reports or feature request, please check [existing or past issues](https://go.gov.sg/formsg-issues) and [existing or past pull requests](https://go.gov.sg/formsg-pulls).
You might find out that you don't need to create one.

When **submitting a bug report**, please include as many details as possible, such as the steps to reproduce this bug, expected and actual behaviour.

When **submitting a feature request**, please include the motivation, alternatives that you've considered and any additional contexts that could help us better understand your goal.

Here are some tips to writing good issues:
- **Use clear and descriptive title** to identify the problem
- **Describe the exact steps to reproduce the problem** and **explain how you did it**
- **Provide specific examples to demonstrate the steps**
- **Include screenshots or animated GIFs if you can**
- **Explain why this new feature would be useful**

## Making a pull request

Issues available to be picked up by the community are labeled with `contribute`.

If you're submitting a pull request, some points to note:

1. Ensure any install or build dependencies are removed before the end of the layer when doing a build. Refer to [README.md](https://go.gov.sg/formsg-readme) for more details
2. Update the [README.md](https://go.gov.sg/formsg-readme) with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
<!---Increase the version numbers of the packages in any example files and the [README.md](https://github.com/opengovsg/formsg/blob/master/README.md) to the new version that this Pull Request would represent.--->
3. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.

## Contributor License Agreement

Code contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project.
Head over [here](https://go.gov.sg/ogp-cla) to submit one.

You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project owned by [GovTech](https://www.tech.gov.sg)), you probably don't need to do it again.

## Contact us

Have questions? Feel free out to us [here]([email protected]).

14 changes: 4 additions & 10 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
Except for any logos, trade marks, service marks, names, insignias, emblems, the Singapore state crest and Singapore national coat of arms, and/or any other graphic, image or sound which is used to identify any Singapore public sector agency or is associated with any Singapore public sector agency, or which belongs to a third party such as Shutterstock, Inc., and/or any asset or code identified by the Government Technology Agency (“GovTech”) as not licensed to you (such identification may come in the form of a filename labelled with “restricted” or similar phrasing), the contents of this repository are provided under the MIT License SUBJECT FURTHER TO THE FOLLOWING:
Except for any logos, trade marks, service marks, names, insignias, emblems, the Singapore state crest and Singapore national coat of arms, and/or any other graphic, image or sound which is used to identify any Singapore public sector agency or is associated with any Singapore public sector agency, or which belongs to a third party such as Shutterstock, Inc., and/or any asset or code identified by the Government Technology Agency (“GovTech”) as not licensed to you (such identification may come in the form of a filename labelled with “restricted” or similar phrasing), the contents of this repository are provided under the MIT License SUBJECT FURTHER TO THE FOLLOWING:

(1) Such contents are only licensed to such entities as expressly permitted by GovTech in writing;

(2) Notwithstanding the MIT License terms, you shall not publish, make public, distribute or sublicense or sell such contents (whether in object or source form) or permit other persons or entities to do so without the prior written consent of GovTech; and

(3) The MIT License and the terms herein (collectively, the “Terms”) shall be governed by the laws of Singapore. Any dispute arising out of or in connection with the Terms, including any question regarding its existence, validity or termination, shall be referred to and finally resolved by arbitration administered by the Singapore International Arbitration Centre (“SIAC”) in accordance with the Arbitration Rules of the Singapore International Arbitration Centre (“SIAC Rules”) for the time being in force, which rules are deemed to be incorporated by reference in this clause. The seat of arbitration shall be Singapore. The Tribunal shall consist of one (1) arbitrator. The language of the arbitration shall be English.
(1) The MIT License and the terms herein (collectively, the “Terms”) shall be governed by the laws of Singapore. Any dispute arising out of or in connection with the Terms, including any question regarding its existence, validity or termination, shall be referred to and finally resolved by arbitration administered by the Singapore International Arbitration Centre (“SIAC”) in accordance with the Arbitration Rules of the Singapore International Arbitration Centre (“SIAC Rules”) for the time being in force, which rules are deemed to be incorporated by reference in this clause. The seat of arbitration shall be Singapore. The Tribunal shall consist of one (1) arbitrator. The language of the arbitration shall be English.

MIT License

Copyright 2020 Government Technology Agency.

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.”

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.
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
**Table of Contents**
# FormSG

[![Build Status](https://travis-ci.com/opengovsg/formsg.svg?branch=release)](https://travis-ci.com/opengovsg/formsg)

## Table of Contents

- [FormSG](#formsg)
- [Table of Contents](#table-of-contents)
- [Local Development (Docker)](#local-development-docker)
- [Prerequisites](#prerequisites)
- [Running Locally](#running-locally)
- [Environment variables](#environment-variables)
- [Testing](#testing)
- [Prerequisites](#prerequisites-1)
- [Testing Prerequisites](#testing-prerequisites)
- [Running tests](#running-tests)
- [Unit tests](#unit-tests)
- [End-to-end tests](#end-to-end-tests)
- [Architecture](#architecture)
- [MongoDB Scripts](#mongodb-scripts)
- [Maintenance Banners](#maintenance-banners)
- [Contributing](#contributing)
- [Support](#support)

# FormSG

master: [![Build Status](https://travis-ci.com/datagovsg/formsg.svg?token=3iDBzqD5prSEyiedYGYi&branch=master)](https://travis-ci.com/datagovsg/formsg) release: [![Build Status](https://travis-ci.com/datagovsg/formsg.svg?token=3iDBzqD5prSEyiedYGYi&branch=release)](https://travis-ci.com/datagovsg/formsg)

## Local Development (Docker)

### Prerequisites
Expand All @@ -28,7 +31,7 @@ Install [docker and docker-compose](https://docs.docker.com/get-docker/).

Run

```
```bash
npm run dev
```

Expand All @@ -37,7 +40,7 @@ to build the Docker image from scratch. This will usually take 10 or so minutes.
If there have been no dependency changes in `package.json` or changes in the
root `server.js` file, you can run

```
```bash
docker-compose up
```

Expand Down Expand Up @@ -70,7 +73,7 @@ required values with your own.
The docker environment has not been configured to run tests. Thus, you will need
to follow the following local build guide to get tests running locally.

### Prerequisites
### Testing Prerequisites

The team uses macOS for development.

Expand All @@ -82,7 +85,7 @@ Make you sure have the following node version & package manager on your machine:

Run

```
```bash
nvm install 12.18.0
npm install
pip install "localstack[full]"
Expand All @@ -95,7 +98,7 @@ to install node modules and Localstack locally to be able to run tests. Note tha

#### Unit tests

```
```bash
npm run test
```

Expand All @@ -105,21 +108,21 @@ will build the backend and run both our backend and frontend unit tests. The tes

If the backend is already built, you can run

```
```bash
npm run test-ci
```

#### End-to-end tests

```
```bash
npm run test-e2e
```

will build both the frontend and backend then run our end-to-end tests. The tests are located at [`tests/end-to-end`](./tests/end-to-end). You will need to stop the Docker dev container to be able to run the end-to-end tests.

If you do not need to rebuild the frontend and backend, you can run

```
```bash
npm run test-e2e-ci
```

Expand Down Expand Up @@ -160,4 +163,4 @@ We welcome contributions to code open sourced by the Government Technology Agenc

## Support

Please contact FormSG (formsg@data.gov.sg) for any details.
Please contact FormSG (formsg@tech.gov.sg) for any details.
12 changes: 12 additions & 0 deletions jest-mongodb-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
mongodbMemoryServerOptions: {
binary: {
version: process.env.MONGO_BINARY_VERSION || '3.6.12',
checkMD5: true,
},
instance: {
dbName: 'jest',
},
autoStart: false,
},
}
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { defaults: tsJestPreset } = require('ts-jest/presets')

module.exports = {
preset: '@shelf/jest-mongodb',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|test).[t]s?(x)'],
modulePaths: ['<rootDir>'],
transform: {
// Needed to use @shelf/jest-mongodb preset.
...tsJestPreset.transform,
},
}
Loading