PWV-2: Change on ServerConfiguration logic to make it extensible

This commit is contained in:
Emanuel F. Oliveira 2016-09-25 19:37:32 +00:00 committed by Erik Ziegler
parent a30cfc95f9
commit 8aa8b4288c
4 changed files with 27 additions and 18 deletions

View File

@ -165,11 +165,6 @@ export const PublicServerConfig = new SimpleSchema({
ui: {
type: UISettings,
label: 'UI Settings'
},
custom: {
type: Object,
label: 'Custom Settings',
optional: true
}
});

View File

@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import { Tracker } from 'meteor/tracker';
import { DICOMWebServer as dicomSchema } from 'meteor/ohif:study-list/both/schema/servers.js';
import { DIMSEServer as dimseSchema } from 'meteor/ohif:study-list/both/schema/servers.js';

View File

@ -27,6 +27,7 @@ Package.onUse(function(api) {
// Our custom packages
api.use('design');
api.use('ohif:core');
api.use('ohif:log');
api.use('ohif:dicom-services');
api.use('ohif:viewerbase');
api.use('ohif:wadoproxy');

View File

@ -1,16 +1,29 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { ServerConfiguration } from '../both/schema/servers.js';
// import { check } from 'meteor/check';
import { OHIF } from 'meteor/ohif:core';
import { ServerConfiguration } from 'meteor/ohif:study-list/both/schema/servers.js';
/*
-- Taking this out for now to prevent confusion.
TODO: Make the error messages more clear
Meteor.startup(() => {
console.log('------ Testing Meteor Settings ------');
let config = ServerConfiguration.clean(Meteor.settings);
console.log(JSON.stringify(config, null, 2));
// Save custom properties (if any)...
// "Meteor.settings" and "Meteor.settings.public" are set by default...
let custom = {
private: Meteor.settings.custom,
public: Meteor.settings.public.custom
};
Meteor.settings = config;
check(config, ServerConfiguration);
});*/
// ... and remove them to prevent clean up
delete Meteor.settings.custom;
delete Meteor.settings.public.custom;
ServerConfiguration.clean(Meteor.settings);
// TODO: Make the error messages more clear
// console.log('------ Testing Meteor Settings ------');
// Taking this out for now to prevent confusion.
// check(Meteor.settings, ServerConfiguration);
Meteor.settings.custom = custom.private;
Meteor.settings.public.custom = custom.public;
OHIF.log.info(JSON.stringify(Meteor.settings, null, 2));
});