From 94b02e09a63f9132ecedc46c4d09e423dc2ce378 Mon Sep 17 00:00:00 2001 From: Salim Kanoun Date: Fri, 9 Oct 2020 10:48:31 +0200 Subject: [PATCH] add date format in settings burner --- BackEnd/controllers/authentication.js | 4 ++-- BackEnd/controllers/options.js | 3 ++- BackEnd/model/Options.js | 3 ++- BackEnd/model/monitoring/cdburner/CdBurner.js | 2 +- FrontEnd/src/components/Admin/CDBurner/BurnerOptions.js | 9 +++++++++ FrontEnd/src/components/Authentication.js | 2 -- FrontEnd/src/components/Main/Footer.js | 2 +- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/BackEnd/controllers/authentication.js b/BackEnd/controllers/authentication.js index f7e4acfb3..bccdb58c9 100644 --- a/BackEnd/controllers/authentication.js +++ b/BackEnd/controllers/authentication.js @@ -6,7 +6,7 @@ authentication = async function (req, res) { try { const userObject = new Users(body.username) await userObject.checkPassword(body.password, async function(reponse) { - console.log(reponse) + if (reponse) { let user = new Users(body.username) @@ -29,7 +29,7 @@ authentication = async function (req, res) { var TOKEN = jwt.sign(payload, process.env.TOKEN_SECRET, { expiresIn: '1h' }); - res.cookie("tokenOrthancJs", TOKEN, {secure: true, httpOnly: true}) + res.cookie("tokenOrthancJs", TOKEN, {httpOnly: true}) res.json(true) }) } else { diff --git a/BackEnd/controllers/options.js b/BackEnd/controllers/options.js index e9072f6f9..f420c4929 100644 --- a/BackEnd/controllers/options.js +++ b/BackEnd/controllers/options.js @@ -23,7 +23,8 @@ var updateRobotOptions = async function(req, res){ body.burner_monitoring_level, body.burner_support_type, body.burner_delete_study_after_sent, - body.burner_transfer_syntax + body.burner_transfer_syntax, + body.date_format ) res.json(true) } diff --git a/BackEnd/model/Options.js b/BackEnd/model/Options.js index 0737bb299..0486aa5cd 100644 --- a/BackEnd/model/Options.js +++ b/BackEnd/model/Options.js @@ -24,7 +24,7 @@ const Options = { }, setBurnerOptions : async (burner_monitored_path, burner_viewer_path, burner_label_path, burner_manifacturer, burner_monitoring_level, - burner_support_type, burner_delete_study_after_sent, burner_transfer_syntax ) => { + burner_support_type, burner_delete_study_after_sent, burner_transfer_syntax, date_format ) => { const option = await db.Option.findOne(({ where: { id: 1 } })) @@ -36,6 +36,7 @@ const Options = { option.burner_support_type = burner_support_type option.burner_delete_study_after_sent = burner_delete_study_after_sent option.burner_transfer_syntax = burner_transfer_syntax + option.date_format = date_format await option.save() diff --git a/BackEnd/model/monitoring/cdburner/CdBurner.js b/BackEnd/model/monitoring/cdburner/CdBurner.js index c51106904..fdd681a95 100644 --- a/BackEnd/model/monitoring/cdburner/CdBurner.js +++ b/BackEnd/model/monitoring/cdburner/CdBurner.js @@ -31,7 +31,7 @@ class CdBurner { this.dateOptions = { month: 'numeric', day: 'numeric', year : 'numeric' } //precision of the date const options = await Options.getCdBurnerOptions() - + //format of date (using contry convention) if (options.date_format === "fr") { this.format = "DD/MM/YYYY" diff --git a/FrontEnd/src/components/Admin/CDBurner/BurnerOptions.js b/FrontEnd/src/components/Admin/CDBurner/BurnerOptions.js index 06da3de91..25485b174 100644 --- a/FrontEnd/src/components/Admin/CDBurner/BurnerOptions.js +++ b/FrontEnd/src/components/Admin/CDBurner/BurnerOptions.js @@ -19,6 +19,7 @@ export default class BurnerOptions extends Component{ burner_manifacturer : '', burner_monitoring_level : '', burner_support_type : '', + date_format: '', burner_delete_study_after_sent : false, burner_transfer_syntax : null @@ -40,6 +41,11 @@ export default class BurnerOptions extends Component{ {value : 'DVD', label : 'DVD'} ] + dateFormatOptions = [ + {value: 'uk', label : 'MMDDYYYY'}, + {value: 'fr', label : "DDMMYYYY"} + ] + transferSyntaxOptions = [ {value: 'None', label: 'None (Original TS)'}, {value: '1.2.840.10008.1.2', label: 'Implicit VR Endian'}, @@ -111,6 +117,7 @@ export default class BurnerOptions extends Component{ render(){ return ( + //date_format

CD/DVD Burner Options

@@ -125,6 +132,8 @@ export default class BurnerOptions extends Component{ + +
diff --git a/FrontEnd/src/components/Authentication.js b/FrontEnd/src/components/Authentication.js index 90f3b4086..9276655d7 100644 --- a/FrontEnd/src/components/Authentication.js +++ b/FrontEnd/src/components/Authentication.js @@ -43,8 +43,6 @@ export default class Authentication extends Component { await apis.authentication.logIn(postData).then((answer)=>{ console.log(answer) - // get token from fetch request - const token = answer; newState = { accessCheck : true diff --git a/FrontEnd/src/components/Main/Footer.js b/FrontEnd/src/components/Main/Footer.js index 75485928c..a435f251b 100644 --- a/FrontEnd/src/components/Main/Footer.js +++ b/FrontEnd/src/components/Main/Footer.js @@ -8,7 +8,7 @@ export default class Footer extends Component { render () { return ( -
Orthanc Tools JS: 0.4.4 +
Orthanc Tools JS: 0.4.5