ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-14591 Show Alert response in separate popup so that they can be read more easily and be copy pasted. (atkach)
Date Fri, 08 Jan 2016 14:28:08 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 de221faff -> 0a89b754e


AMBARI-14591 Show Alert response in separate popup so that they can be read more easily and
be copy pasted. (atkach)


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

Branch: refs/heads/branch-2.2
Commit: 0a89b754e639e127624e71587da698e608142076
Parents: de221fa
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Fri Jan 8 14:28:16 2016 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Fri Jan 8 14:28:16 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |  6 +++++-
 .../templates/common/host_progress_popup.hbs    |  2 +-
 .../app/templates/common/selectable_popup.hbs   |  2 +-
 .../main/alerts/definition_details.hbs          |  4 +++-
 .../main/alerts/definition_details_view.js      | 14 ++++++++++++-
 .../main/alerts/definition_details_view_test.js | 21 ++++++++++++++++++++
 6 files changed, 44 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0a89b754/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 214b214..6cb8633 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -290,6 +290,8 @@ Em.I18n.translations = {
   'common.timeout.warning.popup.body.after': ' seconds due to inactivity',
   'common.timeout.warning.popup.primary': 'Remain Logged In',
   'common.timeout.warning.popup.secondary': 'Log Out Now',
+  'common.openNewWindow': 'Open in New Window',
+  'common.fullLogPopup.clickToCopy': 'Click to Copy',
 
   'models.alert_instance.tiggered.verbose': "Occurred on {0} <br> Checked on {1}",
   'models.alert_definition.triggered.verbose': "Occurred on {0}",
@@ -2834,5 +2836,7 @@ Em.I18n.translations = {
 
   'utils.ajax.errorMessage': 'Error message',
   'utils.ajax.defaultErrorPopupBody.message': 'received on {0} method for API: {1}',
-  'utils.ajax.defaultErrorPopupBody.statusCode': '{0} status code'
+  'utils.ajax.defaultErrorPopupBody.statusCode': '{0} status code',
+
+  'alerts.instance.fullLogPopup.header': 'Instance Response'
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a89b754/ambari-web/app/templates/common/host_progress_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/host_progress_popup.hbs b/ambari-web/app/templates/common/host_progress_popup.hbs
index 9a5cf30..a50ebd1 100644
--- a/ambari-web/app/templates/common/host_progress_popup.hbs
+++ b/ambari-web/app/templates/common/host_progress_popup.hbs
@@ -193,7 +193,7 @@
         <i {{bindAttr class="view.openedTask.status :task-detail-status-ico view.openedTask.icon"}}></i>
 
         <div class="task-detail-ico-wrap">
-          <a title="Click to Copy" {{action "textTrigger" taskInfo target="view"}} class="task-detail-copy"><i
+          <a {{translateAttr title="common.fullLogPopup.clickToCopy"}} {{action "textTrigger"
taskInfo target="view"}} class="task-detail-copy"><i
                   class="icon-copy"></i> {{t common.copy}}</a>
           <a title="Open in New Window" {{action openTaskLogInDialog}} class="task-detail-open-dialog"><i
                   class="icon-external-link"></i> {{t common.open}}</a>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a89b754/ambari-web/app/templates/common/selectable_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/selectable_popup.hbs b/ambari-web/app/templates/common/selectable_popup.hbs
index 4426d2c..c95e3fa 100644
--- a/ambari-web/app/templates/common/selectable_popup.hbs
+++ b/ambari-web/app/templates/common/selectable_popup.hbs
@@ -19,7 +19,7 @@
 <div>
   <div class="task-top-wrap">
     <div class="task-detail-ico-wrap">
-      <a href="#" title="Click to Copy" {{action "textTrigger"}} class="task-detail-copy"><i
class="icon-copy"></i> {{t common.copy}}</a>
+      <a href="#" {{translateAttr title="common.fullLogPopup.clickToCopy"}} {{action "textTrigger"}}
class="task-detail-copy"><i class="icon-copy"></i> {{t common.copy}}</a>
     </div>
   </div>
   <div class="task-detail-log-info">

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a89b754/ambari-web/app/templates/main/alerts/definition_details.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/alerts/definition_details.hbs b/ambari-web/app/templates/main/alerts/definition_details.hbs
index 2df3fb0..1c2605d 100644
--- a/ambari-web/app/templates/main/alerts/definition_details.hbs
+++ b/ambari-web/app/templates/main/alerts/definition_details.hbs
@@ -203,7 +203,9 @@
                 </td>
                 <td>{{view view.parentView.lastDayCount hostNameBinding="instance.hostName"}}</td>
                 <td>
-                  <span class="alert-text" {{bindAttr data-original-title="instance.text"}}>{{instance.text}}</span>
+                  <a href="#" class="alert-text" {{action openFullResponse instance target="view"}}
{{bindAttr data-original-title="instance.text"}}>
+                    {{instance.text}}
+                  </a>
                 </td>
               {{/view}}
             {{/each}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a89b754/ambari-web/app/views/main/alerts/definition_details_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/alerts/definition_details_view.js b/ambari-web/app/views/main/alerts/definition_details_view.js
index 6b5e065..cb8f309 100644
--- a/ambari-web/app/views/main/alerts/definition_details_view.js
+++ b/ambari-web/app/views/main/alerts/definition_details_view.js
@@ -102,7 +102,6 @@ App.MainAlertDefinitionDetailsView = App.TableView.extend({
       App.tooltip(this.$("[rel=tooltip]"));
       App.tooltip(this.$(".alert-text"), {
         placement: 'left',
-        delay: { "show": 0, "hide": 1500 },
         template: '<div class="tooltip"><div class="tooltip-arrow"></div><div
class="tooltip-inner alert-def-detail-tooltip"></div></div>'
       });
     },
@@ -132,6 +131,19 @@ App.MainAlertDefinitionDetailsView = App.TableView.extend({
         App.router.get('mainHostDetailsController').set('referer', App.router.location.lastSetURL);
         App.router.transitionTo('main.hosts.hostDetails.alerts', event.context);
       }
+    },
+
+    /**
+     * open popup that contain full response of Alert Instance
+     * @param {Object} event
+     */
+    openFullResponse: function(event) {
+      App.ModalPopup.show({
+        header: Em.I18n.t('alerts.instance.fullLogPopup.header'),
+        secondary: null,
+        content: event.context.get('text'),
+        bodyClass: App.SelectablePopupBodyView
+      });
     }
 
   }),

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a89b754/ambari-web/test/views/main/alerts/definition_details_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/alerts/definition_details_view_test.js b/ambari-web/test/views/main/alerts/definition_details_view_test.js
index ff336a0..84323e5 100644
--- a/ambari-web/test/views/main/alerts/definition_details_view_test.js
+++ b/ambari-web/test/views/main/alerts/definition_details_view_test.js
@@ -51,4 +51,25 @@ describe('App.MainAlertDefinitionDetailsView', function () {
     });
   });
 
+  describe("#openFullResponse()", function() {
+
+    beforeEach(function() {
+      sinon.stub(App.ModalPopup, 'show');
+    });
+
+    afterEach(function() {
+      App.ModalPopup.show.restore();
+    });
+
+    it("App.ModalPopup.show should be called", function() {
+      instanceTableRow.openFullResponse({context: Em.Object.create({text: 'text1'})});
+      expect(App.ModalPopup.show.calledWith({
+        header: Em.I18n.t('alerts.instance.fullLogPopup.header'),
+        secondary: null,
+        content: 'text1',
+        bodyClass: App.SelectablePopupBodyView
+      })).to.be.true;
+    });
+  });
+
 });


Mime
View raw message