syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [syncope] branch 2_1_X updated: Applying enhanced SearchConditionBuilder
Date Tue, 24 Mar 2020 11:43:26 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/2_1_X by this push:
     new 5fc9a49  Applying enhanced SearchConditionBuilder
5fc9a49 is described below

commit 5fc9a49b05e408a3cc92cf8a65b2e15d6c19e559
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
AuthorDate: Tue Mar 24 12:43:12 2020 +0100

    Applying enhanced SearchConditionBuilder
---
 .../syncope/client/console/panels/AnyPanel.java    |  1 -
 .../client/console/panels/GroupDirectoryPanel.java | 29 ++++++++++------------
 .../client/console/panels/RoleDirectoryPanel.java  |  7 +++---
 .../client/console/wizards/WizardMgtPanel.java     | 12 +++++++++
 .../syncope/client/console/wizards/any/Groups.java |  2 +-
 5 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
index c3fd912..bb62175 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
@@ -82,7 +82,6 @@ public class AnyPanel extends Panel implements ModalPanel {
 
     protected static DirectoryPanelSupplier DEFAULT_DIRECTORYPANEL_SUPPLIER =
             (id, anyTypeTO, realmTO, anyLayout, pageRef) -> {
-
                 AnyTypeClassRestClient anyTypeClassRestClient = new AnyTypeClassRestClient();
 
                 final Panel panel;
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDirectoryPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDirectoryPanel.java
index 33734ae..be99f89 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDirectoryPanel.java
@@ -109,38 +109,35 @@ public class GroupDirectoryPanel extends AnyDirectoryPanel<GroupTO,
GroupRestCli
                         (id, anyTypeTO, realmTO, anyLayout, pageRef) -> {
                             final Panel panel;
                             if (AnyTypeKind.USER.name().equals(type)) {
-                                String query = SyncopeClient.getUserSearchConditionBuilder().and(
-                                        SyncopeClient.getUserSearchConditionBuilder().inGroups(groupTO.getKey()),
-                                        SyncopeClient.getUserSearchConditionBuilder().
-                                                is(Constants.KEY_FIELD_NAME).notNullValue()).query();
+                                String fiql = SyncopeClient.getUserSearchConditionBuilder().
+                                        inGroups(groupTO.getKey()).
+                                        and(Constants.KEY_FIELD_NAME).notNullValue().query();
 
                                 panel = new UserDirectoryPanel.Builder(
                                         classRestClient.list(anyTypeTO.getClasses()), anyTypeTO.getKey(),
pageRef).
                                         setRealm(SyncopeConstants.ROOT_REALM).
                                         setFiltered(true).
-                                        setFiql(query).
+                                        setFiql(fiql).
                                         disableCheckBoxes().
-                                        addNewItemPanelBuilder(
-                                                AnyLayoutUtils.newLayoutInfo(
-                                                        new UserTO(),
-                                                        anyTypeTO.getClasses(),
-                                                        anyLayout.getUser(),
-                                                        pageRef), false).
+                                        addNewItemPanelBuilder(AnyLayoutUtils.newLayoutInfo(
+                                                new UserTO(),
+                                                anyTypeTO.getClasses(),
+                                                anyLayout.getUser(),
+                                                pageRef), false).
                                         setWizardInModal(false).build(id);
 
                                 MetaDataRoleAuthorizationStrategy.authorize(
                                         panel, WebPage.RENDER, StandardEntitlement.USER_SEARCH);
                             } else {
-                                String query = SyncopeClient.getAnyObjectSearchConditionBuilder(type).and(
-                                        SyncopeClient.getUserSearchConditionBuilder().inGroups(groupTO.getKey()),
-                                        SyncopeClient.getUserSearchConditionBuilder().
-                                                is(Constants.KEY_FIELD_NAME).notNullValue()).query();
+                                String fiql = SyncopeClient.getAnyObjectSearchConditionBuilder(type).
+                                        inGroups(groupTO.getKey()).
+                                        and(Constants.KEY_FIELD_NAME).notNullValue().query();
 
                                 panel = new AnyObjectDirectoryPanel.Builder(
                                         classRestClient.list(anyTypeTO.getClasses()), anyTypeTO.getKey(),
pageRef).
                                         setRealm(SyncopeConstants.ROOT_REALM).
                                         setFiltered(true).
-                                        setFiql(query).
+                                        setFiql(fiql).
                                         disableCheckBoxes().
                                         addNewItemPanelBuilder(AnyLayoutUtils.newLayoutInfo(
                                                 new AnyObjectTO(),
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDirectoryPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDirectoryPanel.java
index 222a200..3899f63 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDirectoryPanel.java
@@ -169,10 +169,9 @@ public class RoleDirectoryPanel extends DirectoryPanel<RoleTO, RoleWrapper,
Role
                         layout.getAnyPanelClass(),
                         BaseModal.CONTENT_ID, userType, null, layout, false,
                         (id, anyTypeTO, realmTO, anyLayout, pageRef) -> {
-                            String query = SyncopeClient.getUserSearchConditionBuilder().and(
-                                    SyncopeClient.getUserSearchConditionBuilder().inRoles(model.getObject().getKey()),
-                                    SyncopeClient.getUserSearchConditionBuilder().
-                                            is(Constants.KEY_FIELD_NAME).notNullValue()).
+                            String query = SyncopeClient.getUserSearchConditionBuilder().
+                                    inRoles(model.getObject().getKey()).
+                                    and(Constants.KEY_FIELD_NAME).notNullValue().
                                     query();
 
                             Panel panel = new UserDirectoryPanel.Builder(
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
index 6924d8a..3d221dd 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
@@ -164,6 +164,18 @@ public abstract class WizardMgtPanel<T extends Serializable> extends
Panel imple
         return actualId;
     }
 
+    public boolean isWizardInModal() {
+        return wizardInModal;
+    }
+
+    public ModalPanelBuilder<T> getNewItemPanelBuilder() {
+        return newItemPanelBuilder;
+    }
+
+    public boolean isNewItemDefaultButtonEnabled() {
+        return addAjaxLink.isVisible() && addAjaxLink.isEnabled();
+    }
+
     @Override
     @SuppressWarnings("unchecked")
     public void onEvent(final IEvent<?> event) {
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
index 7dd86c4..bdc2730 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
@@ -135,7 +135,7 @@ public class Groups extends AbstractGroups {
                             : groupRestClient.search(
                                     anyTO.getRealm(),
                                     SyncopeClient.getGroupSearchConditionBuilder().
-                                            isAssignable().and().is("name").equalToIgnoreCase(filter).query(),
+                                            isAssignable().and("name").equalToIgnoreCase(filter).query(),
                                     1, Constants.MAX_GROUP_LIST_SIZE,
                                     new SortParam<>("name", true),
                                     null)).stream().map(input -> {


Mime
View raw message