Skip to content

Commit

Permalink
[SYNCOPE-1832] AjaxSpinnerFieldPanel -> AjaxNumberFieldPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Oct 20, 2024
1 parent 3ed59ca commit ab01f1a
Show file tree
Hide file tree
Showing 25 changed files with 282 additions and 430 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
import org.apache.syncope.client.ui.commons.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxCheckBoxPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxNumberFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxPalettePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxSpinnerFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.ui.commons.pages.BaseWebPage;
import org.apache.syncope.client.ui.commons.panels.WizardModalPanel;
Expand Down Expand Up @@ -205,7 +205,7 @@ protected Iterator<String> getChoices(final String input) {
max(Comparator.comparing(ClientAppTO::getClientAppId)).
ifPresent(app -> clientAppTO.setClientAppId(app.getClientAppId() + 1));
}
fields.add(new AjaxSpinnerFieldPanel.Builder<Long>().build(
fields.add(new AjaxNumberFieldPanel.Builder<Long>().build(
"field", "clientAppId", Long.class,
new PropertyModel<>(clientAppTO, "clientAppId")).setRequired(true));

Expand Down Expand Up @@ -434,7 +434,7 @@ public void setObject(final String object) {
requiredNameIdFormat.addRequiredLabel().setEnabled(true);
fields.add(requiredNameIdFormat);

fields.add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).build(
fields.add(new AjaxNumberFieldPanel.Builder<Integer>().min(0).build(
"field", "skewAllowance", Integer.class,
new PropertyModel<>(clientAppTO, "skewAllowance")));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.apache.syncope.client.ui.commons.Constants;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxCheckBoxPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxSpinnerFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxNumberFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.common.lib.to.SRARouteTO;
import org.apache.syncope.common.lib.types.SRARouteType;
Expand Down Expand Up @@ -154,7 +154,7 @@ public void setObject(final String object) {

add(new AjaxCheckBoxPanel("csrf", "csrf", new PropertyModel<>(route, "csrf")));

add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).build(
add(new AjaxNumberFieldPanel.Builder<Integer>().min(0).build(
"order", "order", Integer.class, new PropertyModel<>(route, "order")).
setRequired(true));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxCheckBoxPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxGridFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxNumberFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxPalettePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxSpinnerFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.ui.commons.pages.BaseWebPage;
import org.apache.syncope.common.lib.policy.AttrReleasePolicyTO;
Expand Down Expand Up @@ -120,7 +120,7 @@ public AttrReleasePolicyModalPanel(
new PropertyModel<>(model.getObject().getConf(), "principalAttrRepoConf.ignoreResolvedAttributes"),
false));

add(new AjaxSpinnerFieldPanel.Builder<Long>().build(
add(new AjaxNumberFieldPanel.Builder<Long>().build(
"expiration",
"expiration",
Long.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.apache.syncope.client.console.wizards.mapping.AttrRepoMappingPanel;
import org.apache.syncope.client.ui.commons.Constants;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxSpinnerFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxNumberFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.ui.commons.wizards.AjaxWizard;
import org.apache.syncope.common.lib.attr.AttrRepoConf;
Expand Down Expand Up @@ -125,7 +125,7 @@ Constants.DESCRIPTION_FIELD_NAME, getString(Constants.DESCRIPTION_FIELD_NAME),
state.setNullValid(false);
add(state);

add(new AjaxSpinnerFieldPanel.Builder<Integer>().build(
add(new AjaxNumberFieldPanel.Builder<Integer>().build(
"order",
"order",
Integer.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.apache.syncope.client.ui.commons.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxCheckBoxPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxSpinnerFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxNumberFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.ui.commons.wizards.AjaxWizard;
import org.apache.syncope.common.lib.AbstractLDAPConf;
Expand Down Expand Up @@ -129,7 +129,7 @@ Constants.DESCRIPTION_FIELD_NAME, getString(Constants.DESCRIPTION_FIELD_NAME),
state.setNullValid(false);
add(state);

add(new AjaxSpinnerFieldPanel.Builder<Integer>().build(
add(new AjaxNumberFieldPanel.Builder<Integer>().build(
"order",
"order",
Integer.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import org.apache.syncope.client.ui.commons.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior;
import org.apache.syncope.client.ui.commons.markup.html.form.AbstractFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxCheckBoxPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxNumberFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxPasswordFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxSpinnerFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.FieldPanel;
import org.apache.syncope.common.lib.types.ConnConfProperty;
Expand Down Expand Up @@ -100,9 +100,8 @@ protected void populateItem(final ListItem<ConnConfProperty> item) {
}

if (ClassUtils.isAssignable(Number.class, propertySchemaClass)) {
@SuppressWarnings("unchecked")
Class<Number> numberClass = (Class<Number>) propertySchemaClass;
field = new AjaxSpinnerFieldPanel.Builder<>().build("panel", label, numberClass, new Model<>());
field = new AjaxNumberFieldPanel.Builder<>().build(
"panel", label, AjaxNumberFieldPanel.cast(propertySchemaClass), new Model<>());
required = property.getSchema().isRequired();
} else if (ClassUtils.isAssignable(Boolean.class, propertySchemaClass)) {
field = new AjaxCheckBoxPanel("panel", label, new Model<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.apache.syncope.client.ui.commons.Constants;
import org.apache.syncope.client.ui.commons.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxSpinnerFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxNumberFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.common.lib.to.ConnIdBundle;
import org.apache.syncope.common.lib.to.ConnInstanceTO;
Expand Down Expand Up @@ -180,27 +180,27 @@ protected void onUpdate(final AjaxRequestTarget target) {
connInstanceTO.setPoolConf(new ConnPoolConfTO());
}

add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
add(new AjaxNumberFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
"connRequestTimeout", "connRequestTimeout", Integer.class,
new PropertyModel<>(connInstanceTO, "connRequestTimeout")));

add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
add(new AjaxNumberFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
"poolMaxObjects", "poolMaxObjects", Integer.class,
new PropertyModel<>(connInstanceTO.getPoolConf(), "maxObjects")));

add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
add(new AjaxNumberFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
"poolMinIdle", "poolMinIdle", Integer.class,
new PropertyModel<>(connInstanceTO.getPoolConf(), "minIdle")));

add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
add(new AjaxNumberFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
"poolMaxIdle", "poolMaxIdle", Integer.class,
new PropertyModel<>(connInstanceTO.getPoolConf(), "maxIdle")));

add(new AjaxSpinnerFieldPanel.Builder<Long>().min(0L).max(Long.MAX_VALUE).build(
add(new AjaxNumberFieldPanel.Builder<Long>().min(0L).max(Long.MAX_VALUE).build(
"poolMaxWait", "poolMaxWait", Long.class,
new PropertyModel<>(connInstanceTO.getPoolConf(), "maxWait")));

add(new AjaxSpinnerFieldPanel.Builder<Long>().min(0L).max(Long.MAX_VALUE).build(
add(new AjaxNumberFieldPanel.Builder<Long>().min(0L).max(Long.MAX_VALUE).build(
"poolMinEvictableIdleTime", "poolMinEvictableIdleTime", Long.class,
new PropertyModel<>(connInstanceTO.getPoolConf(), "minEvictableIdleTimeMillis")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.apache.syncope.client.ui.commons.Constants;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxCheckBoxPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxNumberFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxPalettePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxSpinnerFieldPanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.common.lib.to.ConnInstanceTO;
import org.apache.syncope.common.lib.to.ImplementationTO;
Expand Down Expand Up @@ -102,7 +102,7 @@ public ResourceDetailsPanel(final ResourceTO resourceTO, final boolean createFla
new PropertyModel<>(resourceTO, "enforceMandatoryCondition"),
false));

container.add(new AjaxSpinnerFieldPanel.Builder<Integer>().build(
container.add(new AjaxNumberFieldPanel.Builder<Integer>().build(
"propagationPriority",
"propagationPriority",
Integer.class,
Expand Down
Loading

0 comments on commit ab01f1a

Please sign in to comment.