From 8098c3f4a606a47f15f2a5f0ac941ea45b0d4e53 Mon Sep 17 00:00:00 2001 From: abby Date: Tue, 1 Aug 2017 10:58:27 +0800 Subject: [PATCH 1/8] initial fork version - fixed missing port in verification link for dev env - disable linting (existing code base > 1k jslint warning, generating huge amount of logs & hiding other logs during build) --- config/env/development.js | 1 + config/express.js | 8 ++------ gruntfile.js | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/config/env/development.js b/config/env/development.js index b3099268..2506743b 100755 --- a/config/env/development.js +++ b/config/env/development.js @@ -2,6 +2,7 @@ module.exports = { baseUrl: process.env.BASE_URL || 'http://localhost:5000', + port: process.env.PORT || 5000, db: { uri: 'mongodb://'+( process.env.DB_PORT_27017_TCP_ADDR || process.env.DB_HOST || '0.0.0.0') +'/mean', options: { diff --git a/config/express.js b/config/express.js index ca5001bc..8952e1a3 100755 --- a/config/express.js +++ b/config/express.js @@ -91,11 +91,7 @@ module.exports = function(db) { urlPath = url.parse(req.url).path.split('/'); if (urlPath.indexOf('static') > -1) { urlPath.splice(1, 1); - if(process.env.NODE_ENV === 'development'){ - req.root = req.protocol + '://' + config.baseUrl + ':' + config.port + urlPath.join('/'); - } else { - req.root = req.protocol + '://' + config.baseUrl + urlPath.join('/'); - } + req.root = req.protocol + '://' + config.baseUrl + urlPath.join('/'); return next(); } @@ -287,7 +283,7 @@ module.exports = function(db) { if (!err) { return next(); } - + // Log it client.captureError(err); diff --git a/gruntfile.js b/gruntfile.js index 52da56c5..a2fccd86 100755 --- a/gruntfile.js +++ b/gruntfile.js @@ -363,8 +363,8 @@ module.exports = function(grunt) { grunt.registerTask('secure', ['env:secure', 'lint', 'html2js:main', 'html2js:forms', 'concurrent:default']); // Lint task(s). - grunt.registerTask('lint', ['jshint', 'csslint']); - grunt.registerTask('lint:tests', ['jshint:allTests']); + // grunt.registerTask('lint', ['jshint', 'csslint']); + // grunt.registerTask('lint:tests', ['jshint:allTests']); // Build task(s). grunt.registerTask('build', ['lint', 'loadConfig', 'cssmin', 'ngAnnotate', 'uglify', 'closure-compiler', 'html2js:main', 'html2js:forms']); From 77b9a325d6b76d64ff1ca7b2ef73f84337f7f3a1 Mon Sep 17 00:00:00 2001 From: abby Date: Tue, 1 Aug 2017 17:19:26 +0800 Subject: [PATCH 2/8] fix create analyse page - fix create menu display analyze page & vice versa --- public/modules/forms/admin/views/admin-form.client.view.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/modules/forms/admin/views/admin-form.client.view.html b/public/modules/forms/admin/views/admin-form.client.view.html index beac1b77..9e494f8f 100644 --- a/public/modules/forms/admin/views/admin-form.client.view.html +++ b/public/modules/forms/admin/views/admin-form.client.view.html @@ -62,14 +62,14 @@
- +
- +
From 0063ce520bc33722dcb2165050e863468bf4e942 Mon Sep 17 00:00:00 2001 From: abby Date: Wed, 2 Aug 2017 10:14:36 +0800 Subject: [PATCH 3/8] fix menu & submenu - main menu has items: create, configure and share but analyse, share & design menu are submenus in share page - fixed index of uib-tab --- .../forms/admin/views/admin-form.client.view.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/public/modules/forms/admin/views/admin-form.client.view.html b/public/modules/forms/admin/views/admin-form.client.view.html index 9e494f8f..78951aad 100644 --- a/public/modules/forms/admin/views/admin-form.client.view.html +++ b/public/modules/forms/admin/views/admin-form.client.view.html @@ -64,14 +64,13 @@ - +
- - + - +
@@ -117,7 +116,7 @@
- +
From bdd24c1805fbf6f2e48a1db231d3b9037382e6be Mon Sep 17 00:00:00 2001 From: abby Date: Wed, 2 Aug 2017 11:19:40 +0800 Subject: [PATCH 4/8] change menu order change the menu order to create, configure, design, analyse, share --- .../admin/views/admin-form.client.view.html | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/public/modules/forms/admin/views/admin-form.client.view.html b/public/modules/forms/admin/views/admin-form.client.view.html index 78951aad..a2c3673d 100644 --- a/public/modules/forms/admin/views/admin-form.client.view.html +++ b/public/modules/forms/admin/views/admin-form.client.view.html @@ -67,56 +67,7 @@
- - - - -
-
-
- - -
-
- {{ 'TELLFORM_URL' | translate }} -
-
- -
-
- -
-
-
- -
-
- {{ 'COPY_AND_PASTE' | translate }} -
-
- - - -
-
- -
-
-
-
-
-
-
-
- +
@@ -187,6 +138,55 @@
+ + + + +
+
+
+ + +
+
+ {{ 'TELLFORM_URL' | translate }} +
+
+ +
+
+ +
+
+
+ +
+
+ {{ 'COPY_AND_PASTE' | translate }} +
+
+ + + +
+
+ +
+
+
+
+
+
+
+
From fa80ef038edc19d67b296ce71c0660f845cc7b91 Mon Sep 17 00:00:00 2001 From: abby Date: Wed, 2 Aug 2017 16:12:32 +0800 Subject: [PATCH 5/8] updated readme - added setup procedure for FORMA --- README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 69d30d86..3def55db 100755 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ TellForm 2.0.0 - [Contributors](#contributors) - [Mentions on the Web](#mentions-on-the-web) -## Features +## Features ### Currently following features are implemented: @@ -55,7 +55,7 @@ All contributors are eligible to get a free [TellForm Sticker](https://www.stick ## Quickstart -Before you start, make sure you have +Before you start, make sure you have 1. [Redis](https://redis.io/) installed and running at 127.0.0.1:6379 2. [MongoDB](https://www.mongodb.com/) installed and running at 127.0.0.1:27017 (OR specify the host and port in config/env/all) @@ -106,7 +106,7 @@ Your application should run on port 3000 or the port you specified in your .env ## Deploying with Docker -To deploy with docker, first install docker [here](https://docs.docker.com/engine/installation/). +To deploy with docker, first install docker [here](https://docs.docker.com/engine/installation/). Then run these commands @@ -155,6 +155,60 @@ To calculate your client-side test coverage with Istanbul, run the coverage task $ grunt coverage:client ``` +## FORMA + +Before you start, make sure you have +1. [Redis](https://redis.io/) installed and running at 127.0.0.1:6379 +2. [MongoDB](https://www.mongodb.com/) installed and running at 127.0.0.1:27017 (OR specify the host and port in config/env/all) +3. [Docker](https://docs.docker.com/engine/installation/) installed and running + +Also make sure to install [DNS Masq](http://www.thekelleys.org.uk/dnsmasq/doc.html) or equivalent if running it locally on your computer (look at dns_masq_setup_osx for instructions on OSX) + + +Install dependencies. +``` +$ npm install +``` + +Create .env file at project root folder. Fill in MAILER_SERVICE_PROVIDER, MAILER_EMAIL_ID and MAILER_PASSWORD. +``` +APP_NAME=forma +APP_DESC= +APP_KEYWORDS= +NODE_ENV=development +BASE_URL=localhost:5000 +PORT=5000 +username=forma_admin +MAILER_SERVICE_PROVIDER= +MAILER_EMAIL_ID= +MAILER_PASSWORD= +MAILER_FROM=forma@data.gov.sg +SIGNUP_DISABLED=false +SUBDOMAINS_DISABLED=true +DISABLE_CLUSTER_MODE=true +GOOGLE_ANALYTICS_ID= +RAVEN_DSN= +PRERENDER_TOKEN= +COVERALLS_REPO_TOKEN= +``` + +#### Deploy with Docker: +Create and start mongo & redis docker container. +``` +$ docker run -p 27017:27017 -d --name forma-mongo mongo +$ docker run -p 127.0.0.1:6379:6379 -d --name forma-redis redis +``` + +After code changes, build and start docker containers. +``` +$ docker start forma-mongo && docker start forma-redis +$ docker build -t forma-tellform . +$ docker stop forma-tellform +$ docker run --rm -p 5000:5000 --link forma-redis:redis-db --link forma-mongo:db --name forma-tellform forma-tellform +``` + +Your application should run on port 5000 or the port you specified in your .env file, so in your browser just go to [http://localhost:5000](http://localhost:5000) + ## Where to get help From de014dd9ad40ab7d2d6112ede8abf50af8118c29 Mon Sep 17 00:00:00 2001 From: abby Date: Wed, 2 Aug 2017 16:18:16 +0800 Subject: [PATCH 6/8] minor changes --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3def55db..873ae8f2 100755 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ TellForm 2.0.0 - [Quickstart](#quickstart) - [Deploying with Docker](#deploying-with-docker) - [Testing your Application](#testing-your-application) +- [FORMA](#forma) - [Where to Get Help](#where-to-get-help) - [Sponsors](#sponsors) - [Backers](#backers) @@ -157,6 +158,7 @@ $ grunt coverage:client ## FORMA +#### Prerequisite: Before you start, make sure you have 1. [Redis](https://redis.io/) installed and running at 127.0.0.1:6379 2. [MongoDB](https://www.mongodb.com/) installed and running at 127.0.0.1:27017 (OR specify the host and port in config/env/all) @@ -165,11 +167,12 @@ Before you start, make sure you have Also make sure to install [DNS Masq](http://www.thekelleys.org.uk/dnsmasq/doc.html) or equivalent if running it locally on your computer (look at dns_masq_setup_osx for instructions on OSX) -Install dependencies. +#### Install dependencies: ``` $ npm install ``` +#### Prepare .env file: Create .env file at project root folder. Fill in MAILER_SERVICE_PROVIDER, MAILER_EMAIL_ID and MAILER_PASSWORD. ``` APP_NAME=forma @@ -254,7 +257,7 @@ Love our work and community? [Become a backer](https://opencollective.com/tellfo -## Contributors +## Contributors | [
David Baldwynn](http://baldwynn.me)
[πŸ’»](https://github.com/tellform/TellForm/commits?author=whitef0x0 "Code") [πŸ”§](#tool-whitef0x0 "Tools") [πŸš‡](#infra-whitef0x0 "Infrastructure (Hosting, Build-Tools, etc)") [πŸ“–](https://github.com/tellform/TellForm/commits?author=whitef0x0 "Documentation") [πŸ’‘](#example-whitef0x0 "Examples") [🎨](#design-whitef0x0 "Design") [πŸ”](#fundingFinding-whitef0x0 "Funding Finding") [πŸ‘€](#review-whitef0x0 "Reviewed Pull Requests") [⚠️](https://github.com/tellform/TellForm/commits?author=whitef0x0 "Tests") | [
Samuel Laulhau](https://samuellaulhau.fr)
[πŸ’»](https://github.com/tellform/TellForm/commits?author=lalop "Code") [🌍](#translation-lalop "Translation") | [
Arun Pattnaik](http://arun.co)
[🎨](#design-arunpattnaik "Design") | [
ThiΓͺn ToΓ‘n](https://toanalien.com)
[πŸ›](https://github.com/tellform/TellForm/issues?q=author%3Atoanalien "Bug reports") [πŸ’»](https://github.com/tellform/TellForm/commits?author=toanalien "Code") [πŸ“–](https://github.com/tellform/TellForm/commits?author=toanalien "Documentation") | [
Adrian Portabales](https://github.com/AdrianP-)
[πŸ›](https://github.com/tellform/TellForm/issues?q=author%3AAdrianP- "Bug reports") [πŸ’»](https://github.com/tellform/TellForm/commits?author=AdrianP- "Code") | [
Peter Thaleikis](https://github.com/spekulatius)
[πŸ“–](https://github.com/tellform/TellForm/commits?author=spekulatius "Documentation") | [
MickaΓ«l Andrieu](http://www.mickael-andrieu.com)
[πŸ“–](https://github.com/tellform/TellForm/commits?author=mickaelandrieu "Documentation") | From 80669ab2767d93ad74086f7f1b3a7014916744e6 Mon Sep 17 00:00:00 2001 From: User Date: Mon, 7 Aug 2017 15:37:00 +0800 Subject: [PATCH 7/8] Removed fixed height of buttons --- .../views/directiveViews/form/edit-form.client.view.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/modules/forms/admin/views/directiveViews/form/edit-form.client.view.html b/public/modules/forms/admin/views/directiveViews/form/edit-form.client.view.html index 3b6a267f..7d296cd2 100644 --- a/public/modules/forms/admin/views/directiveViews/form/edit-form.client.view.html +++ b/public/modules/forms/admin/views/directiveViews/form/edit-form.client.view.html @@ -585,10 +585,11 @@
+