You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/01/23 12:44:25 UTC

[syncope] 01/02: White noise

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit d3c7d2ccdac93685026b219df83cfebb33c2f6ae
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Thu Jan 23 12:43:26 2020 +0100

    White noise
---
 .../client/console/commons/AnyDataProvider.java    | 22 ++++++++++------------
 .../console/wizards/any/AnyObjectDetails.java      |  6 ++----
 .../client/console/wizards/any/GroupDetails.java   |  5 ++---
 .../client/console/wizards/any/UserDetails.java    |  1 -
 4 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/commons/AnyDataProvider.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/commons/AnyDataProvider.java
index f8e6899..2f4dc17 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/commons/AnyDataProvider.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/commons/AnyDataProvider.java
@@ -18,8 +18,6 @@
  */
 package org.apache.syncope.client.console.commons;
 
-import org.apache.syncope.client.ui.commons.DirectoryDataProvider;
-
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -28,6 +26,7 @@ import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.client.console.pages.BasePage;
 import org.apache.syncope.client.console.rest.AbstractAnyRestClient;
 import org.apache.syncope.client.ui.commons.Constants;
+import org.apache.syncope.client.ui.commons.DirectoryDataProvider;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -44,19 +43,19 @@ public class AnyDataProvider<A extends AnyTO> extends DirectoryDataProvider<A> {
 
     protected static final Logger LOG = LoggerFactory.getLogger(AnyDataProvider.class);
 
-    private final SortableAnyProviderComparator<A> comparator;
+    protected final SortableAnyProviderComparator<A> comparator;
 
-    private final AbstractAnyRestClient<A> restClient;
+    protected final AbstractAnyRestClient<A> restClient;
 
     protected String fiql;
 
     protected final boolean filtered;
 
-    private final String realm;
+    protected final String realm;
 
-    private final String type;
+    protected final String type;
 
-    private final PageReference pageRef;
+    protected final PageReference pageRef;
 
     public AnyDataProvider(
             final AbstractAnyRestClient<A> restClient,
@@ -112,8 +111,8 @@ public class AnyDataProvider<A extends AnyTO> extends DirectoryDataProvider<A> {
             SyncopeConsoleSession.get().onException(e);
 
             Optional<AjaxRequestTarget> target = RequestCycle.get().find(AjaxRequestTarget.class);
-            target.ifPresent(ajaxRequestTarget ->
-                ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(ajaxRequestTarget));
+            target.ifPresent(ajaxRequestTarget
+                    -> ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(ajaxRequestTarget));
         }
 
         result.sort(comparator);
@@ -134,9 +133,8 @@ public class AnyDataProvider<A extends AnyTO> extends DirectoryDataProvider<A> {
             LOG.error("While requesting for size() with FIQL {}", fiql, e);
             SyncopeConsoleSession.get().onException(e);
 
-            Optional<AjaxRequestTarget> target = RequestCycle.get().find(AjaxRequestTarget.class);
-            target.ifPresent(ajaxRequestTarget ->
-                ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(ajaxRequestTarget));
+            RequestCycle.get().find(AjaxRequestTarget.class).
+                    ifPresent(target -> ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target));
         }
 
         return result;
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyObjectDetails.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyObjectDetails.java
index d4c1923..1a1be0c 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyObjectDetails.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyObjectDetails.java
@@ -36,10 +36,8 @@ public class AnyObjectDetails extends Details<AnyObjectTO> {
 
         super(wrapper, templateMode, includeStatusPanel, pageRef);
 
-        AnyObjectTO anyObjectTO = wrapper.getInnerObject();
-
-        AjaxTextFieldPanel name =
-                new AjaxTextFieldPanel("name", "name", new PropertyModel<>(anyObjectTO, "name"), false);
+        AjaxTextFieldPanel name = new AjaxTextFieldPanel(
+                "name", "name", new PropertyModel<>(wrapper.getInnerObject(), "name"), false);
         if (templateMode) {
             name.enableJexlHelp();
         } else {
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java
index 641fc64..198ced2 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java
@@ -35,9 +35,8 @@ public class GroupDetails extends Details<GroupTO> {
 
         super(wrapper, templateMode, includeStatusPanel, pageRef);
 
-        GroupTO groupTO = GroupWrapper.class.cast(wrapper).getInnerObject();
-
-        AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", "name", new PropertyModel<>(groupTO, "name"), false);
+        AjaxTextFieldPanel name = new AjaxTextFieldPanel(
+                "name", "name", new PropertyModel<>(wrapper.getInnerObject(), "name"), false);
         if (templateMode) {
             name.enableJexlHelp();
         } else {
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
index bca9994..57fe136 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
@@ -143,6 +143,5 @@ public class UserDetails extends Details<UserTO> {
             add(new Label("warning", new ResourceModel("password.change.warning")));
             add(new PasswordPanel("passwordPanel", wrapper, templateMode));
         }
-
     }
 }