mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
refactor: HeliumService
This commit is contained in:
parent
f31bf3c7c3
commit
33a2bd8f8b
1 changed files with 6 additions and 11 deletions
|
|
@ -70,9 +70,7 @@ export default function heliumService($http, $sce, baseUrlSrv) {
|
|||
|
||||
this.executeSpell = function(magic, textWithoutMagic) {
|
||||
const promisedConf = this.getSinglePackageConfigUsingMagic(magic)
|
||||
.then(confs => {
|
||||
return createPersistableConfig(confs);
|
||||
});
|
||||
.then(confs => createPersistableConfig(confs));
|
||||
|
||||
return promisedConf.then(conf => {
|
||||
const spell = this.getSpellByMagic(magic);
|
||||
|
|
@ -84,16 +82,13 @@ export default function heliumService($http, $sce, baseUrlSrv) {
|
|||
});
|
||||
};
|
||||
|
||||
this.executeSpellAsDisplaySystem = function(type, data) {
|
||||
const promisedConf = this.getSinglePackageConfigUsingMagic(type)
|
||||
.then(confs => {
|
||||
return createPersistableConfig(confs);
|
||||
});
|
||||
this.executeSpellAsDisplaySystem = function(magic, textWithoutMagic) {
|
||||
const promisedConf = this.getSinglePackageConfigUsingMagic(magic)
|
||||
.then(confs => createPersistableConfig(confs));
|
||||
|
||||
return promisedConf.then(conf => {
|
||||
|
||||
const spell = this.getSpellByMagic(type);
|
||||
const spellResult = spell.interpret(data.trim(), conf);
|
||||
const spell = this.getSpellByMagic(magic);
|
||||
const spellResult = spell.interpret(textWithoutMagic.trim(), conf);
|
||||
const parsed = spellResult.getAllParsedDataWithTypes(spellPerMagic);
|
||||
|
||||
return parsed;
|
||||
|
|
|
|||
Loading…
Reference in a new issue