Skip to content

Commit

Permalink
MID-7442 more cards and subpages for sysconfig UI, wip
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Feb 18, 2022
1 parent 69755c5 commit cc5ce08
Show file tree
Hide file tree
Showing 14 changed files with 271 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,24 @@ protected void onInitialize() {
}

public void initLayout() {

WebMarkupContainer detailsBox = new WebMarkupContainer(ID_DETAILS_BOX);
detailsBox.setOutputMarkupId(true);
detailsBox.add(AttributeModifier.append("class", createHeaderCss()));
add(detailsBox);

initHeader(detailsBox);

}

private IModel<String> createHeaderCss() {

return (IModel<String>) () -> {
return () -> {
switch (type) {
case INFO:
return " box-info";
case SUCCESS:
return " box-success";
case ERROR:
return " box-danger";
case WARN: // TODO:
case WARN:
default:
return " box-warning";
}
Expand All @@ -80,8 +77,7 @@ private IModel<String> createHeaderCss() {
private void initHeader(WebMarkupContainer box) {
WebMarkupContainer iconType = new WebMarkupContainer(ID_ICON_TYPE);
iconType.setOutputMarkupId(true);
iconType.add(new AttributeAppender("class", (IModel) () -> {

iconType.add(AttributeAppender.append("class", () -> {
switch (type) {
case INFO:
return " fa-info";
Expand All @@ -100,7 +96,7 @@ private void initHeader(WebMarkupContainer box) {
Label message = new Label(ID_MESSAGE, getModel());
box.add(message);

AjaxLink<Void> close = new AjaxLink<Void>(ID_CLOSE) {
AjaxLink<Void> close = new AjaxLink<>(ID_CLOSE) {

private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,15 @@ private void initLayout() {
// createCompositedButton("Global policy rule", "fa fa-eye", PageGlobalPolicyRule.class)
// createCompositedButton("Global projection policy", "fa fa-globe", PageGlobalProjectionPolicy.class)
// createCompositedButton("Cleanup policy", "fa fa-eraser", PageCleanupPolicy.class)
createCompositedButton("fa fa-camera", PageSystemPolicies.class),
createCompositedButton("fa fa-envelope", PageSystemNotification.class),
createCompositedButton("fa fa-file-text", PageSystemLogging.class),
// createCompositedButton("Profiling", "fa fa-camera", PageProfiling.class)
createCompositedButton("fa fa-camera", PageProfiling.class),
createCompositedButton("fa fa-camera", PageSystemAdminGui.class),
createCompositedButton("fa fa-camera", PageSystemWorkflow.class),
createCompositedButton("fa fa-camera", PageRoleManagement.class),
createCompositedButton("fa fa-camera", PageInternals.class),
// createCompositedButton("Deployment information", "fa fa-camera", PageDeploymentInformation.class)
createCompositedButton("fa fa-camera", PageAccessCertification.class)
// createCompositedButton("Infrastructure", "fa fa-camera", PageInfrastructure.class)
// createCompositedButton("Full text configuration", "fa fa-camera", PageFullTextSearch.class)
));

MultiCompositedButtonPanel panel = new MultiCompositedButtonPanel(ID_CONTAINER, model) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
~ Copyright (c) 2022 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>
<div class="row">
<div class="col-md-12">
<div wicket:id="mainPanel" />
</div>
</div>
</wicket:panel>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.web.application.PanelDisplay;
import com.evolveum.midpoint.web.application.PanelInstance;
import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.DeploymentInformationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType;

@PanelType(name = "deploymentPanel")
@PanelInstance(
identifier = "deploymentPanel",
applicableForType = SystemConfigurationType.class,
display = @PanelDisplay(
label = "DeploymentContentPanel.label",
icon = GuiStyleConstants.CLASS_CIRCLE_FULL,
order = 20
)
)
public class DeploymentContentPanel extends AbstractObjectMainPanel<SystemConfigurationType, AssignmentHolderDetailsModel<SystemConfigurationType>> {

private static final String ID_MAIN_PANEL = "mainPanel";

public DeploymentContentPanel(String id, AssignmentHolderDetailsModel<SystemConfigurationType> model, ContainerPanelConfigurationType config) {
super(id, model, config);
}

@Override
protected void initLayout() {
SingleContainerPanel panel = new SingleContainerPanel(ID_MAIN_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(SystemConfigurationType.F_DEPLOYMENT_INFORMATION)),
DeploymentInformationType.COMPLEX_TYPE);
add(panel);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
~ Copyright (c) 2022 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>
<div class="row">
<div class="col-md-12">
<div wicket:id="mainPanel" />
</div>
</div>
</wicket:panel>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.web.application.PanelDisplay;
import com.evolveum.midpoint.web.application.PanelInstance;
import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.DeploymentInformationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.InfrastructureConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType;

@PanelType(name = "infrastructurePanel")
@PanelInstance(
identifier = "infrastructurePanel",
applicableForType = SystemConfigurationType.class,
display = @PanelDisplay(
label = "InfrastructureContentPanel.label",
icon = GuiStyleConstants.CLASS_CIRCLE_FULL,
order = 30
)
)
public class InfrastructureContentPanel extends AbstractObjectMainPanel<SystemConfigurationType, AssignmentHolderDetailsModel<SystemConfigurationType>> {

private static final String ID_MAIN_PANEL = "mainPanel";

public InfrastructureContentPanel(String id, AssignmentHolderDetailsModel<SystemConfigurationType> model, ContainerPanelConfigurationType config) {
super(id, model, config);
}

@Override
protected void initLayout() {
SingleContainerPanel panel = new SingleContainerPanel(ID_MAIN_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(SystemConfigurationType.F_INFRASTRUCTURE)),
InfrastructureConfigurationType.COMPLEX_TYPE);
add(panel);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
~ Copyright (c) 2022 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>
<div class="row">
<div class="col-md-12">
<div wicket:id="mainPanel" />
</div>
</div>
</wicket:panel>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.web.application.PanelDisplay;
import com.evolveum.midpoint.web.application.PanelInstance;
import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

@PanelType(name = "singleContainerPanel")
@PanelInstance(
identifier = "fullTextSearchPanel",
applicableForType = SystemConfigurationType.class,
display = @PanelDisplay(
label = "FullTextSearchPanel.label",
icon = GuiStyleConstants.CLASS_CIRCLE_FULL,
order = 40
)
)
public class SingleContainerContentPanel extends AbstractObjectMainPanel<SystemConfigurationType, AssignmentHolderDetailsModel<SystemConfigurationType>> {

private static final String ID_MAIN_PANEL = "mainPanel";

public SingleContainerContentPanel(String id, AssignmentHolderDetailsModel<SystemConfigurationType> model, ContainerPanelConfigurationType config) {
super(id, model, config);
}

@Override
protected void initLayout() {
SingleContainerPanel panel = new SingleContainerPanel(ID_MAIN_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(SystemConfigurationType.F_FULL_TEXT_SEARCH)),
FullTextSearchConfigurationType.COMPLEX_TYPE);
add(panel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.web.page.admin.configuration.system;
package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.page;

import org.apache.wicket.request.mapper.parameter.PageParameters;

import com.evolveum.midpoint.authentication.api.util.AuthConstants;
import com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.page.PageBaseSystemConfiguration;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.authentication.api.authorization.AuthorizationAction;
import com.evolveum.midpoint.authentication.api.authorization.PageDescriptor;
import com.evolveum.midpoint.authentication.api.authorization.Url;
import com.evolveum.midpoint.authentication.api.util.AuthConstants;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ProfilingConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType;

@PageDescriptor(
urls = {
@Url(mountUrl = "/admin/config/system/profiling", matchUrlForSecurity = "/admin/config/system/profiling"),
@Url(mountUrl = "/admin/config/system/profiling"),
},
action = {
@AuthorizationAction(actionUri = AuthConstants.AUTH_CONFIGURATION_ALL,
Expand All @@ -27,6 +32,24 @@
})
public class PageProfiling extends PageBaseSystemConfiguration {

private static final long serialVersionUID = 1L;

public PageProfiling() {
}

public PageProfiling(PageParameters parameters) {
super(parameters);
}

public PageProfiling(PrismObject<SystemConfigurationType> object) {
super(object);
}

@Override
public Class<? extends Containerable> getDetailsType() {
return ProfilingConfigurationType.class;
}

// @Override
// protected List<ITab> createTabs() {
// List<ITab> tabs = new ArrayList<>();
Expand Down

0 comments on commit cc5ce08

Please sign in to comment.