syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject syncope git commit: [SYNCOPE-803] Now more evident that toggle button are for connector property override
Date Fri, 01 Apr 2016 09:25:45 GMT
Repository: syncope
Updated Branches:
  refs/heads/master ab0551c8d -> 0e5b127be


[SYNCOPE-803] Now more evident that toggle button are for connector property override


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

Branch: refs/heads/master
Commit: 0e5b127be2a4fbea11fc54591f844d7f36ae53e3
Parents: ab0551c
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri Apr 1 11:25:36 2016 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Apr 1 11:25:36 2016 +0200

----------------------------------------------------------------------
 .../panels/AbstractConnectorConfPanel.java      | 45 +++++++++-----------
 .../console/panels/ConnectorConfPanel.java      |  9 +---
 .../client/console/panels/ConnectorModal.java   | 11 +++--
 .../client/console/panels/ResourceModal.java    | 20 ++++++---
 .../panels/search/SearchClausePanel.java        | 18 ++++----
 .../wicket/markup/html/form/FieldPanel.java     |  5 +--
 .../html/list/ConnConfPropertyListView.java     | 25 +++++++----
 .../client/console/wizards/any/Ownership.java   | 18 ++++----
 .../META-INF/resources/css/syncopeConsole.css   |  9 ++++
 9 files changed, 84 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/0e5b127b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractConnectorConfPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractConnectorConfPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractConnectorConfPanel.java
index c055c95..3b24fad 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractConnectorConfPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractConnectorConfPanel.java
@@ -36,11 +36,6 @@ import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.ResourceModel;
 
-/**
- * Modal window with Connector form.
- *
- * @param <T> model type.
- */
 public abstract class AbstractConnectorConfPanel<T extends AbstractBaseBean> extends
Panel {
 
     private static final long serialVersionUID = -2025535531121434050L;
@@ -52,7 +47,6 @@ public abstract class AbstractConnectorConfPanel<T extends AbstractBaseBean>
ext
     protected final IModel<T> model;
 
     public AbstractConnectorConfPanel(final String id, final IModel<T> model) {
-
         super(id, model);
         this.model = model;
         setOutputMarkupId(true);
@@ -74,33 +68,32 @@ public abstract class AbstractConnectorConfPanel<T extends AbstractBaseBean>
ext
     }
 
     protected void setConfPropertyListView(final String modelExpression, final boolean withOverridable)
{
-
         final ConnConfPropertyListView connPropView = new ConnConfPropertyListView(
                 "connectorProperties",
                 new PropertyModel<List<ConnConfProperty>>(model.getObject(),
modelExpression) {
 
-                    private static final long serialVersionUID = 1L;
+            private static final long serialVersionUID = -7809699384012595307L;
+
+            @Override
+            public List<ConnConfProperty> getObject() {
+                final List<ConnConfProperty> res = new ArrayList<>((Set<ConnConfProperty>)
super.getObject());
+
+                // re-order properties
+                Collections.sort(res, new Comparator<ConnConfProperty>() {
 
                     @Override
-                    public List<ConnConfProperty> getObject() {
-                        final List<ConnConfProperty> res = new ArrayList<>((Set<ConnConfProperty>)
super.getObject());
-
-                        // re-order properties
-                        Collections.sort(res, new Comparator<ConnConfProperty>() {
-
-                            @Override
-                            public int compare(final ConnConfProperty left, final ConnConfProperty
right) {
-                                if (left == null) {
-                                    return -1;
-                                } else {
-                                    return left.compareTo(right);
-                                }
-                            }
-                        });
-
-                        return res;
+                    public int compare(final ConnConfProperty left, final ConnConfProperty
right) {
+                        if (left == null) {
+                            return -1;
+                        } else {
+                            return left.compareTo(right);
+                        }
                     }
-                },
+                });
+
+                return res;
+            }
+        },
                 withOverridable
         );
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/0e5b127b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorConfPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorConfPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorConfPanel.java
index a487ee8..0c541b5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorConfPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorConfPanel.java
@@ -28,9 +28,6 @@ import org.apache.syncope.common.lib.types.ConnConfPropSchema;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
 import org.apache.wicket.model.IModel;
 
-/**
- * Modal window with Connector form.
- */
 public abstract class ConnectorConfPanel extends AbstractConnectorConfPanel<ConnInstanceTO>
{
 
     private static final long serialVersionUID = -2025535531121434050L;
@@ -38,11 +35,10 @@ public abstract class ConnectorConfPanel extends AbstractConnectorConfPanel<Conn
     private final List<ConnBundleTO> bundles;
 
     public ConnectorConfPanel(final String id, final IModel<ConnInstanceTO> model,
final List<ConnBundleTO> bundles) {
-
         super(id, model);
         this.bundles = bundles;
 
-        final List<ConnConfProperty> properties = getConnProperties(model.getObject());
+        List<ConnConfProperty> properties = getConnProperties(model.getObject());
         model.getObject().getConf().clear();
         model.getObject().getConf().addAll(properties);
 
@@ -57,7 +53,6 @@ public abstract class ConnectorConfPanel extends AbstractConnectorConfPanel<Conn
      */
     @Override
     protected final List<ConnConfProperty> getConnProperties(final ConnInstanceTO instance)
{
-
         final List<ConnConfProperty> res = CollectionUtils.collect(
                 ConnectorModal.getBundle(instance, bundles).getProperties(),
                 new Transformer<ConnConfPropSchema, ConnConfProperty>() {
@@ -67,7 +62,7 @@ public abstract class ConnectorConfPanel extends AbstractConnectorConfPanel<Conn
                 final ConnConfProperty property = new ConnConfProperty();
                 property.setSchema(key);
 
-                if (instance.getKey() != null 
+                if (instance.getKey() != null
                         && instance.getConfMap().containsKey(key.getName())
                         && instance.getConfMap().get(key.getName()).getValues() !=
null) {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/0e5b127b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
index f47d9bb..15d1b88 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
@@ -37,6 +37,7 @@ import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.event.Broadcast;
 import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
+import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.IModel;
@@ -60,8 +61,7 @@ public class ConnectorModal extends AbstractResourceModal<Serializable>
{
 
         super(modal, pageRef);
 
-        this.bundles = CollectionUtils.select(connectorRestClient.getAllBundles(),
-                new Predicate<ConnBundleTO>() {
+        this.bundles = CollectionUtils.select(connectorRestClient.getAllBundles(), new Predicate<ConnBundleTO>()
{
 
             @Override
             public boolean evaluate(final ConnBundleTO object) {
@@ -94,7 +94,7 @@ public class ConnectorModal extends AbstractResourceModal<Serializable>
{
             public Panel getPanel(final String panelId) {
                 return new ConnectorConfPanel(panelId, model, bundles) {
 
-                    private static final long serialVersionUID = 1L;
+                    private static final long serialVersionUID = -5886691077681158494L;
 
                     @Override
                     protected void check(final AjaxRequestTarget target) {
@@ -106,6 +106,11 @@ public class ConnectorModal extends AbstractResourceModal<Serializable>
{
                         SyncopeConsoleSession.get().getNotificationPanel().refresh(target);
                     }
 
+                    @Override
+                    protected void onComponentTag(final ComponentTag tag) {
+                        tag.append("class", "scrollable-tab-content", " ");
+                    }
+
                 };
             }
         });

http://git-wip-us.apache.org/repos/asf/syncope/blob/0e5b127b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java
index f9ebc9b..3249860 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceModal.java
@@ -45,6 +45,7 @@ import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
 import org.apache.wicket.event.Broadcast;
 import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
+import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.IModel;
@@ -77,7 +78,7 @@ public class ResourceModal<T extends Serializable> extends AbstractResourceModal
         //--------------------------------
         // Resource details panel
         //--------------------------------
-        tabs.add(new AbstractTab(new ResourceModel("general", "general")) {
+        tabs.add(new AbstractTab(new ResourceModel("general")) {
 
             private static final long serialVersionUID = -5861786415855103549L;
 
@@ -92,8 +93,8 @@ public class ResourceModal<T extends Serializable> extends AbstractResourceModal
         //--------------------------------
         // Resource provision panels
         //--------------------------------
-        final ListViewPanel.Builder<ProvisionTO> builder
-                = new ListViewPanel.Builder<ProvisionTO>(ProvisionTO.class, pageRef)
{
+        final ListViewPanel.Builder<ProvisionTO> builder =
+                new ListViewPanel.Builder<ProvisionTO>(ProvisionTO.class, pageRef)
{
 
             private static final long serialVersionUID = 4907732721283972943L;
 
@@ -175,7 +176,7 @@ public class ResourceModal<T extends Serializable> extends AbstractResourceModal
 
         builder.addNewItemPanelBuilder(new ProvisionWizardBuilder("wizard", model.getObject(),
pageRef));
 
-        tabs.add(new AbstractTab(new ResourceModel("provisions", "provisions")) {
+        tabs.add(new AbstractTab(new ResourceModel("provisions")) {
 
             private static final long serialVersionUID = -5861786415855103549L;
 
@@ -189,7 +190,7 @@ public class ResourceModal<T extends Serializable> extends AbstractResourceModal
         //--------------------------------
         // Resource connector configuration panel
         //--------------------------------
-        tabs.add(new AbstractTab(new ResourceModel("connectorProperties", "connectorProperties"))
{
+        tabs.add(new AbstractTab(new ResourceModel("connectorProperties")) {
 
             private static final long serialVersionUID = -5861786415855103549L;
 
@@ -197,7 +198,7 @@ public class ResourceModal<T extends Serializable> extends AbstractResourceModal
             public Panel getPanel(final String panelId) {
                 final ResourceConnConfPanel panel = new ResourceConnConfPanel(panelId, model,
createFlag) {
 
-                    private static final long serialVersionUID = 1L;
+                    private static final long serialVersionUID = -1128269449868933504L;
 
                     @Override
                     protected void check(final AjaxRequestTarget target) {
@@ -208,6 +209,11 @@ public class ResourceModal<T extends Serializable> extends AbstractResourceModal
                         }
                         SyncopeConsoleSession.get().getNotificationPanel().refresh(target);
                     }
+
+                    @Override
+                    protected void onComponentTag(final ComponentTag tag) {
+                        tag.append("class", "scrollable-tab-content", " ");
+                    }
                 };
                 MetaDataRoleAuthorizationStrategy.authorize(panel, ENABLE, StandardEntitlement.CONNECTOR_READ);
                 return panel;
@@ -218,7 +224,7 @@ public class ResourceModal<T extends Serializable> extends AbstractResourceModal
         //--------------------------------
         // Resource security panel
         //--------------------------------
-        tabs.add(new AbstractTab(new ResourceModel("security", "security")) {
+        tabs.add(new AbstractTab(new ResourceModel("security")) {
 
             private static final long serialVersionUID = -5861786415855103549L;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/0e5b127b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
index df52f8c..8008119 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
@@ -265,16 +265,14 @@ public class SearchClausePanel extends FieldPanel<SearchClause>
{
         operatorContainer.setOutputMarkupId(true);
         field.add(operatorContainer);
 
-        final BootstrapToggleConfig config = new BootstrapToggleConfig();
-        config
-                .withOnStyle(BootstrapToggleConfig.Style.info).withOffStyle(BootstrapToggleConfig.Style.warning)
-                .withSize(BootstrapToggleConfig.Size.mini)
-                .withOnLabel("AND")
-                .withOffLabel("OR");
+        final BootstrapToggleConfig config = new BootstrapToggleConfig().
+                withOnStyle(BootstrapToggleConfig.Style.info).
+                withOffStyle(BootstrapToggleConfig.Style.warning).
+                withSize(BootstrapToggleConfig.Size.mini);
 
         operatorFragment.add(new BootstrapToggle("operator", new Model<Boolean>() {
 
-            private static final long serialVersionUID = 1L;
+            private static final long serialVersionUID = -7157802546272668001L;
 
             @Override
             public Boolean getObject() {
@@ -287,16 +285,16 @@ public class SearchClausePanel extends FieldPanel<SearchClause>
{
             }
         }, config) {
 
-            private static final long serialVersionUID = 1L;
+            private static final long serialVersionUID = 2969634208049189343L;
 
             @Override
             protected IModel<String> getOffLabel() {
-                return Model.of(getString("Off", null, "OR"));
+                return Model.of("OR");
             }
 
             @Override
             protected IModel<String> getOnLabel() {
-                return Model.of(getString("On", null, "AND"));
+                return Model.of("AND");
             }
 
             @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/0e5b127b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
index 1d5171c..23c4e51 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.java
@@ -58,10 +58,7 @@ public abstract class FieldPanel<T extends Serializable> extends
AbstractFieldPa
 
     public FieldPanel<T> setTitle(final String title) {
         this.title = title;
-        field.add(AttributeModifier.replace("title", title != null
-                ? title
-                : ""));
-
+        field.add(AttributeModifier.replace("title", title == null ? StringUtils.EMPTY :
title));
         return this;
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/0e5b127b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/ConnConfPropertyListView.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/ConnConfPropertyListView.java
b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/ConnConfPropertyListView.java
index 344ef53..d5445f1 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/ConnConfPropertyListView.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/list/ConnConfPropertyListView.java
@@ -143,24 +143,21 @@ public class ConnConfPropertyListView extends ListView<ConnConfProperty>
{
     }
 
     private FormComponent<?> addCheckboxToggle(final ConnConfProperty property) {
-
-        final BootstrapToggleConfig config = new BootstrapToggleConfig();
-        config
-                .withOnStyle(BootstrapToggleConfig.Style.info).withOffStyle(BootstrapToggleConfig.Style.warning)
-                .withSize(BootstrapToggleConfig.Size.mini)
-                .withOnLabel("Overridable")
-                .withOffLabel("Not Overridable");
+        final BootstrapToggleConfig config = new BootstrapToggleConfig().
+                withOnStyle(BootstrapToggleConfig.Style.success).
+                withOffStyle(BootstrapToggleConfig.Style.danger).
+                withSize(BootstrapToggleConfig.Size.mini);
 
         return new BootstrapToggle("externalAction", new PropertyModel<Boolean>(property,
"overridable"), config) {
 
-            private static final long serialVersionUID = 1L;
+            private static final long serialVersionUID = -875219845189261873L;
 
             @Override
             protected CheckBox newCheckBox(final String id, final IModel<Boolean> model)
{
                 final CheckBox checkBox = super.newCheckBox(id, model);
                 checkBox.add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE)
{
 
-                    private static final long serialVersionUID = 1L;
+                    private static final long serialVersionUID = -1107858522700306810L;
 
                     @Override
                     protected void onUpdate(final AjaxRequestTarget target) {
@@ -170,6 +167,16 @@ public class ConnConfPropertyListView extends ListView<ConnConfProperty>
{
             }
 
             @Override
+            protected IModel<String> getOnLabel() {
+                return Model.of("Override");
+            }
+
+            @Override
+            protected IModel<String> getOffLabel() {
+                return Model.of("Override?");
+            }
+
+            @Override
             protected void onComponentTag(final ComponentTag tag) {
                 super.onComponentTag(tag);
                 tag.append("class", "overridable", " ");

http://git-wip-us.apache.org/repos/asf/syncope/blob/0e5b127b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java
index 2cf76b6..58e9efa 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java
@@ -97,16 +97,14 @@ public class Ownership extends WizardStep {
 
         isGroupOwnership = Model.of(groupHandler.getInnerObject().getGroupOwner() != null);
 
-        final BootstrapToggleConfig config = new BootstrapToggleConfig();
-        config
-                .withOnStyle(BootstrapToggleConfig.Style.info).withOffStyle(BootstrapToggleConfig.Style.warning)
-                .withSize(BootstrapToggleConfig.Size.mini)
-                .withOnLabel(AnyTypeKind.GROUP.name())
-                .withOffLabel(AnyTypeKind.USER.name());
+        final BootstrapToggleConfig config = new BootstrapToggleConfig().
+                withOnStyle(BootstrapToggleConfig.Style.info).
+                withOffStyle(BootstrapToggleConfig.Style.warning).
+                withSize(BootstrapToggleConfig.Size.mini);
 
         add(new BootstrapToggle("ownership", new Model<Boolean>() {
 
-            private static final long serialVersionUID = 1L;
+            private static final long serialVersionUID = 6062041315055645807L;
 
             @Override
             public Boolean getObject() {
@@ -114,16 +112,16 @@ public class Ownership extends WizardStep {
             }
         }, config) {
 
-            private static final long serialVersionUID = 1L;
+            private static final long serialVersionUID = 2969634208049189343L;
 
             @Override
             protected IModel<String> getOffLabel() {
-                return Model.of(getString("Off", null, "USER Owner"));
+                return Model.of("USER Owner");
             }
 
             @Override
             protected IModel<String> getOnLabel() {
-                return Model.of(getString("On", null, "GROUP Owner"));
+                return Model.of("GROUP Owner");
             }
 
             @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/0e5b127b/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css b/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
index b2d692d..5799957 100644
--- a/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
+++ b/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
@@ -161,6 +161,11 @@ div.wicket-modal div.w_content_3 {
   position: relative !important;
 }
 
+.scrollable-tab-content {
+  overflow-y: auto;
+  max-height: 400px;
+}
+
 a.help {
   position: relative;
   display: inline;
@@ -283,6 +288,10 @@ span.overridable div.checkbox {
   padding: 0px;
 }
 
+span.overridable div.checkbox label div div.toggle-group label {
+  padding-left: 7px;
+}
+
 div#outer.modal-lg {
   width: 1200px;
 }


Mime
View raw message