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:38:43 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 cbccd7354 -> 8464c5c0b


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/8464c5c0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8464c5c0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8464c5c0

Branch: refs/heads/branch-1.7.0
Commit: 8464c5c0b2b7baf406f9d2d4c94f851a016b1bca
Parents: cbccd73
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Fri Oct 17 21:19:28 2014 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Fri Oct 17 21:19:28 2014 +0300

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/8464c5c0/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/8464c5c0/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/8464c5c0/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 9a850a1..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>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8464c5c0/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..a553f73 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);

http://git-wip-us.apache.org/repos/asf/ambari/blob/8464c5c0/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..4450a3a 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"
         }
       }
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/8464c5c0/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 474d209..8310256 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');
 
 });


Mime
View raw message