You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2015/05/15 07:21:57 UTC

[28/52] [abbrv] incubator-kylin git commit: add tip when no models listed in project

add tip when no models listed in project


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/db883f41
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/db883f41
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/db883f41

Branch: refs/heads/0.8.0
Commit: db883f41df6aa1bd1a14c4cf7332456093d00ac9
Parents: ef5ccb5
Author: jiazhong <ji...@ebay.com>
Authored: Wed Mar 25 19:16:59 2015 +0800
Committer: honma <ho...@ebay.com>
Committed: Fri May 15 11:36:52 2015 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/models.js          |  5 +++--
 webapp/app/partials/cubes/cube_detail.html   |  2 +-
 webapp/app/partials/models/model_detail.html |  3 ++-
 webapp/app/partials/models/model_schema.html | 22 ++++++++++++++++++++--
 4 files changed, 26 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/db883f41/webapp/app/js/controllers/models.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/models.js b/webapp/app/js/controllers/models.js
index 973ede0..e9e942f 100644
--- a/webapp/app/js/controllers/models.js
+++ b/webapp/app/js/controllers/models.js
@@ -48,8 +48,10 @@ KylinApp.controller('ModelsCtrl', function ($scope, $q, $routeParams, $location,
 
         //  TODO offset&limit
         $scope.list = function () {
+            var defer = $q.defer();
             if(!$scope.projectModel.projects.length){
-                return [];
+                defer.resolve([]);
+                return defer.promise;
             }
 //            offset = (!!offset) ? offset : null;
 //            limit = (!!limit) ? limit : null;
@@ -62,7 +64,6 @@ KylinApp.controller('ModelsCtrl', function ($scope, $q, $routeParams, $location,
 
             $scope.loading = true;
 
-            var defer = $q.defer();
              ModelList.list(queryParam).then(function(resp){
                 $scope.loading = false;
                 defer.resolve(resp);

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/db883f41/webapp/app/partials/cubes/cube_detail.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubes/cube_detail.html b/webapp/app/partials/cubes/cube_detail.html
index 91e5afe..5ee5e3e 100755
--- a/webapp/app/partials/cubes/cube_detail.html
+++ b/webapp/app/partials/cubes/cube_detail.html
@@ -16,7 +16,7 @@
 * limitations under the License.
 -->
 
-<div ng-controller="CubeCtrl" class="nav-tabs-custom">
+<div ng-controller="CubeCtrl" class="nav-tabs-custom" style="margin-top:40px;">
     <ul class="nav nav-tabs">
         <li class="{{(!cube.visiblePage || cube.visiblePage=='metadata')? 'active':''}}">
             <a href="" ng-click="cube.visiblePage='metadata'">Grid</a>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/db883f41/webapp/app/partials/models/model_detail.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/models/model_detail.html b/webapp/app/partials/models/model_detail.html
index b116a0a..5f2830d 100644
--- a/webapp/app/partials/models/model_detail.html
+++ b/webapp/app/partials/models/model_detail.html
@@ -16,7 +16,8 @@
 * limitations under the License.
 -->
 
-<div ng-controller="CubeModelCtrl" class="nav-tabs-custom">
+<!--show detail when exist models-->
+<div ng-controller="CubeModelCtrl" class="nav-tabs-custom" style="margin-top:40px;">
     <ul ng-show="model.name" class="nav nav-tabs">
         <li class="{{(!model.visiblePage || model.visiblePage=='metadata')? 'active':''}}">
             <a href="" ng-click="model.visiblePage='metadata'">Grid</a>

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/db883f41/webapp/app/partials/models/model_schema.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/models/model_schema.html b/webapp/app/partials/models/model_schema.html
index 898343a..aef280b 100644
--- a/webapp/app/partials/models/model_schema.html
+++ b/webapp/app/partials/models/model_schema.html
@@ -16,6 +16,7 @@
 * limitations under the License.
 -->
 
+<!--hide when view model and no model selected-->
 <div class="box box-primary model-design box-2px" ng-hide="state.mode=='view'&&!model.name">
     <div class="box-header widget-header-blue widget-header-flat">
         <h4 class="box-title text-info">Model Designer</h4>
@@ -67,13 +68,30 @@
     </div>
 </div>
 
-<div ng-show="state.mode=='view'&&!model.name">
+<!--show create model tip when no models list-->
+<div ng-show="state.mode=='view'&&!models_treedata.length" style="margin-top:40px;">
+    <div class="box box-primary">
+        <div class="box-header with-border">
+            <h3 class="box-title">No model</h3>
+        </div>
+        <div class="box-body">
+            <p>
+                <a href="models/add" ng-if="userService.hasRole('ROLE_MODELER')">Click here to create your model</a>
+            </p>
+        </div><!-- /.box-body -->
+    </div>
+</div>
+
+<!--show select model tip when models not empty and no model selected-->
+<div ng-show="state.mode=='view'&&!!models_treedata.length&&!model.name" style="margin-top:40px;">
     <div class="box box-primary">
         <div class="box-header with-border">
             <h3 class="box-title">No model selected</h3>
         </div>
         <div class="box-body">
-            Plese choose your model
+            <p>
+               Select your model
+            </p>
         </div><!-- /.box-body -->
     </div>
 </div>
\ No newline at end of file