Removing serverInformationModal from DOM
This commit is contained in:
1 parent
2a5699a5b7
commit
91abaf8a60
19 files changed
+72
-86
No files matched your search
@@ -1,3 +1,3 @@
|
||||
<template name="section">
|
||||
{{>instance.renderFunction.get instance.sectionData.get}}
|
||||
</template>
|
||||
<template name="section">{{! TODO: use whitespace control when/if it's available (https://github.com/meteor/blaze/issues/88)
|
||||
}}{{>instance.renderFunction.get instance.sectionData.get}}{{!
|
||||
}}</template>
|
||||
@@ -3,24 +3,9 @@ import { Tracker } from 'meteor/tracker';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
// Get the view that contains the desired section's content and return it
|
||||
const getSection = (view, sectionName) => {
|
||||
let currentView = view;
|
||||
while (!currentView._sectionMap || !currentView._sectionMap.get(sectionName)) {
|
||||
currentView = OHIF.blaze.getParentTemplateView(currentView);
|
||||
if (!currentView) return;
|
||||
}
|
||||
|
||||
return currentView._sectionMap.get(sectionName);
|
||||
};
|
||||
|
||||
Template.section.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
if (instance.data === 'dialogFooter') {
|
||||
console.warn('>>>>instance', instance);
|
||||
}
|
||||
|
||||
// Create the render function and section data as reactive objects
|
||||
instance.renderFunction = new ReactiveVar(null);
|
||||
instance.sectionData = new ReactiveVar(null);
|
||||
@@ -55,7 +40,7 @@ Template.section.onCreated(() => {
|
||||
// Wait for re-rendering and print the section content
|
||||
Tracker.afterFlush(() => {
|
||||
// Get the defined section's content
|
||||
const section = getSection(currentView, sectionName);
|
||||
const section = OHIF.blaze.getSectionContent(currentView, sectionName);
|
||||
|
||||
// Stop here if the section content is not defined
|
||||
if (!section) {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
.modal .modal-footer:empty
|
||||
display: none
|
||||
@@ -13,6 +13,7 @@
|
||||
<div class="modal-body">
|
||||
{{>UI.contentBlock}}
|
||||
</div>
|
||||
<div class="modal-footer">{{>section 'dialogFooter'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -51,3 +51,14 @@ OHIF.blaze.getParentTemplateView = view => {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Get the view that contains the desired section's content and return it
|
||||
OHIF.blaze.getSectionContent = (view, sectionName) => {
|
||||
let currentView = view;
|
||||
while (!currentView._sectionMap || !currentView._sectionMap.get(sectionName)) {
|
||||
currentView = OHIF.blaze.getParentTemplateView(currentView);
|
||||
if (!currentView) return;
|
||||
}
|
||||
|
||||
return currentView._sectionMap.get(sectionName);
|
||||
};
|
||||
@@ -26,6 +26,7 @@ Package.onUse(function(api) {
|
||||
api.addFiles([
|
||||
'client/ui/dimensional/dimensional.styl',
|
||||
'client/ui/resizable/resizable.styl',
|
||||
'client/components/bootstrap/dialog/bootstrap.styl',
|
||||
'client/components/bootstrap/dialog/loading.styl',
|
||||
'client/components/bootstrap/dialog/progress.styl',
|
||||
'client/components/bootstrap/dialog/unsavedChangesDialog.styl',
|
||||
|
||||
@@ -5,5 +5,4 @@ import './trialOptionsModal/irRCDescription.html';
|
||||
import './trialOptionsModal/recistDescription.html';
|
||||
|
||||
import './trialOptionsModal/trialOptionsModal.html';
|
||||
import './trialOptionsModal/trialOptionsModal.styl';
|
||||
import './trialOptionsModal/trialOptionsModal.js';
|
||||
+1
-1
@@ -15,4 +15,4 @@
|
||||
<li>Up to a max of 10 target lesions total</li>
|
||||
</ul>
|
||||
<!--Time Point Measurement Total = SPD target lesions + SPD new lesions (SPD = sum of product of long axis and short axis diameters)-->
|
||||
</template>
|
||||
</template>
|
||||
+1
-1
@@ -11,4 +11,4 @@
|
||||
<li>Target lesions must have measurements (cannot be assessed as CR, UN/NE, EX)</li>
|
||||
</ul>
|
||||
<!-- Time Point Measurement Total = Sum of long axis measurements for extranodal target lesion + short axis measurements for nodal lesions</li>-->
|
||||
</template>
|
||||
</template>
|
||||
+7
-8
@@ -1,17 +1,16 @@
|
||||
<template name="trialOptionsModal">
|
||||
{{#dialogForm (extend this
|
||||
schema=instance.schema id='trialOptionsModal' dialogClass='modal-lg'
|
||||
schema=instance.schema dialogClass='modal-lg'
|
||||
confirmLabel='Save' title='Clinical Trial Options'
|
||||
)}}
|
||||
<h3 class="m-t-0">Select one or more Trial Criteria types:</h3>
|
||||
{{>groupRadio class='js-trial' labelClass='form-group' key='trialCriteria'}}
|
||||
<div>
|
||||
<h3>Selected Trial Criteria:</h3>
|
||||
<div class="m-t-2">
|
||||
{{#let descriptionTemplate=(getDescriptionTemplate instance.selectedTrial.get)}}
|
||||
{{>Template.dynamic template=descriptionTemplate}}
|
||||
{{/let}}
|
||||
</div>
|
||||
|
||||
<h3>Selected Trial Criteria:</h3>
|
||||
<div class="m-t-2">
|
||||
{{#let descriptionTemplate=(getDescriptionTemplate instance.selectedTrial.get)}}
|
||||
{{>Template.dynamic template=descriptionTemplate}}
|
||||
{{/let}}
|
||||
</div>
|
||||
{{/dialogForm}}
|
||||
</template>
|
||||
@@ -1,3 +0,0 @@
|
||||
#trialOptionsModal
|
||||
.panel
|
||||
background-color: transparent
|
||||
+1
-1
@@ -34,7 +34,7 @@ Template.serverInformationForm.onCreated(() => {
|
||||
Template.serverInformationForm.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
instance.data.$form = instance.$('form:first');
|
||||
instance.data.$form = instance.$('form').first();
|
||||
instance.data.form = instance.data.$form.data('component');
|
||||
|
||||
// Handle the server type
|
||||
|
||||
+10
-25
@@ -1,27 +1,12 @@
|
||||
<template name="serverInformationModal">
|
||||
<div class="modal" id="serverInformationModal" tabindex="-1" role="dialog" aria-labelledby="serverInformationModalLabel">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
{{#let isList=(eq instance.container.mode.get "list")}}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="serverInformationModalLabel">Server Information</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{#if isList}}
|
||||
{{>serverInformationList instance.container}}
|
||||
{{else}}
|
||||
{{>serverInformationForm instance.container}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{#unless isList}}
|
||||
<button type="button" class="btn btn-default js-back">Back</button>
|
||||
{{/unless}}
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
{{/let}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{#dialogSimple (extend this dialogClass='modal-lg' title='Server Information')}}
|
||||
{{#if (eq instance.container.mode.get "list")}}
|
||||
{{>serverInformationList instance.container}}
|
||||
{{else}}
|
||||
{{>serverInformationForm instance.container}}
|
||||
{{/if}}
|
||||
{{#section 'dialogFooter'}}{{#unless (eq instance.container.mode.get "list")}}{{!
|
||||
}}<button type="button" class="btn btn-default js-back">Back</button>{{!
|
||||
}}{{/unless}}{{/section}}
|
||||
{{/dialogSimple}}
|
||||
</template>
|
||||
+5
-2
@@ -1,5 +1,8 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
|
||||
Template.serverInformationModal.onCreated(function() {
|
||||
var instance = Template.instance();
|
||||
const instance = Template.instance();
|
||||
instance.container = {
|
||||
mode: new ReactiveVar('list'),
|
||||
serverType: new ReactiveVar(null),
|
||||
@@ -14,7 +17,7 @@ Template.serverInformationModal.onCreated(function() {
|
||||
});
|
||||
|
||||
Template.serverInformationModal.events({
|
||||
'click .js-back, click [data-dismiss=modal]': function(event, instance) {
|
||||
'click .js-back'(event, instance) {
|
||||
instance.container.resetState();
|
||||
}
|
||||
});
|
||||
@@ -3,6 +3,7 @@ import { Template } from 'meteor/templating';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { Session } from 'meteor/session';
|
||||
import { Router } from 'meteor/iron:router';
|
||||
import { moment } from 'meteor/momentjs:moment';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
// Display the last login modal as default
|
||||
@@ -10,13 +11,14 @@ Session.setDefault('displayLastLoginModal', true);
|
||||
|
||||
Template.userAccountMenu.helpers({
|
||||
name: function() {
|
||||
var nameSplit = Meteor.user().profile.fullName.split(' ');
|
||||
var lastName = nameSplit[nameSplit.length - 1];
|
||||
const nameSplit = Meteor.user().profile.fullName.split(' ');
|
||||
const lastName = nameSplit[nameSplit.length - 1];
|
||||
nameSplit[nameSplit.length - 1] = lastName.substr(0, 1) + '.';
|
||||
return nameSplit.join(' ');
|
||||
},
|
||||
|
||||
currentUser: function() {
|
||||
var verifyEmail = Meteor.settings && Meteor.settings.public && Meteor.settings.public.verifyEmail || false;
|
||||
const verifyEmail = Meteor.settings && Meteor.settings.public && Meteor.settings.public.verifyEmail || false;
|
||||
|
||||
if (!Meteor.user() || !Meteor.userId()) {
|
||||
return;
|
||||
@@ -36,7 +38,7 @@ Template.userAccountMenu.helpers({
|
||||
|
||||
Template.userAccountMenu.events({
|
||||
'click #serverInformation'() {
|
||||
$('#serverInformationModal').modal('show');
|
||||
OHIF.ui.showDialog('serverInformationModal');
|
||||
},
|
||||
|
||||
'click #themeSelector'() {
|
||||
@@ -51,7 +53,7 @@ Template.userAccountMenu.events({
|
||||
});
|
||||
|
||||
Template.userAccountMenu.onCreated(function userAccountMenuCreated() {
|
||||
const instance = Template.instance();
|
||||
const instance = Template.instance();
|
||||
|
||||
// Create reactive last login date
|
||||
instance.lastLoginDate = new ReactiveVar();
|
||||
@@ -60,14 +62,14 @@ Template.userAccountMenu.onCreated(function userAccountMenuCreated() {
|
||||
let oldUser;
|
||||
|
||||
// Get last login date
|
||||
Meteor.call('getPriorLoginDate', function(error, lastLoginDate){
|
||||
Meteor.call('getPriorLoginDate', function(error, lastLoginDate) {
|
||||
if (error) {
|
||||
console.log(error);
|
||||
OHIF.log.error(error);
|
||||
return;
|
||||
}
|
||||
|
||||
// Format the last login date
|
||||
const formattedLastLoginDate = moment(lastLoginDate).format("MMMM Do YYYY, HH:mm:ss A");
|
||||
const formattedLastLoginDate = moment(lastLoginDate).format('MMMM Do YYYY, HH:mm:ss A');
|
||||
|
||||
instance.lastLoginDate.set(formattedLastLoginDate);
|
||||
|
||||
@@ -80,7 +82,7 @@ Template.userAccountMenu.onCreated(function userAccountMenuCreated() {
|
||||
}
|
||||
|
||||
// Hook login/logout
|
||||
var user = Meteor.user();
|
||||
const user = Meteor.user();
|
||||
if (!user) {
|
||||
// Display last login modal for the next login
|
||||
Session.setPersistent('displayLastLoginModal', true);
|
||||
@@ -97,6 +99,7 @@ Template.userAccountMenu.onCreated(function userAccountMenuCreated() {
|
||||
// Remove the user by oldUserId from Reviewers
|
||||
Meteor.call('removeUserFromReviewers', oldUser._id);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user