You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by fm...@apache.org on 2019/02/07 16:47:08 UTC
[syncope] branch 2_0_X updated: [SYNCOPE-1433] disable flag during
schema editing
This is an automated email from the ASF dual-hosted git repository.
fmartelli pushed a commit to branch 2_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/2_0_X by this push:
new d6fc589 [SYNCOPE-1433] disable flag during schema editing
d6fc589 is described below
commit d6fc58934b5d430967828d6dc19b3f61994c1c28
Author: fmartelli <fa...@gmail.com>
AuthorDate: Thu Feb 7 17:46:55 2019 +0100
[SYNCOPE-1433] disable flag during schema editing
---
.../syncope/client/console/panels/PlainSchemaDetails.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
index dc85323..eeff2c6 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
@@ -62,7 +62,7 @@ public class PlainSchemaDetails extends AbstractSchemaDetailsPanel {
private final MultiFieldPanel<String> enumerationKeys;
private final AjaxDropDownChoicePanel<String> validatorClass;
-
+
private final AjaxDropDownChoicePanel<AttrSchemaType> type;
public PlainSchemaDetails(
@@ -71,12 +71,14 @@ public class PlainSchemaDetails extends AbstractSchemaDetailsPanel {
final PlainSchemaTO schemaTO) {
super(id, pageReference, schemaTO);
-
+
+ boolean isCreate = schemaTO == null || schemaTO.getKey() == null || schemaTO.getKey().isEmpty();
+
type = new AjaxDropDownChoicePanel<>(
"type", getString("type"), new PropertyModel<AttrSchemaType>(schemaTO, "type"));
type.setChoices(Arrays.asList(AttrSchemaType.values()));
- type.setEnabled(schemaTO == null || schemaTO.getKey() == null || schemaTO.getKey().isEmpty());
+ type.setEnabled(isCreate);
type.addRequiredLabel();
schemaForm.add(type);
@@ -286,8 +288,8 @@ public class PlainSchemaDetails extends AbstractSchemaDetailsPanel {
"readonly", getString("readonly"), new PropertyModel<Boolean>(schemaTO, "readonly")));
schemaForm.add(new AjaxCheckBoxPanel("uniqueConstraint",
- getString("uniqueConstraint"), new PropertyModel<Boolean>(schemaTO, "uniqueConstraint")));
-
+ getString("uniqueConstraint"), new PropertyModel<Boolean>(schemaTO, "uniqueConstraint")).
+ setEnabled(isCreate));
}
private void showHide(final PlainSchemaTO schema, final AjaxDropDownChoicePanel<AttrSchemaType> type,