From faa7067c9db8bf34cceaac08d46d42bdda24cd8f Mon Sep 17 00:00:00 2001 From: astroshim Date: Thu, 9 Jun 2016 21:03:17 +0900 Subject: [PATCH 1/4] alert message when trying to delete last paragraph. --- .../paragraph/paragraph.controller.js | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index c8195658105..e371a21ab8d 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -522,17 +522,26 @@ angular.module('zeppelinWebApp') }; $scope.removeParagraph = function() { - BootstrapDialog.confirm({ - closable: true, - title: '', - message: 'Do you want to delete this paragraph?', - callback: function(result) { - if (result) { - console.log('Remove paragraph'); - websocketMsgSrv.removeParagraph($scope.paragraph.id); + var paragraphs = angular.element('div[id$="_paragraphColumn_main"'); + if (paragraphs[paragraphs.length-1].id.startsWith($scope.paragraph.id)) { + BootstrapDialog.alert({ + closable: true, + message: 'The last paragraph can\'t be deleted.' + }); + } + else { + BootstrapDialog.confirm({ + closable: true, + title: '', + message: 'Do you want to delete this paragraph?', + callback: function(result) { + if (result) { + console.log('Remove paragraph'); + websocketMsgSrv.removeParagraph($scope.paragraph.id); + } } - } - }); + }); + } }; $scope.clearParagraphOutput = function() { From 4316d28cb3cd8e7d82fde4a8bc19eabcd4f9322f Mon Sep 17 00:00:00 2001 From: astroshim Date: Thu, 9 Jun 2016 22:39:31 +0900 Subject: [PATCH 2/4] fix coding style --- .../src/app/notebook/paragraph/paragraph.controller.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index e371a21ab8d..22ac8e27bc9 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -528,8 +528,7 @@ angular.module('zeppelinWebApp') closable: true, message: 'The last paragraph can\'t be deleted.' }); - } - else { + } else { BootstrapDialog.confirm({ closable: true, title: '', From 6acdd9d3554eb72af3cd8ca9edc47ed5e18124cf Mon Sep 17 00:00:00 2001 From: astroshim Date: Sat, 11 Jun 2016 01:14:59 +0900 Subject: [PATCH 3/4] add ng-hide --- zeppelin-web/src/app/notebook/paragraph/paragraph-control.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html b/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html index 7c51f3ad6f3..c36a316dd8e 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html @@ -90,7 +90,7 @@
  • - Remove + Remove
  • From 8c4a29ebc80879740eb3ec312675af1324f8f81a Mon Sep 17 00:00:00 2001 From: astroshim Date: Wed, 15 Jun 2016 12:55:21 +0900 Subject: [PATCH 4/4] reset commits --- .../src/app/notebook/paragraph/paragraph-control.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html b/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html index c36a316dd8e..4ec515654a0 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph-control.html @@ -54,10 +54,10 @@
  • - Move Up + Move Up
  • - Move Down + Move Down
  • Insert New