syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skylar...@apache.org
Subject syncope git commit: [SYNCOPE-1171] 'Relationships' wizard step is now skipped when no relationship types exist
Date Thu, 03 Aug 2017 14:31:47 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 0c2414c1a -> aa1e117c7


[SYNCOPE-1171] 'Relationships' wizard step is now skipped when no relationship types exist


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

Branch: refs/heads/master
Commit: aa1e117c7232932789d878e7749d7124a7bbc2f7
Parents: 0c2414c
Author: skylark17 <matteo.alessandroni@tirasa.net>
Authored: Thu Aug 3 16:30:04 2017 +0200
Committer: skylark17 <matteo.alessandroni@tirasa.net>
Committed: Thu Aug 3 16:30:51 2017 +0200

----------------------------------------------------------------------
 .../client/console/wizards/any/Relationships.java     | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/aa1e117c/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java
index 1cc758c..115da51 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.console.wizards.any;
 
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -69,6 +70,7 @@ import org.apache.wicket.event.IEvent;
 import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
 import org.apache.wicket.extensions.markup.html.tabs.ITab;
 import org.apache.wicket.extensions.wizard.IWizard;
+import org.apache.wicket.extensions.wizard.WizardModel;
 import org.apache.wicket.extensions.wizard.WizardStep;
 import org.apache.wicket.markup.head.IHeaderResponse;
 import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
@@ -82,7 +84,7 @@ import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.model.util.ListModel;
 
-public class Relationships extends WizardStep {
+public class Relationships extends WizardStep implements WizardModel.ICondition {
 
     private static final long serialVersionUID = 855618618337931784L;
 
@@ -93,6 +95,8 @@ public class Relationships extends WizardStep {
     private final AnyTypeClassRestClient anyTypeClassRestClient = new AnyTypeClassRestClient();
 
     private final AnyTO anyTO;
+    
+    private final RelationshipTypeRestClient relationshipTypeRestClient = new RelationshipTypeRestClient();
 
     public Relationships(final AnyWrapper<?> modelObject, final PageReference pageRef)
{
         super();
@@ -233,6 +237,12 @@ public class Relationships extends WizardStep {
         }
     }
 
+    @Override
+    public boolean evaluate() {
+        // [SYNCOPE-1171] - skip current step when the are no relationships types in Syncope
+        return !relationshipTypeRestClient.list().isEmpty();
+    }
+
     public class Specification extends Panel {
 
         private static final long serialVersionUID = 6199050589175839467L;
@@ -243,8 +253,6 @@ public class Relationships extends WizardStep {
 
         private WizardMgtPanel<AnyWrapper<AnyObjectTO>> anyObjectDirectoryPanel;
 
-        private final RelationshipTypeRestClient relationshipTypeRestClient = new RelationshipTypeRestClient();
-
         public Specification() {
             super("specification");
             rel = new RelationshipTO();


Mime
View raw message