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

This commit is contained in:
Emanuel F. Oliveira authored and Erik Ziegler committed 2016-11-15 08:24:01 +01:00
1 parent a30cfc95f9
commit 8aa8b4288c
4 files changed
+27 -18

No files matched your search

@@ -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));
});