You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by sk...@apache.org on 2017/08/03 14:30:16 UTC
syncope git commit: [SYNCOPE-1171] 'Relationships' wizard step is now
skipped when no relationship types exist
Repository: syncope
Updated Branches:
refs/heads/2_0_X 50c8df89c -> 923f64a87
[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/923f64a8
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/923f64a8
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/923f64a8
Branch: refs/heads/2_0_X
Commit: 923f64a87eae8c7baecb88e110e1d55491acbf42
Parents: 50c8df8
Author: skylark17 <ma...@tirasa.net>
Authored: Thu Aug 3 16:30:04 2017 +0200
Committer: skylark17 <ma...@tirasa.net>
Committed: Thu Aug 3 16:30:04 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/923f64a8/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();