Skip to content

Commit

Permalink
webpack done
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielReid committed Aug 20, 2018
1 parent 1b19a6a commit 842f6dc
Show file tree
Hide file tree
Showing 23 changed files with 79 additions and 81 deletions.
1 change: 0 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"devel" : true, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jasmine" : true, // Jasmine
"jquery" : true, // jQuery
"mocha" : true, // Mocha
"mootools" : false, // MooTools
"node" : true, // Node.js
Expand Down
1 change: 1 addition & 0 deletions R/gemtc.R
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ gemtc <- function(params) {
}

# create network
print(is.vector(studies))
network <- mtc.network(data.ab=data.ab, data.re=data.re, treatments=treatments, studies=studies)

# pair-wise analysis: filter network
Expand Down
3 changes: 2 additions & 1 deletion R/r-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM patavi/worker-amqp

USER root

RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q r-cran-rjags
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q r-cran-xml

Expand All @@ -18,6 +19,6 @@ RUN R -e 'install.packages("truncnorm", repos="http://cran.rstudio.com/"); if (!
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q r-cran-rglpk

# RUN R -e 'install.packages("gemtc", repos="http://cran.rstudio.com/"); if (!require("gemtc")) quit(save="no", status=8)'
COPY gemtc_0.8-2.tar.gz gemtc_0.8.tar.gz
COPY gemtc_0.8-3.tar.gz gemtc_0.8.tar.gz
RUN R -e 'install.packages("gemtc_0.8.tar.gz", repos=NULL, type="source"); if (!require("gemtc")) quit(save="no", status=8)'

56 changes: 32 additions & 24 deletions app/js/app.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
'use strict';
define(
['angular',
'./analyses/analyses',
'angular-patavi-client',
'angular-touch',
'angular-ui-router',
'angular-animate',
'./constants',
'./controllers',
'core-js',
'error-reporting',
'export-directive',
'help-popup',
'jQuery',
'angular-foundation-6',
'./models/models',
'angular-sanitize',
'./patavi/patavi',
'./services',
'./util/util'
],
function(angular) {

'./analyses/analyses',
'angular-patavi-client',
'angular-touch',
'angular-ui-router',
'angular-animate',
'./constants',
'./controllers',
'core-js',
'error-reporting',
'export-directive',
'help-popup',
'jquery',
'angular-foundation-6',
'./models/models',
'angular-sanitize',
'./patavi/patavi',
'./services',
'./util/util'
],
function(angular) {

//@require "../views/*.html"
var dependencies = [
'ui.router',
'ngTouch',
Expand All @@ -42,8 +43,15 @@ define(

var app = angular.module('gemtc', dependencies);

app.run(['$rootScope', '$window', '$http', '$location', '$anchorScroll', 'HelpPopupService',
function($rootScope, $window, $http, $location, $anchorScroll, HelpPopupService) {
app.run(['$rootScope', '$http', '$templateCache', 'HelpPopupService',
function($rootScope, $http, $templateCache, HelpPopupService) {

$templateCache.put('model-settings-section.html', require('../views/model-settings-section.html'));
$templateCache.put('convergence-diagnostics-section.html', require('../views/convergence-diagnostics-section.html'));
$templateCache.put('meta-regression-section.html', require('../views/meta-regression-section.html'));
$templateCache.put('results-section.html', require('../views/results-section.html'));
$templateCache.put('model-fit-section.html', require('../views/model-fit-section.html'));

$rootScope.$safeApply = function($scope, fn) {
var phase = $scope.$root.$$phase;
if (phase === '$apply' || phase === '$digest') {
Expand Down Expand Up @@ -189,4 +197,4 @@ define(
]);

return app;
});
});
21 changes: 9 additions & 12 deletions app/js/controllers/modelController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
define(['lodash', 'clipboard'], function(_, Clipboard) {
var dependencies = ['$scope', '$q', '$http', '$modal', '$state', '$stateParams', '$window', 'gemtcRootPath', 'ModelResource', 'ModelBaselineResource',
define(['lodash', 'clipboard', 'jquery'], function(_, Clipboard, $) {
var dependencies = ['$scope', '$q', '$http', '$modal', '$state', '$stateParams',
'$window', 'ModelResource', 'ModelBaselineResource',
'FunnelPlotResource',
'PataviService',
'RelativeEffectsTableService',
Expand All @@ -14,7 +15,8 @@ define(['lodash', 'clipboard'], function(_, Clipboard) {
'MetaRegressionService',
'ResultsPlotService'
];
var ModelController = function($scope, $q, $http, $modal, $state, $stateParams, $window, gemtcRootPath, ModelResource, ModelBaselineResource,
var ModelController = function($scope, $q, $http, $modal, $state, $stateParams,
$window, ModelResource, ModelBaselineResource,
FunnelPlotResource,
PataviService,
RelativeEffectsTableService,
Expand Down Expand Up @@ -47,11 +49,6 @@ define(['lodash', 'clipboard'], function(_, Clipboard) {
$scope.model = ModelResource.get($stateParams);
$scope.modelPromise = modelDefer.promise;
$scope.comparisonAdjustedFunnelPlots = FunnelPlotResource.query($stateParams);
$scope.resultsViewTemplate = gemtcRootPath + 'views/results-section.html';
$scope.modelSettingsViewTemplate = gemtcRootPath + 'views/model-settings-section.html';
$scope.convergenceDiagnosticsViewTemplate = gemtcRootPath + 'views/convergence-diagnostics-section.html';
$scope.modelFitViewTemplate = gemtcRootPath + 'views/model-fit-section.html';
$scope.metaRegressionTemplate = gemtcRootPath + 'views/meta-regression-section.html';
$scope.stateParams = $stateParams;
new Clipboard('.clipboard-button');
$scope.selectedBaseline = undefined;
Expand Down Expand Up @@ -103,7 +100,7 @@ define(['lodash', 'clipboard'], function(_, Clipboard) {
function openRunLengthDialog() {
$modal.open({
windowClass: 'small',
templateUrl: gemtcRootPath + 'js/models/extendRunLength.html',
templateUrl: 'gemtc-web/models/extendRunLength.html',
scope: $scope,
controller: 'ExtendRunLengthController',
resolve: {
Expand All @@ -128,7 +125,7 @@ define(['lodash', 'clipboard'], function(_, Clipboard) {
function openComparisonAdjustedModal() {
$modal.open({
windowClass: 'small',
templateUrl: gemtcRootPath + 'js/models/addComparisonFunnelPlot.html',
templateUrl: 'gemtc-web/models/addComparisonFunnelPlot.html',
scope: $scope,
controller: 'AddComparisonFunnelPlotController',
resolve: {
Expand Down Expand Up @@ -221,7 +218,7 @@ define(['lodash', 'clipboard'], function(_, Clipboard) {

function openBaselineDistributionModal() {
$modal.open({
templateUrl: gemtcRootPath + 'js/models/setBaselineDistribution.html',
templateUrl: 'gemtc-web/models/setBaselineDistribution.html',
controller: 'SetBaselineDistributionController',
windowClass: 'small',
resolve: {
Expand Down Expand Up @@ -302,4 +299,4 @@ define(['lodash', 'clipboard'], function(_, Clipboard) {
}
};
return dependencies.concat(ModelController);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ define(['d3', 'nvd3', 'lodash'], function(d3, nvd3, _) {
problemPromise: '=',
resultsPromise: '='
},
templateUrl: gemtcRootPath + 'js/models/funnelPlot/funnelPlot.html',
templateUrl: 'gemtc-web/models/funnelPlot/funnelPlot.html',
link: function(scope, element) {
$q.all([scope.resultsPromise, scope.problemPromise]).then(function(promiseResults) {
var results = promiseResults[0];
Expand Down Expand Up @@ -88,4 +88,4 @@ define(['d3', 'nvd3', 'lodash'], function(d3, nvd3, _) {
};
};
return dependencies.concat(FunnelPlot);
});
});
4 changes: 2 additions & 2 deletions app/js/models/funnelPlot/funnelPlotDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define(['d3', 'nvd3', 'lodash'], function(d3, nvd3, _) {
scope: {
resultsPromise: '='
},
templateUrl: gemtcRootPath + 'js/models/funnelPlot/funnelPlot.html',
templateUrl: 'gemtc-web/models/funnelPlot/funnelPlot.html',
link: function(scope, element) {

scope.resultsPromise.then(function(results) {
Expand Down Expand Up @@ -51,4 +51,4 @@ define(['d3', 'nvd3', 'lodash'], function(d3, nvd3, _) {
};
};
return dependencies.concat(FunnelPlot);
});
});
4 changes: 2 additions & 2 deletions app/js/models/funnelPlot/funnelPlotService.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
define(['d3', 'nvd3', 'lodash'], function(d3, nvd3, _) {
define(['d3', 'nvd3', 'lodash', 'jquery'], function(d3, nvd3, _, $) {
var dependencies = [];
var FunnelPlotService = function() {

Expand Down Expand Up @@ -87,4 +87,4 @@ define(['d3', 'nvd3', 'lodash'], function(d3, nvd3, _) {
};

return dependencies.concat(FunnelPlotService);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define([], function() {
var HeterogeneityPriorDirective = function(gemtcRootPath) {
return {
restrict: 'E',
templateUrl: gemtcRootPath + 'js/models/heterogeneityPrior/heterogeneityPrior.html',
templateUrl: 'gemtc-web/models/heterogeneityPrior/heterogeneityPrior.html',
scope: {
prior: '='
},
Expand Down
4 changes: 2 additions & 2 deletions app/js/models/nodeSplitOverviewController.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ define(['angular', 'lodash'], function(angular, _) {
function openCreateNetworkDialog() {
$modal.open({
windowClass: 'small',
templateUrl: gemtcRootPath + 'js/models/createModelFromBase.html',
templateUrl: 'gemtc-web/models/createModelFromBase.html',
scope: $scope,
controller: 'CreateNetworkModelController',
resolve: {
Expand All @@ -144,7 +144,7 @@ define(['angular', 'lodash'], function(angular, _) {
function openCreateNodeSplitDialog(comparison) {
$modal.open({
windowClass: 'small',
templateUrl: gemtcRootPath + 'js/models/createModelFromBase.html',
templateUrl: 'gemtc-web/models/createModelFromBase.html',
scope: $scope,
controller: 'CreateNodeSplitModelController',
resolve: {
Expand Down
2 changes: 1 addition & 1 deletion app/js/models/result/metaRegressionCovPlotsDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define([], function() {
problemPromise: '='
},
restrict: 'E',
templateUrl: gemtcRootPath + 'js/models/result/metaRegressionCovPlots.html',
templateUrl: 'gemtc-web/models/result/metaRegressionCovPlots.html',
link: function(scope) {

$q.all([scope.modelPromise, scope.resultsPromise, scope.problemPromise])
Expand Down
2 changes: 1 addition & 1 deletion app/js/models/result/nodeSplitDensityPlotsDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define([], function() {
problemPromise: '='
},
restrict: 'E',
templateUrl: gemtcRootPath + 'js/models/result/nodeSplitDensityPlots.html',
templateUrl: 'gemtc-web/models/result/nodeSplitDensityPlots.html',
link: function(scope) {

$q.all([scope.modelPromise, scope.resultsPromise, scope.problemPromise])
Expand Down
2 changes: 1 addition & 1 deletion app/js/models/result/pairwiseForestPlotsDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define(['lodash'], function(_) {
problemPromise: '='
},
restrict: 'E',
templateUrl: gemtcRootPath + 'js/models/result/pairwiseForestPlots.html',
templateUrl: 'gemtc-web/models/result/pairwiseForestPlots.html',
link: function(scope) {

$q.all([scope.modelPromise, scope.resultsPromise, scope.problemPromise])
Expand Down
2 changes: 1 addition & 1 deletion app/js/models/result/relativeEffectPlotsDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define(['lodash'], function(_) {
problemPromise: '='
},
restrict: 'E',
templateUrl: gemtcRootPath + 'js/models/result/relativeEffectPlots.html',
templateUrl: 'gemtc-web/models/result/relativeEffectPlots.html',
link: function(scope) {

function prefixPlots(plots) {
Expand Down
3 changes: 1 addition & 2 deletions app/js/signin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
define(['bowser', 'css/gemtc-drugis.css'], function(bowser){
window.bowser = bowser;

});
});
4 changes: 2 additions & 2 deletions app/js/util/graphModalDirective/graphModalDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ define([], function() {
},
restrict: 'E',
// using template because loading teplateUrl irritating in submodule
templateUrl: gemtcRootPath + 'js/util/graphModalDirective/graphModalDirective.html',
templateUrl: 'gemtc-web/util/graphModalDirective/graphModalDirective.html',
link: function(scope) {

scope.openModal = function() {
$modal.open({
templateUrl: gemtcRootPath + 'js/util/graphModalDirective/plotNavigation.html',
templateUrl: 'gemtc-web/util/graphModalDirective/plotNavigation.html',
scope: scope,
windowClass: 'small',
controller: 'PlotNavigationController'
Expand Down
2 changes: 1 addition & 1 deletion app/js/util/pagedPngPlotDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define([], function() {
},
restrict: 'E',
// using template because loading teplateUrl irritating in submodule
templateUrl: gemtcRootPath + 'js/util/pagedPngPlotDirective.html',
templateUrl: 'gemtc-web/util/pagedPngPlotDirective.html',
link: function(scope) {
scope.selectNextPage = selectNextPage;
scope.selectPreviousPage = selectPreviousPage;
Expand Down
2 changes: 1 addition & 1 deletion app/js/util/pagedSvgPlotDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define([], function() {
},
restrict: 'E',
// using template because loading templateUrl irritating in submodule
templateUrl: gemtcRootPath + 'js/util/pagedSvgPlotDirective.html',
templateUrl: 'gemtc-web/util/pagedSvgPlotDirective.html',
link: function(scope) {
scope.selectNextPage = selectNextPage;
scope.selectPreviousPage = selectPreviousPage;
Expand Down
10 changes: 5 additions & 5 deletions app/views/modelView.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ <h5>
</div>
</div>

<ng-include src="modelSettingsViewTemplate"></ng-include>
<ng-include src="'model-settings-section.html'"></ng-include>

<ng-include src="convergenceDiagnosticsViewTemplate"></ng-include>
<ng-include src="'convergence-diagnostics-section.html'"></ng-include>

<ng-include ng-show="model.modelType.type === 'regression'" src="metaRegressionTemplate"></ng-include>
<ng-include ng-if="model.modelType.type === 'regression'" src="'meta-regression-section.html'"></ng-include>

<ng-include src="resultsViewTemplate"></ng-include>
<ng-include src="'results-section.html'"></ng-include>

<ng-include src="modelFitViewTemplate"></ng-include>
<ng-include src="'model-fit-section.html'"></ng-include>


</div ui-view>
3 changes: 0 additions & 3 deletions standalone-app/loginUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ module.exports = {
}
else if (request.method === 'GET' && // if not then you can get static content or go sign in
(request.url.startsWith('/css') ||
// request.url.startsWith('/dist') ||
request.url.startsWith('/views') ||
request.url.startsWith('/img') ||
request.url.startsWith('/fonts') ||
request.url.startsWith('/font') ||
request.url === '/signin.html' ||
request.url === '/signin.bundle.js' ||
request.url === '/main.bundle.js' ||
Expand Down
6 changes: 3 additions & 3 deletions standalone-app/pataviTaskRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ var httpsOptions = {
try {
httpsOptions.key = fs.readFileSync(process.env.PATAVI_CLIENT_KEY);
} catch (e) {
logger.warn('could not read patavi client key at: ' + process.env.PATAVI_CLIENT_KEY);
logger.error('could not read patavi client key at: ' + process.env.PATAVI_CLIENT_KEY);
httpsOptions.key = 'empty-key';
}

try {
httpsOptions.cert = fs.readFileSync(process.env.PATAVI_CLIENT_CRT);
} catch (e) {
logger.warn('could not read patavi client certivicate key at: ' + process.env.PATAVI_CLIENT_CRT);
logger.error('could not read patavi client certivicate key at: ' + process.env.PATAVI_CLIENT_CRT);
httpsOptions.cert = 'empty-client-crt';
}

Expand Down Expand Up @@ -133,4 +133,4 @@ function deleteTask(id, callback) {
}
});
deleteReq.end();
}
}
Loading

0 comments on commit 842f6dc

Please sign in to comment.