WIP reorganization

This commit is contained in:
Erik Ziegler committed 2018-12-12 09:10:39 +01:00
1 parent 6706dfe634
commit 054e37dfb7
266 files changed
+98 -620

No files matched your search

@@ -0,0 +1,8 @@
<template name="emailVerification">
<div id="emailVerification">
<div id="emailVerificationContent">
<h3>Verify Your Email Address</h3>
<p>We need to verify your email address. We've sent an email to <b>{{emailAddress}}</b> to verify your address. Please click the link in your email to continue.</p>
</div>
</div>
</template>
@@ -0,0 +1,5 @@
Template.emailVerification.helpers({
emailAddress: function() {
return Meteor.user().emails[0].address;
}
});
@@ -0,0 +1,15 @@
#emailVerification
#emailVerificationContent
position: absolute
top: 0
bottom: 0
left: 0
right: 0
margin: auto
width: 60%
height: 20%
z-index: 100
border-radius: 5px
padding: 10px 20px 10px 20px
background-color: rgba(255,255,255,1)
outline: none
@@ -0,0 +1,12 @@
Meteor.startup(() => {
// TODO: Configure some settings
HipaaAuditLog.configure({
classes: {
input: 'form-control',
select: 'form-control',
ribbon: ''
},
highlightColor: '#006289',
closeButton: true
});
});
@@ -0,0 +1,6 @@
#hipaaLogPage
margin-top: 40px
#hipaaAuditLog
.hipaaAuditItem
&:nth-child(1)
border-top: 1px solid lightgray
@@ -0,0 +1,11 @@
import './emailVerification/emailVerification.html';
import './emailVerification/emailVerification.styl';
import './emailVerification/emailVerification.js';
import './hipaaLogPage/hipaaLogPage.styl';
import './hipaaLogPage/hipaaLogPage.js';
import './lastLoginModal/lastLoginModal.html';
import './timeoutCountdownDialog/timeoutCountdownDialog.html';
import './timeoutCountdownDialog/timeoutCountdownDialog.js';
@@ -0,0 +1,10 @@
<template name="lastLoginModal">
{{#dialogSimple (extend this dialogClass='modal-blank')}}
<div class="alert alert-info" style="margin: 0 auto;">
<a href="#" class="close" data-dismiss="modal">&times;</a>
{{#if lastLoginDate}}
<h5>You last logged in on <strong>{{lastLoginDate}}</strong></h5>
{{/if}}
</div>
{{/dialogSimple}}
</template>
@@ -0,0 +1,5 @@
<template name="timeoutCountdownDialog">
{{#dialogSimple title='Your session is about to expire'}}
<div>You will be logged out in {{timeLeft}}.</div>
{{/dialogSimple}}
</template>
@@ -0,0 +1,61 @@
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
import { Tracker } from 'meteor/tracker';
import { OHIF } from 'meteor/ohif:core';
Meteor.startup(() => {
const closeObserver = new Tracker.Dependency();
$.event.add(window, 'TriggerCloseTimeoutCountdownDialog', () => closeObserver.changed());
$.event.add(window, 'TriggerOpenTimeoutCountdownDialog', (event, timeLeft) => {
OHIF.ui.showDialog('timeoutCountdownDialog', {
timeLeft,
closeObserver
});
});
});
Template.timeoutCountdownDialog.helpers({
timeLeft() {
const timeLeft = Session.get('countdownDialogTimeLeft');
const suffix = timeLeft > 1 ? 'seconds': 'second';
return `${timeLeft} ${suffix}`;
}
});
Template.timeoutCountdownDialog.onCreated(() => {
const instance = Template.instance();
const { timeLeft, closeObserver } = instance.data;
instance.close = callback => {
const $modal = instance.$('.modal');
$modal.on('hidden.bs.modal', () => callback()).modal('hide');
};
instance.autorun(computation => {
closeObserver.depend();
if (computation.firstRun) return;
instance.close(instance.data.promiseResolve);
});
Session.set('countdownDialogTimeLeft', timeLeft);
});
Template.timeoutCountdownDialog.onRendered(() => {
const instance = Template.instance();
let timeLeft = instance.data.timeLeft;
// Update countdownDialogTimeLeft session every second
instance.interval = setInterval(() => {
Session.set('countdownDialogTimeLeft', --timeLeft);
if (!timeLeft) {
instance.close(instance.data.promiseReject);
}
}, 1000);
});
Template.timeoutCountdownDialog.onDestroyed(() => {
const instance = Template.instance();
clearInterval(instance.interval);
Session.delete('countdownDialogTimeLeft');
});