You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by dr...@apache.org on 2017/02/27 13:53:17 UTC

[1/2] brooklyn-ui git commit: Use the "itemType" to redirect the user to the right page after a catalog import

Repository: brooklyn-ui
Updated Branches:
  refs/heads/master f45d697b1 -> 9c2d7f706


Use the "itemType" to redirect the user to the right page after a catalog import


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

Branch: refs/heads/master
Commit: e0e02e04a0f3b720808a4e3b2984b3289595117b
Parents: f45d697
Author: Thomas Bouron <th...@cloudsoftcorp.com>
Authored: Tue Feb 21 17:46:35 2017 +0000
Committer: Thomas Bouron <th...@cloudsoftcorp.com>
Committed: Tue Feb 21 17:46:35 2017 +0000

----------------------------------------------------------------------
 src/main/webapp/assets/js/view/editor.js | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/e0e02e04/src/main/webapp/assets/js/view/editor.js
----------------------------------------------------------------------
diff --git a/src/main/webapp/assets/js/view/editor.js b/src/main/webapp/assets/js/view/editor.js
index 53f12f3..5d10100 100644
--- a/src/main/webapp/assets/js/view/editor.js
+++ b/src/main/webapp/assets/js/view/editor.js
@@ -335,7 +335,30 @@ define([
             if(succeeded){
                 log("Submit [succeeded] ... redirecting back to " + type);
                 if(type && type === 'catalog'){
-                    Backbone.history.navigate('v1/catalog', {trigger: true});
+                    var firstItem;
+                    var keys = _.keys(data);
+                    if (keys.length > 0) {
+                        firstItem = data[keys[0]];
+                    }
+                    var url = 'v1/catalog';
+                    if (firstItem) {
+                        switch (firstItem.itemType) {
+                            case 'template':
+                                url += '/applications';
+                                break;
+                            case 'entity':
+                                url += '/entities';
+                                break;
+                            case 'policy':
+                                url += '/policies';
+                                break;
+                            case 'location':
+                                url += '/locations';
+                                break;
+                        }
+                        url += '/' + firstItem.id;
+                    }
+                    Backbone.history.navigate(url, {trigger: true});
                 }else{
                     // no need to refresh apps (this.collection) because homePage route does that
                     Backbone.history.navigate('v1/home', {trigger: true});


[2/2] brooklyn-ui git commit: This closes #42

Posted by dr...@apache.org.
This closes #42


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

Branch: refs/heads/master
Commit: 9c2d7f7062873d18fb8116113c4b35d335a09c22
Parents: f45d697 e0e02e0
Author: Duncan Godwin <dr...@googlemail.com>
Authored: Mon Feb 27 13:52:58 2017 +0000
Committer: Duncan Godwin <dr...@googlemail.com>
Committed: Mon Feb 27 13:52:58 2017 +0000

----------------------------------------------------------------------
 src/main/webapp/assets/js/view/editor.js | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------