Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:drugis/gemtc-web into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielReid committed Nov 15, 2019
2 parents 7c6f385 + a425548 commit 423bd33
Show file tree
Hide file tree
Showing 46 changed files with 1,113 additions and 331 deletions.
9 changes: 6 additions & 3 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters.
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : false, // true: Prohibit use of `++` and `--`
"quotmark" : false, // Quotation mark consistency:
"quotmark" : "single", // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : true, // Unused variables:
"unused" : "strict", // Unused variables:
// true : all variables, last function parameter
// "vars" : all variables only
// "strict" : all variables, all function parameters
Expand All @@ -43,7 +43,7 @@
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
"eqnull" : false, // true: Tolerate use of `== null`
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
"esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
"esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`)
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil" : false, // true: Tolerate use of `eval` and `new Function()`
Expand Down Expand Up @@ -72,10 +72,12 @@
"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
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"phantom" : false, // PhantomJS
"prototypejs" : false, // Prototype and Scriptaculous
"qunit" : false, // QUnit
"rhino" : false, // Rhino
Expand All @@ -88,6 +90,7 @@
// Custom Globals
"globals" : {
"define" : false,
"describe" : true,
"require" : false,
"inject" : false,
"module" : false
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update
RUN apt-get upgrade -y
RUN apt update
RUN apt upgrade -y -f -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"

# Install nodejs
RUN apt-get install -y curl
RUN apt install -y curl
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs git
RUN apt install -y nodejs git

RUN npm install -g yarn
RUN npm install -g forever
Expand Down
2 changes: 1 addition & 1 deletion R/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ ADD gemtc.R /var/lib/patavi/gemtc.R

USER patavi
WORKDIR /var/lib/patavi
ENTRYPOINT ["patavi-worker", "--method", "gemtc", "-n", "1", "--file", "/var/lib/patavi/gemtc.R", "--rserve", "--packages", "gemtc,rjags,base64enc"]
ENTRYPOINT ["patavi-worker", "--method", "gemtc", "-n", "4", "--file", "/var/lib/patavi/gemtc.R", "--rserve", "--packages", "gemtc,rjags,base64enc"]
1 change: 1 addition & 0 deletions R/r-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ FROM patavi/worker-amqp
USER root

RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q r-api-3 r-cran-coda
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 Down
6 changes: 6 additions & 0 deletions app/js/analyses/analyses.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ define([
'./editAnalysisTitleController',
'./editOutcomeNameController',
'./deleteAnalysisController',
'./editStudyTitleController',
'./editTreatmentNameController',
'./analysisResource',
'./problemResource',
'./analysisService',
Expand All @@ -25,6 +27,8 @@ define([
EditAnalysisTitleController,
EditOutcomeNameController,
DeleteAnalysisController,
EditStudyTitleController,
EditTreatmentNameController,
AnalysisResource,
ProblemResource,
AnalysisService,
Expand All @@ -45,6 +49,8 @@ define([
.controller('EditAnalysisTitleController', EditAnalysisTitleController)
.controller('EditOutcomeNameController', EditOutcomeNameController)
.controller('DeleteAnalysisController', DeleteAnalysisController)
.controller('EditStudyTitleController', EditStudyTitleController)
.controller('EditTreatmentNameController', EditTreatmentNameController)

// resources
.factory('AnalysisResource', AnalysisResource)
Expand Down
4 changes: 4 additions & 0 deletions app/js/analyses/analysisResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ define([], function() {
setOutcome: {
url: '/analyses/:analysisId/setOutcome',
method: 'PUT'
},
setProblem: {
url: '/analyses/:analysisId/setProblem',
method: 'PUT'
}
});
};
Expand Down
7 changes: 4 additions & 3 deletions app/js/analyses/deleteAnalysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<div class="cell">
<h3>Delete analysis: {{ analysis.title }}</h3>
</div>
<div class="cell alert">
Are you certain you want to delete this analysis?
<div class="cell">
<i class="fa fa-exclamation-triangle"></i>
<em> Are you certain you want to delete this analysis?</em>
</div>
<div class="cell">
<button ng-click="deleteAnalysis()" class="button" type="button">
<button ng-click="deleteAnalysis()" class="button alert" type="button">
Delete
</button>
</div>
Expand Down
30 changes: 30 additions & 0 deletions app/js/analyses/editStudyTitle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<form id="edit-study-title-form" novalidate ng-submit="editTitle(title.new)">
<div class="grid-container">
<div class="grid-x">
<div class="cell">
<h3>Edit study title</h3>
</div>
<div class="cell">
<label>Study title</label>
</div>
<div class="cell large-6">
<input autofocus="true" type="text" ng-model="title.new" ng-change="checkTitle(title.new)">
</div>
<div class="cell">
<i class="fa fa-exclamation-triangle"></i>
<em>Changing the study title will delete all model results!</em>
</div>
<div class="cell alert">
<button ng-disabled="error" ng-click="editTitle(title.new)" class="button alert" type="button">
Edit
</button>
</div>
<div class="cell alert" ng-if="error">
{{error}}
</div>
</div>
</div>
<button ng-click="cancel()" class="close-button" aria-label="Close reveal" type="button">
<span aria-hidden="true">&times;</span>
</button>
</form>
47 changes: 47 additions & 0 deletions app/js/analyses/editStudyTitleController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict';
define(['lodash'], function(_) {
var dependencies = [
'$scope',
'$modalInstance',
'studyTitle',
'entries',
'callback'
];
var EditStudyTitleController = function(
$scope,
$modalInstance,
studyTitle,
entries,
callback
) {
// functions
$scope.cancel = $modalInstance.close;
$scope.editTitle = editTitle;
$scope.checkTitle = checkTitle;

// init
$scope.title = {
new: studyTitle
};

function checkTitle(newTitle) {
if (newTitle === '') {
$scope.error = 'Title is empty';
} else if (newTitle !== studyTitle && _.some(entries, ['study', newTitle])) {
$scope.error = 'Study with that title already exists';
} else {
$scope.error = undefined;
}
}

function editTitle() {
if ($scope.error) {
return;
}
callback($scope.title.new);
$modalInstance.close();
}

};
return dependencies.concat(EditStudyTitleController);
});
30 changes: 30 additions & 0 deletions app/js/analyses/editTreatmentName.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<form id="edit-treatment-name-form" novalidate ng-submit="editName(name.new)">
<div class="grid-container">
<div class="grid-x">
<div class="cell">
<h3>Edit treatment name</h3>
</div>
<div class="cell">
<label>Treatment name</label>
</div>
<div class="cell large-6">
<input autofocus="true" type="text" ng-model="name.new" ng-change="checkName(name.new)">
</div>
<div class="cell">
<i class="fa fa-exclamation-triangle"></i>
<em> Changing the treatment name will delete all model results!</em>
</div>
<div class="cell">
<button ng-disabled="error" ng-click="editName(name.new)" class="button alert" type="button">
Edit
</button>
</div>
<div class="cell alert" ng-if="error">
{{error}}
</div>
</div>
</div>
<button ng-click="cancel()" class="close-button" aria-label="Close reveal" type="button">
<span aria-hidden="true">&times;</span>
</button>
</form>
47 changes: 47 additions & 0 deletions app/js/analyses/editTreatmentNameController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict';
define(['lodash'], function(_) {
var dependencies = [
'$scope',
'$modalInstance',
'name',
'treatments',
'callback'
];
var EditTreatmentNameController = function(
$scope,
$modalInstance,
name,
treatments,
callback
) {
// functions
$scope.cancel = $modalInstance.close;
$scope.editName = editName;
$scope.checkName = checkName;

// init
$scope.name = {
new: name
};

function checkName(newName) {
if (newName === '') {
$scope.error = 'Name is empty';
} else if (newName !== name && _.some(treatments, ['name', newName])) {
$scope.error = 'Study with that name already exists';
} else {
$scope.error = undefined;
}
}

function editName() {
if ($scope.error) {
return;
}
callback($scope.name.new);
$modalInstance.close();
}

};
return dependencies.concat(EditTreatmentNameController);
});
8 changes: 7 additions & 1 deletion app/js/analyses/evidenceTable.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@
<td rowspan="{{treatment.studyRowSpan}}" ng-show="{{treatment.showStudyColumn}}"
style="vertical-align: top;">
{{treatment.studyTitle}}
<a ng-click="editStudyTitle(treatment.studyTitle)" tooltip="Edit study title" ng-if="!editmode.disableEditing">
<i class="fa fa-edit"></i>
</a>
</td>
<td ng-repeat="covariate in treatment.covariatesColumns" rowspan="{{treatment.studyRowSpan}}"
ng-show="{{treatment.showStudyColumn}}" style="vertical-align:top" class="text-center">
{{covariate.data}}
</td>
<td>
{{treatment.treatmentTitle}}
<a ng-click="editTreatmentName(treatment)" tooltip="Edit treatment name" ng-if="!editmode.disableEditing">
<i class="fa fa-edit"></i>
</a>
</td>
<td class="text-center" ng-show="outcomeType === 'dichotomous' || outcomeType === 'survival'">
{{treatment.evidence.responders}}
Expand All @@ -59,4 +65,4 @@
</table>
</div>
</div>
</div>
</div>
Loading

0 comments on commit 423bd33

Please sign in to comment.