Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected void createNewNote() {
WebDriverWait block = new WebDriverWait(driver, MAX_BROWSER_TIMEOUT_SEC);
block.until(ExpectedConditions.visibilityOfElementLocated(By.id("noteCreateModal")));
clickAndWait(By.id("createNoteButton"));
block.until(ExpectedConditions.invisibilityOfElementLocated(By.className("pull-right")));
block.until(ExpectedConditions.invisibilityOfElementLocated(By.id("createNoteButton")));
}

protected void deleteTestNotebook(final WebDriver driver) {
Expand Down
24 changes: 7 additions & 17 deletions zeppelin-web/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["eslint:recommended", "google", "standard"],
"extends": ["eslint:recommended", "google"],
"env": {
"browser": true,
"jasmine": true,
Expand Down Expand Up @@ -31,26 +31,11 @@
"process": false
},
"rules": {
"array-bracket-spacing": 0,
"space-before-function-paren": 0,
"no-unneeded-ternary": 0,
"comma-dangle": 0,
"object-curly-spacing": 0,
"standard/object-curly-even-spacing": 0,
"arrow-parens": 0,
"require-jsdoc": 0,
"valid-jsdoc": 0,
"no-invalid-this": 0,
"no-console": 0,
"guard-for-in": 0,
"no-mixed-operators": 1,
"no-useless-escape": 1,
"no-bitwise": 2,
"camelcase": 2,
"curly": 2,
"eqeqeq": 2,
"wrap-iife": [2, "any"],
"no-use-before-define": 0,
"new-cap": 2,
"no-caller": 2,
"quotes": [2, "single"],
Expand All @@ -59,6 +44,11 @@
"no-unused-vars": [2, { "vars": "local", "args": "none" }],
"strict": [2, "global"],
"max-len": [2, {"code": 120, "ignoreComments": true, "ignoreRegExpLiterals": true}],
"linebreak-style": 0
"require-jsdoc": "off",
"no-console": ["off"],
"valid-jsdoc": "off",
"semi": [2, "always"],
"no-invalid-this": 1,
"indent": ["error", 2, { "SwitchCase": 1 }]
}
}
52 changes: 26 additions & 26 deletions zeppelin-web/src/app/app.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,48 @@
* limitations under the License.
*/

angular.module('zeppelinWebApp').controller('MainCtrl', MainCtrl)
angular.module('zeppelinWebApp').controller('MainCtrl', MainCtrl);

function MainCtrl ($scope, $rootScope, $window, arrayOrderingSrv) {
'ngInject'
function MainCtrl($scope, $rootScope, $window, arrayOrderingSrv) {
'ngInject';

$scope.looknfeel = 'default'
$scope.looknfeel = 'default';

let init = function () {
$scope.asIframe = (($window.location.href.indexOf('asIframe') > -1) ? true : false)
}
let init = function() {
$scope.asIframe = (($window.location.href.indexOf('asIframe') > -1) ? true : false);
};

init()
init();

$rootScope.$on('setIframe', function (event, data) {
$rootScope.$on('setIframe', function(event, data) {
if (!event.defaultPrevented) {
$scope.asIframe = data
event.preventDefault()
$scope.asIframe = data;
event.preventDefault();
}
})
});

$rootScope.$on('setLookAndFeel', function (event, data) {
$rootScope.$on('setLookAndFeel', function(event, data) {
if (!event.defaultPrevented && data && data !== '' && data !== $scope.looknfeel) {
$scope.looknfeel = data
event.preventDefault()
$scope.looknfeel = data;
event.preventDefault();
}
})
});

// Set The lookAndFeel to default on every page
$rootScope.$on('$routeChangeStart', function (event, next, current) {
$rootScope.$broadcast('setLookAndFeel', 'default')
})
$rootScope.$on('$routeChangeStart', function(event, next, current) {
$rootScope.$broadcast('setLookAndFeel', 'default');
});

$rootScope.noteName = function (note) {
$rootScope.noteName = function(note) {
if (!_.isEmpty(note)) {
return arrayOrderingSrv.getNoteName(note)
return arrayOrderingSrv.getNoteName(note);
}
}
};

BootstrapDialog.defaultOptions.onshown = function () {
angular.element('#' + this.id).find('.btn:last').focus()
}
BootstrapDialog.defaultOptions.onshown = function() {
angular.element('#' + this.id).find('.btn:last').focus();
};

// Remove BootstrapDialog animation
BootstrapDialog.configDefaultOptions({animate: false})
BootstrapDialog.configDefaultOptions({animate: false});
}
44 changes: 22 additions & 22 deletions zeppelin-web/src/app/app.controller.test.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
describe('Controller: MainCtrl', function () {
beforeEach(angular.mock.module('zeppelinWebApp'))
describe('Controller: MainCtrl', function() {
beforeEach(angular.mock.module('zeppelinWebApp'));

let scope
let rootScope
let scope;
let rootScope;

beforeEach(inject(function ($controller, $rootScope) {
rootScope = $rootScope
scope = $rootScope.$new()
beforeEach(inject(function($controller, $rootScope) {
rootScope = $rootScope;
scope = $rootScope.$new();
$controller('MainCtrl', {
$scope: scope
})
}))
$scope: scope,
});
}));

it('should attach "asIframe" to the scope and the default value should be false', function () {
expect(scope.asIframe).toBeDefined()
expect(scope.asIframe).toEqual(false)
})
it('should attach "asIframe" to the scope and the default value should be false', function() {
expect(scope.asIframe).toBeDefined();
expect(scope.asIframe).toEqual(false);
});

it('should set the default value of "looknfeel to "default"', function () {
expect(scope.looknfeel).toEqual('default')
})
it('should set the default value of "looknfeel to "default"', function() {
expect(scope.looknfeel).toEqual('default');
});

it('should set "asIframe" flag to true when a controller broadcasts setIframe event', function () {
rootScope.$broadcast('setIframe', true)
expect(scope.asIframe).toEqual(true)
})
})
it('should set "asIframe" flag to true when a controller broadcasts setIframe event', function() {
rootScope.$broadcast('setIframe', true);
expect(scope.asIframe).toEqual(true);
});
});
Loading