Skip to content

Commit

Permalink
Interface database-details nearly finished (other Remedy Compositions…
Browse files Browse the repository at this point in the history
… to finish)

Need some fix on the model before (add Remedy entity, a set of plant ingredients)
  • Loading branch information
acheype committed May 16, 2017
1 parent ba09755 commit 7b75759
Show file tree
Hide file tree
Showing 41 changed files with 148 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface InVitroPharmacoRepository extends JpaRepository<InVitroPharmaco
// ".plantIngredients where inVitroPharmaco.id =:id")
//InVitroPharmaco findOneWithEagerRelationships(@Param("id") Long id);

@Query("select iv from InVitroPharmaco iv join iv.plantIngredients pi where iv.publication.id = :pubId and pi.id in :piIds")
@Query("select distinct iv from InVitroPharmaco iv join iv.plantIngredients pi where iv.publication.id = :pubId and pi.id in :piIds")
List<InVitroPharmaco> findByPublicationIdAndPlantIngredients(@Param("pubId") Long pubId, @Param("piIds") List<Long>
piIds);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface InVivoPharmacoRepository extends JpaRepository<InVivoPharmaco,L
// ".plantIngredients where inVivoPharmaco.id =:id")
//InVivoPharmaco findOneWithEagerRelationships(@Param("id") Long id);

@Query("select iv from InVivoPharmaco iv join iv.plantIngredients pi where iv.publication.id = :pubId and pi.id in :piIds")
@Query("select distinct iv from InVivoPharmaco iv join iv.plantIngredients pi where iv.publication.id = :pubId and pi.id in :piIds")
List<InVivoPharmaco> findByPublicationIdAndPlantIngredients(@Param("pubId") Long pubId, @Param("piIds") List<Long>
piIds);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public ResponseEntity<List<PubSpecies>> getPubSpeciesByPublicationId(@PathVariab
}

/**
* GET /publications/:pubId/pi/:piIds/ethnologies -> get all the pubSpecies with the "id" publication and the
* GET /publications/:pubId/pi/:piIds/pubSpecies -> get all the pubSpecies with the "id" publication and the
* list of plant ingredient ids
*/
@RequestMapping(value = "/publications/{pubId}/pi/{piIds}/pubSpecies",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/.h2.server.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#H2 Server Properties
#Mon Jan 11 10:45:16 NCT 2016
#Tue May 16 17:44:33 NCT 2017
0=JHipster H2 (Memory)|org.h2.Driver|jdbc\:h2\:mem\:jhipster|
webAllowOthers=true
webPort=8082
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@
separator=","
tableName="in_vivo_pharmaco_plant_ingredient"/>

<loadData encoding="UTF-8"
file="config/liquibase/test_data/in_vitro_pharmaco.csv"
separator=","
tableName="in_vitro_pharmaco"/>

<loadData encoding="UTF-8"
file="config/liquibase/test_data/in_vitro_pharmaco_plant_ingredient.csv"
separator=","
tableName="in_vitro_pharmaco_plant_ingredient"/>

</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"PUBLICATION_ID","ID","TESTED_ENTITY","EXTRACTION_SOLVENT","ADDITIVE_PRODUCT","COMPOUND_NAME","SCREENING_TEST","MEASURE_METHOD","CONCENTRATION","MOL_CONCENTRATION","INHIBITION","IC50","MOL_IC50","SELECTIVITY_INDEX","COMPILERS_OBSERVATIONS"
"2","1","Fraction",null,null,null,"Erythrocyt","Enzymatic",null,null,null,null,"4.4700",null,null
"2","2","Extract","Methanol",null,null,"Toxicity","Enzymatic",null,null,null,null,null,"1.80","A compiler observation example ! Done."
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"PLANT_INGREDIENTS_ID","IN_VITRO_PHARMACOS_ID"
"1","1"
"2","1"
"1","2"
"2","2"
7 changes: 2 additions & 5 deletions src/main/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ $citation-font: 'EB Garamond';
margin: 10px auto 10px auto;
}

.colored-background {
background-color: $gray-lighter;
}

.colored-background .table-striped > tbody > tr:nth-of-type(odd) {
.table-striped > tbody > tr:nth-of-type(odd) {
background-color: #fff;
}

Expand Down Expand Up @@ -236,6 +232,7 @@ ul#strength {
.alerts .alert{
text-overflow: ellipsis;
}

.alert pre{
background: none;
border: none;
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/scripts/app/admin/health/health.controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

angular.module('malariaplantdbApp')
.controller('HealthController', function ($scope, MonitoringService, $modal) {
.controller('HealthController', function ($scope, MonitoringService, $uibModal) {
$scope.updatingHealth = true;
$scope.separator = '.';

Expand Down Expand Up @@ -62,7 +62,7 @@ angular.module('malariaplantdbApp')


$scope.showHealth = function(health) {
var modalInstance = $modal.open({
var modalInstance = $uibModal.open({
templateUrl: 'scripts/app/admin/health/health.modal.html',
controller: 'HealthModalController',
size: 'lg',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict';

angular.module('malariaplantdbApp')
.controller('HealthModalController', function($scope, $modalInstance, currentHealth, baseName, subSystemName) {
.controller('HealthModalController', function($scope, $uibModalInstance, currentHealth, baseName, subSystemName) {

$scope.currentHealth = currentHealth;
$scope.baseName = baseName, $scope.subSystemName = subSystemName;

$scope.cancel = function() {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

angular.module('malariaplantdbApp')
.controller('MetricsController', function ($scope, MonitoringService, $modal) {
.controller('MetricsController', function ($scope, MonitoringService, $uibModal) {
$scope.metrics = {};
$scope.updatingMetrics = true;

Expand Down Expand Up @@ -43,7 +43,7 @@ angular.module('malariaplantdbApp')
$scope.refreshThreadDumpData = function() {
MonitoringService.threadDump().then(function(data) {

var modalInstance = $modal.open({
var modalInstance = $uibModal.open({
templateUrl: 'scripts/app/admin/metrics/metrics.modal.html',
controller: 'MetricsModalController',
size: 'lg',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

angular.module('malariaplantdbApp')
.controller('MetricsModalController', function($scope, $modalInstance, threadDump) {
.controller('MetricsModalController', function($scope, $uibModalInstance, threadDump) {

$scope.threadDump = threadDump;
$scope.threadDumpRunnable = 0;
Expand All @@ -25,7 +25,7 @@ angular.module('malariaplantdbApp')
$scope.threadDumpTimedWaiting + $scope.threadDumpBlocked;

$scope.cancel = function() {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};

$scope.getLabelClass = function (threadState) {
Expand Down
22 changes: 8 additions & 14 deletions src/main/webapp/scripts/app/database/database-detail.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,15 @@ angular.module('malariaplantdbApp')
$scope.ethnology = ethnology;
$scope.inVivoPharmacos = inVivoPharmacos;
$scope.inVitroPharmacos = inVitroPharmacos;
$scope.otherRemedies = {};

angular.forEach(pubSummary.plantIngredients, function(key, value){
if (angular.equals(value.plantIngredientsIds, $stateParams.piIds)) {
delete pubSummary.plantIngredients[key];
var paramPiIds = $stateParams.piIds.split(",").map(Number);

angular.forEach(pubSummary.plantIngredients, function(value, key){
if (angular.equals(value.plantIngredientsIds, paramPiIds)) {
$scope.plantIngredientsStr = key;
} else {
$scope.otherRemedies[key] = value;
}
});
$scope.pubSummary = pubSummary.plantIngredients;

var plantIngredients = ethnology ? ethnology.plantIngredients :
(inVivoPharmacos.length > 0 ? inVivoPharmacos[0].plantIngredients :
(inVitroPharmacos.length > 0 ? inVitroPharmacos[0].plantIngredients : null));

$scope.plantIngredientsStr = plantIngredients && plantIngredients.length > 0 ?
plantIngredients.map(
function(o) {return o.species.family + ' ' + o.species.species + ', ' + o.partUsed}
).join(" / ") :
pubSpecies[0].species.family + " " + pubSpecies[0].species.species;
});
20 changes: 11 additions & 9 deletions src/main/webapp/scripts/app/database/database-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,32 +345,34 @@ <h3>Details for <small>&laquo; {{plantIngredientsStr}} &raquo;</small></h3><br/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2 property-label properties-col">
Measure method
</div>
<div class="col-xs-6 col-sm-6 col-md-2 properties-col">
{{ivt.measureMethod | placeholder}}
</div>
<div ng-if="ivt.screeningTest != 'Toxicity && ivt.concentration'"
<div ng-if="ivt.screeningTest != 'Toxicity' && ivt.concentration"
class="col-xs-6 col-sm-6 col-md-2 property-label properties-col">
Concentration for selected result <small>(&micro;g/kg)</small>
</div>
<div ng-if="ivt.screeningTest != 'Toxicity && ivt.concentration'"
<div ng-if="ivt.screeningTest != 'Toxicity' && ivt.concentration"
class="col-xs-6 col-sm-6 col-md-2 properties-col">
{{ivt.concentration | placeholder}}
</div>
<div ng-if="ivt.screeningTest != 'Toxicity && ivt.molConcentration'"
<div ng-if="ivt.screeningTest != 'Toxicity' && ivt.molConcentration"
class="col-xs-6 col-sm-6 col-md-2 property-label properties-col">
Concentration for selected result <small>(&micro;mol/kg)</small>
</div>
<div ng-if="ivt.screeningTest != 'Toxicity && ivt.molConcentration'"
<div ng-if="ivt.screeningTest != 'Toxicity' && ivt.molConcentration"
class="col-xs-6 col-sm-6 col-md-2 properties-col">
{{ivt.concentration | placeholder}}
</div>
<div
ng-if="ivt.screeningTest != 'Toxicity && !ivt.concentration &&
ng-if="ivt.screeningTest != 'Toxicity' && !ivt.concentration &&
!ivt.molConcentration"
class="col-xs-6 col-sm-6 col-md-2 property-label properties-col">
Concentration for selected result
</div>
<div ng-if="ivt.screeningTest != 'Toxicity && ivt.molConcentration'"
<div ng-if="ivt.screeningTest != 'Toxicity' && !ivt.concentration &&
!ivt.molConcentration"
class="col-xs-6 col-sm-6 col-md-2 properties-col">
{{null | placeholder}}
</div>
Expand Down Expand Up @@ -445,11 +447,11 @@ <h3>Details for <small>&laquo; {{plantIngredientsStr}} &raquo;</small></h3><br/>
<!-- OTHER INGREDIENTS -->
<div ng-if="pubSummary.plantIngredients.length" class="row">
<div class="col-xs-12 col-sm-12 col-md-12 review-label">
Other ingredients
Other remedy compositions
</div>
</div>
<div class="row ingredients-item" ng-repeat="(pi, piTests) in pubSummary.plantIngredients">
<summary publication="pub" plant-ingredient-str="pi" pi-summary="piTests"></summary>
<div class="row ingredients-item" ng-repeat="(pi, piTests) in otherRemedies">
<summary publication="publication" plant-ingredient-str="pi" pi-summary="piTests"></summary>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

angular.module('malariaplantdbApp').controller('AuthorDialogController',
['$scope', '$stateParams', '$modalInstance', 'entity', 'Author', 'Publication',
function ($scope, $stateParams, $modalInstance, entity, Author, Publication) {
['$scope', '$stateParams', '$uibModalInstance', 'entity', 'Author', 'Publication',
function ($scope, $stateParams, $uibModalInstance, entity, Author, Publication) {

$scope.author = entity;
$scope.publications = Publication.sortedQuery();
Expand All @@ -14,7 +14,7 @@ angular.module('malariaplantdbApp').controller('AuthorDialogController',

var onSaveFinished = function (result) {
$scope.$emit('malariaplantdbApp:authorUpdate', result);
$modalInstance.close(result);
$uibModalInstance.close(result);
};

$scope.save = function () {
Expand All @@ -26,6 +26,6 @@ angular.module('malariaplantdbApp').controller('AuthorDialogController',
};

$scope.clear = function() {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
}]);
8 changes: 4 additions & 4 deletions src/main/webapp/scripts/app/entities/author/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ angular.module('malariaplantdbApp')
data: {
authorities: ['ROLE_USER'],
},
onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) {
$modal.open({
onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {
$uibModal.open({
templateUrl: 'scripts/app/entities/author/author-dialog.html',
controller: 'AuthorDialogController',
size: 'lg',
Expand All @@ -67,8 +67,8 @@ angular.module('malariaplantdbApp')
data: {
authorities: ['ROLE_USER'],
},
onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) {
$modal.open({
onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {
$uibModal.open({
templateUrl: 'scripts/app/entities/author/author-dialog.html',
controller: 'AuthorDialogController',
size: 'lg',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

angular.module('malariaplantdbApp').controller('CompilerDialogController',
['$scope', '$stateParams', '$modalInstance', 'entity', 'Compiler',
function($scope, $stateParams, $modalInstance, entity, Compiler) {
['$scope', '$stateParams', '$uibModalInstance', 'entity', 'Compiler',
function($scope, $stateParams, $uibModalInstance, entity, Compiler) {

$scope.compiler = entity;
$scope.load = function(id) {
Expand All @@ -13,7 +13,7 @@ angular.module('malariaplantdbApp').controller('CompilerDialogController',

var onSaveFinished = function (result) {
$scope.$emit('malariaplantdbApp:compilerUpdate', result);
$modalInstance.close(result);
$uibModalInstance.close(result);
};

$scope.save = function () {
Expand All @@ -25,6 +25,6 @@ angular.module('malariaplantdbApp').controller('CompilerDialogController',
};

$scope.clear = function() {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
}]);
8 changes: 4 additions & 4 deletions src/main/webapp/scripts/app/entities/compiler/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ angular.module('malariaplantdbApp')
data: {
authorities: ['ROLE_USER'],
},
onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) {
$modal.open({
onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {
$uibModal.open({
templateUrl: 'scripts/app/entities/compiler/compiler-dialog.html',
controller: 'CompilerDialogController',
size: 'lg',
Expand All @@ -67,8 +67,8 @@ angular.module('malariaplantdbApp')
data: {
authorities: ['ROLE_USER'],
},
onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) {
$modal.open({
onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {
$uibModal.open({
templateUrl: 'scripts/app/entities/compiler/compiler-dialog.html',
controller: 'CompilerDialogController',
size: 'lg',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

angular.module('malariaplantdbApp').controller('EthnologyDialogController',
['$scope', '$stateParams', '$modalInstance', 'entity', 'Ethnology', 'Publication', 'PlantIngredient',
function($scope, $stateParams, $modalInstance, entity, Ethnology, Publication, PlantIngredient) {
['$scope', '$stateParams', '$uibModalInstance', 'entity', 'Ethnology', 'Publication', 'PlantIngredient',
function($scope, $stateParams, $uibModalInstance, entity, Ethnology, Publication, PlantIngredient) {

$scope.ethnology = entity;
$scope.publications = Publication.sortedQuery();
Expand All @@ -15,7 +15,7 @@ angular.module('malariaplantdbApp').controller('EthnologyDialogController',

var onSaveFinished = function (result) {
$scope.$emit('malariaplantdbApp:ethnologyUpdate', result);
$modalInstance.close(result);
$uibModalInstance.close(result);
};

$scope.save = function () {
Expand All @@ -27,6 +27,6 @@ angular.module('malariaplantdbApp').controller('EthnologyDialogController',
};

$scope.clear = function() {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
}]);
8 changes: 4 additions & 4 deletions src/main/webapp/scripts/app/entities/ethnology/ethnology.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ angular.module('malariaplantdbApp')
data: {
authorities: ['ROLE_USER'],
},
onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) {
$modal.open({
onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {
$uibModal.open({
templateUrl: 'scripts/app/entities/ethnology/ethnology-dialog.html',
controller: 'EthnologyDialogController',
size: 'lg',
Expand All @@ -67,8 +67,8 @@ angular.module('malariaplantdbApp')
data: {
authorities: ['ROLE_USER'],
},
onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) {
$modal.open({
onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {
$uibModal.open({
templateUrl: 'scripts/app/entities/ethnology/ethnology-dialog.html',
controller: 'EthnologyDialogController',
size: 'lg',
Expand Down
Loading

0 comments on commit 7b75759

Please sign in to comment.