[11/12] zeppelin git commit: [ZEPPELIN-3245] checkstyle/eslintrc for zeppelin-web (JavaScript)
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/helium/helium.service.js -- diff --git a/zeppelin-web/src/app/helium/helium.service.js b/zeppelin-web/src/app/helium/helium.service.js index d2054b3..7501fae 100644 --- a/zeppelin-web/src/app/helium/helium.service.js +++ b/zeppelin-web/src/app/helium/helium.service.js @@ -12,290 +12,294 @@ * limitations under the License. */ -import { HeliumType, } from './helium-type' +import {HeliumType} from './helium-type'; import { createAllPackageConfigs, createPersistableConfig, mergePersistedConfWithSpec, -} from './helium-conf' +} from './helium-conf'; import { createDefaultPackages, -} from './helium-package' +} from './helium-package'; -angular.module('zeppelinWebApp').service('heliumService', HeliumService) +angular.module('zeppelinWebApp').service('heliumService', HeliumService); export default function HeliumService($http, $sce, baseUrlSrv) { - 'ngInject' + 'ngInject'; - let visualizationBundles = [] - let visualizationPackageOrder = [] + let visualizationBundles = []; + let visualizationPackageOrder = []; // name `heliumBundles` should be same as `HeliumBundleFactory.HELIUM_BUNDLES_VAR` - let heliumBundles = [] + let heliumBundles = []; // map for `{ magic: interpreter }` - let spellPerMagic = {} + let spellPerMagic = {}; // map for `{ magic: package-name }` - let pkgNamePerMagic = {} + let pkgNamePerMagic = {}; /** * @param magic {string} e.g `%flowchart` * @returns {SpellBase} undefined if magic is not registered */ - this.getSpellByMagic = function (magic) { -return spellPerMagic[magic] - } + this.getSpellByMagic = function(magic) { +return spellPerMagic[magic]; + }; - this.executeSpell = function (magic, textWithoutMagic) { + this.executeSpell = function(magic, textWithoutMagic) { const promisedConf = this.getSinglePackageConfigUsingMagic(magic) - .then(confs => createPersistableConfig(confs)) + .then((confs) => createPersistableConfig(confs)); -return promisedConf.then(conf => { - const spell = this.getSpellByMagic(magic) - const spellResult = spell.interpret(textWithoutMagic, conf) +return promisedConf.then((conf) => { + const spell = this.getSpellByMagic(magic); + const spellResult = spell.interpret(textWithoutMagic, conf); const parsed = spellResult.getAllParsedDataWithTypes( -spellPerMagic, magic, textWithoutMagic) +spellPerMagic, magic, textWithoutMagic); - return parsed -}) - } + return parsed; +}); + }; - this.executeSpellAsDisplaySystem = function (magic, textWithoutMagic) { + this.executeSpellAsDisplaySystem = function(magic, textWithoutMagic) { const promisedConf = this.getSinglePackageConfigUsingMagic(magic) - .then(confs => createPersistableConfig(confs)) + .then((confs) => createPersistableConfig(confs)); -return promisedConf.then(conf => { - const spell = this.getSpellByMagic(magic) - const spellResult = spell.interpret(textWithoutMagic.trim(), conf) - const parsed = spellResult.getAllParsedDataWithTypes(spellPerMagic) +return promisedConf.then((conf) => { + const spell = this.getSpellByMagic(magic); + const spellResult = spell.interpret(textWithoutMagic.trim(), conf); + const parsed = spellResult.getAllParsedDataWithTypes(spellPerMagic); - return parsed -}) - } + return parsed; +}); + }; - this.getVisualizationCachedPackages = function () { -return visualizationBundles - } + this.getVisualizationCachedPackages = function() { +return visualizationBundles; + }; - this.getVisualizationCachedPackageOrder = function () { -return visualizationPackageOrder - } + this.getVisualizationCachedPackageOrder = function() { +return visualizationPackageOrder; + }; /** * @returns {Promise} which returns bundleOrder and cache it in `visualizationPackageOrder` */ - this.getVisualizationPackageOrder = function () { + this.getVisualizationPackageOrder = function() { return $http.get(baseUrlSrv.getRestApiBase() + '/helium/order/visualization') - .then(function (response, status) { -const order = response.data.body -visualizationPackageOrder = order -return order - }) - .catch(function (error) { -console.error('Can not get bundle order', error) + .then(function(response, status) { +const order = response.data.body; +visualizationPackageOrder = order; +return order; }) - } + .catch(function(error) { +console.error('Can not get bundle order', error); + }); + }; - this.setVisualizationPackageOrder = function (list) { -return $http.post(baseUrlSrv.getRestApiBase() + '/helium/order/visualization', list) - } + this.setVisualizationPackageOrder = function(list)
[11/12] zeppelin git commit: [ZEPPELIN-3245] checkstyle/eslintrc for zeppelin-web (JavaScript)
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ea2c9447/zeppelin-web/src/app/helium/helium.service.js -- diff --git a/zeppelin-web/src/app/helium/helium.service.js b/zeppelin-web/src/app/helium/helium.service.js index d2054b3..7501fae 100644 --- a/zeppelin-web/src/app/helium/helium.service.js +++ b/zeppelin-web/src/app/helium/helium.service.js @@ -12,290 +12,294 @@ * limitations under the License. */ -import { HeliumType, } from './helium-type' +import {HeliumType} from './helium-type'; import { createAllPackageConfigs, createPersistableConfig, mergePersistedConfWithSpec, -} from './helium-conf' +} from './helium-conf'; import { createDefaultPackages, -} from './helium-package' +} from './helium-package'; -angular.module('zeppelinWebApp').service('heliumService', HeliumService) +angular.module('zeppelinWebApp').service('heliumService', HeliumService); export default function HeliumService($http, $sce, baseUrlSrv) { - 'ngInject' + 'ngInject'; - let visualizationBundles = [] - let visualizationPackageOrder = [] + let visualizationBundles = []; + let visualizationPackageOrder = []; // name `heliumBundles` should be same as `HeliumBundleFactory.HELIUM_BUNDLES_VAR` - let heliumBundles = [] + let heliumBundles = []; // map for `{ magic: interpreter }` - let spellPerMagic = {} + let spellPerMagic = {}; // map for `{ magic: package-name }` - let pkgNamePerMagic = {} + let pkgNamePerMagic = {}; /** * @param magic {string} e.g `%flowchart` * @returns {SpellBase} undefined if magic is not registered */ - this.getSpellByMagic = function (magic) { -return spellPerMagic[magic] - } + this.getSpellByMagic = function(magic) { +return spellPerMagic[magic]; + }; - this.executeSpell = function (magic, textWithoutMagic) { + this.executeSpell = function(magic, textWithoutMagic) { const promisedConf = this.getSinglePackageConfigUsingMagic(magic) - .then(confs => createPersistableConfig(confs)) + .then((confs) => createPersistableConfig(confs)); -return promisedConf.then(conf => { - const spell = this.getSpellByMagic(magic) - const spellResult = spell.interpret(textWithoutMagic, conf) +return promisedConf.then((conf) => { + const spell = this.getSpellByMagic(magic); + const spellResult = spell.interpret(textWithoutMagic, conf); const parsed = spellResult.getAllParsedDataWithTypes( -spellPerMagic, magic, textWithoutMagic) +spellPerMagic, magic, textWithoutMagic); - return parsed -}) - } + return parsed; +}); + }; - this.executeSpellAsDisplaySystem = function (magic, textWithoutMagic) { + this.executeSpellAsDisplaySystem = function(magic, textWithoutMagic) { const promisedConf = this.getSinglePackageConfigUsingMagic(magic) - .then(confs => createPersistableConfig(confs)) + .then((confs) => createPersistableConfig(confs)); -return promisedConf.then(conf => { - const spell = this.getSpellByMagic(magic) - const spellResult = spell.interpret(textWithoutMagic.trim(), conf) - const parsed = spellResult.getAllParsedDataWithTypes(spellPerMagic) +return promisedConf.then((conf) => { + const spell = this.getSpellByMagic(magic); + const spellResult = spell.interpret(textWithoutMagic.trim(), conf); + const parsed = spellResult.getAllParsedDataWithTypes(spellPerMagic); - return parsed -}) - } + return parsed; +}); + }; - this.getVisualizationCachedPackages = function () { -return visualizationBundles - } + this.getVisualizationCachedPackages = function() { +return visualizationBundles; + }; - this.getVisualizationCachedPackageOrder = function () { -return visualizationPackageOrder - } + this.getVisualizationCachedPackageOrder = function() { +return visualizationPackageOrder; + }; /** * @returns {Promise} which returns bundleOrder and cache it in `visualizationPackageOrder` */ - this.getVisualizationPackageOrder = function () { + this.getVisualizationPackageOrder = function() { return $http.get(baseUrlSrv.getRestApiBase() + '/helium/order/visualization') - .then(function (response, status) { -const order = response.data.body -visualizationPackageOrder = order -return order - }) - .catch(function (error) { -console.error('Can not get bundle order', error) + .then(function(response, status) { +const order = response.data.body; +visualizationPackageOrder = order; +return order; }) - } + .catch(function(error) { +console.error('Can not get bundle order', error); + }); + }; - this.setVisualizationPackageOrder = function (list) { -return $http.post(baseUrlSrv.getRestApiBase() + '/helium/order/visualization', list) - } + this.setVisualizationPackageOrder = function(list)