Repository: ambari Updated Branches: refs/heads/trunk 9bf9034a5 -> 6a39f2b37
AMBARI-8740. Alerts UI: some minor clean up. (xiwang via yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6a39f2b3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6a39f2b3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6a39f2b3 Branch: refs/heads/trunk Commit: 6a39f2b37e157d9d35fc10efb0cd5b66d05b69d9 Parents: 9bf9034 Author: Yusaku Sako <[email protected]> Authored: Mon Dec 22 17:08:16 2014 -0800 Committer: Yusaku Sako <[email protected]> Committed: Mon Dec 22 17:08:53 2014 -0800 ---------------------------------------------------------------------- ambari-web/app/messages.js | 1 + .../alerts/add_definition_to_group_popup.hbs | 39 ++++++++++++-------- .../app/views/main/alert_definitions_view.js | 2 +- .../main/alerts/manage_alert_groups_view.js | 15 ++++++-- 4 files changed, 36 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/6a39f2b3/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 4ea3062..b40c964 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -1900,6 +1900,7 @@ Em.I18n.translations = { 'alerts.actions.manage_alert_groups_popup.removeButtonDisabled':'Cannot delete default alert group', 'alerts.actions.manage_alert_groups_popup.renameButton':'Rename Alert Group', 'alerts.actions.manage_alert_groups_popup.duplicateButton':'Duplicate Alert Group', + 'alerts.actions.manage_alert_groups_popup.addDefinition.noDefinitions':'No alert definitions to display', 'alerts.actions.manage_alert_groups_popup.addDefinition':'Add alert definitions to selected Alert Group', 'alerts.actions.manage_alert_groups_popup.addDefinitionDisabled':'There are no available alert definitions to add', 'alerts.actions.manage_alert_groups_popup.addDefinitionToDefault': 'Cannot modify default alert group', http://git-wip-us.apache.org/repos/asf/ambari/blob/6a39f2b3/ambari-web/app/templates/main/alerts/add_definition_to_group_popup.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/alerts/add_definition_to_group_popup.hbs b/ambari-web/app/templates/main/alerts/add_definition_to_group_popup.hbs index a6a28db..6c9d3b3 100644 --- a/ambari-web/app/templates/main/alerts/add_definition_to_group_popup.hbs +++ b/ambari-web/app/templates/main/alerts/add_definition_to_group_popup.hbs @@ -97,26 +97,33 @@ <th width="25%">{{t common.service}}</th> <th width="30%">{{t common.component}}</th> </tr> - </thead> + </thead> </table> <div class="hosts-table-container"> <table class="table table-striped hosts-table"> - {{#each entry in view.pageContent}} - <tr {{bindAttr class="entry.filtered::hidden"}}> - <td width="10%"> - {{view Ember.Checkbox checkedBinding="entry.selected"}} - </td> - <td width="35%"> - {{entry.label}} - </td> - <td> - {{entry.serviceNameDisplay}} - </td> - <td> - {{entry.componentNameDisplay}} - </td> + {{#if view.pageContent}} + {{#each entry in view.pageContent}} + <tr {{bindAttr class="entry.filtered::hidden"}}> + <td width="10%"> + {{view Ember.Checkbox checkedBinding="entry.selected"}} + </td> + <td width="35%"> + {{entry.label}} + </td> + <td> + {{entry.serviceNameDisplay}} + </td> + <td> + {{entry.componentNameDisplay}} + </td> + </tr> + {{/each}} + {{else}} + <tr> + <td width="30%"></td> + <td>{{t alerts.actions.manage_alert_groups_popup.addDefinition.noDefinitions}}</td> </tr> - {{/each}} + {{/if}} </table> </div> </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/6a39f2b3/ambari-web/app/views/main/alert_definitions_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/alert_definitions_view.js b/ambari-web/app/views/main/alert_definitions_view.js index c894a03..4b655d1 100644 --- a/ambari-web/app/views/main/alert_definitions_view.js +++ b/ambari-web/app/views/main/alert_definitions_view.js @@ -171,7 +171,7 @@ App.MainAlertDefinitionsView = App.TableView.extend({ }, { value: 'PENDING', - label: 'PENDING' + label: 'NONE' } ], onChangeValue: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/6a39f2b3/ambari-web/app/views/main/alerts/manage_alert_groups_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/alerts/manage_alert_groups_view.js b/ambari-web/app/views/main/alerts/manage_alert_groups_view.js index 42e6859..6775680 100644 --- a/ambari-web/app/views/main/alerts/manage_alert_groups_view.js +++ b/ambari-web/app/views/main/alerts/manage_alert_groups_view.js @@ -130,15 +130,22 @@ App.MainAlertsManageAlertGroupView = Em.View.extend({ else { return Em.I18n.t('alerts.actions.manage_alert_groups_popup.addDefinition'); } - }.property('controller.selectedAlertGroup.isDefault', 'controller.selectedAlertGroup.isAddDefinitionsDisabled'), + }.property('controller.selectedAlertGroup.default', 'controller.selectedAlertGroup.isAddDefinitionsDisabled'), /** * Tooltip for "Remove definition from group"-button * @type {string} */ removeDefinitionTooltip: function () { - return this.get('controller.isDeleteDefinitionsDisabled') ? Em.I18n.t('alerts.actions.manage_alert_groups_popup.removeDefinitionDisabled') : - Em.I18n.t('alerts.actions.manage_alert_groups_popup.removeDefinition'); - }.property('controller.isDeleteDefinitionsDisabled') + if (this.get('controller.selectedAlertGroup.default')) { + return Em.I18n.t('alerts.actions.manage_alert_groups_popup.removeDefinitionDisabled'); + } + else + if (this.get('controller.isDeleteDefinitionsDisabled')) { + return 'Nothing to delete'; + } else { + return Em.I18n.t('alerts.actions.manage_alert_groups_popup.removeDefinition'); + } + }.property('controller.selectedAlertGroup.default', 'controller.isDeleteDefinitionsDisabled') });
