You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/09/30 16:38:08 UTC

[1/2] brooklyn-ui git commit: Use new pinned and constraints flag to work out which parameter need to be displayed on the app wizard

Repository: brooklyn-ui
Updated Branches:
  refs/heads/master ef66e69e5 -> 48f82d6be


Use new pinned and constraints flag to work out which parameter need to be displayed on the app wizard


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/387230ac
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/387230ac
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/387230ac

Branch: refs/heads/master
Commit: 387230ac4f730aa46223791bf6d1734f792c142c
Parents: ef66e69
Author: Thomas Bouron <th...@cloudsoftcorp.com>
Authored: Wed Sep 28 12:41:54 2016 +0100
Committer: Thomas Bouron <th...@cloudsoftcorp.com>
Committed: Fri Sep 30 17:36:00 2016 +0100

----------------------------------------------------------------------
 src/main/webapp/assets/js/view/application-add-wizard.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/387230ac/src/main/webapp/assets/js/view/application-add-wizard.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/application-add-wizard.js b/src/main/webapp/assets/js/view/application-add-wizard.js
index 1e1b595..c656491 100644
--- a/src/main/webapp/assets/js/view/application-add-wizard.js
+++ b/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 && (cfg.defaultValue === undefined || cfg.defaultValue === ''))) {
                             var html = _.template(RequiredConfigEntryHtml, {data:cfg});
-                            that.$('.config-table').append(html)
+                            that.$('.config-table').append(html);
                         }
                     })
                 }


[2/2] brooklyn-ui git commit: Closes #34

Posted by sv...@apache.org.
Closes #34

Use new pinned and constraints flag returned by the REST API

This allows the UI to work out which parameters need to be displayed on the app wizard, following this convention:
- if a parameter if marked as `pinned`, it is always displayed
- if a parameter has a `required` constraint and empty `defaultValue`, it is displayed

Everything is sorted by the priority

This is based on https://github.com/apache/brooklyn-server/pull/358 (to be merged first)


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/48f82d6b
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/48f82d6b
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/48f82d6b

Branch: refs/heads/master
Commit: 48f82d6be42f3582730701d17918134a2dee250b
Parents: ef66e69 387230a
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Fri Sep 30 19:37:59 2016 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Fri Sep 30 19:37:59 2016 +0300

----------------------------------------------------------------------
 src/main/webapp/assets/js/view/application-add-wizard.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------