Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Mar 7, 2022
2 parents 816e6ab + c8248d0 commit 6b23a7a
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package com.evolveum.midpoint.gui.impl.page.admin.component;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismObjectWrapper;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.ObjectDetailsModels;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
Expand Down Expand Up @@ -135,6 +134,40 @@
type = "InternalsConfigurationType",
expanded = true
)
@PanelInstance(
identifier = "roleManagementPanel",
applicableForType = RoleManagementConfigurationType.class,
display = @PanelDisplay(
label = "RoleManagementContentPanel.label",
icon = GuiStyleConstants.CLASS_CIRCLE_FULL,
order = 10
),
containerPath = "roleManagement",
type = "RoleManagementConfigurationType",
hiddenContainers = {
"roleManagement/relations"
},
expanded = true
)
// todo custom panel needs to be created for logging, since profilingClassLogger property wrapper is created automagically and
// can't be hidden using virtual container because it's using non-existing path (item name).
//@PanelInstance(
// identifier = "loggingPanel",
// applicableForType = LoggingConfigurationType.class,
// display = @PanelDisplay(
// label = "LoggingPanelContent.label",
// icon = GuiStyleConstants.CLASS_CIRCLE_FULL,
// order = 100
// ),
// expanded = true,
// containerPath = "logging",
// hiddenContainers = {
// "logging/classLogger",
// "logging/subSystemLogger",
// "logging/appender",
// "logging/profilingClassLogger"
// }
//)
public class GenericSingleContainerPanel<C extends Containerable, O extends ObjectType> extends AbstractObjectMainPanel<O, ObjectDetailsModels<O>> {

private static final String ID_DETAILS = "details";
Expand All @@ -145,13 +178,6 @@ public GenericSingleContainerPanel(String id, ObjectDetailsModels<O> model, Cont

@Override
protected void initLayout() {
IModel model = () -> {
PrismObjectWrapper wrapper = getObjectWrapperModel().getObject();
wrapper.setShowEmpty(true, true);

return wrapper;
};

add(new SingleContainerPanel<C>(ID_DETAILS, model, getPanelConfiguration()));
add(new SingleContainerPanel<C>(ID_DETAILS, (IModel) getObjectWrapperModel(), getPanelConfiguration()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,38 @@
package com.evolveum.midpoint.gui.impl.page.admin.focus.component;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;

import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.prism.wrapper.PrismObjectWrapper;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.FocusDetailsModels;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
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.*;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;

@PanelType(name = "activation")
@PanelInstance(identifier = "activation",
@PanelInstance(
identifier = "activation",
applicableForType = FocusType.class,
display = @PanelDisplay(label = "ActivationType.title", icon = GuiStyleConstants.CLASS_LIFECYCLE_ICON, order = 40))
display = @PanelDisplay(
label = "ActivationType.title",
icon = GuiStyleConstants.CLASS_LIFECYCLE_ICON,
order = 40
),
containerPath = "activation",
type = "ActivationType",
expanded = true
)
public class FocusActivationPanel<F extends FocusType, FDM extends FocusDetailsModels<F>> extends AbstractObjectMainPanel<F, FDM> {

private static final long serialVersionUID = 1L;

private static final Trace LOGGER = TraceManager.getTrace(FocusActivationPanel.class);

private static final String ID_PANEL = "panel";

private static final String DOT_CLASS = FocusActivationPanel.class.getName() + ".";
Expand All @@ -43,10 +49,11 @@ public FocusActivationPanel(String id, FDM model, ContainerPanelConfigurationTyp

@Override
protected void initLayout() {
// path is defined via PanelInstance -> an therefore via panelConfiguration (virtual container)
SingleContainerPanel panel =
new SingleContainerPanel<>(ID_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), FocusType.F_ACTIVATION),
PasswordType.COMPLEX_TYPE);
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.EMPTY_PATH),
getPanelConfiguration());
add(panel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,38 @@
package com.evolveum.midpoint.gui.impl.page.admin.focus.component;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismObjectWrapper;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.FocusDetailsModels;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
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.*;

import org.apache.wicket.model.IModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;

@PanelType(name = "password")
@PanelInstance(identifier = "password",
@PanelInstance(
identifier = "password",
applicableForType = FocusType.class,
display = @PanelDisplay(label = "prismPropertyPanel.name.credentials.password", icon = GuiStyleConstants.CLASS_PASSWORD_ICON, order = 50))
display = @PanelDisplay(
label = "prismPropertyPanel.name.credentials.password",
icon = GuiStyleConstants.CLASS_PASSWORD_ICON,
order = 50
),
containerPath = "credentials/password",
type = "PasswordType",
expanded = true
)
public class FocusPasswordPanel<F extends FocusType, FDM extends FocusDetailsModels<F>> extends AbstractObjectMainPanel<F, FDM> {

private static final long serialVersionUID = 1L;

private static final Trace LOGGER = TraceManager.getTrace(FocusPasswordPanel.class);

private static final String ID_PANEL = "panel";

private static final String DOT_CLASS = FocusPasswordPanel.class.getName() + ".";
Expand All @@ -42,10 +49,11 @@ public FocusPasswordPanel(String id, FDM model, ContainerPanelConfigurationType

@Override
protected void initLayout() {
// path is defined via PanelInstance -> an therefore via panelConfiguration (virtual container)
SingleContainerPanel panel =
new SingleContainerPanel<>(ID_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(FocusType.F_CREDENTIALS, CredentialsType.F_PASSWORD)),
PasswordType.COMPLEX_TYPE);
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.EMPTY_PATH),
getPanelConfiguration());
add(panel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.web.application.CollectionInstance;
import com.evolveum.midpoint.web.application.PanelDisplay;
import com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn;
import com.evolveum.midpoint.web.component.form.MidpointForm;
import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem;
import com.evolveum.midpoint.web.component.util.SelectableBean;
Expand Down Expand Up @@ -80,7 +81,7 @@ protected TableId getTableId() {

@Override
protected IColumn<SelectableBean<MessageTemplateType>, String> createCheckboxColumn() {
return null;
return new CheckBoxHeaderColumn<>();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
* @author lazyman
* @author skublik
*/
@PageDescriptor(
urls = {
@Url(mountUrl = "/admin/config/system2"),
@Url(mountUrl = "/admin/config/system"),
},
action = {
@AuthorizationAction(actionUri = AuthConstants.AUTH_CONFIGURATION_ALL,
Expand All @@ -52,6 +53,60 @@
})
public class PageSystemConfiguration extends PageBase {

public enum SubPage {

BASIC("fa fa-wrench", PageSystemBasic.class),

POLICIES("fa fa-camera", PageSystemPolicies.class),

NOTIFICATION("fa fa-envelope", PageSystemNotification.class),

LOGGING("fa fa-file-text", PageSystemLogging.class),

PROFILING("fa fa-bar-chart", PageProfiling.class),

ADMIN_GUI("fa fa-desktop", PageSystemAdminGui.class),

WORKFLOW("fa fa-code-fork", PageSystemWorkflow.class),

ROLE_MANAGEMENT("fe fe-role", PageRoleManagement.class),

INTERNALS("fa fa-cogs", PageSystemInternals.class),

ACCESS_CERTIFICATION("fa fa-certificate", PageAccessCertification.class);

String icon;

Class<? extends PageBaseSystemConfiguration> page;

SubPage(String icon, Class<? extends PageBaseSystemConfiguration> page) {
this.icon = icon;
this.page = page;
}

public String getIcon() {
return icon;
}

public Class<? extends PageBaseSystemConfiguration> getPage() {
return page;
}

public static String getIcon(Class<?extends PageBaseSystemConfiguration> page) {
if (page == null) {
return null;
}

for (SubPage sp : values()) {
if (page.equals(sp.getPage())) {
return sp.getIcon();
}
}

return null;
}
}

private static final long serialVersionUID = 1L;

private static final String DOT_CLASS = PageSystemConfiguration.class.getName() + ".";
Expand All @@ -65,18 +120,10 @@ public PageSystemConfiguration() {
}

private void initLayout() {
IModel<List<CompositedIconButtonDto>> model = Model.ofList(Arrays.asList(
createCompositedButton("fa fa-wrench", PageSystemBasic.class),
createCompositedButton("fa fa-camera", PageSystemPolicies.class),
createCompositedButton("fa fa-envelope", PageSystemNotification.class),
createCompositedButton("fa fa-file-text", PageSystemLogging.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", PageSystemInternals.class),
createCompositedButton("fa fa-camera", PageAccessCertification.class)
));
List<CompositedIconButtonDto> buttons = Arrays.stream(SubPage.values())
.map(s -> createCompositedButton(s.getIcon(), s.getPage())).collect(Collectors.toUnmodifiableList());

IModel<List<CompositedIconButtonDto>> model = Model.ofList(buttons);

MultiCompositedButtonPanel panel = new MultiCompositedButtonPanel(ID_CONTAINER, model) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ protected List<InlineMenuItem> createInlineMenu() {
@Override
protected List<Component> createToolbarButtonsList(String idButton) {
Component choice = createNewAppenderChoice(idButton);

AjaxIconButton newObjectIcon = new AjaxIconButton(idButton, Model.of("fa fa-plus"), Model.of("")) {
// todo push html through title? not very nice
AjaxSubmitButton newObjectIcon = new AjaxSubmitButton(idButton, new Model<>("<i class=\"fa fa-plus\"></i>")) {

private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
protected void onSubmit(AjaxRequestTarget target) {
newItemPerformed(target, null);
}
};
Expand Down

This file was deleted.

0 comments on commit 6b23a7a

Please sign in to comment.