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 B99E1200B8F for ; Fri, 30 Sep 2016 18:30:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B85D2160AD9; Fri, 30 Sep 2016 16:30:02 +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 30D8B160AB4 for ; Fri, 30 Sep 2016 18:30:02 +0200 (CEST) Received: (qmail 49082 invoked by uid 500); 30 Sep 2016 16:30:01 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 49057 invoked by uid 99); 30 Sep 2016 16:30:01 -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; Fri, 30 Sep 2016 16:30:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id ED780DFD4C; Fri, 30 Sep 2016 16:30:00 +0000 (UTC) From: neykov To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org References: In-Reply-To: Subject: [GitHub] brooklyn-ui pull request #34: Use new pinned and constraints flag returned b... Content-Type: text/plain Message-Id: <20160930163000.ED780DFD4C@git1-us-west.apache.org> Date: Fri, 30 Sep 2016 16:30:00 +0000 (UTC) archived-at: Fri, 30 Sep 2016 16:30:02 -0000 Github user neykov commented on a diff in the pull request: https://github.com/apache/brooklyn-ui/pull/34#discussion_r81372539 --- Diff: src/main/webapp/assets/js/view/application-add-wizard.js --- @@ -680,10 +680,12 @@ define([ this.$('.required-config-loading').hide() if (catalogEntryItem!=null && catalogEntryItem.config!=null) { var that = this - _.each(catalogEntryItem.config, function (cfg) { - if (cfg.priority !== undefined) { + _.chain(catalogEntryItem.config).sortBy(function (cfg){ + return !isNaN(cfg.priority) ? cfg.priority : 99999; + }).each(function (cfg) { + if (cfg.pinned === true || (cfg.contraints.indexOf('required') > -1 && typeof cfg.defaultValue === 'string' && cfg.defaultValue === '')) { --- End diff -- Agree, that's my point. `defaultValue == null` on the server side is serialized as missing (`undefined`) on the wire. Which means that `cfg.contraints.indexOf('required') > -1 && typeof cfg.defaultValue === 'string' && cfg.defaultValue === ''` will be `false` for `undefined`. So it will not be shown, even if required. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---