-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
313 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
seed/static/seed/js/controllers/match_merge_modal_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* SEED Platform (TM), Copyright (c) Alliance for Sustainable Energy, LLC, and other contributors. | ||
* See also https://github.com/SEED-platform/seed/blob/main/LICENSE.md | ||
*/ | ||
angular.module('BE.seed.controller.match_merge_modal', []).controller('match_merge_modal_controller', [ | ||
'$scope', | ||
'$uibModalInstance', | ||
'spinner_utility', | ||
'dataset_service', | ||
'uploader_service', | ||
'org', | ||
'property_ubid_matching', | ||
'taxlot_ubid_matching', | ||
'Notification', | ||
// eslint-disable-next-line func-names | ||
function ( | ||
$scope, | ||
$uibModalInstance, | ||
spinner_utility, | ||
dataset_service, | ||
uploader_service, | ||
org, | ||
property_ubid_matching, | ||
taxlot_ubid_matching, | ||
Notification | ||
) { | ||
$scope.org = org; | ||
$scope.cycles = org.cycles; | ||
$scope.selected_cycle = {}; | ||
$scope.property_ubid_matching = property_ubid_matching; | ||
$scope.taxlot_ubid_matching = taxlot_ubid_matching; | ||
|
||
$scope.uploader = { | ||
in_progress: false, | ||
progress: 0, | ||
complete: false, | ||
status_message: '' | ||
}; | ||
|
||
spinner_utility.hide(); | ||
$scope.trigger_match_merge = () => { | ||
dataset_service.match_merge_inventory($scope.selected_cycle.cycle_id).then((data) => { | ||
$scope.uploader.in_progress = true; | ||
uploader_service.check_progress_loop( | ||
data.progress_key, | ||
0, | ||
1, | ||
() => { | ||
Notification.success('Matched and merged cycle inventory'); | ||
$scope.close(); | ||
}, | ||
() => { | ||
console.log('failure'); | ||
}, | ||
$scope.uploader | ||
); | ||
}); | ||
}; | ||
|
||
$scope.cycle_change = () => { | ||
console.log($scope.selected_cycle); | ||
}; | ||
$scope.close = () => { | ||
$uibModalInstance.close(); | ||
}; | ||
|
||
$scope.cancel = () => { | ||
$uibModalInstance.dismiss(); | ||
}; | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<div class="modal-header"> | ||
<h3 class="modal-title" translate>Match and Merge Inventory</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<div> | ||
Select a cycle to re-trigger matching and merging with <strong>ubid threshold: {$ org.ubid_threshold $}</strong>. This process will match and merge all records within the selected cycle based on | ||
the matching criteria. This process may take several minutes. | ||
</div> | ||
<ul style="margin-top: 20px"> | ||
<li>Property UBID Mathcing Criteria: <strong>{$ property_ubid_matching $}</strong></li> | ||
<li>TaxLot UBID Matching Criteria: <strong>{$ taxlot_ubid_matching $}</strong></li> | ||
</ul> | ||
|
||
<div class="form-group cycle-select-container" ng-show="!uploader.in_progress"> | ||
<label for="cycle-select">Select Cycle</label> | ||
<select | ||
id="cycle-select" | ||
class="form-control" | ||
ng-model="selected_cycle" | ||
ng-options="cycle.name for cycle in cycles" | ||
ng-change="cycle_change()" | ||
placeholder="{$:: 'Cycle Name' | translate $}" | ||
></select> | ||
</div> | ||
<div ng-show="uploader.in_progress" style="margin: 20px 0">Selected Cycle: <strong>{$ selected_cycle.name $}</strong></div> | ||
|
||
<div class="progress_bar_container" ng-if="uploader.in_progress"> | ||
<div class="progress_bar_copy_top">Progress:</div> | ||
<uib-progressbar class="progress-striped active" value="uploader.progress" type="success"></uib-progressbar> | ||
<div class="progress_bar_copy_bottom">{$ uploader.progress | number:0 $}% {$:: 'Complete' | translate $} {$ uploader.status_message ? ': ' + uploader.status_message : '' $}</div> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-primary" ng-click="close()" autofocus ng-disabled="uploader.in_progress" translate>Close</button> | ||
<button type="button" class="btn btn-warning" ng-click="trigger_match_merge()" ng-disabled="uploader.in_progress" translate>Match and Merge</button> | ||
</div> |
Oops, something went wrong.