You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by fm...@apache.org on 2015/09/21 15:51:16 UTC
[30/30] syncope git commit: [SYNCOPE-156] merge from master + fix
navbar layout + fix sidebar auto select
[SYNCOPE-156] merge from master + fix navbar layout + fix sidebar auto select
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/1aa234c5
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/1aa234c5
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/1aa234c5
Branch: refs/heads/SYNCOPE-156
Commit: 1aa234c5252b55be182af9f2826460367e393390
Parents: a6b51b0
Author: fmartelli <fa...@gmail.com>
Authored: Mon Sep 21 15:48:35 2015 +0200
Committer: fmartelli <fa...@gmail.com>
Committed: Mon Sep 21 15:49:40 2015 +0200
----------------------------------------------------------------------
.../syncope/client/console/pages/Realms.java | 1 +
.../syncope/client/console/panels/Realm.java | 42 ++++++++++----------
.../client/console/panels/RealmDetails.java | 37 ++++++++++-------
.../console/panels/RealmSidebarPanel.java | 22 +++++-----
.../META-INF/resources/css/syncopeConsole.css | 40 +++++++++++--------
.../client/console/panels/RealmDetails.html | 10 +++--
.../markup/html/form/AjaxTextFieldPanel.html | 7 ++--
.../wicket/markup/html/form/FieldPanel.html | 3 --
8 files changed, 88 insertions(+), 74 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/1aa234c5/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
index cb02ca5..3c5f0ea 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
@@ -80,6 +80,7 @@ public class Realms extends BasePage {
@Override
public void onClose(final AjaxRequestTarget target) {
target.add(realmSidebarPanel.reloadRealmTree());
+ target.add(updateRealmContent(realmSidebarPanel.getCurrentRealm()));
modal.show(false);
http://git-wip-us.apache.org/repos/asf/syncope/blob/1aa234c5/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
index 49ab781..68a0b79 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
@@ -84,7 +84,9 @@ public class Realm extends Panel {
@Override
public Panel getPanel(final String panelId) {
- return new RealmDetails(panelId, realmTO);
+ final RealmDetails panel = new RealmDetails(panelId, realmTO, false);
+ panel.setEnabled(false);
+ return panel;
}
});
@@ -106,25 +108,25 @@ public class Realm extends Panel {
private Panel getAnyPanel(final String id, final PageReference pageReference, final AnyTypeTO anyTypeTO) {
final Panel panel;
- switch (anyTypeTO.getKind()) {
- case USER:
- panel = new UserSearchResultPanel(anyTypeTO.getKey(), id,
- false, null, pageReference, userRestClient, anyTypeRestClient.getAnyTypeClass(
- anyTypeTO.getClasses()), realmTO.getFullPath());
- break;
- case GROUP:
- panel = new GroupSearchResultPanel(anyTypeTO.getKey(), id,
- false, null, pageReference, groupRestClient, anyTypeRestClient.getAnyTypeClass(
- anyTypeTO.getClasses()), realmTO.getFullPath());
- break;
- case ANY_OBJECT:
- panel = new AnySearchResultPanel(anyTypeTO.getKey(), id,
- false, null, pageReference, anyObjectRestClient, anyTypeRestClient.getAnyTypeClass(
- anyTypeTO.getClasses()), realmTO.getFullPath());
- break;
- default:
- panel = new LabelPanel(id, null);
- }
+ switch (anyTypeTO.getKind()) {
+ case USER:
+ panel = new UserSearchResultPanel(anyTypeTO.getKey(), id,
+ false, null, pageReference, userRestClient, anyTypeRestClient.getAnyTypeClass(
+ anyTypeTO.getClasses()), realmTO.getFullPath());
+ break;
+ case GROUP:
+ panel = new GroupSearchResultPanel(anyTypeTO.getKey(), id,
+ false, null, pageReference, groupRestClient, anyTypeRestClient.getAnyTypeClass(
+ anyTypeTO.getClasses()), realmTO.getFullPath());
+ break;
+ case ANY_OBJECT:
+ panel = new AnySearchResultPanel(anyTypeTO.getKey(), id,
+ false, null, pageReference, anyObjectRestClient, anyTypeRestClient.getAnyTypeClass(
+ anyTypeTO.getClasses()), realmTO.getFullPath());
+ break;
+ default:
+ panel = new LabelPanel(id, null);
+ }
return panel;
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/1aa234c5/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
index b9abec3..2bc232b 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
@@ -21,6 +21,7 @@ package org.apache.syncope.client.console.panels;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
import org.apache.syncope.common.lib.to.RealmTO;
+import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.PropertyModel;
import org.slf4j.Logger;
@@ -33,25 +34,33 @@ public class RealmDetails extends Panel {
protected static final Logger LOG = LoggerFactory.getLogger(RealmDetails.class);
public RealmDetails(final String id, final RealmTO realmTO) {
+ this(id, realmTO, true);
+ }
+
+ public RealmDetails(final String id, final RealmTO realmTO, final boolean unwraped) {
super(id);
- final FieldPanel<String> name =
- new AjaxTextFieldPanel("name", "name", new PropertyModel<String>(realmTO, "name"));
+
+ final WebMarkupContainer container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+ container.setRenderBodyOnly(unwraped);
+ add(container);
+
+ final FieldPanel<String> name = new AjaxTextFieldPanel(
+ "name", "name", new PropertyModel<String>(realmTO, "name"), false);
name.addRequiredLabel();
- add(name);
+ container.add(name);
- final FieldPanel<String> fullPath =
- new AjaxTextFieldPanel("fullPath", "fullPath", new PropertyModel<String>(realmTO, "fullPath"));
+ final FieldPanel<String> fullPath = new AjaxTextFieldPanel(
+ "fullPath", "fullPath", new PropertyModel<String>(realmTO, "fullPath"), false);
fullPath.setEnabled(false);
- add(fullPath);
+ container.add(fullPath);
- final FieldPanel<String> accountPolicy =
- new AjaxTextFieldPanel("accountPolicy",
- "accountPolicy", new PropertyModel<String>(realmTO, "accountPolicy"));
- add(accountPolicy);
+ final FieldPanel<String> accountPolicy = new AjaxTextFieldPanel(
+ "accountPolicy", "accountPolicy", new PropertyModel<String>(realmTO, "accountPolicy"), false);
+ container.add(accountPolicy);
- final FieldPanel<String> passwordPolicy =
- new AjaxTextFieldPanel("passwordPolicy",
- "passwordPolicy", new PropertyModel<String>(realmTO, "passwordPolicy"));
- add(passwordPolicy);
+ final FieldPanel<String> passwordPolicy = new AjaxTextFieldPanel(
+ "passwordPolicy", "passwordPolicy", new PropertyModel<String>(realmTO, "passwordPolicy"), false);
+ container.add(passwordPolicy);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/1aa234c5/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
index 5d0d7b8..221a05b 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
@@ -171,22 +171,20 @@ public class RealmSidebarPanel extends Panel {
final Map<Long, List<RealmTO>> cache = new HashMap<>();
for (RealmTO realm : realms) {
- if (tree.containsKey(realm.getParent())) {
- tree.get(realm.getParent()).getRight().add(realm);
+ final List<RealmTO> children = new ArrayList<>();
+ tree.put(realm.getKey(), Pair.<RealmTO, List<RealmTO>>of(realm, children));
- final List<RealmTO> children = new ArrayList<>();
- tree.put(realm.getKey(), Pair.<RealmTO, List<RealmTO>>of(realm, children));
+ if (cache.containsKey(realm.getKey())) {
+ children.addAll(cache.get(realm.getKey()));
+ cache.remove(realm.getKey());
+ }
- if (cache.containsKey(realm.getKey())) {
- children.addAll(cache.get(realm.getKey()));
- cache.remove(realm.getKey());
- }
+ if (tree.containsKey(realm.getParent())) {
+ tree.get(realm.getParent()).getRight().add(realm);
} else if (cache.containsKey(realm.getParent())) {
cache.get(realm.getParent()).add(realm);
} else {
- final List<RealmTO> children = new ArrayList<>();
- children.add(realm);
- cache.put(realm.getParent(), children);
+ cache.put(realm.getParent(), new ArrayList<>(Collections.singleton(realm)));
}
}
@@ -215,7 +213,7 @@ public class RealmSidebarPanel extends Panel {
RealmTO realm;
if (tree.containsKey(realmTO.getKey())) {
- realm = realmTO;
+ realm = tree.get(realmTO.getKey()).getLeft();
} else if (tree.containsKey(realmTO.getParent())) {
realm = tree.get(realmTO.getParent()).getLeft();
} else {
http://git-wip-us.apache.org/repos/asf/syncope/blob/1aa234c5/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 e9dee59..fcdc8db 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
@@ -59,11 +59,11 @@ pre {
}
.block-sidebar {
- max-height: 100%;
- overflow: auto;
- padding-top: 90px;
- padding-bottom: 50px;
- position: fixed;
+ max-height: 100% !important;
+ overflow: auto !important;
+ padding-top: 90px !important;
+ padding-bottom: 50px !important;
+ position: fixed !important;
}
.inner-control-sidebar {
@@ -96,15 +96,15 @@ div.listview-actions a{
}
.block-header {
- position: fixed;
- width: 100%;
- top: 0;
+ position: fixed !important;
+ width: 100% !important;
+ top: 0 !important;
}
.block-footer {
- position: fixed;
- width: 100%;
- bottom: 0px;
+ position: fixed !important;
+ width: 100% !important;
+ bottom: 0px !important;
}
.logo-pos {
@@ -126,10 +126,8 @@ div.listview-actions a{
z-index: 3;
}
-@media (min-width: 768px) {
- .main-header .logo {
- height: 54px;
- }
+.main-header .logo {
+ height: 55px !important;
}
.w_caption h3 {
@@ -197,9 +195,17 @@ div.basepage-content{
}
.modal-open .modal {
- overflow: hidden;
+ overflow: hidden;
}
.modal {
- background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
+ background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
+}
+
+div.realms div.summarize {
+ margin: 50px 100px;
+}
+
+.navbar a {
+ height: 55px
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/1aa234c5/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html
index 281ddd1..d894546 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/RealmDetails.html
@@ -23,10 +23,12 @@ under the License.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite">
<body>
<wicket:panel>
- <span wicket:id="name">[name]</span>
- <span wicket:id="fullPath">[fullPath]</span>
- <span wicket:id="accountPolicy">[accountPolicy]</span>
- <span wicket:id="passwordPolicy">[passwordPolicy]</span>
+ <div wicket:id="container" class="summarize">
+ <span wicket:id="name">[name]</span>
+ <span wicket:id="fullPath">[fullPath]</span>
+ <span wicket:id="accountPolicy">[accountPolicy]</span>
+ <span wicket:id="passwordPolicy">[passwordPolicy]</span>
+ </div>
</wicket:panel>
</body>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/1aa234c5/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
index c512d77..28d897d 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/AjaxTextFieldPanel.html
@@ -18,10 +18,9 @@ under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<wicket:extend>
- <div class="input-group">
- <span id="basic-addon1" class="input-group-addon" wicket:id="label">[label]</span>
- <input type="text" aria-describedby="basic-addon1" class="form-control" wicket:id="textField"/>
+ <div class="form-group">
+ <label wicket:id="label">[LABEL]</label><span wicket:id="required"/>
+ <input type="text" class="form-control" wicket:id="textField"/>
</div>
- <br/>
</wicket:extend>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/1aa234c5/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.html
index 55a77e1..9972280 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/FieldPanel.html
@@ -17,7 +17,6 @@ specific language governing permissions and limitations
under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:head></wicket:head>
<wicket:panel>
<wicket:fragment wicket:id="requiredFragment">
@@ -28,7 +27,5 @@ under the License.
</wicket:fragment>
<wicket:child />
-
- <span wicket:id="required"/>
</wicket:panel>
</html>