fix(google-cloud): Minor cleanup to prevent Google Cloud packages from being added unnecessarily
This commit is contained in:
1 parent
9486522552
commit
46828dc5ce
31 files changed
+48
-45
No files matched your search
@@ -61,10 +61,11 @@ Template.ohifViewer.onCreated(() => {
|
||||
Session.set('ViewerOpened', isViewer);
|
||||
});
|
||||
|
||||
if (OHIF.demoMode && OHIF.demoMode.userLoggedIn())
|
||||
OHIF.demoMode.setDemoServerConfig();
|
||||
else if (OHIF.gcloud && OHIF.gcloud.isEnabled()) {
|
||||
if (OHIF.demoMode && OHIF.demoMode.userLoggedIn()) {
|
||||
OHIF.demoMode.setDemoServerConfig();
|
||||
} else if (OHIF.gcloud && OHIF.gcloud.isEnabled()) {
|
||||
const server = OHIF.servers.getCurrentServer();
|
||||
|
||||
if (!server || !server.isCloud) {
|
||||
Session.set("IsStudyListReady", false);
|
||||
OHIF.gcloud.showDicomStorePicker({canClose: OHIF.demoMode}).then(config => {
|
||||
@@ -94,7 +95,7 @@ Template.ohifViewer.events({
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
Template.ohifViewer.helpers({
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
import './components';
|
||||
import './routes.js';
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,7 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import devModeMediator from './demoModeMediator.js';
|
||||
import './components';
|
||||
import './routes.js';
|
||||
|
||||
OHIF.demoMode = devModeMediator;
|
||||
|
||||
File renamed without changes.
@@ -1,9 +1,3 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import './client';
|
||||
import devModeMediator from './client/demoModeMediator.js';
|
||||
|
||||
const demoMode = Meteor.settings && Meteor.settings.public && Meteor.settings.public.demoMode;
|
||||
|
||||
if (demoMode) {
|
||||
OHIF.demoMode = devModeMediator;
|
||||
}
|
||||
if (Meteor.settings.public.demoMode) {
|
||||
import './imports/client/index.js';
|
||||
}
|
||||
@@ -16,5 +16,4 @@ Package.onUse(function(api) {
|
||||
|
||||
// Main module
|
||||
api.mainModule('main.js', 'client');
|
||||
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
if (Meteor.settings.public.googleCloud) {
|
||||
import '../imports/index.js';
|
||||
import '../imports/client/index.js';
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,8 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import GCloudAdapter from './lib/GCloudAdapter';
|
||||
|
||||
const gcloud = GCloudAdapter;
|
||||
|
||||
OHIF.gcloud = gcloud;
|
||||
|
||||
|
||||
+5
-1
@@ -1,3 +1,5 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
const GCloudAdapter = {};
|
||||
|
||||
const GCP_HEALTHCARE_CONFIG = 'GCP_HEALTHCARE_CONFIG';
|
||||
@@ -16,7 +18,9 @@ GCloudAdapter.setConfig = function(config) {
|
||||
|
||||
GCloudAdapter.showDicomStorePicker = function(options) {
|
||||
return OHIF.ui.showDialog('dicomStorePicker', options).then(config => {
|
||||
if (config) OHIF.gcloud.setConfig(config);
|
||||
if (config) {
|
||||
OHIF.gcloud.setConfig(config);
|
||||
}
|
||||
return config;
|
||||
});
|
||||
};
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
export function loadScript(url, callback=undefined)
|
||||
{
|
||||
export function loadScript(url, callback) {
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
@@ -7,4 +6,4 @@ export function loadScript(url, callback=undefined)
|
||||
script.onreadystatechange = callback;
|
||||
script.onload = callback;
|
||||
head.appendChild(script);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import GCloudAdapter from './lib/GCloudAdapter';
|
||||
|
||||
if (Meteor.settings.public.googleCloud) {
|
||||
const gcloud = GCloudAdapter;
|
||||
OHIF.gcloud = gcloud;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,12 +19,9 @@ Package.onUse(function(api) {
|
||||
api.use(['templating', 'stylus'], 'client');
|
||||
|
||||
// Main module
|
||||
api.mainModule('main.js', ['client']);
|
||||
api.mainModule('client/main.js', ['client']);
|
||||
|
||||
// Client imports and routes
|
||||
api.addFiles('client/index.js', 'client');
|
||||
|
||||
var assets = [
|
||||
const assets = [
|
||||
'.npm/package/node_modules/healthcare-api-adapter/dist/gcp.min.js',
|
||||
'.npm/package/node_modules/healthcare-api-adapter/dist/gcp.0.min.js',
|
||||
'.npm/package/node_modules/healthcare-api-adapter/dist/gcp.2.min.js',
|
||||
|
||||
@@ -21,6 +21,9 @@ if (Meteor.settings &&
|
||||
});
|
||||
|
||||
const newServer = Servers.findOne();
|
||||
if (!newServer) {
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentServer.insert({
|
||||
serverId: newServer._id
|
||||
|
||||
@@ -20,8 +20,7 @@ Meteor.methods({
|
||||
if (server.type === 'dicomWeb') {
|
||||
if(server.metadataSource ==='qido') {
|
||||
return OHIF.studies.services.QIDO.RetrieveMetadata(server, studyInstanceUid);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return OHIF.studies.services.WADO.RetrieveMetadata(server, studyInstanceUid);
|
||||
}
|
||||
} else if (server.type === 'dimse') {
|
||||
|
||||
+6
-9
@@ -84,10 +84,8 @@ let filter;
|
||||
*/
|
||||
function getFilter(filter) {
|
||||
const server = OHIF.servers.getCurrentServer();
|
||||
if (!server.isCloud) {
|
||||
if (filter && filter.length && filter.substr(filter.length - 1) !== '*') {
|
||||
filter += '*';
|
||||
}
|
||||
if (filter && filter.length && filter.substr(filter.length - 1) !== '*') {
|
||||
filter += '*';
|
||||
}
|
||||
|
||||
return filter;
|
||||
@@ -133,13 +131,12 @@ function search(instance) {
|
||||
studyDescription: getFilter($('input#studyDescription').val()),
|
||||
studyDateFrom,
|
||||
studyDateTo,
|
||||
modalitiesInStudy: $('input#modality').val() ? $('input#modality').val() : ''
|
||||
modalitiesInStudy: $('input#modality').val() ? $('input#modality').val() : '',
|
||||
offset: rowsPerPage * currentPage,
|
||||
limit: rowsPerPage
|
||||
};
|
||||
const server = OHIF.servers.getCurrentServer();
|
||||
if (!server.isCloud) {
|
||||
filter.offset=rowsPerPage * currentPage;
|
||||
filter.limit=rowsPerPage;
|
||||
}
|
||||
|
||||
// Make sure that modality has a reasonable value, since it is occasionally
|
||||
// returned as 'undefined'
|
||||
const modality = replaceUndefinedColumnValue($('input#modality').val());
|
||||
|
||||
Reference in new issue
Block a user