LT-302: Adding close buttons to Audit Log screen
This commit is contained in:
parent
c004aee40f
commit
3c831c5d5a
@ -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');
|
||||
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
<template name="hipaaCloseButton">
|
||||
<div class="close-btn">
|
||||
{{#if header}}
|
||||
<button type="button" class="close">
|
||||
<span>×</span>
|
||||
</button>
|
||||
{{else}}
|
||||
<button type="button" class="btn btn-default">
|
||||
Close
|
||||
</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
@ -0,0 +1,12 @@
|
||||
Template.hipaaCloseButton.events({
|
||||
'click button': function() {
|
||||
var history = window.history;
|
||||
|
||||
if(history.length > 0) {
|
||||
history.go(-1);
|
||||
}
|
||||
else {
|
||||
window.location = '/'
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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>
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -102,4 +102,4 @@ Template.hipaaRibbon.helpers({
|
||||
getEndDate: function () {
|
||||
return moment(Session.get("endDateFilter")).format("YYYY-MM-DD");
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -14,6 +14,7 @@ if (Meteor.isClient) {
|
||||
select: "",
|
||||
ribbon: ""
|
||||
},
|
||||
highlightColor: ""
|
||||
highlightColor: "",
|
||||
closeButton: false
|
||||
});
|
||||
}
|
||||
|
||||
@ -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');
|
||||
});
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -1,2 +1,6 @@
|
||||
#hipaaLogPage
|
||||
margin-top: 40px
|
||||
margin-top: 40px
|
||||
#hipaaAuditLog
|
||||
.hipaaAuditItem
|
||||
&:nth-child(1)
|
||||
border-top: 1px solid lightgray
|
||||
Loading…
Reference in New Issue
Block a user