zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prabhjyotsi...@apache.org
Subject [10/12] zeppelin git commit: [ZEPPELIN-3245] checkstyle/eslintrc for zeppelin-web (JavaScript)
Date Fri, 23 Feb 2018 04:56:01 GMT
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/jobmanager/jobmanager.component.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/jobmanager/jobmanager.component.js b/zeppelin-web/src/app/jobmanager/jobmanager.component.js
index 364cc45..c883a11 100644
--- a/zeppelin-web/src/app/jobmanager/jobmanager.component.js
+++ b/zeppelin-web/src/app/jobmanager/jobmanager.component.js
@@ -12,129 +12,132 @@
  * limitations under the License.
  */
 
-import './job/job.component'
-import { JobManagerFilter } from './jobmanager.filter'
-import { JobManagerService} from './jobmanager.service'
+import './job/job.component';
+import {JobManagerFilter} from './jobmanager.filter';
+import {JobManagerService} from './jobmanager.service';
 
-import { getJobIconByStatus, getJobColorByStatus } from './job-status'
+import {getJobIconByStatus, getJobColorByStatus} from './job-status';
 
 angular.module('zeppelinWebApp')
   .controller('JobManagerCtrl', JobManagerController)
   .filter('JobManager', JobManagerFilter)
-  .service('JobManagerService', JobManagerService)
+  .service('JobManagerService', JobManagerService);
 
 const JobDateSorter = {
   RECENTLY_UPDATED: 'Recently Update',
   OLDEST_UPDATED: 'Oldest Updated',
-}
+};
 
 function JobManagerController($scope, ngToast, JobManagerFilter, JobManagerService) {
-  'ngInject'
+  'ngInject';
 
-  $scope.isFilterLoaded = false
-  $scope.jobs = []
+  $scope.isFilterLoaded = false;
+  $scope.jobs = [];
   $scope.sorter = {
-    availableDateSorter: Object.keys(JobDateSorter).map(key => { return JobDateSorter[key]
}),
+    availableDateSorter: Object.keys(JobDateSorter).map((key) => {
+      return JobDateSorter[key];
+    }),
     currentDateSorter: JobDateSorter.RECENTLY_UPDATED,
-  }
-  $scope.filteredJobs = $scope.jobs
+  };
+  $scope.filteredJobs = $scope.jobs;
   $scope.filterConfig = {
     isRunningAlwaysTop: true,
     noteNameFilterValue: '',
     interpreterFilterValue: '*',
     isSortByAsc: true,
-  }
+  };
 
   $scope.pagination = {
     currentPage: 1,
     itemsPerPage: 10,
     maxPageCount: 5,
-  }
+  };
 
-  ngToast.dismiss()
-  init()
+  ngToast.dismiss();
+  init();
 
   /** functions */
 
   $scope.setJobDateSorter = function(dateSorter) {
-    $scope.sorter.currentDateSorter = dateSorter
-  }
+    $scope.sorter.currentDateSorter = dateSorter;
+  };
 
   $scope.getJobsInCurrentPage = function(jobs) {
-    const cp = $scope.pagination.currentPage
-    const itp = $scope.pagination.itemsPerPage
-    return jobs.slice((cp - 1) * itp, (cp * itp))
-  }
+    const cp = $scope.pagination.currentPage;
+    const itp = $scope.pagination.itemsPerPage;
+    return jobs.slice((cp - 1) * itp, (cp * itp));
+  };
 
-  let asyncNotebookJobFilter = function (jobs, filterConfig) {
+  let asyncNotebookJobFilter = function(jobs, filterConfig) {
     return new Promise((resolve, reject) => {
-      $scope.filteredJobs = JobManagerFilter(jobs, filterConfig)
-      resolve($scope.filteredJobs)
-    })
-  }
+      // eslint-disable-next-line new-cap
+      $scope.filteredJobs = JobManagerFilter(jobs, filterConfig);
+      resolve($scope.filteredJobs);
+    });
+  };
 
   $scope.$watch('sorter.currentDateSorter', function() {
     $scope.filterConfig.isSortByAsc =
-      $scope.sorter.currentDateSorter === JobDateSorter.OLDEST_UPDATED
-    asyncNotebookJobFilter($scope.jobs, $scope.filterConfig)
-  })
+      $scope.sorter.currentDateSorter === JobDateSorter.OLDEST_UPDATED;
+    asyncNotebookJobFilter($scope.jobs, $scope.filterConfig);
+  });
 
-  $scope.getJobIconByStatus = getJobIconByStatus
-  $scope.getJobColorByStatus = getJobColorByStatus
+  $scope.getJobIconByStatus = getJobIconByStatus;
+  $scope.getJobColorByStatus = getJobColorByStatus;
 
-  $scope.filterJobs = function (jobs, filterConfig) {
+  $scope.filterJobs = function(jobs, filterConfig) {
     asyncNotebookJobFilter(jobs, filterConfig)
       .then(() => {
-        $scope.isFilterLoaded = true
-      })
-      .catch(error => {
-        console.error('Failed to search jobs from server', error)
+        $scope.isFilterLoaded = true;
       })
-  }
+      .catch((error) => {
+        console.error('Failed to search jobs from server', error);
+      });
+  };
 
-  $scope.filterValueToName = function (filterValue, maxStringLength) {
+  $scope.filterValueToName = function(filterValue, maxStringLength) {
     if (typeof $scope.defaultInterpreters === 'undefined') {
-      return
+      return;
     }
 
-    let index = $scope.defaultInterpreters.findIndex(intp => intp.value === filterValue)
+    let index = $scope.defaultInterpreters.findIndex((intp) => intp.value === filterValue);
     if (typeof $scope.defaultInterpreters[index].name !== 'undefined') {
       if (typeof maxStringLength !== 'undefined' &&
         maxStringLength > $scope.defaultInterpreters[index].name) {
-        return $scope.defaultInterpreters[index].name.substr(0, maxStringLength - 3) + '...'
+        return $scope.defaultInterpreters[index].name.substr(0, maxStringLength - 3) + '...';
       }
-      return $scope.defaultInterpreters[index].name
+      return $scope.defaultInterpreters[index].name;
     } else {
-      return 'NONE'
+      return 'NONE';
     }
-  }
+  };
 
-  $scope.setFilterValue = function (filterValue) {
-    $scope.filterConfig.interpreterFilterValue = filterValue
-    $scope.filterJobs($scope.jobs, $scope.filterConfig)
-  }
+  $scope.setFilterValue = function(filterValue) {
+    $scope.filterConfig.interpreterFilterValue = filterValue;
+    $scope.filterJobs($scope.jobs, $scope.filterConfig);
+  };
 
   $scope.setJobs = function(jobs) {
-    $scope.jobs = jobs
+    $scope.jobs = jobs;
     let interpreters = $scope.jobs
-      .filter(j => typeof j.interpreter !== 'undefined')
-      .map(j => j.interpreter)
-    interpreters = [...new Set(interpreters)] // remove duplicated interpreters
+      .filter((j) => typeof j.interpreter !== 'undefined')
+      .map((j) => j.interpreter);
+    interpreters = [...new Set(interpreters)]; // remove duplicated interpreters
 
-    $scope.defaultInterpreters = [ { name: 'ALL', value: '*' } ]
+    $scope.defaultInterpreters = [{name: 'ALL', value: '*'}];
     for (let i = 0; i < interpreters.length; i++) {
-      $scope.defaultInterpreters.push({ name: interpreters[i], value: interpreters[i] })
+      $scope.defaultInterpreters.push({name: interpreters[i], value: interpreters[i]});
     }
-  }
+  };
 
   function init() {
-    JobManagerService.getJobs()
-    JobManagerService.subscribeSetJobs($scope, setJobsCallback)
-    JobManagerService.subscribeUpdateJobs($scope, updateJobsCallback)
+    JobManagerService.getJobs();
+    JobManagerService.subscribeSetJobs($scope, setJobsCallback);
+    JobManagerService.subscribeUpdateJobs($scope, updateJobsCallback);
 
-    $scope.$on('$destroy', function () {
-      JobManagerService.disconnect()
-    })
+    $scope.$on('$destroy', function() {
+      JobManagerService.disconnect();
+    });
   }
 
   /*
@@ -142,45 +145,45 @@ function JobManagerController($scope, ngToast, JobManagerFilter, JobManagerServi
    */
 
   function setJobsCallback(event, response) {
-    const jobs = response.jobs
-    $scope.setJobs(jobs)
-    $scope.filterJobs($scope.jobs, $scope.filterConfig)
+    const jobs = response.jobs;
+    $scope.setJobs(jobs);
+    $scope.filterJobs($scope.jobs, $scope.filterConfig);
   }
 
   function updateJobsCallback(event, response) {
-    let jobs = $scope.jobs
+    let jobs = $scope.jobs;
     let jobByNoteId = jobs.reduce((acc, j) => {
-      const noteId = j.noteId
-      acc[noteId] = j
-      return acc
-    }, {})
+      const noteId = j.noteId;
+      acc[noteId] = j;
+      return acc;
+    }, {});
 
-    let updatedJobs = response.jobs
-    updatedJobs.map(updatedJob => {
+    let updatedJobs = response.jobs;
+    updatedJobs.map((updatedJob) => {
       if (typeof jobByNoteId[updatedJob.noteId] === 'undefined') {
-        let newItem = angular.copy(updatedJob)
-        jobs.push(newItem)
-        jobByNoteId[updatedJob.noteId] = newItem
+        let newItem = angular.copy(updatedJob);
+        jobs.push(newItem);
+        jobByNoteId[updatedJob.noteId] = newItem;
       } else {
-        let job = jobByNoteId[updatedJob.noteId]
+        let job = jobByNoteId[updatedJob.noteId];
 
         if (updatedJob.isRemoved === true) {
-          delete jobByNoteId[updatedJob.noteId]
-          let removeIndex = jobs.findIndex(j => j.noteId === updatedJob.noteId)
+          delete jobByNoteId[updatedJob.noteId];
+          let removeIndex = jobs.findIndex((j) => j.noteId === updatedJob.noteId);
           if (removeIndex) {
-            jobs.splice(removeIndex, 1)
+            jobs.splice(removeIndex, 1);
           }
         } else {
           // update the job
-          job.isRunningJob = updatedJob.isRunningJob
-          job.noteName = updatedJob.noteName
-          job.noteType = updatedJob.noteType
-          job.interpreter = updatedJob.interpreter
-          job.unixTimeLastRun = updatedJob.unixTimeLastRun
-          job.paragraphs = updatedJob.paragraphs
+          job.isRunningJob = updatedJob.isRunningJob;
+          job.noteName = updatedJob.noteName;
+          job.noteType = updatedJob.noteType;
+          job.interpreter = updatedJob.interpreter;
+          job.unixTimeLastRun = updatedJob.unixTimeLastRun;
+          job.paragraphs = updatedJob.paragraphs;
         }
       }
-    })
-    $scope.filterJobs(jobs, $scope.filterConfig)
+    });
+    $scope.filterJobs(jobs, $scope.filterConfig);
   }
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/jobmanager/jobmanager.component.test.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/jobmanager/jobmanager.component.test.js b/zeppelin-web/src/app/jobmanager/jobmanager.component.test.js
index a4b858b..7604142 100644
--- a/zeppelin-web/src/app/jobmanager/jobmanager.component.test.js
+++ b/zeppelin-web/src/app/jobmanager/jobmanager.component.test.js
@@ -1,26 +1,26 @@
 describe('JobManagerComponent', () => {
-  let $scope
-  let $controller
+  let $scope;
+  let $controller;
 
-  beforeEach(angular.mock.module('zeppelinWebApp'))
+  beforeEach(angular.mock.module('zeppelinWebApp'));
   beforeEach(angular.mock.inject((_$rootScope_, _$controller_) => {
-    $scope = _$rootScope_.$new()
-    $controller = _$controller_
-  }))
+    $scope = _$rootScope_.$new();
+    $controller = _$controller_;
+  }));
 
   it('should set jobs using `setJobs`', () => {
-    let ctrl = $controller('JobManagerCtrl', { $scope: $scope, })
-    expect(ctrl).toBeDefined()
+    let ctrl = $controller('JobManagerCtrl', {$scope: $scope});
+    expect(ctrl).toBeDefined();
 
     const mockJobs = [
-      { noteId: 'TN01', interpreter: 'spark', },
-      { noteId: 'TN02', interpreter: 'spark', },
-    ]
+      {noteId: 'TN01', interpreter: 'spark'},
+      {noteId: 'TN02', interpreter: 'spark'},
+    ];
 
-    $scope.setJobs(mockJobs)
+    $scope.setJobs(mockJobs);
     expect($scope.defaultInterpreters).toEqual([
-      { name: 'ALL', value: '*', },
-      { name: 'spark', value: 'spark', },
-    ])
-  })
-})
+      {name: 'ALL', value: '*'},
+      {name: 'spark', value: 'spark'},
+    ]);
+  });
+});

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/jobmanager/jobmanager.filter.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/jobmanager/jobmanager.filter.js b/zeppelin-web/src/app/jobmanager/jobmanager.filter.js
index d6c8d69..c4abb1c 100644
--- a/zeppelin-web/src/app/jobmanager/jobmanager.filter.js
+++ b/zeppelin-web/src/app/jobmanager/jobmanager.filter.js
@@ -13,44 +13,44 @@
  */
 
 export function JobManagerFilter() {
-  function filterContext (jobs, filterConfig) {
-    let interpreter = filterConfig.interpreterFilterValue
-    let noteName = filterConfig.noteNameFilterValue
-    let isSortByAsc = filterConfig.isSortByAsc
-    let filteredJobs = jobs
+  function filterContext(jobs, filterConfig) {
+    let interpreter = filterConfig.interpreterFilterValue;
+    let noteName = filterConfig.noteNameFilterValue;
+    let isSortByAsc = filterConfig.isSortByAsc;
+    let filteredJobs = jobs;
 
     if (typeof interpreter === 'undefined') {
       filteredJobs = filteredJobs.filter((jobItem) => {
-        return typeof jobItem.interpreter === 'undefined'
-      })
+        return typeof jobItem.interpreter === 'undefined';
+      });
     } else if (interpreter !== '*') {
-      filteredJobs = filteredJobs.filter(j => j.interpreter === interpreter)
+      filteredJobs = filteredJobs.filter((j) => j.interpreter === interpreter);
     }
 
     // filter by note name
     if (noteName !== '') {
       filteredJobs = filteredJobs.filter((jobItem) => {
-        let lowerFilterValue = noteName.toLocaleLowerCase()
-        let lowerNotebookName = jobItem.noteName.toLocaleLowerCase()
-        return lowerNotebookName.match(new RegExp('.*' + lowerFilterValue + '.*'))
-      })
+        let lowerFilterValue = noteName.toLocaleLowerCase();
+        let lowerNotebookName = jobItem.noteName.toLocaleLowerCase();
+        return lowerNotebookName.match(new RegExp('.*' + lowerFilterValue + '.*'));
+      });
     }
 
     // sort by name
     filteredJobs = filteredJobs.sort((jobItem) => {
-      return jobItem.noteName.toLowerCase()
-    })
+      return jobItem.noteName.toLowerCase();
+    });
 
     // sort by timestamp
     filteredJobs = filteredJobs.sort((x, y) => {
       if (isSortByAsc) {
-        return x.unixTimeLastRun - y.unixTimeLastRun
+        return x.unixTimeLastRun - y.unixTimeLastRun;
       } else {
-        return y.unixTimeLastRun - x.unixTimeLastRun
+        return y.unixTimeLastRun - x.unixTimeLastRun;
       }
-    })
+    });
 
-    return filteredJobs
+    return filteredJobs;
   }
-  return filterContext
+  return filterContext;
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/jobmanager/jobmanager.service.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/jobmanager/jobmanager.service.js b/zeppelin-web/src/app/jobmanager/jobmanager.service.js
index 603950f..472ac6d 100644
--- a/zeppelin-web/src/app/jobmanager/jobmanager.service.js
+++ b/zeppelin-web/src/app/jobmanager/jobmanager.service.js
@@ -14,51 +14,51 @@
 
 export class JobManagerService {
   constructor($http, $rootScope, baseUrlSrv, websocketMsgSrv) {
-    'ngInject'
+    'ngInject';
 
-    this.$http = $http
-    this.$rootScope = $rootScope
-    this.BaseUrlService = baseUrlSrv
-    this.WebsocketMessageService = websocketMsgSrv
+    this.$http = $http;
+    this.$rootScope = $rootScope;
+    this.BaseUrlService = baseUrlSrv;
+    this.WebsocketMessageService = websocketMsgSrv;
   }
 
   sendStopJobRequest(noteId) {
-    const apiURL = this.BaseUrlService.getRestApiBase() + `/notebook/job/${noteId}`
-    return this.$http({ method: 'DELETE', url: apiURL, })
+    const apiURL = this.BaseUrlService.getRestApiBase() + `/notebook/job/${noteId}`;
+    return this.$http({method: 'DELETE', url: apiURL});
   }
 
   sendRunJobRequest(noteId) {
-    const apiURL = this.BaseUrlService.getRestApiBase() + `/notebook/job/${noteId}`
-    return this.$http({ method: 'POST', url: apiURL, })
+    const apiURL = this.BaseUrlService.getRestApiBase() + `/notebook/job/${noteId}`;
+    return this.$http({method: 'POST', url: apiURL});
   }
 
   getJobs() {
-    this.WebsocketMessageService.getJobs()
+    this.WebsocketMessageService.getJobs();
   }
 
   disconnect() {
-    this.WebsocketMessageService.disconnectJobEvent()
+    this.WebsocketMessageService.disconnectJobEvent();
   }
 
   subscribeSetJobs(controllerScope, receiveCallback) {
-    const event = 'jobmanager:set-jobs'
-    console.log(`(Event) Subscribed: ${event}`)
-    const unsubscribeHandler = this.$rootScope.$on(event, receiveCallback)
+    const event = 'jobmanager:set-jobs';
+    console.log(`(Event) Subscribed: ${event}`);
+    const unsubscribeHandler = this.$rootScope.$on(event, receiveCallback);
 
     controllerScope.$on('$destroy', () => {
-      console.log(`(Event) Unsubscribed: ${event}`)
-      unsubscribeHandler()
-    })
+      console.log(`(Event) Unsubscribed: ${event}`);
+      unsubscribeHandler();
+    });
   }
 
   subscribeUpdateJobs(controllerScope, receiveCallback) {
-    const event = 'jobmanager:update-jobs'
-    console.log(`(Event) Subscribed: ${event}`)
-    const unsubscribeHandler = this.$rootScope.$on(event, receiveCallback)
+    const event = 'jobmanager:update-jobs';
+    console.log(`(Event) Subscribed: ${event}`);
+    const unsubscribeHandler = this.$rootScope.$on(event, receiveCallback);
 
     controllerScope.$on('$destroy', () => {
-      console.log(`(Event) Unsubscribed: ${event}`)
-      unsubscribeHandler()
-    })
+      console.log(`(Event) Unsubscribed: ${event}`);
+      unsubscribeHandler();
+    });
   }
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/jobmanager/jobmanager.service.test.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/jobmanager/jobmanager.service.test.js b/zeppelin-web/src/app/jobmanager/jobmanager.service.test.js
index fbb0829..be7196d 100644
--- a/zeppelin-web/src/app/jobmanager/jobmanager.service.test.js
+++ b/zeppelin-web/src/app/jobmanager/jobmanager.service.test.js
@@ -1,56 +1,56 @@
-import { ParagraphStatus } from '../notebook/paragraph/paragraph.status'
-import { JobManagerService } from './jobmanager.service'
+import {ParagraphStatus} from '../notebook/paragraph/paragraph.status';
+import {JobManagerService} from './jobmanager.service';
 
 describe('JobManagerService', () => {
-  const baseUrlSrvMock = { getRestApiBase: () => '' }
-  let service
-  let $httpBackend
+  const baseUrlSrvMock = {getRestApiBase: () => ''};
+  let service;
+  let $httpBackend;
 
-  beforeEach(angular.mock.module('zeppelinWebApp'))
+  beforeEach(angular.mock.module('zeppelinWebApp'));
   beforeEach(angular.mock.inject((_$rootScope_, _$httpBackend_, _$http_, _websocketMsgSrv_)
=> {
-    $httpBackend = _$httpBackend_
-    service = new JobManagerService(_$http_, _$rootScope_, baseUrlSrvMock, _websocketMsgSrv_)
-  }))
+    $httpBackend = _$httpBackend_;
+    service = new JobManagerService(_$http_, _$rootScope_, baseUrlSrvMock, _websocketMsgSrv_);
+  }));
 
   it('should sent valid request to run a job', () => {
-    const paragraphs = [ { status: ParagraphStatus.PENDING }, ]
-    const mockNote = createMockNote(paragraphs)
+    const paragraphs = [{status: ParagraphStatus.PENDING}];
+    const mockNote = createMockNote(paragraphs);
 
-    const noteId = mockNote.noteId
-    service.sendRunJobRequest(noteId)
+    const noteId = mockNote.noteId;
+    service.sendRunJobRequest(noteId);
 
-    const url = `/notebook/job/${noteId}`
+    const url = `/notebook/job/${noteId}`;
 
     $httpBackend
       .when('POST', url)
-      .respond(200, { /** return nothing */ })
-    $httpBackend.expectPOST(url)
-    $httpBackend.flush()
+      .respond(200, { /** return nothing */ });
+    $httpBackend.expectPOST(url);
+    $httpBackend.flush();
 
-    checkUnknownHttpRequests()
-  })
+    checkUnknownHttpRequests();
+  });
 
   it('should sent valid request to stop a job', () => {
-    const paragraphs = [ { status: ParagraphStatus.PENDING }, ]
-    const mockNote = createMockNote(paragraphs)
+    const paragraphs = [{status: ParagraphStatus.PENDING}];
+    const mockNote = createMockNote(paragraphs);
 
-    const noteId = mockNote.noteId
-    service.sendStopJobRequest(noteId)
+    const noteId = mockNote.noteId;
+    service.sendStopJobRequest(noteId);
 
-    const url = `/notebook/job/${noteId}`
+    const url = `/notebook/job/${noteId}`;
 
     $httpBackend
       .when('DELETE', url)
-      .respond(200, { /** return nothing */ })
-    $httpBackend.expectDELETE(url)
-    $httpBackend.flush()
+      .respond(200, { /** return nothing */ });
+    $httpBackend.expectDELETE(url);
+    $httpBackend.flush();
 
-    checkUnknownHttpRequests()
-  })
+    checkUnknownHttpRequests();
+  });
 
   function checkUnknownHttpRequests() {
-    $httpBackend.verifyNoOutstandingExpectation()
-    $httpBackend.verifyNoOutstandingRequest()
+    $httpBackend.verifyNoOutstandingExpectation();
+    $httpBackend.verifyNoOutstandingRequest();
   }
 
   function createMockNote(paragraphs) {
@@ -60,6 +60,6 @@ describe('JobManagerService', () => {
       noteId: 'NT01',
       noteName: 'TestNote01',
       noteType: 'normal',
-    }
+    };
   }
-})
+});

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/notebook-repository/notebook-repository.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook-repository/notebook-repository.controller.js b/zeppelin-web/src/app/notebook-repository/notebook-repository.controller.js
index 0f62bc0..d6d13b3 100644
--- a/zeppelin-web/src/app/notebook-repository/notebook-repository.controller.js
+++ b/zeppelin-web/src/app/notebook-repository/notebook-repository.controller.js
@@ -12,76 +12,76 @@
  * limitations under the License.
  */
 
-angular.module('zeppelinWebApp').controller('NotebookRepositoryCtrl', NotebookRepositoryCtrl)
+angular.module('zeppelinWebApp').controller('NotebookRepositoryCtrl', NotebookRepositoryCtrl);
 
 function NotebookRepositoryCtrl($http, baseUrlSrv, ngToast) {
-  'ngInject'
+  'ngInject';
 
-  let vm = this
-  vm.notebookRepos = []
-  vm.showDropdownSelected = showDropdownSelected
-  vm.saveNotebookRepo = saveNotebookRepo
+  let vm = this;
+  vm.notebookRepos = [];
+  vm.showDropdownSelected = showDropdownSelected;
+  vm.saveNotebookRepo = saveNotebookRepo;
 
-  _init()
+  _init();
 
   // Public functions
 
-  function saveNotebookRepo (valueform, repo, data) {
-    console.log('data %o', data)
+  function saveNotebookRepo(valueform, repo, data) {
+    console.log('data %o', data);
     $http.put(baseUrlSrv.getRestApiBase() + '/notebook-repositories', {
       'name': repo.className,
-      'settings': data
-    }).success(function (data) {
-      let index = _.findIndex(vm.notebookRepos, {'className': repo.className})
+      'settings': data,
+    }).success(function(data) {
+      let index = _.findIndex(vm.notebookRepos, {'className': repo.className});
       if (index >= 0) {
-        vm.notebookRepos[index] = data.body
-        console.log('repos %o, data %o', vm.notebookRepos, data.body)
+        vm.notebookRepos[index] = data.body;
+        console.log('repos %o, data %o', vm.notebookRepos, data.body);
       }
-      valueform.$show()
-    }).error(function () {
+      valueform.$show();
+    }).error(function() {
       ngToast.danger({
         content: 'We couldn\'t save that NotebookRepo\'s settings',
         verticalPosition: 'bottom',
-        timeout: '3000'
-      })
-      valueform.$show()
-    })
+        timeout: '3000',
+      });
+      valueform.$show();
+    });
 
-    return 'manual'
+    return 'manual';
   }
 
-  function showDropdownSelected (setting) {
-    let index = _.findIndex(setting.value, {'value': setting.selected})
+  function showDropdownSelected(setting) {
+    let index = _.findIndex(setting.value, {'value': setting.selected});
     if (index < 0) {
-      return 'No value'
+      return 'No value';
     } else {
-      return setting.value[index].name
+      return setting.value[index].name;
     }
   }
 
   // Private functions
 
-  function _getInterpreterSettings () {
+  function _getInterpreterSettings() {
     $http.get(baseUrlSrv.getRestApiBase() + '/notebook-repositories')
-      .success(function (data, status, headers, config) {
-        vm.notebookRepos = data.body
-        console.log('ya notebookRepos %o', vm.notebookRepos)
-      }).error(function (data, status, headers, config) {
+      .success(function(data, status, headers, config) {
+        vm.notebookRepos = data.body;
+        console.log('ya notebookRepos %o', vm.notebookRepos);
+      }).error(function(data, status, headers, config) {
         if (status === 401) {
           ngToast.danger({
             content: 'You don\'t have permission on this page',
             verticalPosition: 'bottom',
-            timeout: '3000'
-          })
-          setTimeout(function () {
-            window.location = baseUrlSrv.getBase()
-          }, 3000)
+            timeout: '3000',
+          });
+          setTimeout(function() {
+            window.location = baseUrlSrv.getBase();
+          }, 3000);
         }
-        console.log('Error %o %o', status, data.message)
-      })
+        console.log('Error %o %o', status, data.message);
+      });
   }
 
-  function _init () {
-    _getInterpreterSettings()
+  function _init() {
+    _getInterpreterSettings();
   }
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/notebook/dropdown-input/dropdown-input.directive.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/dropdown-input/dropdown-input.directive.js b/zeppelin-web/src/app/notebook/dropdown-input/dropdown-input.directive.js
index a64204a..0fe43f7 100644
--- a/zeppelin-web/src/app/notebook/dropdown-input/dropdown-input.directive.js
+++ b/zeppelin-web/src/app/notebook/dropdown-input/dropdown-input.directive.js
@@ -12,15 +12,15 @@
  * limitations under the License.
  */
 
-angular.module('zeppelinWebApp').directive('dropdownInput', dropdownInputDirective)
+angular.module('zeppelinWebApp').directive('dropdownInput', dropdownInputDirective);
 
 function dropdownInputDirective() {
   return {
     restrict: 'A',
-    link: function (scope, element) {
-      element.bind('click', function (event) {
-        event.stopPropagation()
-      })
-    }
-  }
+    link: function(scope, element) {
+      element.bind('click', function(event) {
+        event.stopPropagation();
+      });
+    },
+  };
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/notebook/dynamic-forms/dynamic-forms.directive.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/dynamic-forms/dynamic-forms.directive.js b/zeppelin-web/src/app/notebook/dynamic-forms/dynamic-forms.directive.js
index 40a70eb..1b1043e 100644
--- a/zeppelin-web/src/app/notebook/dynamic-forms/dynamic-forms.directive.js
+++ b/zeppelin-web/src/app/notebook/dynamic-forms/dynamic-forms.directive.js
@@ -12,9 +12,9 @@
  * limitations under the License.
  */
 
-import './dynamic-forms.css'
+import './dynamic-forms.css';
 
-angular.module('zeppelinWebApp').directive('dynamicForms', DynamicFormDirective)
+angular.module('zeppelinWebApp').directive('dynamicForms', DynamicFormDirective);
 
 function DynamicFormDirective($templateRequest, $compile) {
   return {
@@ -27,36 +27,36 @@ function DynamicFormDirective($templateRequest, $compile) {
       forms: '=forms',
       params: '=params',
       action: '=action',
-      removeaction: '=removeaction'
+      removeaction: '=removeaction',
     },
 
-    link: function (scope, element, attrs, controller) {
-      scope.loadForm = this.loadForm
-      scope.toggleCheckbox = this.toggleCheckbox
-      $templateRequest('app/notebook/dynamic-forms/dynamic-forms.directive.html').then(function
(formsHtml) {
-        let forms = angular.element(formsHtml)
-        element.append(forms)
-        $compile(forms)(scope)
-      })
+    link: function(scope, element, attrs, controller) {
+      scope.loadForm = this.loadForm;
+      scope.toggleCheckbox = this.toggleCheckbox;
+      $templateRequest('app/notebook/dynamic-forms/dynamic-forms.directive.html').then(function(formsHtml)
{
+        let forms = angular.element(formsHtml);
+        element.append(forms);
+        $compile(forms)(scope);
+      });
     },
 
-    loadForm: function (formulaire, params) {
-      let value = formulaire.defaultValue
+    loadForm: function(formulaire, params) {
+      let value = formulaire.defaultValue;
       if (params[formulaire.name]) {
-        value = params[formulaire.name]
+        value = params[formulaire.name];
       }
 
-      params[formulaire.name] = value
+      params[formulaire.name] = value;
     },
 
-    toggleCheckbox: function (formulaire, option, params) {
-      let idx = params[formulaire.name].indexOf(option.value)
+    toggleCheckbox: function(formulaire, option, params) {
+      let idx = params[formulaire.name].indexOf(option.value);
       if (idx > -1) {
-        params[formulaire.name].splice(idx, 1)
+        params[formulaire.name].splice(idx, 1);
       } else {
-        params[formulaire.name].push(option.value)
+        params[formulaire.name].push(option.value);
       }
-    }
+    },
 
-  }
+  };
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/notebook/elastic-input/elastic-input.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/elastic-input/elastic-input.controller.js b/zeppelin-web/src/app/notebook/elastic-input/elastic-input.controller.js
index 507b2f6..c11f95b 100644
--- a/zeppelin-web/src/app/notebook/elastic-input/elastic-input.controller.js
+++ b/zeppelin-web/src/app/notebook/elastic-input/elastic-input.controller.js
@@ -12,10 +12,10 @@
  * limitations under the License.
  */
 
-angular.module('zeppelinWebApp').controller('ElasticInputCtrl', ElasticInputCtrl)
+angular.module('zeppelinWebApp').controller('ElasticInputCtrl', ElasticInputCtrl);
 
-function ElasticInputCtrl () {
-  let vm = this
-  vm.showEditor = false
-  vm.value = ''
+function ElasticInputCtrl() {
+  let vm = this;
+  vm.showEditor = false;
+  vm.value = '';
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/ed517a20/zeppelin-web/src/app/notebook/note-var-share.service.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/note-var-share.service.js b/zeppelin-web/src/app/notebook/note-var-share.service.js
index e79f389..a5975ce 100644
--- a/zeppelin-web/src/app/notebook/note-var-share.service.js
+++ b/zeppelin-web/src/app/notebook/note-var-share.service.js
@@ -12,28 +12,28 @@
  * limitations under the License.
  */
 
-angular.module('zeppelinWebApp').service('noteVarShareService', NoteVarShareService)
+angular.module('zeppelinWebApp').service('noteVarShareService', NoteVarShareService);
 
-function NoteVarShareService () {
-  'ngInject'
+function NoteVarShareService() {
+  'ngInject';
 
-  let store = {}
+  let store = {};
 
-  this.clear = function () {
-    store = {}
-  }
+  this.clear = function() {
+    store = {};
+  };
 
-  this.put = function (key, value) {
-    store[key] = value
-  }
+  this.put = function(key, value) {
+    store[key] = value;
+  };
 
-  this.get = function (key) {
-    return store[key]
-  }
+  this.get = function(key) {
+    return store[key];
+  };
 
-  this.del = function (key) {
-    let v = store[key]
-    delete store[key]
-    return v
-  }
+  this.del = function(key) {
+    let v = store[key];
+    delete store[key];
+    return v;
+  };
 }


Mime
View raw message