AMBARI-7268. Configs: need better handling of notes in config history table.(XIWANG)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9bd68735 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9bd68735 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9bd68735 Branch: refs/heads/branch-alerts-dev Commit: 9bd6873554c83c9ea3ed14adfe32206a9745fbb0 Parents: f3e76ef Author: Xi Wang <xiw...@apache.org> Authored: Thu Sep 11 16:18:02 2014 -0700 Committer: Xi Wang <xiw...@apache.org> Committed: Thu Sep 11 17:00:34 2014 -0700 ---------------------------------------------------------------------- .../main/dashboard/config_history_controller.js | 2 +- ambari-web/app/models/service_config_version.js | 5 ++++- ambari-web/app/styles/application.less | 12 +++++++++++- .../templates/common/configs/config_history_flow.hbs | 8 ++++---- .../app/templates/main/dashboard/config_history.hbs | 14 +++++++++++++- .../app/views/main/dashboard/config_history_view.js | 8 ++++++-- 6 files changed, 39 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9bd68735/ambari-web/app/controllers/main/dashboard/config_history_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/dashboard/config_history_controller.js b/ambari-web/app/controllers/main/dashboard/config_history_controller.js index 41816bc..e6d8614 100644 --- a/ambari-web/app/controllers/main/dashboard/config_history_controller.js +++ b/ambari-web/app/controllers/main/dashboard/config_history_controller.js @@ -46,7 +46,7 @@ App.MainConfigHistoryController = Em.ArrayController.extend(App.TableServerMixin associations[2] = 'configGroup'; associations[3] = 'createTime'; associations[4] = 'author'; - associations[5] = 'briefNotes'; + associations[5] = 'notes'; return associations; }.property(), http://git-wip-us.apache.org/repos/asf/ambari/blob/9bd68735/ambari-web/app/models/service_config_version.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service_config_version.js b/ambari-web/app/models/service_config_version.js index 1a3922c..4a65ac2 100644 --- a/ambari-web/app/models/service_config_version.js +++ b/ambari-web/app/models/service_config_version.js @@ -43,7 +43,10 @@ App.ServiceConfigVersion = DS.Model.extend({ return (this.get('groupName') === 'default') ? (this.get('displayName') + ' ' + Em.I18n.t('common.default')) : this.get('groupName'); }.property('groupName'), briefNotes: function () { - return (typeof this.get('notes') === 'string') ? this.get('notes').slice(0, 100) : ""; + return (typeof this.get('notes') === 'string') ? this.get('notes').slice(0, 81) : ""; + }.property('notes'), + moreNotesExists: function () { + return (typeof this.get('notes') === 'string') ? this.get('notes').length > 80 : false; }.property('notes'), versionText: function () { return Em.I18n.t('dashboard.configHistory.table.version.versionText').format(this.get('version')); http://git-wip-us.apache.org/repos/asf/ambari/blob/9bd68735/ambari-web/app/styles/application.less ---------------------------------------------------------------------- diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less index 31ddc76..9dc4307 100644 --- a/ambari-web/app/styles/application.less +++ b/ambari-web/app/styles/application.less @@ -553,6 +553,9 @@ h1 { .tooltip-inner { text-align: left; + max-width: 400px; + overflow-wrap: break-word; + white-space:pre-wrap; } .popover { @@ -4944,6 +4947,9 @@ ul.inline li { width: 75%; } } + td.notes .show-more-button { + font-size: @default-font-size - 1; + } } div.page-bar div.filtered-info { margin-left: 17px; @@ -5015,7 +5021,7 @@ ul.inline li { left: -45px; z-index: 1000; float: left; - min-width: 300px; + width: 300px; padding: 8px; list-style: none; background-color: #ffffff; @@ -5031,7 +5037,9 @@ ul.inline li { padding: 1px 5px 15px 5px; text-align: left; .notes{ + overflow-wrap: break-word; word-wrap: break-word; + white-space: pre-wrap; } .date{ color: #808080; @@ -5191,6 +5199,8 @@ ul.inline li { } .notes{ word-wrap: break-word; + overflow-wrap: break-word; + white-space: pre-wrap; } } .btn { http://git-wip-us.apache.org/repos/asf/ambari/blob/9bd68735/ambari-web/app/templates/common/configs/config_history_flow.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs index 4c79c57..efc452f 100644 --- a/ambari-web/app/templates/common/configs/config_history_flow.hbs +++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs @@ -45,7 +45,7 @@ <div class="content"> <strong>{{serviceVersion.displayName}}</strong> <span class="label label-info">{{serviceVersion.versionText}}</span> <strong>{{t services.service.config.configHistory.configGroup}}:{{serviceVersion.configGroupName}}</strong> <div class="date">{{serviceVersion.createdDate}}</div> - <div class="notes">{{serviceVersion.briefNotes}}</div> + <div class="notes">{{serviceVersion.notes}}</div> </div> <div class="version-operations-buttons"> <button {{bindAttr disabled="serviceVersion.disabledActionAttr.view" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.view"}} {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i> {{t common.view}}</button> @@ -69,7 +69,7 @@ <i class="icon-remove-circle icon-large"></i> </div> <div class="label-wrapper span8" - data-toggle="tooltip" {{bindAttr data-original-title="view.compareServiceVersion.briefNotes"}}> + data-toggle="tooltip" {{bindAttr data-original-title="view.compareServiceVersion.notes"}}> {{t services.service.config.configHistory.comparing}} <span class="label label-info">{{view.displayedServiceVersion.versionText}}</span> ... @@ -107,7 +107,7 @@ <div class="content"> <strong>{{serviceVersion.displayName}}</strong> <span class="label label-info">{{serviceVersion.versionText}}</span> <strong>{{t services.service.config.configHistory.configGroup}}:{{serviceVersion.configGroupName}}</strong> <div class="date">{{serviceVersion.createdDate}}</div> - <div class="notes">{{serviceVersion.briefNotes}}</div> + <div class="notes">{{serviceVersion.notes}}</div> </div> <div class="version-operations-buttons"> <button {{bindAttr disabled="serviceVersion.disabledActionAttr.view" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.view"}} {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i> {{t common.view}}</button> @@ -128,7 +128,7 @@ </ul> </div> {{/if}} - <div class="label-wrapper span8" data-toggle="tooltip" {{bindAttr data-original-title="view.displayedServiceVersion.briefNotes"}}> + <div class="label-wrapper span8" data-toggle="tooltip" {{bindAttr data-original-title="view.displayedServiceVersion.notes"}}> <span class="label label-info">{{view.displayedServiceVersion.versionText}}</span> {{#if view.displayedServiceVersion.isCurrent}} <span class="label label-success">{{t common.current}}</span> http://git-wip-us.apache.org/repos/asf/ambari/blob/9bd68735/ambari-web/app/templates/main/dashboard/config_history.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/dashboard/config_history.hbs b/ambari-web/app/templates/main/dashboard/config_history.hbs index 8156e58..aa33887 100644 --- a/ambari-web/app/templates/main/dashboard/config_history.hbs +++ b/ambari-web/app/templates/main/dashboard/config_history.hbs @@ -57,7 +57,19 @@ </td> <td>{{item.createdDate}}</td> <td>{{item.author}}</td> - <td>{{item.briefNotes}}</td> + <td class="notes"> + {{#if item.moreNotesExists}} + {{#if view.showLessNotes}} + {{item.briefNotes}} + <a {{action toggleShowLessStatus target="view"}} class="show-more-button">>> More</a> + {{else}} + {{item.notes}} + <a {{action toggleShowLessStatus target="view"}} class="show-more-button"><< Less</a> + {{/if}} + {{else}} + {{item.briefNotes}} + {{/if}} + </td> {{/view}} {{/each}} {{else}} http://git-wip-us.apache.org/repos/asf/ambari/blob/9bd68735/ambari-web/app/views/main/dashboard/config_history_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/config_history_view.js b/ambari-web/app/views/main/dashboard/config_history_view.js index ea01bb6..436451e 100644 --- a/ambari-web/app/views/main/dashboard/config_history_view.js +++ b/ambari-web/app/views/main/dashboard/config_history_view.js @@ -115,7 +115,7 @@ App.MainConfigHistoryView = App.TableView.extend({ }), notesSort: sort.fieldView.extend({ column: 5, - name: 'briefNotes', + name: 'notes', displayName: Em.I18n.t('common.notes') }), @@ -193,7 +193,11 @@ App.MainConfigHistoryView = App.TableView.extend({ ConfigVersionView: Em.View.extend({ tagName: 'tr', - didInsertElement: function(){ + showLessNotes: true, + toggleShowLessStatus: function () { + this.set('showLessNotes', !this.get('showLessNotes')); + }, + didInsertElement: function () { App.tooltip(this.$("[rel='Tooltip']")); } }),