This is an automated email from the ASF dual-hosted git repository. skylark17 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/master by this push: new 6918184 [SYNCOPE-1421] Fixed and improved Enduser navigation bar, small fixes for Enduser mobile version, very first styling of the User Requests page 6918184 is described below commit 69181840ee8b4d100fb5c3de99b693020a4d8b69 Author: skylark17 <matteo.alessandr...@tirasa.net> AuthorDate: Wed May 15 14:37:59 2019 +0200 [SYNCOPE-1421] Fixed and improved Enduser navigation bar, small fixes for Enduser mobile version, very first styling of the User Requests page --- .../client/console/SyncopeWebApplication.java | 2 +- client/idrepo/enduser/pom.xml | 6 ++ .../client/enduser/SyncopeWebApplication.java | 18 ++++- .../client/enduser/assets/SyncopeEnduserCss.java | 49 ++++++++++++ .../syncope/client/enduser/navigation/Navbar.java | 89 ++++++++++++++++------ .../client/enduser/pages/BaseEnduserWebPage.java | 18 ----- .../apache/syncope/client/enduser/pages/Self.java | 6 ++ .../client/enduser/assets}/css/syncopeEnduser.scss | 39 ++++++++-- .../syncope/client/enduser/navigation/Navbar.html | 86 ++++++++++++++++++--- .../client/enduser/navigation/Navbar.properties | 3 +- .../client/enduser/navigation/Navbar_it.properties | 3 +- .../client/enduser/navigation/Navbar_ja.properties | 3 +- .../enduser/navigation/Navbar_pt_BR.properties | 3 +- .../client/enduser/navigation/Navbar_ru.properties | 3 +- .../client/enduser/pages/BaseEnduserWebPage.html | 15 ---- .../apache/syncope/client/enduser/pages/Login.html | 2 +- .../client/enduser/pages/MustChangePassword.html | 7 +- .../enduser/pages/SelfConfirmPasswordReset.html | 2 +- .../client/enduser/pages/SelfPasswordReset.html | 2 + .../client/enduser/panels/SelfPwdResetPanel.html | 2 +- ext/flowable/client-enduser/pom.xml | 1 - .../syncope/client/enduser/pages/Flowable.java | 64 +++++++++++++++- .../syncope/client/enduser/pages/Flowable.html | 60 +++++++++++++-- .../client/enduser/pages/Flowable.properties | 2 +- ...{Flowable.properties => Flowable_it.properties} | 2 +- ...{Flowable.properties => Flowable_ja.properties} | 2 +- ...owable.properties => Flowable_pt_BR.properties} | 2 +- ...{Flowable.properties => Flowable_ru.properties} | 2 +- .../src/test/resources/hotswap-agent.properties | 5 +- 29 files changed, 385 insertions(+), 113 deletions(-) diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/SyncopeWebApplication.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/SyncopeWebApplication.java index 4174226..3f4bef1 100644 --- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/SyncopeWebApplication.java +++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/SyncopeWebApplication.java @@ -227,7 +227,7 @@ public class SyncopeWebApplication extends WicketBootSecuredWebApplication { getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setCompressWhitespace(true); - + if (csrf) { getRequestCycleListeners().add(new WebSocketAwareCsrfPreventionRequestCycleListener()); } diff --git a/client/idrepo/enduser/pom.xml b/client/idrepo/enduser/pom.xml index cfa8351..4374d35 100644 --- a/client/idrepo/enduser/pom.xml +++ b/client/idrepo/enduser/pom.xml @@ -153,6 +153,12 @@ under the License. </source> <destination>${project.build.outputDirectory}/META-INF/resources/css</destination> </resource> + <resource> + <source> + <directory>${basedir}/src/main/resources/org/apache/syncope/client/enduser/assets/css</directory> + </source> + <destination>${project.build.outputDirectory}/org/apache/syncope/client/enduser/assets/css</destination> + </resource> </resources> </configuration> </plugin> diff --git a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeWebApplication.java b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeWebApplication.java index 29b3931..ba3e9ea 100644 --- a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeWebApplication.java +++ b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeWebApplication.java @@ -43,6 +43,7 @@ import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.apache.syncope.client.enduser.annotations.Resource; import org.apache.syncope.client.enduser.init.ClassPathScanImplementationLookup; +import org.apache.syncope.client.enduser.assets.SyncopeEnduserCss; import org.apache.syncope.client.enduser.model.CustomAttributesInfo; import org.apache.syncope.client.enduser.pages.Login; import org.apache.syncope.client.enduser.pages.MustChangePassword; @@ -56,6 +57,9 @@ import org.apache.syncope.common.lib.PropertyUtils; import org.apache.wicket.Page; import org.apache.wicket.Session; import org.apache.wicket.WicketRuntimeException; +import org.apache.wicket.markup.head.CssHeaderItem; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.html.IHeaderContributor; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.protocol.http.CsrfPreventionRequestCycleListener; import org.apache.wicket.protocol.http.WebApplication; @@ -250,9 +254,19 @@ public class SyncopeWebApplication extends WicketBootStandardWebApplication { getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setCompressWhitespace(true); + getMarkupSettings().setStripComments(true); - getMarkupSettings().setStripWicketTags(true); - getMarkupSettings().setCompressWhitespace(true); + // add some css assets as Java Wicket resource in order to set Bootstrap css as a dependency of those + // and stop it to override the custom css rules + getHeaderContributorListeners().add(new IHeaderContributor() { + + private static final long serialVersionUID = -8955205747168484695L; + + @Override + public void renderHead(final IHeaderResponse response) { + response.render(CssHeaderItem.forReference(SyncopeEnduserCss.INSTANCE)); + } + }); if (xsrf) { getRequestCycleListeners().add(new CsrfPreventionRequestCycleListener()); diff --git a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/assets/SyncopeEnduserCss.java b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/assets/SyncopeEnduserCss.java new file mode 100644 index 0000000..bc25789 --- /dev/null +++ b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/assets/SyncopeEnduserCss.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.client.enduser.assets; + +import de.agilecoders.wicket.core.Bootstrap; +import java.util.ArrayList; +import java.util.List; +import org.apache.wicket.markup.head.CssHeaderItem; +import org.apache.wicket.markup.head.HeaderItem; +import org.apache.wicket.request.resource.CssResourceReference; + +public class SyncopeEnduserCss extends CssResourceReference { + + private static final long serialVersionUID = 7244898174745686253L; + + /** + * Singleton instance of this reference. + */ + public static final SyncopeEnduserCss INSTANCE = new SyncopeEnduserCss(); + + public SyncopeEnduserCss() { + super(SyncopeEnduserCss.class, "css/syncopeEnduser.css"); + } + + @Override + public List<HeaderItem> getDependencies() { + final List<HeaderItem> dependencies = new ArrayList<>(); + dependencies.add(CssHeaderItem.forReference(Bootstrap.getSettings().getCssResourceReference())); + dependencies.addAll(super.getDependencies()); + return dependencies; + } + +} diff --git a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/navigation/Navbar.java b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/navigation/Navbar.java index fafa87f..18b6298 100644 --- a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/navigation/Navbar.java +++ b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/navigation/Navbar.java @@ -18,14 +18,18 @@ */ package org.apache.syncope.client.enduser.navigation; +import java.util.ArrayList; import java.util.List; +import java.util.Optional; import org.apache.commons.lang3.StringUtils; -import org.apache.syncope.client.enduser.pages.BaseEnduserWebPage; import org.apache.syncope.client.enduser.pages.BaseExtPage; +import org.apache.syncope.client.enduser.pages.Login; +import org.apache.syncope.client.enduser.pages.Self; import org.apache.syncope.client.ui.commons.annotations.ExtPage; -import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component; import org.apache.wicket.Page; +import org.apache.wicket.ajax.AjaxEventBehavior; +import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy; import org.apache.wicket.behavior.Behavior; import org.apache.wicket.markup.ComponentTag; @@ -43,51 +47,86 @@ public class Navbar extends Panel { private final ListView<Class<? extends BaseExtPage>> extPages; + private final List<WebMarkupContainer> navbarItems = new ArrayList<>(); + public Navbar(final String id, final List<Class<? extends BaseExtPage>> extPageClasses) { super(id); setOutputMarkupId(true); + WebMarkupContainer detailsLI = new WebMarkupContainer("detailsLI"); + detailsLI.setMarkupId("self"); + navbarItems.add(detailsLI); + add(detailsLI); + + BookmarkablePageLink<Page> detailsLink = new BookmarkablePageLink<>("detailsLILink", Self.class); + detailsLink.setOutputMarkupId(true); + detailsLink.add(new Label("detailsLILabel", getString("details"))); + detailsLI.add(detailsLink); + + WebMarkupContainer extLI = new WebMarkupContainer("extensionsLI"); + extLI.setOutputMarkupPlaceholderTag(true); + extLI.setVisible(!extPageClasses.isEmpty()); + add(extLI); + extPages = new ListView<Class<? extends BaseExtPage>>("extPages", extPageClasses) { private static final long serialVersionUID = 4949588177564901031L; @Override protected void populateItem(final ListItem<Class<? extends BaseExtPage>> item) { - WebMarkupContainer containingLI = new WebMarkupContainer("extPageLI"); - item.add(containingLI); - if (item.getModelObject().equals(BaseEnduserWebPage.class)) { - containingLI.add(new Behavior() { - - private static final long serialVersionUID = 1469628524240283489L; - - @Override - public void onComponentTag(final Component component, final ComponentTag tag) { - tag.put("class", "active"); - } - }); - } + WebMarkupContainer extPageLI = new WebMarkupContainer("extPageLI"); + item.add(extPageLI); + extPageLI.setMarkupId(item.getModelObject().getSimpleName().toLowerCase()); + navbarItems.add(extPageLI); ExtPage ann = item.getModelObject().getAnnotation(ExtPage.class); - BookmarkablePageLink<Page> link = new BookmarkablePageLink<>("extPage", item.getModelObject()); - link.add(new Label("extPageLabel", ann.label())); + BookmarkablePageLink<Page> extLIPageLink = + new BookmarkablePageLink<>("extPageLILink", item.getModelObject()); + extLIPageLink.setOutputMarkupId(true); + extLIPageLink.add(new Label("extPageLabel", ann.label())); if (StringUtils.isNotBlank(ann.listEntitlement())) { - MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.RENDER, ann.listEntitlement()); + MetaDataRoleAuthorizationStrategy.authorize(extLIPageLink, WebPage.RENDER, ann.listEntitlement()); } - containingLI.add(link); - - Label extPageIcon = new Label("extPageIcon"); - extPageIcon.add(new AttributeModifier("class", "fa " + ann.icon())); - link.add(extPageIcon); + extPageLI.add(extLIPageLink); } }; extPages.setOutputMarkupId(true); - extPages.setVisible(!extPageClasses.isEmpty()); - add(extPages); + extPages.setVisible(true); + extLI.add(extPages); + + WebMarkupContainer logoLinkWmc = new WebMarkupContainer("logoIcon"); + logoLinkWmc.add(new AjaxEventBehavior("click") { + + private static final long serialVersionUID = -4255753643957306394L; + + @Override + protected void onEvent(final AjaxRequestTarget target) { + setResponsePage(Login.class); + } + }); + add(logoLinkWmc); } public ListView<Class<? extends BaseExtPage>> getExtPages() { return extPages; } + public void setActiveNavItem(final String id) { + Optional<WebMarkupContainer> found = navbarItems.stream().filter(containingLI -> { + return containingLI.getMarkupId().equals(id); + }).findFirst(); + if (found.isPresent()) { + found.get().add(new Behavior() { + + private static final long serialVersionUID = -5775607340182293596L; + + @Override + public void onComponentTag(final Component component, final ComponentTag tag) { + tag.put("class", "active"); + } + }); + } + } + } diff --git a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/pages/BaseEnduserWebPage.java b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/pages/BaseEnduserWebPage.java index bc7edc4..8b6ce91 100644 --- a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/pages/BaseEnduserWebPage.java +++ b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/pages/BaseEnduserWebPage.java @@ -21,9 +21,6 @@ package org.apache.syncope.client.enduser.pages; import org.apache.syncope.client.enduser.init.ClassPathScanImplementationLookup; import org.apache.syncope.client.enduser.navigation.Navbar; import org.apache.syncope.client.ui.commons.pages.BaseWebPage; -import org.apache.wicket.Component; -import org.apache.wicket.behavior.Behavior; -import org.apache.wicket.markup.ComponentTag; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.spring.injection.annot.SpringBean; @@ -47,21 +44,6 @@ public class BaseEnduserWebPage extends BaseWebPage { navbar = new Navbar("navbar", lookup.getExtPageClasses()); body.add(navbar); - - if (getPage() instanceof BaseExtPage) { - navbar.getExtPages().add(new Behavior() { - - private static final long serialVersionUID = 1469628524240283489L; - - @Override - public void onComponentTag(final Component component, final ComponentTag tag) { - tag.put("class", "treeview-menu menu-open"); - tag.put("style", "display: block;"); - } - - }); - - } } } diff --git a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/pages/Self.java b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/pages/Self.java index 05dbcdf..9e36dc6 100644 --- a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/pages/Self.java +++ b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/pages/Self.java @@ -68,6 +68,12 @@ public class Self extends BaseEnduserWebPage implements IEventSource { } super.onEvent(event); } + + @Override + protected void onBeforeRender() { + super.onBeforeRender(); + navbar.setActiveNavItem(getClass().getSimpleName().toLowerCase()); + } protected final AjaxWizard<AnyWrapper<UserTO>> buildWizard(final UserTO userTO, final AjaxWizard.Mode mode) { userWizardBuilder = new UserWizardBuilder( diff --git a/client/idrepo/enduser/src/main/resources/META-INF/resources/css/syncopeEnduser.scss b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/assets/css/syncopeEnduser.scss similarity index 95% rename from client/idrepo/enduser/src/main/resources/META-INF/resources/css/syncopeEnduser.scss rename to client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/assets/css/syncopeEnduser.scss index 35e9641..c72ac28 100644 --- a/client/idrepo/enduser/src/main/resources/META-INF/resources/css/syncopeEnduser.scss +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/assets/css/syncopeEnduser.scss @@ -119,7 +119,7 @@ body { > .wrapper .content-wrapper { width: 100%; - margin: 0 2%; + margin: 0 2rem; } } @@ -437,10 +437,10 @@ option { width: 100%; z-index: 10; align-self: flex-start; - max-width: 768px; + /*max-width: 768px;*/ min-width: 415px; - width: auto; - padding-right: 20px; + /*width: auto;*/ + /*padding-right: 20px;*/ background-color: $palette_dark; border-color: $palette_base; @@ -544,7 +544,7 @@ option { } .navbar-toggle { - margin-right: 35px; + margin-right: 6rem; &:not(:focus) { .icon-bar { @@ -563,12 +563,29 @@ option { +/* Accessibility +============================================================================= */ + +.btn-accessibility { + i { + font-size: 26px; + } + &:hover { + cursor: pointer; + } +} + + + /* Password Reset / Confirm Password Reset / Must Change Password ============================================================================= */ .password_reset_wrapper { - padding-top: 25px; - padding-bottom: 25px; + + @include desktop { + padding-top: 25px; + padding-bottom: 25px; + } .page-header { text-align: center; @@ -582,6 +599,14 @@ option { } } +.enduser_fieldset { + padding: 0 10px; +} + +#navbarAccessibility { + padding-right: 4rem; +} + #mcp_logo { padding-top: 20px; padding-bottom: 15px; diff --git a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar.html b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar.html index cced635..5e8c78b 100644 --- a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar.html +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar.html @@ -21,47 +21,109 @@ under the License. <wicket:panel> <nav class="enduser_navbar navbar navbar-default"> <div class="container-fluid"> + <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" - data-target="#navbar" - tabindex="1" + data-target="#navbarDetails" + tabindex="0" aria-label="Toggle navigation bar" aria-expanded="true" - aria-controls="navbar"> + aria-controls="navbarDetails"> + <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand" href="#"> + <a href="#" wicket:id="logoIcon" class="navbar-brand"> <span class="logo-mini" aria-label="Enduser logo" tabindex="0"> + <img alt="Brand" src="ui-commons/img/logo-mini.png"/> </span> </a> </div> <div id="navbarDetails" class="navbar-collapse collapse in" aria-expanded="true"> + <!-- + <ul wicket:id="extPages" class="nav navbar-nav"> + <li wicket:id="detailsLI"> + <a href="#" + wicket:id="detailsLILink" + aria-label="'Details' menu element" + tabindex="0"> + + <span wicket:id="detailsLILabel" /> + <span class="sr-only">(current)</span> + </a> + </li> + <li wicket:id="extPageLI"> + <a href="#" + wicket:id="extPageLink" + aria-label="'User requests' menu element" + tabindex="0"> + + <span wicket:id="extPageLabel" /> + </a> + </li> + </ul> + --> <ul class="nav navbar-nav"> - <li class="active"> + <li wicket:id="detailsLI"> <a href="#" + wicket:id="detailsLILink" aria-label="'Details' menu element" - tabindex="1"> - Details + tabindex="0"> + + <span wicket:id="detailsLILabel" /> <span class="sr-only">(current)</span> </a> </li> - <ul wicket:id="extPages" class="nav navbar-nav"> - <li wicket:id="extPageLI" class="active"> - <a href="#" wicket:id="extPage"><i wicket:id="extPageIcon"></i><span wicket:id="extPageLabel"/></a> - </li> - </ul> + <li wicket:id="extensionsLI"> + <ul wicket:id="extPages" class="nav navbar-nav"> + <li wicket:id="extPageLI"> + <a href="#" + wicket:id="extPageLILink" + aria-label="'User requests' menu element" + tabindex="0"> + + <span wicket:id="extPageLabel" /> + </a> + </li> + </ul> + </li> + </ul> + + <ul id="navbarAccessibility" class="nav navbar-nav navbar-right" aria-expanded="true"> + <li> + <a href="#" + aria-label="'Accessibility' menu element"> + + <div id="change_contrast" class="btn-accessibility"> + <i aria-label="Toggle high contrast colors mode" tabindex="0" accesskey="H" + class="fa fa-adjust"> + </i> + </div> + </a> + </li> + <li> + <a href="#" + aria-label="'Accessibility' menu element"> + + <div id="change_fontSize" class="btn-accessibility"> + <i aria-label="Toggle font size increment" tabindex="0" accesskey="F" + class="fa fa-font"> + </i> + </div> + </a> + </li> </ul> </div> + </div> </nav> </wicket:panel> diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar.properties similarity index 95% copy from ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties copy to client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar.properties index 463bfa8..421ad7e 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar.properties @@ -14,5 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -user.requests.accordion=${bpmnProcess} - +details=Details diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_it.properties similarity index 95% copy from ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties copy to client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_it.properties index 463bfa8..abb0e27 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_it.properties @@ -14,5 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -user.requests.accordion=${bpmnProcess} - +details=Dettagli diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_ja.properties similarity index 95% copy from ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties copy to client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_ja.properties index 463bfa8..2454c39 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_ja.properties @@ -14,5 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -user.requests.accordion=${bpmnProcess} - +details=\u8a73\u7d30 diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_pt_BR.properties similarity index 95% copy from ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties copy to client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_pt_BR.properties index 463bfa8..f57b545 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_pt_BR.properties @@ -14,5 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -user.requests.accordion=${bpmnProcess} - +details=detalhes diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_ru.properties similarity index 94% copy from ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties copy to client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_ru.properties index 463bfa8..36f7ea4 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/navigation/Navbar_ru.properties @@ -14,5 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -user.requests.accordion=${bpmnProcess} - +details=\u0434\u0435\u0442\u0430\u043b\u0438 diff --git a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/BaseEnduserWebPage.html b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/BaseEnduserWebPage.html index 914f121..1cb83cf 100644 --- a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/BaseEnduserWebPage.html +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/BaseEnduserWebPage.html @@ -34,29 +34,14 @@ under the License. <link href="ui-commons/css/animations.css" rel="stylesheet" type="text/css" /> <link href="ui-commons/css/syncopeUI.css" rel="stylesheet" type="text/css"/> <link href="ui-commons/css/login.css" rel="stylesheet" type="text/css" /> - <link href="css/syncopeEnduser.css" rel="stylesheet" type="text/css"/> <!-- accessibility --> - <link href="ui-commons/css/accessibility.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="ui-commons/js/accessibility.js"></script> <script type="text/javascript" src="webjars/bootbox/${bootbox.version}/bootbox.js"></script> <script type="text/javascript" src="webjars/jQuery-slimScroll/${jquery-slimscroll.version}/jquery.slimscroll.min.js"></script> </head> <body wicket:id="body" class="skin-green-light hold-transition sidebar-mini"> - <div id="accessibility"> - <div id="change_contrast" class="btn-accessibility"> - <i aria-label="Toggle high contrast colors mode" tabindex="0" accesskey="H" - class="fa fa-adjust"> - </i> - </div> - <div id="change_fontSize" class="btn-accessibility"> - <i aria-label="Toggle font size increment" tabindex="1" accesskey="F" - class="fa fa-font"> - </i> - </div> - </div> - <span wicket:id="navbar">[NAVBAR]</span> <div class="wrapper"> diff --git a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Login.html b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Login.html index 7a63a82..7d7520c 100644 --- a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Login.html +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Login.html @@ -32,7 +32,6 @@ under the License. <link href="ui-commons/css/login.css" rel="stylesheet" type="text/css" /> <link href="ui-commons/css/syncopeUI.css" rel="stylesheet" type="text/css"/> - <link href="css/syncopeEnduser.css" rel="stylesheet" type="text/css"/> <!-- accessibility --> <link href="ui-commons/css/accessibility.css" rel="stylesheet" type="text/css" /> @@ -52,6 +51,7 @@ under the License. </i> </div> </div> + <div class="container"> <div class="login-card card card-container"> <img class="login-logo" src="ui-commons/img/logo-green.png" /> diff --git a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/MustChangePassword.html b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/MustChangePassword.html index 811830f..6b31a31 100644 --- a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/MustChangePassword.html +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/MustChangePassword.html @@ -32,7 +32,6 @@ under the License. <link href="ui-commons/css/fonts.css" rel="stylesheet" type="text/css"/> <link href="ui-commons/css/syncopeUI.css" rel="stylesheet" type="text/css"/> - <link href="css/syncopeEnduser.css" rel="stylesheet" type="text/css"/> <!-- accessibility --> <link href="ui-commons/css/accessibility.css" rel="stylesheet" type="text/css" /> @@ -54,10 +53,10 @@ under the License. </div> <div id="mcp_wrapper" class="wrapper"> - <div class="content-wrapper custom_content_wrapper"> + <div class="content-wrapper"> <div class="card card-container vertical_align"> - <div class="custom_content_wrapper row"> + <div class="custom_content_wrapper"> <div class="col-xs-12"> <img id="mcp_logo" class="login-logo" src="ui-commons/img/logo-green.png" /> @@ -72,7 +71,7 @@ under the License. <div class="row"> <div class="col-md-6 col-md-offset-3"> <form wicket:id="changePassword" class="form-horizontal"> - <fieldset class="form-group"> + <fieldset class="enduser_fieldset"> <div class="form-group input-md"> <input type="text" wicket:id="username" id="username" class="form-control" wicket:message="placeholder:username" required="required" autofocus="autofocus" /> diff --git a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/SelfConfirmPasswordReset.html b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/SelfConfirmPasswordReset.html index ebec185..78eda9b 100644 --- a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/SelfConfirmPasswordReset.html +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/SelfConfirmPasswordReset.html @@ -32,7 +32,7 @@ under the License. </div> <form wicket:id="selfConfirmPwdResetForm" class="form-horizontal"> - <fieldset class="form-group"> + <fieldset class="enduser_fieldset"> <select wicket:id="domain" class="form-group input-md"/> <span id="password" wicket:id="password" class="form-group input-md"/> <span id="confirmPassword" wicket:id="confirmPassword" class="form-group input-md"/> diff --git a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/SelfPasswordReset.html b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/SelfPasswordReset.html index 5910e87..4442e79 100644 --- a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/SelfPasswordReset.html +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/pages/SelfPasswordReset.html @@ -18,6 +18,7 @@ under the License. --> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> <wicket:extend> + <section class="content" wicket:id="content"> <div id="password_reset" class="container-fluid password_reset_wrapper"> @@ -38,5 +39,6 @@ under the License. </div> <!-- row --> </div> </section> + </wicket:extend> </html> \ No newline at end of file diff --git a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/panels/SelfPwdResetPanel.html b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/panels/SelfPwdResetPanel.html index eeace4c..08c3d35 100644 --- a/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/panels/SelfPwdResetPanel.html +++ b/client/idrepo/enduser/src/main/resources/org/apache/syncope/client/enduser/panels/SelfPwdResetPanel.html @@ -20,7 +20,7 @@ under the License. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> <wicket:panel> - <fieldset class="form-group"> + <fieldset class="enduser_fieldset"> <div class="form-group input-md"> <label for="domain"><wicket:message key="domain"/></label> <select wicket:id="domain" class="form-control"/> diff --git a/ext/flowable/client-enduser/pom.xml b/ext/flowable/client-enduser/pom.xml index 83a77cb..7210c9f 100644 --- a/ext/flowable/client-enduser/pom.xml +++ b/ext/flowable/client-enduser/pom.xml @@ -59,7 +59,6 @@ under the License. <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> </dependency> - </dependencies> <build> diff --git a/ext/flowable/client-enduser/src/main/java/org/apache/syncope/client/enduser/pages/Flowable.java b/ext/flowable/client-enduser/src/main/java/org/apache/syncope/client/enduser/pages/Flowable.java index 2a33195..eee8f9a 100644 --- a/ext/flowable/client-enduser/src/main/java/org/apache/syncope/client/enduser/pages/Flowable.java +++ b/ext/flowable/client-enduser/src/main/java/org/apache/syncope/client/enduser/pages/Flowable.java @@ -18,25 +18,44 @@ */ package org.apache.syncope.client.enduser.pages; +import java.util.Collections; +import java.util.List; import java.util.stream.Collectors; +import org.apache.syncope.client.enduser.SyncopeEnduserSession; import org.apache.syncope.client.enduser.markup.html.form.BpmnProcessesAjaxPanel; import org.apache.syncope.client.enduser.rest.BpmnProcessRestClient; import org.apache.syncope.client.enduser.rest.UserRequestRestClient; import org.apache.syncope.client.ui.commons.Constants; import org.apache.syncope.client.ui.commons.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior; import org.apache.syncope.client.ui.commons.annotations.ExtPage; +import org.apache.syncope.client.ui.commons.wicket.markup.html.bootstrap.tabs.Accordion; +import org.apache.syncope.common.lib.to.UserRequest; import org.apache.syncope.common.lib.types.FlowableEntitlement; import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; +import org.apache.wicket.extensions.markup.html.repeater.util.SortParam; +import org.apache.wicket.extensions.markup.html.tabs.AbstractTab; +import org.apache.wicket.extensions.markup.html.tabs.ITab; import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.PageableListView; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; +import org.apache.wicket.model.StringResourceModel; +import org.apache.wicket.model.util.ListModel; import org.apache.wicket.request.mapper.parameter.PageParameters; -@ExtPage(label = "User Requests", icon = "fa-briefcase", +@ExtPage(label = "User Requests", listEntitlement = FlowableEntitlement.BPMN_PROCESS_GET, priority = 200) public class Flowable extends BaseExtPage { private static final long serialVersionUID = -8781434495150074529L; + private final int rowsPerPage = 10; + + protected final IModel<List<UserRequest>> userRequests; + private final Model<String> bpmnProcessModel = new Model<>(); private final BpmnProcessRestClient restClient = new BpmnProcessRestClient(); @@ -46,8 +65,43 @@ public class Flowable extends BaseExtPage { public Flowable(final PageParameters parameters) { super(parameters); + this.userRequests = new ListModel<>(userRequestRestClient.getUserRequests(1, rowsPerPage, + SyncopeEnduserSession.get().getSelfTO().getUsername(), new SortParam<>("name", true))); final WebMarkupContainer content = new WebMarkupContainer("content"); content.setOutputMarkupId(true); + + // list of accordions containing request form (if any) and delete button + PageableListView<UserRequest> userReqsListView = new PageableListView<>("userRequests", userRequests, + rowsPerPage) { + + private static final long serialVersionUID = -5002600396458362774L; + + @Override + protected void populateItem(final ListItem<UserRequest> item) { + final UserRequest userRequest = item.getModelObject(); + item.add(new Accordion("userRequestDetails", Collections.<ITab>singletonList(new AbstractTab( + new StringResourceModel("user.requests.accordion", content, Model.of(userRequest))) { + + private static final long serialVersionUID = 1037272333056449378L; + + @Override + public WebMarkupContainer getPanel(final String panelId) { + // find the form associated to the current request + return new Panel("userRequestForm") { + + private static final long serialVersionUID = -957948639666058749L; + + }; + } + }), Model.of(-1)).setOutputMarkupId(true)); + } + + }; + + userReqsListView.setOutputMarkupId(true); + content.add(userReqsListView); + content.add(new AjaxPagingNavigator("navigator", userReqsListView)); + // autocomplete select with bpmnProcesses final BpmnProcessesAjaxPanel bpmnProcesses = new BpmnProcessesAjaxPanel("bpmnProcesses", "bpmnProcesses", bpmnProcessModel, @@ -58,6 +112,7 @@ public class Flowable extends BaseExtPage { @Override protected void onUpdate(final AjaxRequestTarget target) { userRequestRestClient.start(bpmnProcessModel.getObject(), null); + target.add(userReqsListView); } }); bpmnProcesses.setChoices(restClient.getDefinitions().stream() @@ -67,4 +122,11 @@ public class Flowable extends BaseExtPage { body.add(content); } + + @Override + protected void onBeforeRender() { + super.onBeforeRender(); + navbar.setActiveNavItem(getClass().getSimpleName().toLowerCase()); + } + } diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.html b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.html index 9349c18..07dadcd 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.html +++ b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.html @@ -18,16 +18,60 @@ under the License. --> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> <wicket:extend> - <section class="content-header"> - <h1> </h1> - <ol class="breadcrumb"> - <li class="active"><wicket:message key="extensions"/></li> - <li class="active">Flowable</li> - </ol> - </section> <section class="content" wicket:id="content"> - <span wicket:id="bpmnProcesses">[BPMN PROCESSES]</span> + <div id="flowable_wrapper" class="container-fluid password_reset_wrapper"> + + <div class="row"> + <div class="col-md-6 col-md-offset-3"> + + <div class="page-header"> + <h1> + <wicket:message key="bpmn.process.title">[BPMN_PROCESSES_TITLE]</wicket:message> + </h1> + </div> + + <div> + <span wicket:id="bpmnProcesses">[BPMN PROCESSES]</span> + </div> + + </div> <!-- col --> + </div> <!-- row --> + + <div class="row"> + <div class="col-md-6 col-md-offset-3"> + + <table> + <tbody> + <tr wicket:id="userRequests"> + <td> + <span wicket:id="userRequestDetails"> + <div wicket:id="userRequestDetails"> + <wicket:panel> + <div wicket:id="userRequestForm"> + <div class="form-group"> + <span wicket:id="panel"> + [panel for dynamic input type markup] + </span> + </div> + </div> + </wicket:panel> + </div> + </span> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td wicket:id="navigator"></td> + </tr> + </tfoot> + </table> + + </div> <!-- col --> + </div> <!-- row --> + </div> </section> + </wicket:extend> </html> \ No newline at end of file diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties index 463bfa8..6a7b4c6 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. user.requests.accordion=${bpmnProcess} - +bpmn.process.title=Requests diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_it.properties similarity index 96% copy from ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties copy to ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_it.properties index 463bfa8..9bc6c8d 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_it.properties @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. user.requests.accordion=${bpmnProcess} - +bpmn.process.title=Richieste diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_ja.properties similarity index 94% copy from ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties copy to ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_ja.properties index 463bfa8..28e0ad5 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_ja.properties @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. user.requests.accordion=${bpmnProcess} - +bpmn.process.title=\u30ea\u30af\u30a8\u30b9\u30c8 diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_pt_BR.properties similarity index 96% copy from ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties copy to ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_pt_BR.properties index 463bfa8..c6b0d8d 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_pt_BR.properties @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. user.requests.accordion=${bpmnProcess} - +bpmn.process.title=Os pedidos diff --git a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_ru.properties similarity index 93% copy from ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties copy to ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_ru.properties index 463bfa8..9830685 100644 --- a/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable.properties +++ b/ext/flowable/client-enduser/src/main/resources/org/apache/syncope/client/enduser/pages/Flowable_ru.properties @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. user.requests.accordion=${bpmnProcess} - +bpmn.process.title=\u0417\u0430\u043f\u0440\u043e\u0441\u044b diff --git a/fit/enduser-reference/src/test/resources/hotswap-agent.properties b/fit/enduser-reference/src/test/resources/hotswap-agent.properties index 0a50d29..4306f21 100644 --- a/fit/enduser-reference/src/test/resources/hotswap-agent.properties +++ b/fit/enduser-reference/src/test/resources/hotswap-agent.properties @@ -21,4 +21,7 @@ autoHotswap=true extraClasspath=\ ${basedir}/../../client/idrepo/common-ui/target/classes/org,\ -${basedir}/../../client/idrepo/enduser/target/classes/org +${basedir}/../../client/idrepo/enduser/target/classes/org,\ +${basedir}/../../ext/saml2sp/client-enduser/target/classes/org,\ +${basedir}/../../ext/flowable/client-enduser/target/classes/org,\ +${basedir}/../../ext/oidcclient/client-enduser/target/classes/org