syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/2] syncope git commit: Realm is correctly loaded after creation for SYNCOPE-1151 - This closes #54
Date Thu, 13 Jul 2017 13:24:05 GMT
Realm is correctly loaded after creation for SYNCOPE-1151 - This closes #54


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

Branch: refs/heads/master
Commit: d7fbfe4862851bc5d7833dbb293c6b3f4b5185d5
Parents: 21ea877
Author: Matteo Alessandroni <matteo.alessandroni@tirasa.net>
Authored: Thu Jul 13 15:16:45 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Thu Jul 13 15:23:48 2017 +0200

----------------------------------------------------------------------
 .../apache/syncope/client/console/pages/Realms.java    | 13 ++++++++-----
 .../client/console/panels/RealmChoicePanel.java        |  8 +++++++-
 2 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/d7fbfe48/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
index f5a523d..b801cf3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
@@ -45,6 +45,7 @@ import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.model.CompoundPropertyModel;
 import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 
 public class Realms extends BasePage {
@@ -192,16 +193,18 @@ public class Realms extends BasePage {
 
                     @Override
                     public void onClose(final AjaxRequestTarget target) {
-                        target.add(realmChoicePanel.reloadRealmTree(target));
-
                         if (modal.getContent() instanceof ResultPage) {
                             Serializable result = ResultPage.class.cast(modal.getContent()).getResult();
 
-                            updateRealmContent(RealmTO.class.cast(
-                                    ProvisioningResult.class.cast(result).getEntity()), selectedIndex);
+                            RealmTO reamTO = RealmTO.class.cast(ProvisioningResult.class.cast(result).getEntity());
+                            // reload realmChoicePanel label too - SYNCOPE-1151
+                            target.add(realmChoicePanel.reloadRealmTree(target, Model.of(reamTO)));
+                            updateRealmContent(reamTO, selectedIndex);
+
                             target.add(content);
+                        } else {
+                            target.add(realmChoicePanel.reloadRealmTree(target));
                         }
-
                         modal.show(false);
                     }
                 });

http://git-wip-us.apache.org/repos/asf/syncope/blob/d7fbfe48/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
index d569b14..51f766a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmChoicePanel.java
@@ -70,7 +70,7 @@ public class RealmChoicePanel extends Panel {
 
     private final WebMarkupContainer container;
 
-    private final Model<RealmTO> model;
+    private Model<RealmTO> model;
 
     private final Collection<String> availableRealms;
 
@@ -314,6 +314,12 @@ public class RealmChoicePanel extends Panel {
         return this;
     }
 
+    public final RealmChoicePanel reloadRealmTree(final AjaxRequestTarget target, final Model<RealmTO>
newModel) {
+        model = newModel;
+        reloadRealmTree(target);
+        return this;
+    }
+
     private Map<String, Pair<RealmTO, List<RealmTO>>> reloadRealmParentMap()
{
         final List<RealmTO> realms = realmRestClient.list();
         Collections.sort(realms, new RealmNameComparator());


Mime
View raw message