LT-302: Adding close buttons to Audit Log screen

This commit is contained in:
Eloízio Salgado 2016-11-11 18:56:01 -02:00 committed by Erik Ziegler
parent c004aee40f
commit 3c831c5d5a
13 changed files with 87 additions and 12 deletions

View File

@ -8,6 +8,13 @@ Template.app.onCreated(() => {
ViewerData = Session.get('ViewerData') || {};
});
Template.app.onRendered(() => {
const contentId = Session.get('activeContentId');
if(contentId === viewerContentId) {
switchToTab(contentId);
}
});
Template.app.events({
'click .js-toggle-studyList'() {
const contentId = Session.get('activeContentId');

View File

@ -29,12 +29,17 @@ Router.route('/', function() {
if (Meteor.user() && Meteor.userId()) {
if (verifyEmail && Meteor.user().emails && !Meteor.user().emails[0].verified) {
this.render('emailVerification', routerOptions);
} else {
Session.set('activeContentId', 'studylistTab');
}
else {
const contentId = Session.get('activeContentId');
if(!contentId) {
Session.set('activeContentId', 'studylistTab');
}
this.render('app', routerOptions);
}
} else {
}
else {
this.render('entrySignIn', routerOptions);
}
});

View File

@ -0,0 +1,13 @@
<template name="hipaaCloseButton">
<div class="close-btn">
{{#if header}}
<button type="button" class="close">
<span>&times;</span>
</button>
{{else}}
<button type="button" class="btn btn-default">
Close
</button>
{{/if}}
</div>
</template>

View File

@ -0,0 +1,12 @@
Template.hipaaCloseButton.events({
'click button': function() {
var history = window.history;
if(history.length > 0) {
history.go(-1);
}
else {
window.location = '/'
}
}
});

View File

@ -0,0 +1,16 @@
.close-btn {
text-align: right;
padding: 5px 5px 0;
margin-right: 10px;
&:before,
&:after {
display: table;
content: " ";
clear: both;
}
.btn-default {
margin-bottom: 5px;
}
}

View File

@ -1,5 +1,9 @@
<template name="hipaaLogPage">
<div id="hipaaLogPage" class="page">
{{#if hasCloseButtons}}
{{> hipaaCloseButton header="true" }}
{{/if}}
{{> hipaaRibbon }}
<div class="container">
@ -8,5 +12,9 @@
</div>
</div>
{{#if hasCloseButtons}}
{{> hipaaCloseButton }}
{{/if}}
</div>
</template>

View File

@ -4,9 +4,12 @@ Router.route("/audit", {
});
Template.hipaaLogPage.helpers({});
Template.hipaaLogPage.events({});
Template.hipaaLogPage.helpers({
hasCloseButtons: function() {
var hipaaAuditLog = Session.get('HipaaAuditLogConfig');
return hipaaAuditLog && hipaaAuditLog.closeButton;
}
});
// We probably don't need this, but the subscription in subscriptions.js doesn't seem to be working?
Template.hipaaLogPage.onCreated(function() {

View File

@ -102,4 +102,4 @@ Template.hipaaRibbon.helpers({
getEndDate: function () {
return moment(Session.get("endDateFilter")).format("YYYY-MM-DD");
}
});
});

View File

@ -14,6 +14,7 @@ if (Meteor.isClient) {
select: "",
ribbon: ""
},
highlightColor: ""
highlightColor: "",
closeButton: false
});
}

View File

@ -37,6 +37,10 @@ Package.on_use(function (api) {
api.addFiles('components/hipaaLogPage/hipaaLogPage.js', "client");
api.addFiles('components/hipaaLogPage/hipaaLogPage.less', "client");
api.addFiles('components/hipaaCloseButton/hipaaCloseButton.html', "client");
api.addFiles('components/hipaaCloseButton/hipaaCloseButton.js', "client");
api.addFiles('components/hipaaCloseButton/hipaaCloseButton.less', "client");
api.export('HipaaAuditLog');
});

View File

@ -62,6 +62,7 @@ switchToTab = function(contentId) {
}
var studies = ViewerData[contentId].studies;
if (studies) {
// ViewerData already has the meta data (in cases when studylist is launched externally)
viewStudiesInTab(contentId, studies);

View File

@ -1,4 +1,4 @@
Meteor.startup(function() {
Meteor.startup(() => {
// TODO: Configure some settings
HipaaAuditLog.configure({
classes: {
@ -6,6 +6,7 @@ Meteor.startup(function() {
select: 'form-control',
ribbon: ''
},
highlightColor: '#006289'
highlightColor: '#006289',
closeButton: true
});
});
});

View File

@ -1,2 +1,6 @@
#hipaaLogPage
margin-top: 40px
margin-top: 40px
#hipaaAuditLog
.hipaaAuditItem
&:nth-child(1)
border-top: 1px solid lightgray