Skip to content

Commit

Permalink
[EAK-504] Fix review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Jan 29, 2024
1 parent 2ded0e6 commit a321900
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.exadel.aem.toolkit.api.annotations.meta.ValueRestriction;
import com.exadel.aem.toolkit.api.annotations.meta.ValueRestrictions;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface MaxChildren {
/**
* Specifies the maximum number of children allowed for container component
* @return Long value, 0 or greater
*/
@ValueRestriction(ValueRestrictions.NON_NEGATIVE)
long value();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class MaxChildrenHandler implements Handler {
/**
* Name of the listener to resolve max children limit for `policies` js module
*/
public static final String MAX_LIMIT_RESOLVER_NAME = "resolvemaxchildren";
public static final String MAX_CHILDREN_RESOLVER_NAME = "resolvemaxchildren";

/**
* Format of default max children limit resolver
*/
private static final String MAX_LIMIT_RESOLVER_FORMAT = "() => %d";
private static final String MAX_CHILDREN_RESOLVER_FORMAT = "() => %d";


/**
Expand All @@ -61,7 +61,7 @@ private static void populate(MaxChildren rule, Target target) {
.attribute(DialogConstants.PN_PRIMARY_TYPE, DialogConstants.NT_EDIT_CONFIG)
.getOrCreateTarget(DialogConstants.NN_LISTENERS)
.attribute(DialogConstants.PN_PRIMARY_TYPE, DialogConstants.NT_LISTENERS)
.attribute(MAX_LIMIT_RESOLVER_NAME, String.format(MAX_LIMIT_RESOLVER_FORMAT, rule.value()));
.attribute(MAX_CHILDREN_RESOLVER_NAME, String.format(MAX_CHILDREN_RESOLVER_FORMAT, rule.value()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
ns.MaxChildrenLimiter.LIMIT_RESOLVER_PROPERTY = 'eak-max-children';

/** The default limit active message */
ns.MaxChildrenLimiter.ERROR_MESSAGE = ns.I18n.get('Maximum number of allowed components reached');
ns.MaxChildrenLimiter.ERROR_MESSAGE = ns.I18n.get('Maximum number of allowed components is reached');

/** The name of attribute to store limit message and marker */
ns.MaxChildrenLimiter.ERROR_MESSAGE_ATTR = 'data-max-children-marker';
Expand Down

0 comments on commit a321900

Please sign in to comment.