Repository: ambari Updated Branches: refs/heads/branch-2.5 b856c5f37 -> ab8b821e2
AMBARI-20150. Hive View 2.0 Tables tab does not open at all if Ranger policy does not include access to the 'admin' user. (diapyanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ab8b821e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ab8b821e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ab8b821e Branch: refs/heads/branch-2.5 Commit: ab8b821e2c8f8c54dbde788357c1995c7027b28b Parents: b856c5f Author: Dipayan Bhowmick <dipayan.bhowm...@gmail.com> Authored: Fri Feb 24 22:24:08 2017 +0530 Committer: Dipayan Bhowmick <dipayan.bhowm...@gmail.com> Committed: Fri Feb 24 22:24:08 2017 +0530 ---------------------------------------------------------------------- .../ui/app/components/notification-message.js | 30 ++++++++++++ .../ui/app/controllers/messages/message.js | 31 ------------- .../resources/ui/app/routes/databases-error.js | 27 +++++++++++ .../ui/app/routes/databases/database-error.js | 27 +++++++++++ .../routes/databases/database/tables-error.js | 27 +++++++++++ .../databases/database/tables/table-error.js | 27 +++++++++++ .../resources/ui/app/services/alert-messages.js | 12 +++-- .../ui/app/styles/bootstrap-overrides.scss | 20 ++++++++ .../components/notification-message.hbs | 48 ++++++++++++++++++++ .../ui/app/templates/databases-error.hbs | 19 ++++++++ .../app/templates/databases/database-error.hbs | 19 ++++++++ .../databases/database/tables-error.hbs | 19 ++++++++ .../databases/database/tables/table-error.hbs | 19 ++++++++ .../ui/app/templates/messages/message.hbs | 31 +------------ 14 files changed, 290 insertions(+), 66 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js b/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js new file mode 100644 index 0000000..339e095 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Component.extend({ + showStatus: Ember.computed('notification', function() { + return this.get('notification.status') !== -1; + }), + + displayBody: Ember.computed('notification', function() { + return !(Ember.isBlank(this.get('notification.responseMessage')) + && Ember.isBlank(this.get('notification.trace'))); + }) +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js deleted file mode 100644 index d46c1f6..0000000 --- a/contrib/views/hive20/src/main/resources/ui/app/controllers/messages/message.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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. - */ - -import Ember from 'ember'; - -export default Ember.Controller.extend({ - - showStatus: Ember.computed('model', function() { - return this.get('model.status') !== -1; - }), - - displayBody: Ember.computed('model', function() { - return !(Ember.isBlank(this.get('model.responseMessage')) - && Ember.isBlank(this.get('model.trace'))); - }) -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/routes/databases-error.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases-error.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases-error.js new file mode 100644 index 0000000..d4a92ab --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases-error.js @@ -0,0 +1,27 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import UILoggerMixin from '../mixins/ui-logger'; + +export default Ember.Route.extend(UILoggerMixin, { + setupController(controller, error) { + let alertMessage = this.get('logger').danger("Failed to fetch databases information", this.extractError(error), {sticky: false, timeout: 0}); + controller.set('alert', alertMessage); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database-error.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database-error.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database-error.js new file mode 100644 index 0000000..6a0fda0 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database-error.js @@ -0,0 +1,27 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import UILoggerMixin from '../../mixins/ui-logger'; + +export default Ember.Route.extend(UILoggerMixin, { + setupController(controller, error) { + let alertMessage = this.get('logger').danger("Failed to fetch database information", this.extractError(error), {sticky: false, timeout: 0}); + controller.set('alert', alertMessage); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables-error.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables-error.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables-error.js new file mode 100644 index 0000000..2b0b0d3 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables-error.js @@ -0,0 +1,27 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import UILoggerMixin from '../../../mixins/ui-logger'; + +export default Ember.Route.extend(UILoggerMixin, { + setupController(controller, error) { + let alertMessage = this.get('logger').danger("Failed to fetch tables information", this.extractError(error), {sticky: false, timeout: 0}); + controller.set('alert', alertMessage); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table-error.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table-error.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table-error.js new file mode 100644 index 0000000..00d3abf --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table-error.js @@ -0,0 +1,27 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import UILoggerMixin from '../../../../mixins/ui-logger'; + +export default Ember.Route.extend(UILoggerMixin, { + setupController(controller, error) { + let alertMessage = this.get('logger').danger("Failed to fetch table information", this.extractError(error), {sticky: false, timeout: 0}); + controller.set('alert', alertMessage); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js b/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js index 5280db2..253a007 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/alert-messages.js @@ -54,23 +54,23 @@ export default Ember.Service.extend({ }), success: function(message, options = {}, alertOptions = {}) { - this._processMessage('success', message, options, alertOptions); + return this._processMessage('success', message, options, alertOptions); }, warn: function(message, options = {}, alertOptions = {}) { - this._processMessage('warn', message, options, alertOptions); + return this._processMessage('warn', message, options, alertOptions); }, info: function(message, options = {}, alertOptions = {}) { - this._processMessage('info', message, options, alertOptions); + return this._processMessage('info', message, options, alertOptions); }, danger: function(message, options = {}, alertOptions = {}) { - this._processMessage('danger', message, options, alertOptions); + return this._processMessage('danger', message, options, alertOptions); }, error: function() { - this.danger(...arguments); + return this.danger(...arguments); }, clearMessages: function() { @@ -97,6 +97,8 @@ export default Ember.Service.extend({ case 'danger': this.get('flashMessages').danger(message, this._getOptions(alertOptions)); } + + return alertRecord; }, _addDetailsToMessage: function(message, record) { http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss index b06db65..4b7bec4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss +++ b/contrib/views/hive20/src/main/resources/ui/app/styles/bootstrap-overrides.scss @@ -42,6 +42,17 @@ $nav-tabs-active-link-hover-border-color: darken($body-bg, 15%); color: #fff; border: 1px solid darken($body-bg, 15%); border-bottom: none; + &.ember-transitioning-out { + background-color: $body-bg; + color: darken($body-bg, 50%); + border: none; + } + } + &.ember-transitioning-in { + background-color: $gray-dark; + color: #fff; + border: 1px solid darken($body-bg, 15%); + border-bottom: none; } } } @@ -54,6 +65,15 @@ $nav-tabs-active-link-hover-border-color: darken($body-bg, 15%); background-color: #fff; border: 1px solid darken($body-bg, 15%); border-bottom: none; + &.ember-transitioning-out { + background-color: $body-bg; + border: none; + } + } + &.ember-transitioning-in { + background-color: #fff; + border: 1px solid darken($body-bg, 15%); + border-bottom: none; } } } http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/templates/components/notification-message.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/notification-message.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/notification-message.hbs new file mode 100644 index 0000000..c2b32a1 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/notification-message.hbs @@ -0,0 +1,48 @@ +{{! +* 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. +}} + +<div class={{alert-message-context-class notification.type "panel panel-"}}> + <div class="panel-heading wrap-message"> + {{#fa-stack size="lg"}} + {{fa-icon "circle-thin" stack=2}} + {{fa-icon (alert-message-icon-class notification.type) stack=1}} + {{/fa-stack}} + {{{notification.message}}} + </div> + {{#if displayBody}} + <div class="panel-body"> + {{#if showStatus}} + <p><strong>Status:</strong> {{notification.status}}</p> + <hr/> + {{/if}} + {{#if notification.responseMessage}} + {{alert-message-display title="Message:" + value=notification.responseMessage + shorten=true + length=200}} + <hr/> + {{/if}} + {{#if notification.trace}} + {{alert-message-display title="Trace:" + value=notification.trace + shorten=true + length=500}} + {{/if}} + </div> + {{/if}} +</div> http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/templates/databases-error.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases-error.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases-error.hbs new file mode 100644 index 0000000..1b2dca9 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases-error.hbs @@ -0,0 +1,19 @@ +{{! +* 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. +}} + +{{notification-message notification=alert}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database-error.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database-error.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database-error.hbs new file mode 100644 index 0000000..1b2dca9 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database-error.hbs @@ -0,0 +1,19 @@ +{{! +* 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. +}} + +{{notification-message notification=alert}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables-error.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables-error.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables-error.hbs new file mode 100644 index 0000000..1b2dca9 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables-error.hbs @@ -0,0 +1,19 @@ +{{! +* 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. +}} + +{{notification-message notification=alert}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table-error.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table-error.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table-error.hbs new file mode 100644 index 0000000..1b2dca9 --- /dev/null +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table-error.hbs @@ -0,0 +1,19 @@ +{{! +* 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. +}} + +{{notification-message notification=alert}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8b821e/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs index 5b82333..24f64a9 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/messages/message.hbs @@ -16,33 +16,4 @@ * limitations under the License. }} -<div class={{alert-message-context-class model.type "panel panel-"}}> - <div class="panel-heading wrap-message"> - {{#fa-stack size="lg"}} - {{fa-icon "circle-thin" stack=2}} - {{fa-icon (alert-message-icon-class model.type) stack=1}} - {{/fa-stack}} - {{{model.message}}} - </div> - {{#if displayBody}} - <div class="panel-body"> - {{#if showStatus}} - <p><strong>Status:</strong> {{model.status}}</p> - <hr/> - {{/if}} - {{#if model.responseMessage}} - {{alert-message-display title="Message:" - value=model.responseMessage - shorten=true - length=200}} - <hr/> - {{/if}} - {{#if model.trace}} - {{alert-message-display title="Trace:" - value=model.trace - shorten=true - length=500}} - {{/if}} - </div> - {{/if}} -</div> +{{notification-message notification=model}}