From 66f23b901947289bbcff4e1c2e10d08fc4db7577 Mon Sep 17 00:00:00 2001 From: matus Date: Thu, 7 Sep 2017 09:56:06 +0200 Subject: [PATCH] Refactoring SystemComfigPanel, markup cleanup --- .../component/SystemConfigPanel.html | 138 +++++++++--------- .../component/SystemConfigPanel.java | 47 ++---- 2 files changed, 79 insertions(+), 106 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/component/SystemConfigPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/component/SystemConfigPanel.html index 3b3978b5b04..a041a6fb9a0 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/component/SystemConfigPanel.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/component/SystemConfigPanel.html @@ -17,76 +17,76 @@ -
-
-

- -

- -
- -
-
- -
- -
-
- -
- -

- -

- -
-

- -

-
- - -
-

- -

- -
- -
- +
+
+

+ +

+ +
+ +
+
+ +
+ +
+
+ +
+ +

+ +

+
+

+ +

+
+
+
+ +
+
+
+

+ +

+ +
+
+ +
+ + + + + + + + + + - - - - - - - - - +
+ --> + + diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/component/SystemConfigPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/component/SystemConfigPanel.java index 6601d6ab1cb..23d6c43cd30 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/component/SystemConfigPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/component/SystemConfigPanel.java @@ -42,22 +42,17 @@ */ public class SystemConfigPanel extends BasePanel { - private static final long serialVersionUID = 1L; - private static final String ID_GLOBAL_PASSWORD_POLICY_CHOOSER = "passwordPolicyChooser"; + private static final long serialVersionUID = 1L; + private static final String ID_GLOBAL_PASSWORD_POLICY_CHOOSER = "passwordPolicyChooser"; private static final String ID_GLOBAL_SECURITY_POLICY_CHOOSER = "securityPolicyChooser"; private static final String ID_OBJECT_POLICY_EDITOR = "objectPolicyEditor"; private static final String ID_GLOBAL_CHOOSEASSIGNEMNTPOLICYENFORCEMENT = "chooseAssignmentPolicyEnforcement"; private static final String ID_CLEANUP_AUDIT_RECORDS = "auditRecordsCleanup"; private static final String ID_CLEANUP_CLOSED_TASKS = "closedTasksCleanup"; - private static final String ID_INFORMATION_DEPLOYMENT_NAME = "deploymentInformationName"; - private static final String ID_INFORMATION_DEPLOYMENT_COLOUR = "deploymentInformationColour"; - private static final String ID_CLEANUP_AUDIT_RECORDS_TOOLTIP = "auditRecordsCleanupTooltip"; - private static final String ID_CLEANUP_CLOSED_TASKS_TOOLTIP = "closedTasksCleanupTooltip"; - private static final String ID_EXPERIMENTAL_CODE_CHECKBOX = "experimentalCodeCheckbox"; - private static final String ID_LABEL_SIZE = "col-md-6"; - private static final String ID_INPUT_SIZE = "col-md-6"; + private static final String ID_LABEL_SIZE = "col-md-4"; + private static final String ID_INPUT_SIZE = "col-md-4"; public SystemConfigPanel(String id, IModel model) { @@ -67,7 +62,7 @@ public SystemConfigPanel(String id, IModel model) { initLayout(); } - protected void initLayout(){ + protected void initLayout() { ChooseTypePanel passPolicyChoosePanel = new ChooseTypePanel(ID_GLOBAL_PASSWORD_POLICY_CHOOSER, new PropertyModel>(getModel(), SystemConfigurationDto.F_PASSWORD_POLICY)); @@ -83,43 +78,21 @@ protected void initLayout(){ DropDownFormGroup assignmentPolicyEnforcementLevel = new DropDownFormGroup(ID_GLOBAL_CHOOSEASSIGNEMNTPOLICYENFORCEMENT, new PropertyModel(getModel(), SystemConfigurationDto.F_ASSIGNMENTPOLICYENFORCEMENT_LEVEL), - WebComponentUtil.createReadonlyModelFromEnum(AEPlevel.class),new EnumChoiceRenderer(SystemConfigPanel.this), - createStringResource("SystemConfigPanel.assignmentPolicyEnforcement"),ID_LABEL_SIZE,ID_INPUT_SIZE, false); + WebComponentUtil.createReadonlyModelFromEnum(AEPlevel.class), new EnumChoiceRenderer(SystemConfigPanel.this), + createStringResource("SystemConfigPanel.assignmentPolicyEnforcement"), ID_LABEL_SIZE, ID_INPUT_SIZE, false); assignmentPolicyEnforcementLevel.setOutputMarkupId(true); assignmentPolicyEnforcementLevel.getInput().add(new EmptyOnChangeAjaxFormUpdatingBehavior()); add(assignmentPolicyEnforcementLevel); - - // TextField auditRecordsField = WebComponentUtil.createAjaxTextField(ID_CLEANUP_AUDIT_RECORDS, new PropertyModel(getModel(), SystemConfigurationDto.F_AUDIT_CLEANUP)); - TextFormGroup auditRecordsField = new TextFormGroup(ID_CLEANUP_AUDIT_RECORDS, new PropertyModel(getModel(),SystemConfigurationDto.F_AUDIT_CLEANUP), createStringResource("SystemConfigPanel.cleanupPolicy.auditRecords"),"SystemConfigPanel.tooltip.duration", true,ID_LABEL_SIZE,ID_INPUT_SIZE,false,false); - TextFormGroup closedTasksField = new TextFormGroup(ID_CLEANUP_CLOSED_TASKS, new PropertyModel(getModel(),SystemConfigurationDto.F_TASK_CLEANUP), createStringResource("SystemConfigPanel.cleanupPolicy.closedTasks"),"SystemConfigPanel.tooltip.duration",true,ID_LABEL_SIZE,ID_INPUT_SIZE, false, false); - - // TextField closedTasksField = WebComponentUtil.createAjaxTextField(ID_CLEANUP_CLOSED_TASKS, new PropertyModel(getModel(), SystemConfigurationDto.F_TASK_CLEANUP)); - - // TextField deploymentNameField = WebComponentUtil.createAjaxTextField(ID_INFORMATION_DEPLOYMENT_NAME, new PropertyModel(getModel(), SystemConfigurationDto.F_DEPLOYMENT_NAME)); - - //TextField deploymentColourField = WebComponentUtil.createAjaxTextField(ID_INFORMATION_DEPLOYMENT_COLOUR, new PropertyModel(getModel(), SystemConfigurationDto.F_DEPLOYMENT_COLOUR)); + TextFormGroup auditRecordsField = new TextFormGroup(ID_CLEANUP_AUDIT_RECORDS, new PropertyModel(getModel(), SystemConfigurationDto.F_AUDIT_CLEANUP), createStringResource("SystemConfigPanel.cleanupPolicy.auditRecords"), "SystemConfigPanel.tooltip.duration", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false, false); + TextFormGroup closedTasksField = new TextFormGroup(ID_CLEANUP_CLOSED_TASKS, new PropertyModel(getModel(), SystemConfigurationDto.F_TASK_CLEANUP), createStringResource("SystemConfigPanel.cleanupPolicy.closedTasks"), "SystemConfigPanel.tooltip.duration", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false, false); add(auditRecordsField); add(closedTasksField); - // createTooltip(ID_CLEANUP_AUDIT_RECORDS_TOOLTIP); - //createTooltip(ID_CLEANUP_CLOSED_TASKS_TOOLTIP); - - - //CheckBox experimentalCodeCheck = WebComponentUtil.createAjaxCheckBox(ID_EXPERIMENTAL_CODE_CHECKBOX, new PropertyModel(getModel(), SystemConfigurationDto.F_ENABLE_EXPERIMENTAL_CODE)); - CheckFormGroup experimentalCodeCheck = new CheckFormGroup(ID_EXPERIMENTAL_CODE_CHECKBOX, new PropertyModel(getModel(), SystemConfigurationDto.F_ENABLE_EXPERIMENTAL_CODE), createStringResource("SystemConfigPanel.misc.enableExperimentalCode"),ID_LABEL_SIZE, ID_INPUT_SIZE); + CheckFormGroup experimentalCodeCheck = new CheckFormGroup(ID_EXPERIMENTAL_CODE_CHECKBOX, new PropertyModel(getModel(), SystemConfigurationDto.F_ENABLE_EXPERIMENTAL_CODE), createStringResource("SystemConfigPanel.misc.enableExperimentalCode"), ID_LABEL_SIZE, ID_INPUT_SIZE); add(experimentalCodeCheck); - - } - - - - private void createTooltip(String id) { - Label tooltip = new Label(id); - tooltip.add(new InfoTooltipBehavior()); - add(tooltip); } }