-
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.
Merge pull request #3228 from SEED-platform/3218-feat/refresh_metadata
3218 feat/refresh metadata
- Loading branch information
Showing
17 changed files
with
221 additions
and
30 deletions.
There are no files selected for viewing
Binary file not shown.
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
Binary file not shown.
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
51 changes: 51 additions & 0 deletions
51
seed/static/seed/js/controllers/refresh_metadata_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,51 @@ | ||
/** | ||
* :copyright (c) 2014 - 2022, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Department of Energy) and contributors. All rights reserved. | ||
* :author | ||
*/ | ||
angular.module('BE.seed.controller.refresh_metadata_modal', []).controller('refresh_metadata_modal_controller', [ | ||
'$scope', | ||
'$state', | ||
'$uibModalInstance', | ||
'ids', | ||
'inventory_type', | ||
'inventory_service', | ||
'uploader_service', | ||
function( | ||
$scope, | ||
$state, | ||
$uibModalInstance, | ||
ids, | ||
inventory_type, | ||
inventory_service, | ||
uploader_service, | ||
|
||
) { | ||
$scope.id_count = ids.length | ||
$scope.inventory_type = inventory_type | ||
$scope.refresh_progress = { | ||
progress: 0, | ||
status_message: '', | ||
}; | ||
$scope.refreshing = false | ||
|
||
$scope.refresh_metadata = function () { | ||
$scope.refreshing = true | ||
inventory_service.start_refresh_metadata() | ||
.then(data => { | ||
uploader_service.check_progress_loop(data.data.progress_key, 0, 1, | ||
function () { $scope.refresh_page()}, | ||
function () { }, | ||
$scope.refresh_progress); | ||
return inventory_service.refresh_metadata(ids, inventory_type, data.data.progress_key); | ||
}) | ||
} | ||
|
||
$scope.refresh_page = function () { | ||
$state.reload(); | ||
$uibModalInstance.dismiss('cancel'); | ||
}; | ||
|
||
$scope.cancel = function() { | ||
$uibModalInstance.dismiss('cancel'); | ||
} | ||
}]); |
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
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
Oops, something went wrong.