forked from sitcomlab/Ethics-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sitcomlab#50 from sitcomlab/dev
Dev
- Loading branch information
Showing
50 changed files
with
1,621 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,6 @@ REMIND_AFTER=7 | |
REMIND_UNITL=0 | ||
REMIND_ALL=true | ||
JWTSECRET='secret' | ||
|
||
UPLOAD_DIR='uploads/' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Version 1.4.1 | ||
- Added Email Notification to all Members when Review is started (and not pending anymore) | ||
- Added q14 (Custom Files) | ||
- Added Password Generation on Cover Sheet | ||
- bugfixes & style improvements | ||
- Added Debugging for SMTP Connection | ||
|
||
>>>>>>> Stashed changes | ||
# Version 1.4.0 | ||
- Added Reminder Email to be sent out after 7 days of inactivity with still pending reviews. | ||
- Added Revision Number on Output Documents | ||
- Functionality for user to revert Document to Draft Phase after it was already approved (for fixing typos etc.) | ||
- Added downloadable How-To Guide | ||
- Added Cover Sheet Generation | ||
- Status now explicitly listed on Status Overview Page | ||
- various bugfixes | ||
|
||
# Version 1.0 | ||
- Initial App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,33 @@ | ||
{ | ||
"name": "ethics-app", | ||
"version": "0.0.1", | ||
"authors": [ | ||
"Nicholas Schiestel <[email protected]>" | ||
], | ||
"description": "Ethics-App for the Institute for Geoinformatics, Münster", | ||
"license": "MIT", | ||
"private": true, | ||
"dependencies": { | ||
"angular": "1.6.4", | ||
"angular-momentjs": "^0.2.2", | ||
"angular-route": "1.6.4", | ||
"angular-sanitize": "1.6.4", | ||
"angular-translate": "^2.11.1", | ||
"bootstrap": "v4.0.0-alpha.6", | ||
"font-awesome": "^4.6.3", | ||
"jquery": "^3.1.0", | ||
"moment": "^2.14.1", | ||
"tether": "^1.3.7", | ||
"flag-icon-css": "^2.0.0", | ||
"underscore": "^1.8.3", | ||
"angular-underscore-module": "^1.0.3", | ||
"angucomplete-alt": "^3.0.0" | ||
}, | ||
"resolutions": { | ||
"angular": "1.6.4", | ||
"angular-route": "1.6.4", | ||
"angular-sanitize": "1.6.4", | ||
"bootstrap": "v4.0.0-alpha.6" | ||
} | ||
"name": "ethics-app", | ||
"version": "0.0.1", | ||
"authors": [ | ||
"Nicholas Schiestel <[email protected]>" | ||
], | ||
"description": "Ethics-App for the Institute for Geoinformatics, Münster", | ||
"license": "MIT", | ||
"private": true, | ||
"dependencies": { | ||
"angular": "1.6.4", | ||
"angular-momentjs": "^0.2.2", | ||
"angular-route": "1.6.4", | ||
"angular-sanitize": "1.6.4", | ||
"angular-translate": "^2.11.1", | ||
"bootstrap": "v4.0.0-alpha.6", | ||
"font-awesome": "^4.6.3", | ||
"jquery": "^3.1.0", | ||
"moment": "^2.14.1", | ||
"tether": "^1.3.7", | ||
"flag-icon-css": "^2.0.0", | ||
"underscore": "^1.8.3", | ||
"angular-underscore-module": "^1.0.3", | ||
"angucomplete-alt": "^3.0.0", | ||
"angular-upload": "^1.0.12" | ||
}, | ||
"resolutions": { | ||
"angular": "1.6.4", | ||
"angular-route": "1.6.4", | ||
"angular-sanitize": "1.6.4", | ||
"bootstrap": "v4.0.0-alpha.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
var async = require('async'); | ||
var colors = require('colors'); | ||
var pg = require('pg'); | ||
var types = require('pg').types; | ||
types.setTypeParser(1700, 'text', parseFloat); | ||
var _ = require('underscore'); | ||
var pool = require('../../server.js').pool; | ||
|
||
var fs = require("fs"); | ||
var dir = "/../../sql/queries/concerns/"; | ||
var query_get_concern = fs.readFileSync(__dirname + dir + 'get.sql', 'utf8').toString(); | ||
var query_add_file = fs.readFileSync(__dirname + dir + 'set_uploaded_file.sql', 'utf8').toString(); | ||
|
||
|
||
// EDIT | ||
exports.upload = function(req, res) { | ||
|
||
async.waterfall([ | ||
function(callback){ | ||
// Connect to database | ||
pool.connect(function(err, client, done) { | ||
if(err) { | ||
callback(err, 500); | ||
} else { | ||
callback(null, client, done); | ||
} | ||
}); | ||
}, | ||
function(client, done, callback) { | ||
// Database query | ||
client.query(query_get_concern, [ | ||
req.params.concern_id | ||
], function(err, result) { | ||
done(); | ||
if (err) { | ||
callback(err, 500); | ||
} else { | ||
// Check if Concern exists | ||
if (result.rows.length === 0) { | ||
callback(new Error("Concern not found"), 404); | ||
} else { | ||
callback(null, client, done); | ||
} | ||
} | ||
}); | ||
}, | ||
function(client, done, callback) { | ||
// TODO: Add object/schema validation | ||
var object = { | ||
concern_id: req.params.concern_id, | ||
q14_filename: req.file.originalname, | ||
q14_filepath: '/files/custom/' + req.headers['x-documentid'] + "/" + req.file.filename | ||
}; | ||
var params = _.values(object); | ||
callback(null, client, done, params); | ||
}, | ||
function(client, done, params, callback){ | ||
// Database query | ||
client.query(query_add_file, params, function(err, result) { | ||
done(); | ||
if (err) { | ||
callback(err, 500); | ||
} else { | ||
callback(null, 200, params[2], result.rows[0]); | ||
} | ||
}); | ||
} | ||
], function(err, code, destination, result) { | ||
if(err){ | ||
console.error(colors.red(err)); | ||
res.status(code).send(err.message); | ||
} else { | ||
res.status(code).send(destination); | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,6 +170,8 @@ exports.request = function(req, res) { | |
callback(null, client, done, document, course, revision, description, concern, 3); | ||
} else if(concern.q13_value){ | ||
callback(null, client, done, document, course, revision, description, concern, 3); | ||
} else if(concern.q14_value){ | ||
callback(null, client, done, document, course, revision, description, concern, 3); | ||
} else { | ||
// Check if document has been already in review | ||
if(document.status === 5){ | ||
|
@@ -373,6 +375,14 @@ exports.request = function(req, res) { | |
concern.q13_label = "badge-success"; | ||
concern.q13_sign = "no"; | ||
} | ||
|
||
if(concern.q14_value){ | ||
concern.q14_label = "badge-danger"; | ||
concern.q14_sign = "yes"; | ||
} else { | ||
concern.q14_label = "badge-success"; | ||
concern.q14_sign = "no"; | ||
} | ||
|
||
// Notify each committee member | ||
async.eachOfSeries(members, function (member, key, callback) { | ||
|
@@ -401,9 +411,10 @@ exports.request = function(req, res) { | |
address: process.env.SENDER_EMAIL_ADDRESS | ||
}, | ||
to: member.email_address, | ||
subject: "[Ethics-App] A document needs your review", | ||
subject: "[Ethics-App] A Study needs your review - Study Title: " + description.en_title, | ||
text: text, | ||
html: output | ||
html: output, | ||
messageId: document.document_id + "[email protected]" | ||
}, function(err, info) { | ||
if (err) { | ||
callback(err); | ||
|
Oops, something went wrong.