zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahyoung...@apache.org
Subject zeppelin git commit: [ZEPPELIN-969] order by note name in job menu
Date Mon, 23 Jan 2017 03:14:35 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master 4ef4e1869 -> 062b90a5d


[ZEPPELIN-969] order by note name in job menu

### What is this PR for?
we can sort by note name in job menu.
Sorting supports ascending and descending order.
Sort by note name.

### What type of PR is it?
Feature

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-969

### How should this be tested?
click to name order button.

### Screenshots (if appropriate)
![nameorder](https://cloud.githubusercontent.com/assets/10525473/20826460/66a7e7a6-b8ae-11e6-8e03-e2b00698e069.gif)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: CloverHearts <cloverheartsdev@gmail.com>
Author: cloverhearts <cloverheartsdev@gmail.com>

Closes #1721 from cloverhearts/jobm/nameOrder and squashes the following commits:

6df5688 [cloverhearts] change tooltip msg
4230a2a [cloverhearts] Merge branch 'master' into jobm/nameOrder
d5bca61 [cloverhearts] Merge branch 'master' into jobm/nameOrder
11ffe68 [cloverhearts] Merge branch 'master' into jobm/nameOrder
57347c2 [cloverhearts] change filter icon
ead26f4 [CloverHearts] Merge branch 'master' into jobm/nameOrder
5383a2e [CloverHearts] Merge branch 'master' into jobm/nameOrder
88d4708 [CloverHearts] fix code style
ff44245 [CloverHearts] Merge branch 'master' into jobm/nameOrder
6142b8e [CloverHearts] Revert "change sortBy to orderby"
3b698fb [CloverHearts] change sortBy to orderby
e8a6588 [CloverHearts] Merge branch 'master' into jobm/nameOrder
da09527 [CloverHearts] Rename notebook to note.
2d9fc27 [CloverHearts] order by note name in job menu


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/062b90a5
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/062b90a5
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/062b90a5

Branch: refs/heads/master
Commit: 062b90a5d0c47345963bea00a4d69316276327b1
Parents: 4ef4e18
Author: CloverHearts <cloverheartsdev@gmail.com>
Authored: Sat Jan 21 05:46:22 2017 -0800
Committer: ahyoungryu <ahyoungryu@apache.org>
Committed: Mon Jan 23 12:14:28 2017 +0900

----------------------------------------------------------------------
 .../src/app/jobmanager/jobmanager.controller.js        |  9 +++++++++
 zeppelin-web/src/app/jobmanager/jobmanager.filter.js   |  7 ++++++-
 zeppelin-web/src/app/jobmanager/jobmanager.html        | 13 +++++++++++--
 3 files changed, 26 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/062b90a5/zeppelin-web/src/app/jobmanager/jobmanager.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/jobmanager/jobmanager.controller.js b/zeppelin-web/src/app/jobmanager/jobmanager.controller.js
index 4c437da..37c599b 100644
--- a/zeppelin-web/src/app/jobmanager/jobmanager.controller.js
+++ b/zeppelin-web/src/app/jobmanager/jobmanager.controller.js
@@ -98,10 +98,19 @@ function JobmanagerCtrl($scope, websocketMsgSrv, $interval, ngToast, $q,
$timeou
       filterValueInterpreter: '*',
       isSortByAsc: true
     };
+    $scope.sortTooltipMsg = 'Switch to sort by desc';
     $scope.jobTypeFilter = jobManagerFilter;
 
     websocketMsgSrv.getNoteJobsList();
 
+    $scope.$watch('filterConfig.isSortByAsc', function (value) {
+      if (value) {
+        $scope.sortTooltipMsg = 'Switch to sort by desc';
+      } else {
+        $scope.sortTooltipMsg = 'Switch to sort by asc';
+      }
+    });
+
     $scope.$on('$destroy', function() {
       websocketMsgSrv.unsubscribeJobManager();
     });

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/062b90a5/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 62e85fd..05a1b6e 100644
--- a/zeppelin-web/src/app/jobmanager/jobmanager.filter.js
+++ b/zeppelin-web/src/app/jobmanager/jobmanager.filter.js
@@ -18,6 +18,7 @@ function jobManagerFilter() {
   function filterContext(jobItems, filterConfig) {
     var filterValueInterpreter = filterConfig.filterValueInterpreter;
     var filterValueNotebookName = filterConfig.filterValueNotebookName;
+    var isSortByAsc = filterConfig.isSortByAsc;
     var filterItems = jobItems;
 
     if (filterValueInterpreter === undefined) {
@@ -36,7 +37,11 @@ function jobManagerFilter() {
       });
     }
 
-    return filterItems;
+    filterItems = _.sortBy(filterItems, function(sortItem) {
+      return sortItem.noteName.toLowerCase();
+    });
+
+    return isSortByAsc ? filterItems : filterItems.reverse();
   }
   return filterContext;
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/062b90a5/zeppelin-web/src/app/jobmanager/jobmanager.html
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/jobmanager/jobmanager.html b/zeppelin-web/src/app/jobmanager/jobmanager.html
index eaf5f07..96e05af 100644
--- a/zeppelin-web/src/app/jobmanager/jobmanager.html
+++ b/zeppelin-web/src/app/jobmanager/jobmanager.html
@@ -34,7 +34,16 @@ limitations under the License.
   <div class="row">
     <div class="col-md-6 text-left">
       <div class="form-inline">
-        <span class="labelBtn btn-group" style="margin-left: 0px; padding-left: 10px;">
+        <span class="labelBtn btn-group">
+          <button type="button"
+                  class="btn btn-default"
+                  style="width: 25px; height: 25px; margin-right: 0px; padding: 1px 0px 3px
3px"
+                  ng-click="onChangeSortAsc()"
+                  tooltip-placement="right" tooltip="{{sortTooltipMsg}}">
+            <i class="fa" ng-class="{true: 'fa-sort-amount-asc', false : 'fa-sort-amount-desc'}[filterConfig.isSortByAsc]"></i>
+          </button>
+        </span>
+        <span class="labelBtn btn-group" style="margin-left: 0px; padding-left: 3px;">
           <button type="button" class="btn btn-default btn-xs dropdown-toggle"
                  data-toggle="dropdown"
                  style="min-width: 100px; text-align: right !important;">
@@ -136,7 +145,7 @@ limitations under the License.
   </div>
   <div
     ng-if="JobInfomationsByFilter.length > 0"
-    ng-repeat="notebookJob in JobInfomationsByFilter"
+    ng-repeat="notebookJob in JobInfomationsByFilter track by $index"
     class="paragraph-col">
     <div ng-include src="'app/jobmanager/jobs/job.html'"
          class="job-space box job-margin"


Mime
View raw message