Revision 58250
Added by Michele Artini about 4 years ago
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/modals/resolve_conflicts.html | ||
---|---|---|
2 | 2 |
<div class="modal-dialog modal-xl" role="document"> |
3 | 3 |
<div class="modal-content"> |
4 | 4 |
<div class="modal-header"> |
5 |
<h5 class="modal-title">Select master</h5>
|
|
5 |
<h5 class="modal-title">Resolve conflicts</h5>
|
|
6 | 6 |
<button type="button" class="close" data-dismiss="modal">×</button> |
7 | 7 |
</div> |
8 | 8 |
<div class="modal-body" style="min-height: 300px"> |
9 |
<div ng-repeat="o in orgs"> |
|
10 |
<div class="form-check"> |
|
11 |
<input class="form-check-input" type="radio" name="org_op_master" id="org_op_mergein_{{$index}}" value="{{$index}}" /> |
|
12 |
<div> |
|
13 |
<org-details org="o" org-title="Organization {{$index+1}}"></org-details> |
|
14 |
<div class="input-group input-group-sm mb-3"> |
|
15 |
<div class="input-group-prepend"> |
|
16 |
<label class="input-group-text" for="inputGroupSelect01">Operation</label> |
|
17 |
</div> |
|
18 |
<select class="custom-select"> |
|
19 |
<option>merge to master</option> |
|
20 |
<option>mark as an invalid event</option> |
|
21 |
<option>skip</option> |
|
22 |
</select> |
|
9 |
<div class="row"> |
|
10 |
<div class="col-6"> |
|
11 |
<div ng-repeat="o in orgs" ng-show="o.show != 'hidden'"> |
|
12 |
<org-details org="o" org-title="Organization {{$index+1}}" show="{{o.show}}"></org-details> |
|
13 |
<div class="text-right mb-3"> |
|
14 |
<button type="button" class="btn btn-sm btn-primary" ng-click="selectOrg(o)">select >></button> |
|
23 | 15 |
</div> |
24 | 16 |
</div> |
25 | 17 |
</div> |
18 |
<div class="col-6"> |
|
19 |
<div ng-repeat="o in selectedOrgs" ng-hide="o.show == 'hidden'"> |
|
20 |
<org-details org="o" org-title="Organization {{$index+1}}" show="{{o.show}}"></org-details> |
|
21 |
</div> |
|
22 |
<button type="button" class="btn btn-sm btn-secondary" ng-click="reset()" ng-if="selectedOrgs.length > 0">reset</button> |
|
23 |
<button type="button" class="btn btn-sm btn-primary" ng-click="createGroup()" ng-if="selectedOrgs.length > 1">create group</button> |
|
24 |
</div> |
|
26 | 25 |
</div> |
27 | 26 |
</div> |
28 | 27 |
<div class="modal-footer"> |
29 | 28 |
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
30 |
<button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="resolveConflicts()">Save changes</button> |
|
31 | 29 |
</div> |
32 | 30 |
</div> |
33 | 31 |
</div> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/forms/all_conflicts.html | ||
---|---|---|
37 | 37 |
|
38 | 38 |
</div> |
39 | 39 |
|
40 |
<resolve-conflicts-modal modal-id="resolveConflictsModal" orgs="orgs"></resolve-conflicts-modal> |
|
40 |
<resolve-conflicts-modal modal-id="resolveConflictsModal" orgs="orgs" selected-orgs="selectedOrgs"></resolve-conflicts-modal> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/forms/all_duplicates.html | ||
---|---|---|
47 | 47 |
</div> |
48 | 48 |
<div class="modal-body"> |
49 | 49 |
<div class="text-muted" ng-if="currentDuplicates.length == 0">No duplicates</div> |
50 |
<org-details org="currentOrgDetails" org-title="Registered organization"></org-details> |
|
50 |
<org-details org="currentOrgDetails" org-title="Registered organization" show="default"></org-details>
|
|
51 | 51 |
<org-form-duplicates duplicates="currentDuplicates"></org-form-duplicates> |
52 | 52 |
</div> |
53 | 53 |
<div class="modal-footer"> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/parts/org_dedup_events.html | ||
---|---|---|
1 | 1 |
<div class="card-body"> |
2 | 2 |
|
3 |
<org-details org="currentOrgDetails" org-title="Registered organization"></org-details> |
|
3 |
<org-details org="currentOrgDetails" org-title="Registered organization" show="default"></org-details>
|
|
4 | 4 |
|
5 | 5 |
<org-form-duplicates duplicates="events.duplicates" save-function="saveDuplicates()" show-save-button="1"></org-form-duplicates> |
6 | 6 |
|
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/parts/org_details.html | ||
---|---|---|
1 |
<div class="card mb-3"> |
|
2 |
<div class="card-header bg-primary text-white py-1">{{orgTitle}}</div>
|
|
1 |
<div class="card mb-3" ng-show="show != 'hidden'">
|
|
2 |
<div class="card-header text-white py-1" ng-class="{'bg-primary' : show == 'default', 'bg-success' : show == 'success' }">{{orgTitle}}</div>
|
|
3 | 3 |
<table class="table table-sm table-condensed"> |
4 | 4 |
<tr class="d-flex"> |
5 | 5 |
<th class="col-4">Name</th> |
modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js | ||
---|---|---|
47 | 47 |
return { |
48 | 48 |
restrict: 'E', |
49 | 49 |
scope: { |
50 |
'modalId' : '@', |
|
51 |
'orgs' : '=' |
|
50 |
'modalId' : '@', |
|
51 |
'orgs' : '=', |
|
52 |
'selectedOrgs': '=' |
|
52 | 53 |
}, |
53 | 54 |
templateUrl: 'resources/html/modals/resolve_conflicts.html', |
54 | 55 |
link: function(scope, element, attrs, ctrl) { |
56 |
scope.selectOrg = function(org) { |
|
57 |
var sel = angular.copy(org); |
|
58 |
if (scope.selectedOrgs.length == 0) { sel.show = 'success'; } |
|
59 |
else { sel.show = 'default'; } |
|
60 |
scope.selectedOrgs.push(sel); |
|
61 |
org.show = 'hidden'; |
|
62 |
} |
|
63 |
|
|
64 |
scope.reset = function() { |
|
65 |
scope.selectedOrgs = []; |
|
66 |
angular.forEach(scope.orgs, function(org) { org.show = 'default'; }); |
|
67 |
} |
|
55 | 68 |
|
56 |
|
|
57 |
scope.resolveConflicts = function() { |
|
69 |
scope.createGroup = function() { |
|
58 | 70 |
alert('todo'); |
59 | 71 |
} |
60 | 72 |
} |
... | ... | |
200 | 212 |
restrict: 'E', |
201 | 213 |
scope: { |
202 | 214 |
'org' : '=', |
203 |
'orgTitle' : '@' |
|
215 |
'orgTitle' : '@', |
|
216 |
'show' : '@' |
|
204 | 217 |
}, |
205 | 218 |
templateUrl: 'resources/html/parts/org_details.html', |
206 | 219 |
link: function(scope, element, attrs, ctrl) {} |
... | ... | |
243 | 256 |
|
244 | 257 |
scope.prepareConflictsModal = function(list) { |
245 | 258 |
scope.orgs = []; |
259 |
scope.selectedOrgs = []; |
|
246 | 260 |
|
247 | 261 |
var gets = list.map((o) => $http.get('api/organizations/get?id=' + o.id)); |
248 | 262 |
|
249 | 263 |
$q.all(gets).then(function(responses) { |
250 | 264 |
scope.orgs = responses.map((resp) => resp.data); |
265 |
angular.forEach(scope.orgs, function(org) { org.show = 'default'; }); |
|
251 | 266 |
}); |
252 |
|
|
253 |
scope.orgs = list; |
|
254 | 267 |
} |
255 | 268 |
|
256 | 269 |
} |
Also available in: Unified diff
partial implementation of merge orgs modal