mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
feat: Close spell config panel after saving
This commit is contained in:
parent
c9b0145d27
commit
e599ab92da
2 changed files with 11 additions and 3 deletions
|
|
@ -230,7 +230,10 @@ export default function HeliumCtrl($scope, $rootScope, $sce,
|
|||
const pkgName = pkgSearchResult.pkg.name;
|
||||
const currentConf = $scope.defaultPackageConfigs[pkgName];
|
||||
|
||||
heliumService.saveConfig(pkgSearchResult.pkg, currentConf);
|
||||
heliumService.saveConfig(pkgSearchResult.pkg, currentConf, () => {
|
||||
// close after config is saved
|
||||
pkgSearchResult.configOpened = false;
|
||||
});
|
||||
};
|
||||
|
||||
init();
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ export default function heliumService($http, $sce, baseUrlSrv) {
|
|||
return $http.post(baseUrlSrv.getRestApiBase() + '/helium/disable/' + name);
|
||||
};
|
||||
|
||||
this.saveConfig = function(pkg , defaultPackageConfig) {
|
||||
this.saveConfig = function(pkg , defaultPackageConfig, closeConfigPanelCallback) {
|
||||
// in case of local package, it will include `/`
|
||||
const pkgArtifact = encodeURIComponent(pkg.artifact);
|
||||
const pkgName = pkg.name;
|
||||
|
|
@ -139,7 +139,12 @@ export default function heliumService($http, $sce, baseUrlSrv) {
|
|||
}
|
||||
|
||||
const url = `${baseUrlSrv.getRestApiBase()}/helium/config/${pkgName}/${pkgArtifact}`;
|
||||
return $http.post(url, filtered);
|
||||
return $http.post(url, filtered)
|
||||
.then(() => {
|
||||
if (closeConfigPanelCallback) { closeConfigPanelCallback(); }
|
||||
}).catch((error) => {
|
||||
console.error(`Failed to save config for ${pkgArtifact}`, error);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue