Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-ui/pull/34#discussion_r81366730
  
    --- 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 --
    
    This doesn't handle `defaultValue == null` (or is null converted to `''` 
somethere?).
    Could do:
    ```
    cfg.pinned || (cfg.contraints.indexOf('required') > -1 && (cfg.defaultValue 
=== undefined || cfg.defaultValue === ''))
    ```
    
    `undefined` because `null` values won't be included in the response.
    
    Would be weird to have a `defaultValue` the empty string and required at 
the same time, but you never know :).


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to