Skip to content

Commit b83738c

Browse files
authored
Refactoring & bug-fixes (#19)
* Renamed admin into member-client (will also be done for user-client) * Adopted commentControllers and service in user-client * fixed portugese document generation * Added German and Portuguese Project Descriptions to Review Page Added missing Concerns to Review Page Improved Layout * Updated setup.js added config.js support * Renamed user in user-client * Updated schema renamed Reviews to Reviewers * Updated queries * Updated apiControllers regarding renamed reviewers * Updated templates in user-client added „general_comment“ and „reviewer(s)“ to submission-view * Updated schema Added attribute „updated“ to Revisions to show the submitted timestamp inside the user-/admin-clients * Updated queries * Updated templates * Added missing fields in accountEditController * Refactoring - integrated navController inside mainController - fixed promises in documentDetailsController - fixed editDocument-template * Changes * Added Authorization to apiControllers - updated apiControllers - updated routes - updated queries * Bug-fixes * Fixes * Started admin-client implementation * Fixed queries & apiControllers * Added services, templates and controllers to member-client (still in progress) * fixed new user creation. * added missing English translations. refactored all text on site into languages.js * Fixed document Creation. Fixed infinite loading screen after User Creation. * Changes * Changes * Changes * Changes * Changes * Fixed registration & sign-up in user-client * Changes * Changes * Updated queries and apiController with authorization * Updated queries and apiControllers for filtering documents by user or course * Implemented controllers and services in admin-client (still in progress) * fixed wrong symbols. * Added missing English Translations. * Improved Layout. * Altered Login-Message on Member client. * Changes * Changes * Changes * Added missing translations * Changes * Updated schema - Renamed „Research_Groups“ as „Working_Groups“ (for better name convention, regarding non-research-groups, like the webteam) - Renamed „deleted“ as „former“ in Members, Institutes, Working_Groups - Renamed „deleted“ as „blocked“ in Users - Set „university_id“, „institute_id“, „working_group_id“ as real reference keys in Members and Users * Renaming research_groups as working_groups * Changes * Fixed queries * Cleaned up repository deleted old admin-client * Updated schema * Fixed queries (updating apiControllers is still in progress) * Fixed apiControllers * Fixed templates and controllers in user-client * Added reviewController and updated templates in admin-client (still in progress) * Template improvements * Updated queries, apiControllers and routes * Implemented reviewController (still in progress) * Translations * Implemented reviewController & apiControllers (reviewing is finally working, but some parts are still in progress) * Added missing controllers in admin-client & template improvements (still in progress) * Fixed and added missing apiControllers (still in progress) * Template and controller improvements (still not finished) * removed 'Signature of Participant' from Statement of Researcher * Updated dependencies * Improvements for createCourseController and template (adding responsibilities is still in progress) * Code-cleaning * Template improvements * Fixed filtering for documents With this fix, documents will be always filter by the institute, the institute_id is given by the authenticated member, so that documents of other institutes can not be seen and reviewed * Fixed queries * Template improvements * Typo-fix * Fixed Authorization for admins * Fixed apiControllers and queries Users, members and courses will be filtered by the institute, which the authenticated member belongs to * Template and controller improvements * Fixed document in navbar * Caching filter settings * Code-cleaning * Added missing controllers and templates in member-client * Template improvements in member-client * Template improvements in member-client * Added Introduction to App to UC. * fixed constraints in SQL Schema. * Refactored group_id to working_group_id in API controller. * Added Delete Functionality for Universities, Institutes, WorkingGroups. - Added controllers - Added Templates - Activated routes - Activated in index.html * Template improvements * Added warning-boxes before deleting administrative entries * Implemented pagination for documents * Updated languages * Template improvements * Fixes * Added missing English Translations. fixed typo in Template * fixed typo. Added link to User-Client on login Page of MC * Added automatic refresh for documents in documentListController * Updated queries and apiControllers for creating and editing Courses and their corresponding Responsibilities * Typo-fixes * Implemented create- and editCourseController in member-client * Updated services in member-client * Updated translations and templates * Typo-fixes * Typo-fixes * Updated queries for application-wide paginations * Updated apiControllers (still in progress) * Implemented application-wide paginations (universityDetailsController and instituteDetailsController are temporary not fully working, will be fixed soon, after the server-side implementation) * Changes * Added createUniversity Functionality. * Fixes * bugfixes. * Added editUniversity Functionality. * Fixed queries and apiControllers * Fixed related institutes of a university in the member-client * Changes * Implemented missing apiControllers * Typo-fixes * Updated queries and apiControllers * Improvements for services, controllers and templates in member- and user-client * Typo-fix * Typo-fixes * Added manual * Template improvements * Added createInstitute Functionality. * fixed typo. * Added createWorkingGroup Functionality. * added Edit Functionality for Institutes and Working Groups. Fixed API Controller for institutes.put. * Typo-fixes * Updated queries and apiControllers * Added pagination for members in user-client * Fixed apiController * Updated translations * Updated languages and templates * Changes * Updated languages and templates * Updated languages and templates * Updated languages and templates * Updated languages and templates * Updated queries and apiControllers * Updated apiControllers * Template improvements * Updated schema * Implemented documentDeleteController in member-client * Implemented documentFilesController in member-client * Implemented userCreate- & userEditController in member-client * Updated email-templates * Added ngCloak to the user- and member-client * Improved email-templates (still in progress) * Improved and added new email-templates * Updated apiControllers revised controllers and added email-support * Added FAQ, Troubleshooting, Contact. * bugfixes. * bugfix. * Added missing translations. * Fixed typos. Uncommented Test Placeholders. Added final Submit Warning. * Updated apiControllers & fixed queries * Updated languages * Improved & fixed email-templates * Changes * Changes * Updated queries and apiControllers * Implemented memberCreate- & memberEditController in member-client (editAccountController in member-client is still in progress) * Typo-fixes * Implemented accountEditController in member-client * Bug-fixes * Implemented server-side sorting updated queries & apiControllers * Fixed queries and apiControllers * Added sorting in all templates of the member-client * Added information before overwriting a review * Fixed queries * Updated services * Fixed queries * Added sorting and pagination to detailsController in member-client * Updated defaults.sql.sample and examples.sql.sample * Implemented login by document in member-client * Improved templates - Added info-fields to document edit template in user-client - Added info-field to document review template * Fixes * Implemented recovery and reset password controllers in API and member-client * Fixed JWTs * Improved templates in user-client * Template improvements * Updated schema Added new relation „Notes“ * Implemented apiControllers for notes and updated queries and other apiControllers * Implemented notes in member-client for auto-saving working-notes * Added missing apiController to retrieve a course by document * Added editSettingsController for a document in member-client (still in progress) * Improved templates * Updated queries * Updated languages * Updated schema Added „secret“ attribute members to setup one administrator, which can not be deleted * Updated queries and apiController to filter documents also with/without a course * Improved templates * Updated queries and apiController to filter all accepted by review and auto accepted documents * Added reviseController in user-client * Removed hard-coded port * Typo-fixes in services * Implemented editSettingsController in member-client * Added server-port * Fixed queries and apiControllers Improved the filtering by an attribute for 3 cases: attribute is „true“ or „false“ or „both“ (=when the boolean is „undefined“) * Fixed services and controllers - renamed global „filter“ to „cached_filter“, as well as corresponding functions, „getFilter“ and „setFilter“ to „getCachedFilter“, „setCachedFilter“ to different the global filters setting from the local filters - fixed filtering by former/blocked attribute * Improved templates * Typo-fixes * Fixed createDocumentController in user-client * Fixed apiControllers * Fixes for connecting a document to a course * Fixed controllers and improved templates * Fixed queries and apiController * Fixed controllers and templates in member- and user-client - Updated local filters to retrieve the correct list of dropdown-options (without „former“, „blocked“ status in createControllers - with „former“, „blocked“ status in editControllers) - Fixed autocompletes in templates * Implemented full text search for documents in member-client #15 * Cleaned up repository * Updated services for full text search * Fixed queries * Typo-fixes * Implemented full text search for universities, institutes & workingGroups in member-client #15 * Implemented full text search for courses in member-client #15 * Implemented full text search for members in member-client #15 * Implemented full text search for users in member-client #15 * Improved templates and controllers * Bug-fixes Fixed bug in dropdowns, caused by options, which have been set in the meantime to former * Improved MC Manual. * fixed. * Updated queries and apiController * Template improvements * Implemented reviseController in user-client (still in progress) * Implemented reviseController in user-client * Added translations * Changes * Updated README * Update README.md * Bug-fix in apiController * fixed typos. rephrased to proper English. * - Fixed the missing translation on submit page. - Moved the "Start Review"/"Open Review" Buttons to top of the page - Added subtitles to Files at download (provided by fhillen) * updated showfiles template. * fixed typo. * Template improvements * Updated language.js * Updated config.js * Bug-fixes and refactoring - deleted config.js and replaced it with an .env-file, following the dotenv-guidline - Code-cleaning - bug-fixes in email-templates and notifications * Bug-fixes and refactoring - Added path variables for the member- & user-client to the .env file - Fixed email-templates - Updated README * Bug-fix * Template improvements * Refactoring loading- & alert-messages Updated languages.js and related controllers in user- and member-client * Typo-fix * Updated help in member-client
1 parent 1b4015d commit b83738c

91 files changed

Lines changed: 2666 additions & 285 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
NODE_ENV='development'
22
SERVER_URL='http://localhost'
33
SERVER_PORT=5000
4+
MEMBER_CLIENT_PATH='/member-client'
5+
USER_CLIENT_PATH='/user-client'
46
HTTP_PORT=5000
57
HTTPS_PORT=5443
68
POSTGRES_HOST='localhost'

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ git clone https://github.com/sitcomlab/Ethics-app.git
184184
node npm install
185185
```
186186

187+
* Alternatively you can also use **yarn** for that (run the command with `sudo`, if you don't have permission):
188+
189+
```
190+
yarn install
191+
```
192+
187193
##### 2.4. Bower
188194

189195
* Install Bower via **npm** (run the command with `sudo`, if you don't have permission):
@@ -255,6 +261,8 @@ node server.js
255261
* `NODE_ENV`: server environment (default: `development`, option: `production`, which uses https with a certificate)
256262
* `SERVER_URL`: url/domain of the host-server (default: `http://ethics-app.uni-muenster.de`)
257263
* `SERVER_PORT`: port number of the host-server (default: `80`)
264+
* `MEMBER_CLIENT_PATH`: path to the member-client on the host-server (default: `/member-client`)
265+
* `USER_CLIENT_PATH`: path to the user-client on the host-server (default: `/user-client`)
258266
* `HTTP_PORT`: port number of the nodejs-server: (default: `5000`)
259267
* `HTTPS_PORT`: secure port number of the nodejs-server: (default: `HTTP_PORT + 443`)
260268
* `POSTGRES_HOST`: Postgres host address (default: `localhost`)

controllers/documents/change_status.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ var types = require('pg').types;
55
types.setTypeParser(1700, 'text', parseFloat);
66
var _ = require('underscore');
77
var jwt = require('jsonwebtoken');
8-
var jwtSecret = require('../../server.js').jwtSecret;
98
var mustache = require('mustache');
109
var moment = require('moment');
1110
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
11+
var user_client_path = process.env.USER_CLIENT_PATH;
1212
var pool = require('../../server.js').pool;
1313
var transporter = require('../../server.js').transporter;
1414

@@ -380,6 +380,7 @@ exports.request = function(req, res) {
380380
status_description_1: status_description_1,
381381
status_description_2: status_description_2,
382382
domain: domain,
383+
user_client_path: user_client_path,
383384
year: moment().format("YYYY")
384385
});
385386

controllers/documents/post.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var uuid = require('uuid');
88
var mustache = require('mustache');
99
var moment = require('moment');
1010
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
11+
var user_client_path = process.env.USER_CLIENT_PATH;
1112
var pool = require('../../server.js').pool;
1213
var transporter = require('../../server.js').transporter;
1314

@@ -211,6 +212,7 @@ exports.request = function(req, res) {
211212
user: user,
212213
document: document,
213214
domain: domain,
215+
user_client_path: user_client_path,
214216
year: moment().format("YYYY")
215217
});
216218

controllers/documents/submit.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var _ = require('underscore');
77
var mustache = require('mustache');
88
var moment = require('moment');
99
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
10+
var member_client_path = process.env.MEMBER_CLIENT_PATH;
1011
var pool = require('../../server.js').pool;
1112
var transporter = require('../../server.js').transporter;
1213

@@ -373,9 +374,6 @@ exports.request = function(req, res) {
373374
concern.q13_sign = "no";
374375
}
375376

376-
// Formatting
377-
document.link = domain + "/committee/documents/" + document.document_id + "/login";
378-
379377
// Notify each committee member
380378
async.eachOfSeries(members, function (member, key, callback) {
381379

@@ -389,6 +387,7 @@ exports.request = function(req, res) {
389387
concern: concern,
390388
course: course,
391389
domain: domain,
390+
member_client_path: member_client_path,
392391
year: moment().format("YYYY")
393392
});
394393

controllers/members/post.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var _ = require('underscore');
77
var mustache = require('mustache');
88
var moment = require('moment');
99
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
10+
var member_client_path = process.env.MEMBER_CLIENT_PATH;
1011
var jwt = require('jsonwebtoken');
1112
var pool = require('../../server.js').pool;
1213
var transporter = require('../../server.js').transporter;
@@ -38,7 +39,7 @@ exports.request = function(req, res) {
3839
var token = req.headers.authorization.substring(7);
3940

4041
// Verify token
41-
jwt.verify(token, jwtSecret, function(err, decoded) {
42+
jwt.verify(token, process.env.JWTSECRET, function(err, decoded) {
4243
if(err){
4344
callback(new Error("Authorization failed"), 401);
4445
} else {
@@ -89,6 +90,7 @@ exports.request = function(req, res) {
8990
var output = mustache.render(template_member_account_created, {
9091
member: member,
9192
domain: domain,
93+
member_client_path: member_client_path,
9294
year: moment().format("YYYY")
9395
});
9496

controllers/members/put.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var _ = require('underscore');
77
var mustache = require('mustache');
88
var moment = require('moment');
99
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
10+
var member_client_path = process.env.MEMBER_CLIENT_PATH;
1011
var jwt = require('jsonwebtoken');
1112
var pool = require('../../server.js').pool;
1213
var transporter = require('../../server.js').transporter;
@@ -224,6 +225,7 @@ exports.request = function(req, res) {
224225
member: member,
225226
updated_member: updated_member,
226227
domain: domain,
228+
member_client_path: member_client_path,
227229
year: moment().format("YYYY")
228230
});
229231
} else {
@@ -233,6 +235,7 @@ exports.request = function(req, res) {
233235
member: member,
234236
updated_member: updated_member,
235237
domain: domain,
238+
member_client_path: member_client_path,
236239
year: moment().format("YYYY")
237240
});
238241
}

controllers/recovery/find_member_by_email.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var _ = require('underscore');
77
var mustache = require('mustache');
88
var moment = require('moment');
99
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
10+
var member_client_path = process.env.MEMBER_CLIENT_PATH;
1011
var pool = require('../../server.js').pool;
1112
var transporter = require('../../server.js').transporter;
1213
var jwt = require('jsonwebtoken');
@@ -78,6 +79,7 @@ exports.request = function(req, res) {
7879
var output = mustache.render(template_member_recovery, {
7980
member: member,
8081
domain: domain,
82+
member_client_path: member_client_path,
8183
year: moment().format("YYYY")
8284
});
8385

controllers/recovery/find_user_by_email.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var _ = require('underscore');
77
var mustache = require('mustache');
88
var moment = require('moment');
99
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
10+
var user_client_path = process.env.USER_CLIENT_PATH;
1011
var pool = require('../../server.js').pool;
1112
var transporter = require('../../server.js').transporter;
1213

@@ -142,6 +143,7 @@ exports.request = function(req, res) {
142143
amount: amount,
143144
amount_description: amount_description,
144145
domain: domain,
146+
user_client_path: user_client_path,
145147
year: moment().format("YYYY")
146148
});
147149

controllers/recovery/reset_password.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var _ = require('underscore');
77
var mustache = require('mustache');
88
var moment = require('moment');
99
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
10+
var member_client_path = process.env.MEMBER_CLIENT_PATH;
1011
var pool = require('../../server.js').pool;
1112
var transporter = require('../../server.js').transporter;
1213
var jwt = require('jsonwebtoken');

0 commit comments

Comments
 (0)