Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A6CE1200B78 for ; Thu, 18 Aug 2016 12:29:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A5A18160AC4; Thu, 18 Aug 2016 10:29:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 013D3160AAE for ; Thu, 18 Aug 2016 12:29:38 +0200 (CEST) Received: (qmail 59820 invoked by uid 500); 18 Aug 2016 10:29:38 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 59757 invoked by uid 99); 18 Aug 2016 10:29:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2016 10:29:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id ED9AEE38B0; Thu, 18 Aug 2016 10:29:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: oleewere@apache.org To: commits@ambari.apache.org Date: Thu, 18 Aug 2016 10:29:42 -0000 Message-Id: In-Reply-To: <14ac20334b8a4ebdb990fad06830eb9a@git.apache.org> References: <14ac20334b8a4ebdb990fad06830eb9a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/50] [abbrv] ambari git commit: AMBARI-18149. Config History: disable link to configs for deleted group (akovalenko) archived-at: Thu, 18 Aug 2016 10:29:39 -0000 AMBARI-18149. Config History: disable link to configs for deleted group (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d50518c1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d50518c1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d50518c1 Branch: refs/heads/branch-dev-logsearch Commit: d50518c1e6dbbe0cc720123d541cc8ab4367fb13 Parents: 2dd7510 Author: Aleksandr Kovalenko Authored: Mon Aug 15 20:11:33 2016 +0300 Committer: Aleksandr Kovalenko Committed: Mon Aug 15 20:11:33 2016 +0300 ---------------------------------------------------------------------- .../models/configs/service_config_version.js | 7 ++++ .../views/main/dashboard/config_history_view.js | 4 +-- .../main/dashboard/config_history_view_test.js | 36 +++++++++++++++++--- 3 files changed, 41 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/d50518c1/ambari-web/app/models/configs/service_config_version.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/configs/service_config_version.js b/ambari-web/app/models/configs/service_config_version.js index 8722bb3..2859030 100644 --- a/ambari-web/app/models/configs/service_config_version.js +++ b/ambari-web/app/models/configs/service_config_version.js @@ -51,6 +51,13 @@ App.ServiceConfigVersion = DS.Model.extend({ }.property('groupName','isDefault'), /** + * @type {Boolean} + */ + isConfigGroupDeleted: function () { + return this.get('groupName') === 'Deleted'; + }.property('groupName'), + + /** * @type {string} */ authorFormatted: Em.computed.truncate('author', 15, 15), http://git-wip-us.apache.org/repos/asf/ambari/blob/d50518c1/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 3bfb22b..7bd9e4a 100644 --- a/ambari-web/app/views/main/dashboard/config_history_view.js +++ b/ambari-web/app/views/main/dashboard/config_history_view.js @@ -192,8 +192,8 @@ App.MainConfigHistoryView = App.TableView.extend(App.TableServerViewMixin, { // Define if show plain text label or link isServiceLinkDisabled: function () { - return this.get('content.serviceName') === 'KERBEROS' && !App.Service.find().someProperty('serviceName', 'KERBEROS'); - }.property('content.serviceName') + return this.get('content.serviceName') === 'KERBEROS' && !App.Service.find().someProperty('serviceName', 'KERBEROS') || this.get('content.isConfigGroupDeleted'); + }.property('content.serviceName', 'content.isConfigGroupDeleted') }), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/d50518c1/ambari-web/test/views/main/dashboard/config_history_view_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/dashboard/config_history_view_test.js b/ambari-web/test/views/main/dashboard/config_history_view_test.js index af1733d..d799c44 100644 --- a/ambari-web/test/views/main/dashboard/config_history_view_test.js +++ b/ambari-web/test/views/main/dashboard/config_history_view_test.js @@ -204,11 +204,12 @@ describe('App.MainConfigHistoryView', function() { }); describe("#ConfigVersionView", function () { - var subView = view.get('ConfigVersionView').create({ - parentView: view - }); - + var subView; before(function () { + subView = view.get('ConfigVersionView').create({ + parentView: view + }); + sinon.stub(App, 'tooltip', Em.K); }); after(function () { @@ -223,6 +224,33 @@ describe('App.MainConfigHistoryView', function() { subView.toggleShowLessStatus(); expect(subView.get('showLessNotes')).to.be.false; }); + + describe("#isServiceLinkDisable", function () { + beforeEach(function () { + subView.set('content', Em.Object.create()); + this.hasKerberos = sinon.stub(App.Service, 'find'); + }); + afterEach(function () { + App.Service.find.restore(); + }); + it("should be true for deleted kerberos groups", function () { + subView.set('content.serviceName', 'KERBEROS'); + this.hasKerberos.returns([]); + expect(subView.get('isServiceLinkDisabled')).to.be.true; + }); + it("should be false for deleted kerberos groups", function () { + subView.set('content.serviceName', 'KERBEROS'); + subView.set('content.isConfigGroupDeleted', false); + this.hasKerberos.returns([{serviceName: 'KERBEROS'}]); + expect(subView.get('isServiceLinkDisabled')).to.be.false; + }); + it("should be true if group is deleted", function () { + subView.set('content.serviceName', 'KERBEROS'); + subView.set('content.isConfigGroupDeleted', true); + this.hasKerberos.returns([{serviceName: 'KERBEROS'}]); + expect(subView.get('isServiceLinkDisabled')).to.be.true; + }); + }); }); describe('#didInsertElement()', function() {