You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/11/09 18:15:24 UTC
[1/2] ambari git commit: AMBARI-13790. "Username" and "Password"
inputs are inactive after Sign Out during deploy
Repository: ambari
Updated Branches:
refs/heads/trunk 47ab1426e -> d7f6f18e5
AMBARI-13790. "Username" and "Password" inputs are inactive after Sign Out during deploy
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d7f6f18e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d7f6f18e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d7f6f18e
Branch: refs/heads/trunk
Commit: d7f6f18e547a230134b720d731f5e3d75bd4f6c5
Parents: ac8147b
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Nov 9 18:50:46 2015 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Nov 9 19:06:19 2015 +0200
----------------------------------------------------------------------
ambari-web/app/router.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/d7f6f18e/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index 1da6edf..59e2251 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -271,6 +271,7 @@ App.Router = Em.Router.extend({
},
loginSuccessCallback: function(data, opt, params) {
+ App.router.set('loginController.isSubmitDisabled', false);
App.usersMapper.map({"items": [data]});
this.setUserLoggedIn(decodeURIComponent(params.loginName));
var requestData = {
[2/2] ambari git commit: AMBARI-13785. JS errors on leaving pages
with graphs before they're loaded
Posted by al...@apache.org.
AMBARI-13785. JS errors on leaving pages with graphs before they're loaded
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ac8147b6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ac8147b6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ac8147b6
Branch: refs/heads/trunk
Commit: ac8147b6c9786da067b068ded9c87865ba711547
Parents: 47ab142
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Nov 9 15:28:30 2015 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Nov 9 19:06:19 2015 +0200
----------------------------------------------------------------------
ambari-web/app/assets/test/tests.js | 1 +
ambari-web/app/utils/ember_reopen.js | 12 +++
.../app/views/common/chart/linear_time.js | 15 ++--
ambari-web/test/utils/ember_reopen_test.js | 81 ++++++++++++++++++++
4 files changed, 103 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8147b6/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 71c69db..7e3c83d 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -169,6 +169,7 @@ var files = [
'test/utils/data_manipulation_test',
'test/utils/config_test',
'test/utils/db_test',
+ 'test/utils/ember_reopen_test',
'test/utils/form_field_test',
'test/utils/host_progress_popup_test',
'test/utils/misc_test',
http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8147b6/ambari-web/app/utils/ember_reopen.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ember_reopen.js b/ambari-web/app/utils/ember_reopen.js
index b1bcdcf..4f3f1dd 100644
--- a/ambari-web/app/utils/ember_reopen.js
+++ b/ambari-web/app/utils/ember_reopen.js
@@ -199,6 +199,18 @@ Em.View.reopen({
} else {
console.debug('Calling set on destroyed view');
}
+ },
+
+ /**
+ * overwritten setProperties method of Ember.View to avoid uncaught errors
+ * when trying to set multiple properties of destroyed view
+ */
+ setProperties: function(hash){
+ if(!this.get('isDestroyed') && !this.get('isDestroying')){
+ this._super(hash);
+ } else {
+ console.debug('Calling setProperties on destroyed view');
+ }
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8147b6/ambari-web/app/views/common/chart/linear_time.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js
index a6bd9a4..efea946 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -299,12 +299,15 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
setExportTooltip: function () {
if (this.get('isReady')) {
Em.run.next(this, function () {
- this.$('.corner-icon').on('mouseover', function () {
- $(this).closest("[rel='ZoomInTooltip']").trigger('mouseleave');
- });
- App.tooltip(this.$('.corner-icon > .icon-save'), {
- title: Em.I18n.t('common.export')
- });
+ var icon = this.$('.corner-icon');
+ if (icon) {
+ icon.on('mouseover', function () {
+ $(this).closest("[rel='ZoomInTooltip']").trigger('mouseleave');
+ });
+ App.tooltip(icon.children('.icon-save'), {
+ title: Em.I18n.t('common.export')
+ });
+ }
});
}
}.observes('isReady'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8147b6/ambari-web/test/utils/ember_reopen_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/ember_reopen_test.js b/ambari-web/test/utils/ember_reopen_test.js
new file mode 100644
index 0000000..eda5e81
--- /dev/null
+++ b/ambari-web/test/utils/ember_reopen_test.js
@@ -0,0 +1,81 @@
+/**
+ * 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.
+ */
+
+require('utils/ember_reopen');
+
+describe('Ember functionality extension', function () {
+
+ describe('#Em.View', function () {
+
+ var view,
+ cases = [
+ {
+ result: {
+ p0: 'v3',
+ p1: 'v4',
+ p2: 'v5'
+ },
+ title: 'active view'
+ },
+ {
+ result: {
+ p0: 'v0',
+ p1: 'v1',
+ p2: 'v2'
+ },
+ propertyToSet: 'isDestroyed',
+ title: 'destroyed view'
+ },
+ {
+ result: {
+ p0: 'v0',
+ p1: 'v1',
+ p2: 'v2'
+ },
+ propertyToSet: 'isDestroying',
+ title: 'view being destroyed'
+ }
+ ];
+
+ beforeEach(function () {
+ view = Em.View.create({
+ isDestroyed: false,
+ isDestroying: false,
+ p0: 'v0',
+ p1: 'v1',
+ p2: 'v2'
+ });
+ });
+
+ cases.forEach(function (item) {
+ it(item.title, function () {
+ if (item.propertyToSet) {
+ view.set(item.propertyToSet, true);
+ }
+ view.set('p0', 'v3');
+ view.setProperties({
+ p1: 'v4',
+ p2: 'v5'
+ });
+ expect(view.getProperties(['p0', 'p1', 'p2'])).to.eql(item.result);
+ });
+ });
+
+ });
+
+});