Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7B5E0200B28 for ; Sun, 26 Jun 2016 11:35:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 79E4F160A5C; Sun, 26 Jun 2016 09:35:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9DF57160A28 for ; Sun, 26 Jun 2016 11:35:37 +0200 (CEST) Received: (qmail 17385 invoked by uid 500); 26 Jun 2016 09:35:36 -0000 Mailing-List: contact commits-help@zeppelin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zeppelin.apache.org Delivered-To: mailing list commits@zeppelin.apache.org Received: (qmail 17376 invoked by uid 99); 26 Jun 2016 09:35:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Jun 2016 09:35:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B28E0E0459; Sun, 26 Jun 2016 09:35:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: prabhjyotsingh@apache.org To: commits@zeppelin.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: zeppelin git commit: [MINOR] [ZEPPELIN-1043] Blocked in inaccessible notebook with blank page Date: Sun, 26 Jun 2016 09:35:36 +0000 (UTC) archived-at: Sun, 26 Jun 2016 09:35:38 -0000 Repository: zeppelin Updated Branches: refs/heads/branch-0.6 9299cf581 -> 56a4880d1 [MINOR] [ZEPPELIN-1043] Blocked in inaccessible notebook with blank page ### What is this PR for? Currently, when a user who doesn't have a permission for a notebook is trying to access to the notebook, a dialog is shown up. The user can login in this dialog or close it. But if the user is trying to just close this dialog, the location is not changed and still stay `/notebook/NOTE_ID` with blank page. So the user have to click somewhere manually. So I just added `$window.history.back()` so that it can go back to previous page. See the attached gif image :) ### What type of PR is it? Bug Fix ### Todos - [x] - Disable backdrop, ESC drop and close icon ### What is the Jira issue? [ZEPPELIN-1043](https://issues.apache.org/jira/browse/ZEPPELIN-1043) ### How should this be tested? 1. Apply this patch and activate shiro -> login with `admin` 2. Create a notebook and set a note permission (just fill all 3 fields with `admin`) 3. Logout with `admin` and login with `user1` 4. Try to access to the notebook -> a popup will be shown 5. Click `Cancel` -> Page will redirect to your previous location (home or the previous notebook page) ### Screenshots (if appropriate) - Before ![before](https://cloud.githubusercontent.com/assets/10060731/16245851/96bd5674-37b7-11e6-9f9e-c69b74b0e6cc.gif) - After When you were in home ![after1](https://cloud.githubusercontent.com/assets/10060731/16245854/9a16fc30-37b7-11e6-80d3-b7bae18c78b2.gif) When you were in the other notebook ![after2](https://cloud.githubusercontent.com/assets/10060731/16245855/9c0da7a0-37b7-11e6-8e07-470be0d18fa2.gif) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: AhyoungRyu Closes #1060 from AhyoungRyu/ZEPPELIN-1043 and squashes the following commits: f116391 [AhyoungRyu] Replace history.back() -> location.replace('/') 929cb0b [AhyoungRyu] Disable ESC drop, backdrop and close icon a1c92c0 [AhyoungRyu] Add history.back() when just closing dialog (cherry picked from commit 118ad7de5fdade4f77265ceaf7d3c4d15feb7013) Signed-off-by: Prabhjyot Singh Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/56a4880d Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/56a4880d Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/56a4880d Branch: refs/heads/branch-0.6 Commit: 56a4880d1c6402b07a51c302ede0799934399fe5 Parents: 9299cf5 Author: AhyoungRyu Authored: Sat Jun 25 10:31:02 2016 -0700 Committer: Prabhjyot Singh Committed: Sun Jun 26 15:05:30 2016 +0530 ---------------------------------------------------------------------- zeppelin-web/src/app/notebook/notebook.controller.js | 7 +++++-- .../websocketEvents/websocketEvents.factory.js | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/56a4880d/zeppelin-web/src/app/notebook/notebook.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js b/zeppelin-web/src/app/notebook/notebook.controller.js index 95540d1..4c96325 100644 --- a/zeppelin-web/src/app/notebook/notebook.controller.js +++ b/zeppelin-web/src/app/notebook/notebook.controller.js @@ -16,7 +16,7 @@ 'use strict'; angular.module('zeppelinWebApp').controller('NotebookCtrl', - function($scope, $route, $routeParams, $location, $rootScope, $http, + function($scope, $route, $routeParams, $location, $rootScope, $http, $window, websocketMsgSrv, baseUrlSrv, $timeout, SaveAsService) { $scope.note = null; $scope.showEditor = false; @@ -724,7 +724,9 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', error(function (data, status, headers, config) { console.log('Error %o %o', status, data.message); BootstrapDialog.show({ - closable: true, + closable: false, + closeByBackdrop: false, + closeByKeyboard: false, title: 'Insufficient privileges', message: data.message, buttons: [ @@ -741,6 +743,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', label: 'Cancel', action: function (dialog) { dialog.close(); + $window.location.replace('/'); } } ] http://git-wip-us.apache.org/repos/asf/zeppelin/blob/56a4880d/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js index 3a261a7..e07fb16 100644 --- a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js +++ b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js @@ -13,7 +13,7 @@ */ 'use strict'; -angular.module('zeppelinWebApp').factory('websocketEvents', function($rootScope, $websocket, $location, baseUrlSrv) { +angular.module('zeppelinWebApp').factory('websocketEvents', function($rootScope, $websocket, $location, $window, baseUrlSrv) { var websocketCalls = {}; websocketCalls.ws = $websocket(baseUrlSrv.getWebsocketUrl()); @@ -61,7 +61,9 @@ angular.module('zeppelinWebApp').factory('websocketEvents', function($rootScope, $rootScope.$broadcast('setNoteMenu', data.notes); } else if (op === 'AUTH_INFO') { BootstrapDialog.show({ - closable: true, + closable: false, + closeByBackdrop: false, + closeByKeyboard: false, title: 'Insufficient privileges', message: data.info.toString(), buttons: [{ @@ -74,8 +76,9 @@ angular.module('zeppelinWebApp').factory('websocketEvents', function($rootScope, } }, { label: 'Cancel', - action: function(dialog){ - dialog.close(); + action: function(dialog) { + dialog.close(); + $window.location.replace('/'); } }] });