ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject git commit: AMBARI-7841. Slider View: Show slider-view user beside the Create App page. (akovalenko)
Date Fri, 17 Oct 2014 18:37:42 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 75f78825b -> a1ba750e8


AMBARI-7841. Slider View: Show slider-view user beside the Create App page. (akovalenko)


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

Branch: refs/heads/trunk
Commit: a1ba750e85a3cb8b6614eb6406408d595821d5fa
Parents: 75f7882
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Fri Oct 17 21:36:45 2014 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Fri Oct 17 21:36:45 2014 +0300

----------------------------------------------------------------------
 .../resources/ui/app/controllers/slider_controller.js    |  1 +
 .../slider/src/main/resources/ui/app/styles/app.less     |  5 +++++
 .../src/main/resources/ui/app/templates/application.hbs  | 11 ++++++++---
 .../resources/ui/test/integration/pages/index_test.js    |  7 +++++--
 .../controllers/createAppWizard/step3_controller_test.js |  5 ++++-
 .../ui/test/unit/controllers/slider_controller_test.js   |  4 ++++
 6 files changed, 27 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a1ba750e/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
index e4476fd..3c9ca3c 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
@@ -53,6 +53,7 @@ App.SliderController = Ember.Controller.extend(App.RunPeriodically, {
     App.set('description', Em.get(data, 'ViewInstanceInfo.description'));
     App.set('label', Em.get(data, 'ViewInstanceInfo.label'));
     App.set('javaHome', Em.get(data, 'ViewInstanceInfo.instance_data') && Em.get(data,
'ViewInstanceInfo.instance_data')['java.home']);
+    App.set('sliderUser', data.ViewInstanceInfo.properties['slider.user']);
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1ba750e/contrib/views/slider/src/main/resources/ui/app/styles/app.less
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/styles/app.less b/contrib/views/slider/src/main/resources/ui/app/styles/app.less
index ddff96a..de2e8fe 100644
--- a/contrib/views/slider/src/main/resources/ui/app/styles/app.less
+++ b/contrib/views/slider/src/main/resources/ui/app/styles/app.less
@@ -273,4 +273,9 @@
   .component-label {
     line-height: 28px;
   }
+}
+
+.view-user {
+  line-height: 34px;
+  padding-right: 10px;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1ba750e/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
index 7961387..417db74 100755
--- a/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
@@ -36,10 +36,15 @@
 
 <div class="slider-header">
   {{#view view.SliderTitleView}}
-      <h3 class="pull-left" id="slider-title"><span class="slider-app-title">{{App.label}}</span></h3>
+    <h3 class="pull-left" id="slider-title"><span class="slider-app-title">{{App.label}}</span></h3>
     {{#if view.showCreateAppButton}}
       <div class="box-header pull-right">
-        <div class="create-app">
+        {{#if App.sliderUser}}
+          <div class="pull-left view-user">
+            <i class="icon-user"></i>&nbsp;{{App.sliderUser}}
+          </div>
+        {{/if}}
+        <div class="create-app pull-right">
           <a href="#" class="btn btn-primary" {{action createApp}}>
             <i class="icon-plus"></i><span>&nbsp;{{t slider.apps.create}}</span>
           </a>
@@ -50,4 +55,4 @@
   {{outlet bs-tooltip-box}}
 </div>
 
-{{outlet}}
\ No newline at end of file
+{{outlet}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1ba750e/contrib/views/slider/src/main/resources/ui/test/integration/pages/index_test.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/test/integration/pages/index_test.js
b/contrib/views/slider/src/main/resources/ui/test/integration/pages/index_test.js
index f5d556a..aa3a5c7 100644
--- a/contrib/views/slider/src/main/resources/ui/test/integration/pages/index_test.js
+++ b/contrib/views/slider/src/main/resources/ui/test/integration/pages/index_test.js
@@ -24,7 +24,10 @@ QUnit.module('integration/pages - index', {
       "ViewInstanceInfo": {
         "context_path": "/views/SLIDER/1.0.0/s1",
         "description": "DESCRIPTION",
-        "label": "SLIDER LABEL"
+        "label": "SLIDER LABEL",
+        "properties": {
+          "slider.user": "admin"
+        }
       }
     });
     Ember.run(App, App.advanceReadiness);
@@ -120,4 +123,4 @@ test('Clear Filters', function () {
     });
   });
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1ba750e/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step3_controller_test.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step3_controller_test.js
b/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step3_controller_test.js
index 56346b2..6a10e61 100644
--- a/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step3_controller_test.js
+++ b/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step3_controller_test.js
@@ -46,6 +46,9 @@ test('initConfigs', function () {
       "ViewInstanceInfo" : {
         "instance_data": {
           "java.home": "/usr/jdk64/jdk1.7.0_45"
+        },
+        "properties": {
+          "slider.user": "admin"
         }
       }
     });
@@ -56,4 +59,4 @@ test('initConfigs', function () {
 
   equal(controller.get('configs').findBy('label', 'java_home').get('value'), '/usr/jdk64/jdk1.7.0_45',
'should set default java_home property value');
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1ba750e/contrib/views/slider/src/main/resources/ui/test/unit/controllers/slider_controller_test.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/test/unit/controllers/slider_controller_test.js
b/contrib/views/slider/src/main/resources/ui/test/unit/controllers/slider_controller_test.js
index 0faec95..871130a 100644
--- a/contrib/views/slider/src/main/resources/ui/test/unit/controllers/slider_controller_test.js
+++ b/contrib/views/slider/src/main/resources/ui/test/unit/controllers/slider_controller_test.js
@@ -28,6 +28,9 @@ test('getViewDisplayParametersSuccessCallback', function () {
         "label" : "display s1",
         "instance_data": {
           "java.home": "/usr/jdk64/jdk1.7.0_45"
+        },
+        "properties": {
+          "slider.user": "admin"
         }
       }
     })
@@ -35,5 +38,6 @@ test('getViewDisplayParametersSuccessCallback', function () {
   equal(App.get('label'), 'display s1', 'valid label is set');
   equal(App.get('description'), 'description s1', 'valid description is set');
   equal(App.get('javaHome'), '/usr/jdk64/jdk1.7.0_45', 'valid default java_home property
is set');
+  equal(App.get('sliderUser'), 'admin', 'valid sliderUser is set');
 
 });
\ No newline at end of file


Mime
View raw message