Revision 58353
Added by Michele Artini about 4 years ago
modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/model/view/SuggestionInfoViewByCountry.java | ||
---|---|---|
20 | 20 |
@Column(name = "country") |
21 | 21 |
private String country; |
22 | 22 |
|
23 |
@Column(name = "n_groups") |
|
24 |
private long nGroups; |
|
25 |
|
|
26 | 23 |
@Column(name = "n_duplicates") |
27 | 24 |
private long nDuplicates; |
28 | 25 |
|
... | ... | |
37 | 34 |
this.country = country; |
38 | 35 |
} |
39 | 36 |
|
40 |
public long getnGroups() { |
|
41 |
return nGroups; |
|
42 |
} |
|
43 |
|
|
44 |
public void setnGroups(final long nGroups) { |
|
45 |
this.nGroups = nGroups; |
|
46 |
} |
|
47 |
|
|
48 | 37 |
public long getnDuplicates() { |
49 | 38 |
return nDuplicates; |
50 | 39 |
} |
modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/controller/SuggestionInfo.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
public class SuggestionCounter { |
11 | 11 |
|
12 |
private long nGroups = 0; |
|
13 |
|
|
14 | 12 |
private long nDuplicates = 0; |
15 | 13 |
|
16 | 14 |
private long nConflicts = 0; |
17 | 15 |
|
18 |
public long getnGroups() { |
|
19 |
return nGroups; |
|
20 |
} |
|
21 |
|
|
22 |
public void setnGroups(final long nGroups) { |
|
23 |
this.nGroups = nGroups; |
|
24 |
} |
|
25 |
|
|
26 | 16 |
public long getnDuplicates() { |
27 | 17 |
return nDuplicates; |
28 | 18 |
} |
... | ... | |
40 | 30 |
} |
41 | 31 |
|
42 | 32 |
public void add(final SuggestionInfoViewByCountry infoCountry) { |
43 |
nGroups += infoCountry.getnGroups(); |
|
44 | 33 |
nDuplicates += infoCountry.getnDuplicates(); |
45 | 34 |
nConflicts += infoCountry.getnConflicts(); |
46 | 35 |
} |
modules/dnet-orgs-database-application/trunk/src/main/resources/sql/schema.sql | ||
---|---|---|
221 | 221 |
ORDER BY u.email; |
222 | 222 |
|
223 | 223 |
CREATE VIEW suggestions_info_by_country_view AS SELECT c.val AS country, |
224 |
0::int8 AS n_groups, |
|
225 | 224 |
coalesce(t1.n_duplicates, 0) AS n_duplicates, |
226 | 225 |
coalesce(t2.n_conflicts, 0) AS n_conflicts |
227 | 226 |
FROM countries c |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/forms/all_conflicts.html | ||
---|---|---|
7 | 7 |
<button class="btn btn-outline-primary dropdown-toggle" data-toggle="dropdown">{{country}}</button> |
8 | 8 |
<div class="dropdown-menu"> |
9 | 9 |
<small> |
10 |
<a class="dropdown-item" href="#!/suggestions/{{c}}/3"
|
|
10 |
<a class="dropdown-item" href="#!/suggestions/{{c}}/2"
|
|
11 | 11 |
ng-repeat="(c, vals) in info.byCountry" |
12 | 12 |
ng-if="vals.nConflicts > 0"> |
13 |
{{c}} <span class="badge badge-primary float-right">{{vals.nConflicts}}</span>
|
|
13 |
{{c}} <span class="badge badge-danger float-right">{{vals.nConflicts}}</span>
|
|
14 | 14 |
</a> |
15 | 15 |
</small> |
16 | 16 |
</div> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/forms/all_duplicates.html | ||
---|---|---|
7 | 7 |
<button class="btn btn-outline-primary dropdown-toggle" data-toggle="dropdown">{{country}}</button> |
8 | 8 |
<div class="dropdown-menu"> |
9 | 9 |
<small> |
10 |
<a class="dropdown-item" href="#!/suggestions/{{c}}/2"
|
|
10 |
<a class="dropdown-item" href="#!/suggestions/{{c}}/1"
|
|
11 | 11 |
ng-repeat="(c, vals) in info.byCountry" |
12 | 12 |
ng-if="vals.nDuplicates > 0"> |
13 | 13 |
{{c}} <span class="badge badge-primary float-right">{{vals.nDuplicates}}</span> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/suggestions.html | ||
---|---|---|
3 | 3 |
<div class="card-header"> |
4 | 4 |
<ul class="nav nav-tabs card-header-tabs"> |
5 | 5 |
<li class="nav-item text-nowrap"> |
6 |
<a href="#!/suggestions/_/1" class="nav-link" ng-class="{'active': currentTab == 1}">New Groups <span class="badge badge-primary ml-2">{{info.total.nGroups}}</span></a>
|
|
6 |
<a href="#!/suggestions/_/1" class="nav-link" ng-class="{'active': currentTab == 1}">New Duplicates <span class="badge badge-primary ml-2">{{info.total.nDuplicates}}</span></a>
|
|
7 | 7 |
</li> |
8 | 8 |
<li class="nav-item text-nowrap"> |
9 |
<a href="#!/suggestions/_/2" class="nav-link" ng-class="{'active': currentTab == 2}">New Duplicates <span class="badge badge-primary ml-2">{{info.total.nDuplicates}}</span></a>
|
|
9 |
<a href="#!/suggestions/_/2" class="nav-link" ng-class="{'active': currentTab == 2}">New Conflicts <span class="badge badge-danger ml-2">{{info.total.nConflicts}}</span></a>
|
|
10 | 10 |
</li> |
11 |
<li class="nav-item text-nowrap"> |
|
12 |
<a href="#!/suggestions/_/3" class="nav-link" ng-class="{'active': currentTab == 3}">New Conflicts <span class="badge badge-primary ml-2">{{info.total.nConflicts}}</span></a> |
|
13 |
</li> |
|
14 | 11 |
</ul> |
15 | 12 |
</div> |
16 | 13 |
|
17 | 14 |
<div class="card-body"> |
18 |
<div ng-if="currentTab == 1">NOT IMPLEMENTED</div> |
|
19 |
<all-duplicates duplicates="duplicates" country="{{country}}" info="info" info-method="getInfo()" ng-if="currentTab == 2"></all-duplicates> |
|
20 |
<all-conflicts conflicts="conflicts" country="{{country}}" info="info" info-method="getInfo()" ng-if="currentTab == 3"></all-conflicts> |
|
15 |
<all-duplicates duplicates="duplicates" country="{{country}}" info="info" info-method="getInfo()" ng-if="currentTab == 1"></all-duplicates> |
|
16 |
<all-conflicts conflicts="conflicts" country="{{country}}" info="info" info-method="getInfo()" ng-if="currentTab == 2"></all-conflicts> |
|
21 | 17 |
</div> |
22 | 18 |
|
23 | 19 |
</div> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js | ||
---|---|---|
549 | 549 |
$scope.info = {}; |
550 | 550 |
$scope.conflicts = []; |
551 | 551 |
$scope.duplicates = []; |
552 |
$scope.newGroups = []; |
|
553 | 552 |
$scope.currentTab = $routeParams.tab; |
554 | 553 |
$scope.country = $routeParams.country; |
555 | 554 |
|
... | ... | |
561 | 560 |
var found = ''; |
562 | 561 |
|
563 | 562 |
angular.forEach($scope.info.byCountry, function(values, c) { |
564 |
if (!found && (($scope.currentTab == 1 && values.nGroups > 0) || ($scope.currentTab == 2 && values.nDuplicates > 0) || ($scope.currentTab == 3 && values.nConflicts > 0))) {
|
|
563 |
if (!found && (($scope.currentTab == 1 && values.nDuplicates > 0) || ($scope.currentTab == 2 && values.nConflicts > 0))) {
|
|
565 | 564 |
found = c; |
566 | 565 |
} |
567 | 566 |
}); |
... | ... | |
576 | 575 |
$scope.refresh = function() { |
577 | 576 |
$scope.conflicts = []; |
578 | 577 |
$scope.duplicates = []; |
579 |
$scope.newGroups = []; |
|
580 | 578 |
|
581 | 579 |
if ($scope.country != '_') { |
582 | 580 |
if ($scope.currentTab == 1) { |
583 |
$scope.groups = []; //TODO |
|
584 |
} else if ($scope.currentTab == 2) { |
|
585 | 581 |
$http.get('api/organizations/duplicates/byCountry/' + $scope.country).then(function successCallback(res) { |
586 | 582 |
if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } |
587 | 583 |
$scope.duplicates = res.data; |
... | ... | |
591 | 587 |
}, function errorCallback(res) { |
592 | 588 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
593 | 589 |
}); |
594 |
} else if ($scope.currentTab == 3) {
|
|
590 |
} else if ($scope.currentTab == 2) {
|
|
595 | 591 |
$http.get('api/organizations/conflicts/byCountry/' + $scope.country).then(function successCallback(res) { |
596 | 592 |
if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } |
597 | 593 |
$scope.conflicts = res.data; |
Also available in: Unified diff
removed unused tab (groups)