Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Sep 7, 2021
2 parents 7670f3c + 9da9d31 commit edac637
Show file tree
Hide file tree
Showing 75 changed files with 585 additions and 252 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
import java.util.*;
import javax.annotation.PostConstruct;

import com.evolveum.midpoint.prism.polystring.PolyString;

import com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType;

import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;

import org.apache.commons.lang3.BooleanUtils;
import org.apache.wicket.markup.html.panel.Panel;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -235,7 +241,7 @@ private ContainerPanelConfigurationType compileContainerPanelConfiguration(Class
}
return config;
}

private void addPanelTypeConfiguration(Class<?> clazz, ContainerPanelConfigurationType config) {
PanelType panelType = clazz.getAnnotation(PanelType.class);
if (panelType == null) {
Expand Down Expand Up @@ -302,7 +308,10 @@ private List<ContainerPanelConfigurationType> processChildren(Set<Class<?>> clas

private DisplayType createDisplayType(PanelDisplay display) {
DisplayType displayType = new DisplayType();
displayType.setLabel(WebComponentUtil.createPolyFromOrigString(display.label()));
PolyStringTranslationType translationType = new PolyStringTranslationType();
translationType.setKey(display.label());
PolyString polyString = new PolyString(null, null, translationType);
displayType.setLabel(new PolyStringType(polyString));
displayType.setIcon(new IconType().cssClass(display.icon()));
return displayType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.List;

import com.evolveum.midpoint.gui.api.util.WebDisplayTypeUtil;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
Expand Down Expand Up @@ -213,6 +215,7 @@ protected void onClickPerformed(ContainerPanelConfigurationType config, AjaxRequ
}

private IModel<String> createButtonLabel(IModel<ContainerPanelConfigurationType> model) {

return new ReadOnlyModel<>(() -> {
ContainerPanelConfigurationType config = model.getObject();

Expand All @@ -224,7 +227,7 @@ private IModel<String> createButtonLabel(IModel<ContainerPanelConfigurationType>
return "N/A";
}

return config.getDisplay().getLabel().getOrig();
return WebComponentUtil.getTranslatedPolyString(config.getDisplay().getLabel());
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//@PanelType(name = "inducements", defaultContainerPath = "inducement")
@PanelInstance(identifier = "inducements", applicableFor = AbstractRoleType.class,
display = @PanelDisplay(label = "Inducements", order = 70))
display = @PanelDisplay(label = "FocusType.inducement", order = 70))
public class AbstractRoleInducementPanel<AR extends AbstractRoleType> extends AbstractObjectMainPanel<AR, ObjectDetailsModels<AR>> {

public AbstractRoleInducementPanel(String id, ObjectDetailsModels<AR> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@
@PanelInstances(instances = {
@PanelInstance(identifier = "roleMembers",
applicableFor = RoleType.class,
display = @PanelDisplay(label = "Members", order = 80)),
display = @PanelDisplay(label = "pageRole.members", order = 80)),
@PanelInstance(identifier = "roleGovernance",
applicableFor = RoleType.class,
display = @PanelDisplay(label = "Governance", order = 90)),
display = @PanelDisplay(label = "pageRole.governance", order = 90)),
@PanelInstance(identifier = "serviceMembers",
applicableFor = ServiceType.class,
display = @PanelDisplay(label = "Members", order = 80)),
display = @PanelDisplay(label = "pageRole.members", order = 80)),
@PanelInstance(identifier = "serviceGovernance",
applicableFor = ServiceType.class,
display = @PanelDisplay(label = "Governance", order = 90))
display = @PanelDisplay(label = "pageRole.governance", order = 90))
})
@PanelDisplay(label = "Members", order = 60)
public class AbstractRoleMemberPanel<R extends AbstractRoleType> extends AbstractObjectMainPanel<R, FocusDetailsModels<R>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@PanelType(name = "applicablePolicies")
@PanelInstance(identifier = "applicablePolicies",
applicableFor = AbstractRoleType.class,
display = @PanelDisplay(label = "Applicable policies", order = 60))
display = @PanelDisplay(label = "pageAdminFocus.applicablePolicies", order = 60))
public class FocusApplicablePoliciesPanel<AR extends AbstractRoleType> extends AbstractObjectMainPanel<AR, FocusDetailsModels<AR>> {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//@PanelType(name = "assignments", defaultContainerPath = "assignment")
@PanelInstance(identifier = "assignments",
applicableFor = AssignmentHolderType.class,
display = @PanelDisplay(label = "Assignments", icon = GuiStyleConstants.EVO_ASSIGNMENT_ICON, order = 30))
display = @PanelDisplay(label = "pageAdminFocus.assignments", icon = GuiStyleConstants.EVO_ASSIGNMENT_ICON, order = 30))
@Counter(provider = AssignmentCounter.class)
public class AssignmentHolderAssignmentPanel<AH extends AssignmentHolderType> extends AbstractObjectMainPanel<AH, ObjectDetailsModels<AH>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
applicableFor = AssignmentHolderType.class,
defaultPanel = true,
notApplicableFor = ResourceType.class,
display = @PanelDisplay(label = "Basic", icon = GuiStyleConstants.CLASS_CIRCLE_FULL, order = 10))
display = @PanelDisplay(label = "pageAdminFocus.basic", icon = GuiStyleConstants.CLASS_CIRCLE_FULL, order = 10))
public class AssignmentHolderBasicPanel<AH extends AssignmentHolderType> extends AbstractObjectMainPanel<AH, ObjectDetailsModels<AH>> {

private static final String ID_MAIN_PANEL = "properties";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@PanelInstance(identifier = "allAssignments",
applicableFor = AssignmentHolderType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "All", icon = GuiStyleConstants.EVO_ASSIGNMENT_ICON, order = 10))
display = @PanelDisplay(label = "AssignmentPanel.allLabel", icon = GuiStyleConstants.EVO_ASSIGNMENT_ICON, order = 10))
public class AllAssignmentsPanel<AH extends AssignmentHolderType> extends AbstractAssignmentPanel<AH> {

public AllAssignmentsPanel(String id, LoadableModel<PrismObjectWrapper<AH>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@PanelInstance(identifier = "constructionAssignments",
applicableFor = FocusType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "Resource", icon = GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON, order = 50))
display = @PanelDisplay(label = "ObjectType.ResourceType", icon = GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON, order = 50))
public class ConstructionAssignmentsPanel<AH extends AssignmentHolderType> extends AbstractAssignmentPanel<AH> {

public ConstructionAssignmentsPanel(String id, IModel<PrismObjectWrapper<AH>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
@PanelInstance(identifier = "indirectAssignments",
applicableFor = AssignmentHolderType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "With indirect"))
display = @PanelDisplay(label = "AssignmentTablePanel.menu.showAllAssignments"))
public class DirectAndIndirectAssignmentPanel<AH extends AssignmentHolderType> extends AbstractAssignmentPanel<AH> {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@PanelInstance(identifier = "focusMappingsAssignments",
applicableFor = AbstractRoleType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "Focus mappings", order = 70))
display = @PanelDisplay(label = "AssignmentType.focusMappings", order = 70))
public class FocusMappingsAssignmentsPanel<AH extends AssignmentHolderType> extends AbstractAssignmentPanel<AH> {

private static final Trace LOGGER = TraceManager.getTrace(FocusMappingsAssignmentsPanel.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@PanelInstance(identifier = "gdprAssignments",
applicableFor = UserType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "GDPR"))
display = @PanelDisplay(label = "FocusType.consents"))
public class GdprAssignmentPanel<AH extends AssignmentHolderType> extends AbstractRoleAssignmentPanel {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@PanelInstance(identifier = "dataProtectionAssignments",
applicableFor = FocusType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "Data protection"))
display = @PanelDisplay(label = "pageAdminFocus.dataProtection"))
public class GenericAbstractRoleAssignmentPanel<F extends FocusType> extends AbstractRoleAssignmentPanel<F> {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@PanelInstance(identifier = "orgAssignments",
applicableFor = FocusType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "Org", icon = GuiStyleConstants.CLASS_OBJECT_ORG_ICON, order = 30))
display = @PanelDisplay(label = "ObjectType.OrgType", icon = GuiStyleConstants.CLASS_OBJECT_ORG_ICON, order = 30))
public class OrgAssignmentsPanel<AH extends AssignmentHolderType> extends AbstractRoleAssignmentPanel<AH> {

public OrgAssignmentsPanel(String id, IModel<PrismObjectWrapper<AH>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@PanelInstance(identifier = "policyRuleAssignments",
applicableFor = AbstractRoleType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "Policy rule", icon = GuiStyleConstants.CLASS_POLICY_RULES_ICON, order = 60))
display = @PanelDisplay(label = "AssignmentType.policyRule", icon = GuiStyleConstants.CLASS_POLICY_RULES_ICON, order = 60))
public class PolicyRuleAssignmentsPanel<AH extends AssignmentHolderType> extends AbstractAssignmentPanel<AH> {

private static final Trace LOGGER = TraceManager.getTrace(PolicyRuleAssignmentsPanel.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@PanelInstance(identifier = "roleAssignments",
applicableFor = FocusType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "Role", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 20))
display = @PanelDisplay(label = "ObjectType.RoleType", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 20))
public class RoleAssignmentsPanel<AH extends AssignmentHolderType> extends AbstractRoleAssignmentPanel<AH> {

public RoleAssignmentsPanel(String id, IModel<PrismObjectWrapper<AH>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@PanelInstance(identifier = "serviceAssignments",
applicableFor = FocusType.class,
childOf = AssignmentHolderAssignmentPanel.class,
display = @PanelDisplay(label = "Service", icon = GuiStyleConstants.CLASS_OBJECT_SERVICE_ICON, order = 40))
display = @PanelDisplay(label = "ObjectType.ServiceType", icon = GuiStyleConstants.CLASS_OBJECT_SERVICE_ICON, order = 40))
public class ServiceAssignmentsPanel<AH extends AssignmentHolderType> extends AbstractRoleAssignmentPanel<AH> {

public ServiceAssignmentsPanel(String id, IModel<PrismObjectWrapper<AH>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@PanelInstance(identifier = "allInducements",
applicableFor = AbstractRoleType.class,
childOf = AbstractRoleInducementPanel.class,
display = @PanelDisplay(label = "All", icon = GuiStyleConstants.EVO_ASSIGNMENT_ICON, order = 10))
display = @PanelDisplay(label = "AssignmentPanel.allLabel", icon = GuiStyleConstants.EVO_ASSIGNMENT_ICON, order = 10))
public class AllInducementsPanel<AR extends AbstractRoleType> extends AbstractInducementPanel<AR> {

public AllInducementsPanel(String id, LoadableModel<PrismObjectWrapper<AR>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@PanelInstance(identifier = "constructionInducements",
applicableFor = AbstractRoleType.class,
childOf = AbstractRoleInducementPanel.class,
display = @PanelDisplay(label = "Resource", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 50))
display = @PanelDisplay(label = "ObjectType.ResourceType", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 50))
public class ConstructionInducementsPanel<AR extends AbstractRoleType> extends AbstractInducementPanel<AR> {

public ConstructionInducementsPanel(String id, IModel<PrismObjectWrapper<AR>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@PanelInstance(identifier = "focusMappingsInducements",
applicableFor = AbstractRoleType.class,
childOf = AbstractRoleInducementPanel.class,
display = @PanelDisplay(label = "Focus mappings", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 80))
display = @PanelDisplay(label = "AssignmentType.focusMappings", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 80))
public class FocusMappingsInducementsPanel<AR extends AbstractRoleType> extends AbstractInducementPanel<AR> {

public FocusMappingsInducementsPanel(String id, IModel<PrismObjectWrapper<AR>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
@PanelInstance(identifier = "inducedEntitlements",
applicableFor = AbstractRoleType.class,
childOf = AbstractRoleInducementPanel.class,
display = @PanelDisplay(label = "Induced entitlements", order = 70))
display = @PanelDisplay(label = "AbstractRoleMainPanel.inducedEntitlements", order = 70))
public class InducedEntitlementsPanel<AR extends AbstractRoleType> extends AbstractInducementPanel<AR> {

private static final Trace LOGGER = TraceManager.getTrace(InducedEntitlementsPanel.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@PanelInstance(identifier = "orgInducements",
applicableFor = AbstractRoleType.class,
childOf = AbstractRoleInducementPanel.class,
display = @PanelDisplay(label = "Organization", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 30))
display = @PanelDisplay(label = "ObjectType.OrgType", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 30))
public class OrgInducementsPanel<AR extends AbstractRoleType> extends AbstractInducementPanel<AR> {

public OrgInducementsPanel(String id, IModel<PrismObjectWrapper<AR>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@PanelInstance(identifier = "policyRuleInducements",
applicableFor = AbstractRoleType.class,
childOf = AbstractRoleInducementPanel.class,
display = @PanelDisplay(label = "Policy rule", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 60))
display = @PanelDisplay(label = "AssignmentType.policyRule", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 60))
public class PolicyRuleInducementsPanel<AR extends AbstractRoleType> extends AbstractInducementPanel<AR> {

public PolicyRuleInducementsPanel(String id, IModel<PrismObjectWrapper<AR>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@PanelInstance(identifier = "roleInducements",
applicableFor = AbstractRoleType.class,
childOf = AbstractRoleInducementPanel.class,
display = @PanelDisplay(label = "Role", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 20))
display = @PanelDisplay(label = "ObjectType.RoleType", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 20))
public class RoleInducementsPanel<AR extends AbstractRoleType> extends AbstractInducementPanel<AR> {

public RoleInducementsPanel(String id, IModel<PrismObjectWrapper<AR>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@PanelInstance(identifier = "serviceInducements",
applicableFor = AbstractRoleType.class,
childOf = AbstractRoleInducementPanel.class,
display = @PanelDisplay(label = "Service", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 40))
display = @PanelDisplay(label = "ObjectType.ServiceType", icon = GuiStyleConstants.CLASS_OBJECT_ROLE_ICON, order = 40))
public class ServiceInducementsPanel<AR extends AbstractRoleType> extends AbstractInducementPanel<AR> {

public ServiceInducementsPanel(String id, IModel<PrismObjectWrapper<AR>> model, ContainerPanelConfigurationType config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
@PanelType(name = "approvalCase")
@PanelInstance(identifier = "approvalCase",
display = @PanelDisplay(label = "Approvals", order = 1))
display = @PanelDisplay(label = "PageCase.approvalTab", order = 1))
public class ApprovalCasePanel extends AbstractObjectMainPanel<CaseType, AssignmentHolderDetailsModel<CaseType>> {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
@PanelType(name = "caseWorkItems")
@PanelInstance(identifier = "caseWorkItems",
display = @PanelDisplay(label = "Work items"))
display = @PanelDisplay(label = "PageCase.workitemsTab"))
public class CaseWorkitemsPanel extends AbstractObjectMainPanel<CaseType, AssignmentHolderDetailsModel<CaseType>> {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
@PanelType(name = "childCases")
@PanelInstance(identifier = "childCases", applicableFor = CaseType.class,
display = @PanelDisplay(label = "Child cases"))
display = @PanelDisplay(label = "PageCase.childCasesTab"))
@Counter(provider = ChildrenCasesCounter.class)
public class ChildCasesPanel extends AbstractObjectMainPanel<CaseType, AssignmentHolderDetailsModel<CaseType>> {
private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
@PanelType(name = "manualCase")
@PanelInstance(identifier = "manualCase",
display = @PanelDisplay(label = "Manual case", order = 1))
display = @PanelDisplay(label = "PageCase.manualOperationDetailsTab", order = 1))
public class ManualCasePanel extends AbstractObjectMainPanel<CaseType, AssignmentHolderDetailsModel<CaseType>> {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
@PanelType(name = "operationRequestCase")
@PanelInstance(identifier = "operationRequestCase",
display = @PanelDisplay(label = "Operation request", order = 1))
display = @PanelDisplay(label = "PageCase.operationRequestTab", order = 1))
public class OperationRequestCasePanel extends AbstractObjectMainPanel<CaseType, AssignmentHolderDetailsModel<CaseType>> {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@PanelInstance(identifier = "tasks",
status = ItemStatus.NOT_CHANGED,
applicableFor = FocusType.class,
display = @PanelDisplay(label = "Cases", icon = GuiStyleConstants.EVO_CASE_OBJECT_ICON, order = 50))
display = @PanelDisplay(label = "pageAdminFocus.cases", icon = GuiStyleConstants.EVO_CASE_OBJECT_ICON, order = 50))
@Counter(provider = FocusCassesCounter.class)
public class FocusCasesPanel<F extends FocusType>
extends AbstractObjectMainPanel<F, FocusDetailsModels<F>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*/
@PanelType(name = "history")
@PanelInstance(identifier = "history", applicableFor = FocusType.class, status = ItemStatus.NOT_CHANGED,
display = @PanelDisplay(label = "History", icon = "fa fa-history", order = 40))
display = @PanelDisplay(label = "pageAdminFocus.objectHistory", icon = "fa fa-history", order = 40))
public class FocusHistoryPanel<F extends FocusType> extends AbstractObjectMainPanel<F, FocusDetailsModels<F>> {

private static final long serialVersionUID = 1L;
Expand Down
Loading

0 comments on commit edac637

Please sign in to comment.