From 11e300f0136027d8813925c9414bcea9fc4e5164 Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Mon, 15 Feb 2016 14:36:01 +0100 Subject: [PATCH] Style and bug fixes related to active-entry and hipaaAuditLog integration --- LesionTracker/client/body.styl | 20 ++++++++- LesionTracker/client/routes.js | 4 +- .../components/entrySignIn/entrySignIn.js | 2 +- Packages/active-entry/server/methods.js | 17 ++++++- .../components/activeEntry/activeEntry.js | 36 +++++++++++++++ .../components/activeEntry/activeEntry.styl | 13 ++++++ .../components/hipaaLogPage/hipaaLogPage.js | 11 +++++ .../components/hipaaLogPage/hipaaLogPage.styl | 2 + .../lesionTrackerLayout.html | 45 ++++++++++++------- .../lesionTrackerLayout.js | 27 ++++++----- .../lesionTrackerLayout.styl | 32 ++++++------- .../optionsButton/optionsButton.html | 17 +++---- .../optionsButton/optionsButton.styl | 6 --- Packages/lesiontracker/package.js | 8 +++- Packages/worklist/lib/getStudyMetadata.js | 11 +++++ 15 files changed, 186 insertions(+), 65 deletions(-) create mode 100644 Packages/lesiontracker/client/components/activeEntry/activeEntry.js create mode 100644 Packages/lesiontracker/client/components/activeEntry/activeEntry.styl create mode 100644 Packages/lesiontracker/client/components/hipaaLogPage/hipaaLogPage.js create mode 100644 Packages/lesiontracker/client/components/hipaaLogPage/hipaaLogPage.styl delete mode 100644 Packages/lesiontracker/client/components/optionsButton/optionsButton.styl diff --git a/LesionTracker/client/body.styl b/LesionTracker/client/body.styl index 79a0ebbae..2ce1ba4b6 100644 --- a/LesionTracker/client/body.styl +++ b/LesionTracker/client/body.styl @@ -1,6 +1,24 @@ // TODO: Move all of this into the LesionTracker package +html + height: 100% + width: 100% + + min-height: 100% + min-width: 100% + + body - background-color: #202020 + height: 100% + width: 100% + + min-height: 100% + min-width: 100% + + /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,45484d+100 */ + background: #000000; /* Old browsers */ + background: -moz-linear-gradient(top, #000000 0%, #45484d 100%); /* FF3.6-15 */ + background: -webkit-linear-gradient(top, #000000 0%,#45484d 100%); /* Chrome10-25,Safari5.1-6 */ + background: linear-gradient(to bottom, #000000 0%,#45484d 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ .tab-content height: calc(100% - 40px) diff --git a/LesionTracker/client/routes.js b/LesionTracker/client/routes.js index 69e0e9e74..e4af04d3a 100644 --- a/LesionTracker/client/routes.js +++ b/LesionTracker/client/routes.js @@ -33,7 +33,7 @@ Router.route('/', function() { // Check user is logged in if (!Meteor.user() || !Meteor.userId()) { this.render('entrySignIn', routerOptions); - } else{ + } else { this.render('worklist', routerOptions); } }); @@ -42,7 +42,7 @@ Router.route('/worklist', function() { // Check user is logged in if (!Meteor.user() || !Meteor.userId()) { this.render('entrySignIn', routerOptions); - } else{ + } else { this.render('worklist', routerOptions); } }); diff --git a/Packages/active-entry/components/entrySignIn/entrySignIn.js b/Packages/active-entry/components/entrySignIn/entrySignIn.js index f6af2401b..374bc121e 100755 --- a/Packages/active-entry/components/entrySignIn/entrySignIn.js +++ b/Packages/active-entry/components/entrySignIn/entrySignIn.js @@ -1,6 +1,6 @@ // REFACTOR: Move to ActiveRecord object -Session.set("defaultSignInMessage", "Improve your clinical practice with checklists."); +//Session.set("defaultSignInMessage", "Improve your clinical practice with checklists."); //================================================================================================== // ROUTER diff --git a/Packages/active-entry/server/methods.js b/Packages/active-entry/server/methods.js index 5b6f4c268..9dab3cb13 100644 --- a/Packages/active-entry/server/methods.js +++ b/Packages/active-entry/server/methods.js @@ -45,13 +45,26 @@ Meteor.methods({ }, getFailedAttemptsCount: function(emailAddress) { - return Meteor.users.findOne({"emails.address": emailAddress}).failedPasswordAttempts || 0; + // Check if the user actually exists, and if not, stop here + var currentUser = Meteor.users.findOne({"emails.address": emailAddress}); + if (!currentUser) { + return; + } + + return currentUser.failedPasswordAttempts || 0; }, updateFailedAttempts: function(failedAttemptsParameters) { var emailAddress = failedAttemptsParameters[0]; var failedAttemptsLimit = failedAttemptsParameters[1]; - var failedAttemptCount = Meteor.users.findOne({"emails.address": emailAddress}).failedPasswordAttempts || 0; + + // Check if the user actually exists, and if not, stop here + var currentUser = Meteor.users.findOne({"emails.address": emailAddress}); + if (!currentUser) { + return; + } + + var failedAttemptCount = currentUser.failedPasswordAttempts || 0; if (failedAttemptCount == failedAttemptsLimit) { return failedAttemptCount; } else { diff --git a/Packages/lesiontracker/client/components/activeEntry/activeEntry.js b/Packages/lesiontracker/client/components/activeEntry/activeEntry.js new file mode 100644 index 000000000..21e509c4d --- /dev/null +++ b/Packages/lesiontracker/client/components/activeEntry/activeEntry.js @@ -0,0 +1,36 @@ +Meteor.startup(function() { + if (Meteor.isClient){ + ActiveEntry.configure({ + logo: { + url: '/images/logo.png', + displayed: true + }, + signIn: { + displayFullName: true, + destination: '/worklist' + }, + signUp: { + destination: '/worklist' + }, + themeColors: { + primary: '' + } + }); + } + + if (Meteor.isServer){ + Accounts.emailTemplates.siteName = 'AwesomeSite'; + Accounts.emailTemplates.from = 'AwesomeSite Admin '; + Accounts.emailTemplates.enrollAccount.subject = function(user) { + return 'Welcome to Awesome Town, ' + user.profile.name; + }; + + Accounts.emailTemplates.enrollAccount.text = function(user, url) { + return 'You have been selected to participate in building a better future!' + + ' To activate your account, simply click the link below:\n\n' + + url; + }; + + process.env.MAIL_URL = 'smtp://sandboxid.mailgun.org:mypassword@smtp.mailgun.org:587'; + } +}); diff --git a/Packages/lesiontracker/client/components/activeEntry/activeEntry.styl b/Packages/lesiontracker/client/components/activeEntry/activeEntry.styl new file mode 100644 index 000000000..e179b9e1f --- /dev/null +++ b/Packages/lesiontracker/client/components/activeEntry/activeEntry.styl @@ -0,0 +1,13 @@ +#entrySignIn.entryPage, +#entrySignUp.entryPage + .wrapper-auth + .title-auth + color: white + .entryLogo + margin-top: 50px + height: 50px + width: 50px + +// TODO: Fix theming in active-entry so we don't have to do this +.entryPage .wrapper-auth .subtitle-auth + color: white !important \ No newline at end of file diff --git a/Packages/lesiontracker/client/components/hipaaLogPage/hipaaLogPage.js b/Packages/lesiontracker/client/components/hipaaLogPage/hipaaLogPage.js new file mode 100644 index 000000000..832248371 --- /dev/null +++ b/Packages/lesiontracker/client/components/hipaaLogPage/hipaaLogPage.js @@ -0,0 +1,11 @@ +Meteor.startup(function() { + // TODO: Configure some settings + HipaaAuditLog.configure({ + classes: { + input: 'form-control', + select: 'form-control', + ribbon: '' + }, + highlightColor: '#006289' + }); +}); diff --git a/Packages/lesiontracker/client/components/hipaaLogPage/hipaaLogPage.styl b/Packages/lesiontracker/client/components/hipaaLogPage/hipaaLogPage.styl new file mode 100644 index 000000000..65b1f60e8 --- /dev/null +++ b/Packages/lesiontracker/client/components/hipaaLogPage/hipaaLogPage.styl @@ -0,0 +1,2 @@ +#hipaaLogPage + margin-top: 40px \ No newline at end of file diff --git a/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.html b/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.html index e5cbd445d..72ca5e8b7 100644 --- a/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.html +++ b/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.html @@ -1,26 +1,39 @@ \ No newline at end of file diff --git a/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.js b/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.js index 0c02236ce..d9c384f37 100644 --- a/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.js +++ b/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.js @@ -1,6 +1,8 @@ +Session.set('defaultSignInMessage', 'Tumor tracking in your browser.'); + Template.lesionTrackerLayout.events({ 'click #logoutButton': function() { - Meteor.logout(function(){ + Meteor.logout(function() { Router.go('/entrySignIn'); }); }, @@ -10,7 +12,7 @@ Template.lesionTrackerLayout.events({ }); Template.lesionTrackerLayout.helpers({ - 'fullName': function() { + fullName: function() { return Meteor.user().profile.fullName; } }); @@ -18,27 +20,30 @@ Template.lesionTrackerLayout.helpers({ Template.lesionTrackerLayout.onCreated(function() { // Show countdown dialog var handle; - $(document).on('TriggerOpenTimeoutCountdownDialog', function (e, leftTime) { + $(document).on('TriggerOpenTimeoutCountdownDialog', function(e, leftTime) { // TODO: Show modal dialog handle = setInterval(function() { - leftTime --; + leftTime--; // Set countdownDialogLeftTime session - Session.set("countdownDialogLeftTime", leftTime); + Session.set('countdownDialogLeftTime', leftTime); + // Show dialog - if ($("#timeoutCountdownDialog").css("display") == "none") { - $("#timeoutCountdownDialog").css("display", "block"); + var dialog = $('#timeoutCountdownDialog'); + if (dialog.css('display') === 'none') { + dialog.css('display', 'block'); } }, 1000); }); - $(document).on('TriggerCloseTimeoutCountdownDialog', function (e) { - $("#timeoutCountdownDialog").css("display", "none"); + $(document).on('TriggerCloseTimeoutCountdownDialog', function(e) { + var dialog = $('#timeoutCountdownDialog'); + dialog.css('display', 'none'); if (handle) { clearInterval(handle); // Close the dialog - $("#timeoutCountdownDialog").css("display", "none"); + dialog.css('display', 'none'); } }); -}); \ No newline at end of file +}); diff --git a/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.styl b/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.styl index 1ec80b232..65219a525 100644 --- a/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.styl +++ b/Packages/lesiontracker/client/components/lesionTrackerLayout/lesionTrackerLayout.styl @@ -1,19 +1,18 @@ .logoContainer - position: absolute; - height: 40px; - top: 0; - right: 0; - color: white; + position: absolute + height: 40px + top: 0 + right: 0 + padding: 0 10px + color: white @media only screen and (min-device-width : 375px) and (max-device-width : 667px) and (orientation : portrait) width: 15% - #userProfile + #menu position: relative float: right - - .nav-pills > li > a:hover, .nav .open > a, .nav .open > a:hover, .nav .open > a:focus - background-color: #eee - color: black + height: 100% + line-height: 40px .dropdown-menu > li > a:hover background-color: #eee @@ -22,7 +21,10 @@ margin-right: 5px .dropdown-toggle - color: #C1C1C1 + color: white + height: 100% + font-size: 12pt + font-family: "Sanchez" .divider height: 2px @@ -41,7 +43,7 @@ height: 30px float: left margin-right: 10px - margin-top: 5px; + margin-top: 5px /* Media queries for iPhone6*/ @media only screen and (min-device-width : 375px) and (max-device-width : 667px) and (orientation : portrait) height: 20px @@ -51,11 +53,11 @@ h4.name float: left - margin: 10px 0; + margin: 10px 0 font-family: "Sanchez" - color: #C1C1C1 + color: white @media only screen and (min-device-width : 375px) and (max-device-width : 667px) and (orientation : portrait) font-size: 0.3em font-size: 0.3em - width: 50%; + width: 50% diff --git a/Packages/lesiontracker/client/components/optionsButton/optionsButton.html b/Packages/lesiontracker/client/components/optionsButton/optionsButton.html index 5227dac2f..72f0dab19 100644 --- a/Packages/lesiontracker/client/components/optionsButton/optionsButton.html +++ b/Packages/lesiontracker/client/components/optionsButton/optionsButton.html @@ -1,12 +1,9 @@ \ No newline at end of file diff --git a/Packages/lesiontracker/client/components/optionsButton/optionsButton.styl b/Packages/lesiontracker/client/components/optionsButton/optionsButton.styl deleted file mode 100644 index 47cef16c2..000000000 --- a/Packages/lesiontracker/client/components/optionsButton/optionsButton.styl +++ /dev/null @@ -1,6 +0,0 @@ -// These settings are temporary! -.optionsButton - position: absolute - top: 3px - right: 350px - cursor: pointer \ No newline at end of file diff --git a/Packages/lesiontracker/package.js b/Packages/lesiontracker/package.js index 60bf9870a..040240fec 100644 --- a/Packages/lesiontracker/package.js +++ b/Packages/lesiontracker/package.js @@ -58,8 +58,14 @@ Package.onUse(function(api) { api.addFiles('client/components/associationModal/associationModal.styl', 'client'); api.addFiles('client/components/associationModal/associationModal.js', 'client'); + + api.addFiles('client/components/activeEntry/activeEntry.styl', 'client'); + api.addFiles('client/components/activeEntry/activeEntry.js', 'client'); + + api.addFiles('client/components/hipaaLogPage/hipaaLogPage.styl', 'client'); + api.addFiles('client/components/hipaaLogPage/hipaaLogPage.js', 'client'); + api.addFiles('client/components/optionsButton/optionsButton.html', 'client'); - api.addFiles('client/components/optionsButton/optionsButton.styl', 'client'); api.addFiles('client/components/optionsModal/optionsModal.html', 'client'); api.addFiles('client/components/optionsModal/optionsModal.styl', 'client'); diff --git a/Packages/worklist/lib/getStudyMetadata.js b/Packages/worklist/lib/getStudyMetadata.js index a977d11d4..222bda47a 100644 --- a/Packages/worklist/lib/getStudyMetadata.js +++ b/Packages/worklist/lib/getStudyMetadata.js @@ -24,6 +24,17 @@ getStudyMetadata = function(studyInstanceUid, doneCallback, failCallback) { // If no study metadata is in the cache variable, we need to retrieve it from // the server with a call. Meteor.call('GetStudyMetadata', studyInstanceUid, function(error, study) { + var hipaaEvent = { + eventType: "viewed", + userId: Meteor.userId(), + userName: Meteor.user().profile.fullName, + collectionName: "Study", + recordId: studyInstanceUid, + patientId: study.patientId, + patientName: study.patientName + }; + HipaaLogger.logEvent(hipaaEvent); + log.info('worklistStudy getStudyMetadata: ' + studyInstanceUid); if (error) {