mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
feat: Add disabled class to cfg button while fetching
This commit is contained in:
parent
76d50ca48b
commit
f31bf3c7c3
2 changed files with 10 additions and 2 deletions
|
|
@ -200,9 +200,14 @@ export default function HeliumCtrl($scope, $rootScope, $sce,
|
|||
};
|
||||
|
||||
$scope.configOpened = function(pkgSearchResult) {
|
||||
return pkgSearchResult.configOpened;
|
||||
return pkgSearchResult.configOpened && !pkgSearchResult.configFetching;
|
||||
};
|
||||
|
||||
$scope.getConfigButtonClass = function(pkgSearchResult) {
|
||||
return (pkgSearchResult.configOpened && pkgSearchResult.configFetching) ?
|
||||
'disabled' : '';
|
||||
}
|
||||
|
||||
$scope.toggleConfigButton = function(pkgSearchResult) {
|
||||
if (pkgSearchResult.configOpened) {
|
||||
pkgSearchResult.configOpened = false;
|
||||
|
|
@ -211,11 +216,13 @@ export default function HeliumCtrl($scope, $rootScope, $sce,
|
|||
|
||||
const pkg = pkgSearchResult.pkg;
|
||||
const pkgName = pkg.name;
|
||||
pkgSearchResult.configFetching = true;
|
||||
pkgSearchResult.configOpened = true;
|
||||
|
||||
heliumService.getSinglePackageConfigs(pkg)
|
||||
.then(confs => {
|
||||
$scope.defaultPackageConfigs[pkgName] = confs;
|
||||
pkgSearchResult.configOpened = true;
|
||||
pkgSearchResult.configFetching = false;
|
||||
$scope.$digest(); // to trigger view update
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ limitations under the License.
|
|||
style="float:right">Disable</div>
|
||||
<div ng-show="configExists(pkgSearchResult)"
|
||||
ng-click="toggleConfigButton(pkgSearchResult)"
|
||||
ng-class="getConfigButtonClass(pkgSearchResult)"
|
||||
class="btn btn-default btn-xs spellConfigButton"
|
||||
style="float:right; margin-right:5px;">Config</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue