Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 8464c5c0b -> ca513ed82


AMBARI-7843. Slider View: YARN application link for a slider app doesnt load by 
default (Max Shepel via srimanth)


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

Branch: refs/heads/branch-1.7.0
Commit: ca513ed82243e4cd5697a1cea8079673ea9b61e3
Parents: 8464c5c
Author: Srimanth Gunturi <sgunt...@hortonworks.com>
Authored: Fri Oct 17 15:08:06 2014 -0700
Committer: Srimanth Gunturi <sgunt...@hortonworks.com>
Committed: Fri Oct 17 15:08:06 2014 -0700

----------------------------------------------------------------------
 .../ui/app/mappers/slider_apps_mapper.js        |  2 +-
 .../unit/mappers/slider_apps_mapper_test.js     | 54 ++++++++++++++++++++
 2 files changed, 55 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ca513ed8/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
----------------------------------------------------------------------
diff --git 
a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js 
b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
index 72baa67..4a0323f 100644
--- 
a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
+++ 
b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
@@ -172,7 +172,7 @@ App.SliderAppsMapper = 
App.Mapper.createWithMixins(App.RunPeriodically, {
     if (!Em.isNone(viewConfigs)) {
       var viewConfig = viewConfigs.findBy('viewConfigName', 
'yarn.rm.webapp.url');
       if (!Em.isNone(viewConfig)) {
-        yarnUI = viewConfig.get('value');
+        yarnUI = 'http://' + viewConfig.get('value');
       }
     }
     quickLinks.push(

http://git-wip-us.apache.org/repos/asf/ambari/blob/ca513ed8/contrib/views/slider/src/main/resources/ui/test/unit/mappers/slider_apps_mapper_test.js
----------------------------------------------------------------------
diff --git 
a/contrib/views/slider/src/main/resources/ui/test/unit/mappers/slider_apps_mapper_test.js
 
b/contrib/views/slider/src/main/resources/ui/test/unit/mappers/slider_apps_mapper_test.js
new file mode 100644
index 0000000..e312356
--- /dev/null
+++ 
b/contrib/views/slider/src/main/resources/ui/test/unit/mappers/slider_apps_mapper_test.js
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+QUnit.module('App.SliderAppsMapper', {
+
+  setup: function () {
+    App.SliderApp.store = App.__container__.lookup('store:main');
+  },
+
+  teardown: function () {
+    App.reset();
+  }
+
+});
+
+test('App.SliderAppsMapper.parseQuickLinks', function () {
+
+  var mapper = App.SliderAppsMapper;
+
+  Em.run(function () {
+    App.SliderApp.store.all = function () {
+      return [
+        Em.Object.create({
+          viewConfigName: 'yarn.rm.webapp.url',
+          value: 'host'
+        })
+      ]
+    };
+    App.SliderApp.store.pushMany = function (model, record) {
+      mapper.set('result', record);
+    };
+    mapper.parseQuickLinks({
+      id: '1'
+    })
+  });
+
+  equal(mapper.get('result')[0].get('url'), 
'http://host/cluster/app/application_1', 'valid YARN application URL formed');
+
+});
\ No newline at end of file

Reply via email to