Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5759B1860D for ; Sun, 13 Dec 2015 22:25:22 +0000 (UTC) Received: (qmail 7625 invoked by uid 500); 13 Dec 2015 22:25:22 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 7595 invoked by uid 500); 13 Dec 2015 22:25:22 -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 7586 invoked by uid 99); 13 Dec 2015 22:25:22 -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; Sun, 13 Dec 2015 22:25:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 19575DFDD0; Sun, 13 Dec 2015 22:25:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jaimin@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-14358. On Add service wizard, Ranger Admin Tab shows red badge for unknown property. (Jaimin Jetly) Date: Sun, 13 Dec 2015 22:25:22 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 7edea1cda -> f4325f441 AMBARI-14358. On Add service wizard, Ranger Admin Tab shows red badge for unknown property. (Jaimin Jetly) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f4325f44 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f4325f44 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f4325f44 Branch: refs/heads/trunk Commit: f4325f4411f7710137aa2f9a3a9a13b79a676652 Parents: 7edea1c Author: Jaimin Jetly Authored: Sun Dec 13 14:24:56 2015 -0800 Committer: Jaimin Jetly Committed: Sun Dec 13 14:25:18 2015 -0800 ---------------------------------------------------------------------- .../app/models/configs/objects/service_config_property.js | 2 +- .../models/configs/objects/service_config_property_test.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f4325f44/ambari-web/app/models/configs/objects/service_config_property.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/configs/objects/service_config_property.js b/ambari-web/app/models/configs/objects/service_config_property.js index 3b2b531..feeb976 100644 --- a/ambari-web/app/models/configs/objects/service_config_property.js +++ b/ambari-web/app/models/configs/objects/service_config_property.js @@ -330,7 +330,7 @@ App.ServiceConfigProperty = Em.Object.extend({ var isWarn = false; if (typeof value === 'string' && value.length === 0) { - if (this.get('isRequired')) { + if (this.get('isRequired') && this.get('widgetType') != 'test-db-connection') { this.set('errorMessage', 'This is required'); isError = true; } else { http://git-wip-us.apache.org/repos/asf/ambari/blob/f4325f44/ambari-web/test/models/configs/objects/service_config_property_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/models/configs/objects/service_config_property_test.js b/ambari-web/test/models/configs/objects/service_config_property_test.js index e292109..346367f 100644 --- a/ambari-web/test/models/configs/objects/service_config_property_test.js +++ b/ambari-web/test/models/configs/objects/service_config_property_test.js @@ -473,6 +473,15 @@ describe('App.ServiceConfigProperty', function () { expect(serviceConfigProperty.get('errorMessage')).to.be.empty; expect(serviceConfigProperty.get('error')).to.be.false; }); + it('test-db-connection widget', function () { + serviceConfigProperty.setProperties({ + isRequired: true, + widgetType: 'test-db-connection', + value: '' + }); + expect(serviceConfigProperty.get('errorMessage')).to.be.empty; + expect(serviceConfigProperty.get('error')).to.be.false; + }); it('should validate', function () { serviceConfigProperty.setProperties({ isRequired: true,