Skip to content

Commit

Permalink
Data upload modal text changes
Browse files Browse the repository at this point in the history
  • Loading branch information
axelstudios committed Jan 20, 2017
1 parent 0e69746 commit 3daf0f8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 48 deletions.
54 changes: 18 additions & 36 deletions seed/static/seed/js/controllers/data_upload_modal_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ angular.module('BE.seed.controller.data_upload_modal', [])
$uibModalInstance.close();
$state.go('matching', {importfile_id: $scope.dataset.import_file_id});
};
$scope.view_my_buildings = function () {
$scope.view_my_properties = function () {
$uibModalInstance.close();
spinner_utility.show();
$state.go('inventory_list', {inventory_type: 'properties'});
Expand Down Expand Up @@ -300,7 +300,7 @@ angular.module('BE.seed.controller.data_upload_modal', [])
matching_service.start_system_matching(
import_file_id
).then(function (data) {
if (data.status === 'error' || data.status === 'warning') {
if (_.includes(['error', 'warning'], data.status)) {
$scope.uploader.complete = true;
$scope.uploader.in_progress = false;
$scope.uploader.progress = 0;
Expand All @@ -309,40 +309,22 @@ angular.module('BE.seed.controller.data_upload_modal', [])
$scope.step_10_error_message = data.message;
$scope.step_10_title = data.message;
} else {
uploader_service.check_progress_loop(
data.progress_key,
0,
1.0,
function (data) {
building_services.get_matching_results($scope.dataset.import_file_id)
.then(function (data) {
// resolve promise
$scope.matched_buildings = data.matched;
$scope.unmatched_buildings = data.unmatched;
$scope.duplicate_buildings = data.duplicates;
$scope.uploader.complete = true;
$scope.uploader.in_progress = false;
$scope.uploader.progress = 0;
if ($scope.duplicate_buildings > 0) {
//alert("Duplicate buildings found, trying to delete");
building_services.delete_duplicates_from_import_file($scope.dataset.import_file_id).then(function (data) {
if ($scope.matched_buildings > 0) {
$scope.step.number = 8;
} else {
$scope.step.number = 10;
// building_services.get_total_number_of_buildings_for_user();
}
});
}
else {
if ($scope.matched_buildings > 0) {
$scope.step.number = 8;
} else {
$scope.step.number = 10;
// building_services.get_total_number_of_buildings_for_user();
}
}
});
uploader_service.check_progress_loop(data.progress_key, 0, 1, function (data) {
building_services.get_matching_results($scope.dataset.import_file_id).then(function (data) {
$scope.matched_properties = data.properties.matched;
$scope.unmatched_properties = data.properties.unmatched;
$scope.matched_taxlots = data.tax_lots.matched;
$scope.unmatched_taxlots = data.tax_lots.unmatched;
$scope.uploader.complete = true;
$scope.uploader.in_progress = false;
$scope.uploader.progress = 0;
if ($scope.matched_properties + $scope.matched_taxlots > 0) {
$scope.step.number = 8;
} else {
$scope.step.number = 10;
// building_services.get_total_number_of_buildings_for_user();
}
});
}, function (data) {
// Do nothing
},
Expand Down
23 changes: 11 additions & 12 deletions seed/static/seed/partials/data_upload_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h4 class="modal-title" ng-switch-when="3">Successful upload!</h4>
<h4 class="modal-title" ng-switch-when="4">Upload your energy data.</h4>
<h4 class="modal-title" ng-switch-when="5">Successful upload!</h4>
<h4 class="modal-title" ng-switch-when="6">What type of file would you like to upload?</h4>
<h4 class="modal-title" ng-switch-when="7">Finding building matches.</h4>
<h4 class="modal-title" ng-switch-when="7">Finding inventory matches.</h4>
<h4 class="modal-title" ng-switch-when="8">Matching Results for file: <strong>{$ dataset.filename $}</strong></h4>
<h4 class="modal-title" ng-switch-when="9">Add files to {$ dataset.name $}.</h4>
<h4 class="modal-title" ng-switch-when="10">{$ step_10_title|titleCase $}</h4>
Expand Down Expand Up @@ -116,7 +116,7 @@ <h4 class="modal-title" ng-switch-when="12">Error Processing Data</h4>
<div class="data_upload_steps" ng-switch-when="6">
<div class="row">
<div class="form-group col-sm-12">
<button type="button" class="btn btn-primary" ng-click="goto_step(2)">Buildings list file</button>
<button type="button" class="btn btn-primary" ng-click="goto_step(2)">Inventory list file</button>
<button type="button" class="btn btn-primary" ng-click="goto_step(4)">Energy data file</button>
</div>
</div>
Expand All @@ -126,7 +126,7 @@ <h4 class="modal-title" ng-switch-when="12">Error Processing Data</h4>
<div class="row">
<div class="form-group col-sm-12">
<div class="progress_bar_container">
<div class="progress_bar_copy_top">Finding building matches for
<div class="progress_bar_copy_top">Finding inventory matches for
<strong>{$ dataset.filename $}</strong></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</div>
Expand All @@ -140,10 +140,9 @@ <h4 class="modal-title" ng-switch-when="12">Error Processing Data</h4>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" aria-hidden="true" ng-click="uploader.complete = false">&times;</button>
<ul>
<li>Total records in the file: {$ (matched_buildings + unmatched_buildings + duplicate_buildings)|number:0 $}</li>
<li>Duplicate records, not merged into existing Master buildings: {$ duplicate_buildings|number:0 $}</li>
<li>Records that were matched to existing (or new) Master buildings: {$ matched_buildings|number:0 $}</li>
<li>Records that were made into new Master buildings (not duplicates, not matches): {$ unmatched_buildings|number:0 $}</li>
<li>Total records in the file: {$ (matched_properties + unmatched_properties + matched_taxlots + unmatched_taxlots)|number:0 $}</li>
<li>Records that were matched to existing properties &amp; tax lots: {$ (matched_properties + matched_taxlots)|number:0 $}</li>
<li>Records that were made into new properties &amp; tax lots (not matches): {$ (unmatched_properties + unmatched_taxlots)|number:0 $}</li>
</ul>
</div>
</div>
Expand All @@ -162,7 +161,7 @@ <h4 class="modal-title" ng-switch-when="12">Error Processing Data</h4>
<div class="alert alert-{$ step_10_style $} alert-dismissable">
<button type="button" class="close" aria-hidden="true" ng-click="uploader.complete = false">&times;</button>
<span ng-show="step_10_error_message">{$ step_10_error_message $}</span>
<span ng-hide="step_10_error_message">SEED could not locate any non-duplicate matches and found <strong>{$ duplicate_buildings|number:0 $} duplicates</strong>. Would you like to add another file?</span>
<span ng-hide="step_10_error_message">SEED could not locate any existing matches</strong>. Would you like to add another file?</span>
</div>
<div class="form-group col-sm-12"></div>
</div>
Expand All @@ -172,7 +171,7 @@ <h4 class="modal-title" ng-switch-when="12">Error Processing Data</h4>
<div class="row">
<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" aria-hidden="true" ng-click="uploader.complete = false">&times;</button>
Did you review your mappings? It's a good idea to double check your mappings. Once SEED matches your buildings you cannot undo or edit these mappings.
Did you review your mappings? It's a good idea to double check your mappings. Once SEED matches your properties &amp; tax lots you cannot undo or edit these mappings.
</div>
</div>
</div>
Expand Down Expand Up @@ -215,10 +214,10 @@ <h4 class="modal-title" ng-switch-when="12">Error Processing Data</h4>
<div ng-switch-when="7"></div>
<div ng-switch-when="8">
<div class="row text-center">
<button type="button" class="btn btn-default col-sm-6 center-block" ng-click="view_my_buildings()">View my buildings</button>
<button type="button" class="btn btn-default col-sm-6 center-block" ng-click="view_my_properties()">View my properties</button>
</div>
<div class="row text-center">
<button id="review-mapping" type="button" class="btn btn-primary col-sm-6 center-block" ng-click="goto_data_matching()">Review matches</button>
<!--<button id="review-mapping" type="button" class="btn btn-primary col-sm-6 center-block" ng-click="goto_data_matching()">Review matches</button>-->
</div>
</div>
<div ng-switch-when="9">
Expand All @@ -231,7 +230,7 @@ <h4 class="modal-title" ng-switch-when="12">Error Processing Data</h4>
<button type="button" class="btn btn-primary col-sm-6 center-block" ng-click="goto_step(2)">Add another file</button>
</div>
<div class="row text-center">
<button id="view-buildings" type="button" class="btn btn-primary col-sm-6 center-block" ng-click="view_my_buildings()">View my buildings</button>
<button id="view-buildings" type="button" class="btn btn-primary col-sm-6 center-block" ng-click="view_my_properties()">View my properties</button>
</div>
</div>
<div ng-switch-when="11">
Expand Down

0 comments on commit 3daf0f8

Please sign in to comment.