Skip to content

Commit 32bc644

Browse files
fileinput v2 css update
2 parents 67976d8 + 3907187 commit 32bc644

File tree

113 files changed

+937
-2626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+937
-2626
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ executors:
115115
docker:
116116
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.6-openjdk11
117117
<<: *docker_auth
118-
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:1209202301-openjdk11
118+
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:13804-openjdk11
119119
<<: *docker_auth
120120

121121
jobs:

.github/workflows/spec-validate-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
3030
# Check if any commit message contains a specific keyword or pattern (e.g., "RTC")
3131
if echo "$commit_messages" | grep -q 'RTC' && echo "$changed_files" | grep -E 'resources/schema/.*\.json$'; then
32-
echo "Commit message contains 'RTC' keyword, and specification files have changed. Build passed."
32+
echo "Commit message contains 'RTC' keyword, and specification files have changed. Build passed. Please check if your changes are working in visual rule editor"
3333
else
34-
echo "Either commit message doesn't contain 'RTC' keyword or specification files haven't changed. Build failed."
34+
echo "Either commit message doesn't contain 'RTC' keyword or specification files haven't changed. Build failed. Please check if your changes are working in visual rule editor"
3535
exit 1
3636
fi
3737
shell: bash

bundles/af-core/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@
340340
<plugin>
341341
<groupId>net.revelc.code</groupId>
342342
<artifactId>impsort-maven-plugin</artifactId>
343-
<version>1.4.1</version>
344343
<configuration>
345344
<groups>java, javax, org</groups>
346345
<staticGroups>*</staticGroups>

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v2/form/FormContainerImpl.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import com.adobe.cq.forms.core.components.models.form.ThankYouOption;
5050
import com.adobe.cq.forms.core.components.util.AbstractContainerImpl;
5151
import com.adobe.cq.forms.core.components.util.ComponentUtils;
52+
import com.day.cq.commons.LanguageUtil;
5253
import com.day.cq.wcm.api.Page;
5354
import com.day.cq.wcm.api.PageManager;
5455
import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -259,6 +260,26 @@ public String getLang() {
259260
}
260261
}
261262

263+
@Override
264+
public String getContainingPageLang() {
265+
// todo: right now it is copy of aem form because app is part of far, and af-apps is not pare of far
266+
if (request != null) {
267+
Page currentPage = getCurrentPage();
268+
if (!GuideWCMUtils.isForms(currentPage.getPath())) {
269+
String pagePath = currentPage.getPath(), pageLocaleRoot = LanguageUtil.getLanguageRoot(pagePath), locale = "";
270+
if (StringUtils.isNotBlank(pageLocaleRoot)) {
271+
int localeStartIndex = StringUtils.lastIndexOf(pageLocaleRoot, '/');
272+
locale = StringUtils.substring(pageLocaleRoot, localeStartIndex + 1);
273+
}
274+
return locale;
275+
} else {
276+
return FormContainer.super.getContainingPageLang();
277+
}
278+
} else {
279+
return FormContainer.super.getContainingPageLang();
280+
}
281+
}
282+
262283
@Override
263284
public String getLanguageDirection() {
264285
return GuideUtils.getLanguageDirection(getLang());

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/FormContainer.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,17 @@ default String getLang() {
295295
return "en-US";
296296
}
297297

298+
/**
299+
* Returns the language of the containing page
300+
*
301+
* @return the language of the containing page
302+
* @since com.adobe.cq.forms.core.components.models.form 4.7.1
303+
*/
304+
@JsonIgnore
305+
default String getContainingPageLang() {
306+
return getLang();
307+
}
308+
298309
/**
299310
* API to give direction of content in HTML for a given language.
300311
*

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Label.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,21 @@
2121
/**
2222
* Interface for a label
2323
*
24-
* @since com.adobe.cq.forms.core.components.models.form 4.6.0
24+
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
2525
*/
2626
@ConsumerType
27-
public interface Label extends TextContent {
27+
public interface Label {
28+
29+
/**
30+
* Returns {@code true} if label is rich text, otherwise {@code false}.
31+
*
32+
* @return {@code true} if label is rich text, otherwise {@code false}
33+
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
34+
*/
35+
@Nullable
36+
default Boolean isRichText() {
37+
return null;
38+
}
2839

2940
/**
3041
* Returns {@code true} if label should be visible, otherwise {@code false}.
@@ -37,4 +48,15 @@ default Boolean isVisible() {
3748
return null;
3849
}
3950

51+
/**
52+
* Returns the value of this label.
53+
*
54+
* @return the value of this label
55+
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
56+
*/
57+
@Nullable
58+
default String getValue() {
59+
return null;
60+
}
61+
4062
}

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/OptionsConstraint.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import org.osgi.annotation.versioning.ProviderType;
1919

20-
import com.fasterxml.jackson.annotation.JsonIgnore;
2120
import com.fasterxml.jackson.annotation.JsonProperty;
2221

2322
/**
@@ -58,17 +57,5 @@ default boolean isEnforceEnum() {
5857
* @return the list of enum names
5958
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
6059
*/
61-
@Deprecated
62-
@JsonIgnore
6360
String[] getEnumNames();
64-
65-
/**
66-
* Returns a list of RichText to be displayed to the end user.
67-
* The length of enum and enumNames array must match
68-
*
69-
* @return the list of enum names
70-
* @since com.adobe.cq.forms.core.components.models.form 4.6.0
71-
*/
72-
@JsonProperty("enumNames")
73-
TextContent[] getEnumNamesAsTextContent();
7461
}

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/TextContent.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* version, is bound to this proxy component resource type.
3535
* </p>
3636
*/
37-
@Version("4.7.0")
37+
@Version("5.2.0") // aligning this with release/650 since af2-rest-api is compiled with 5.2.0 in release/650
3838
package com.adobe.cq.forms.core.components.models.form;
3939

4040
import org.osgi.annotation.versioning.Version;

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractOptionsFieldImpl.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929

3030
import com.adobe.cq.forms.core.components.models.form.Field;
3131
import com.adobe.cq.forms.core.components.models.form.OptionsConstraint;
32-
import com.adobe.cq.forms.core.components.models.form.TextContent;
33-
import com.fasterxml.jackson.annotation.JsonIgnore;
34-
import com.fasterxml.jackson.annotation.JsonInclude;
3532

3633
/**
3734
* Abstract class which can be used as base class for options {@link Field} implementations.
@@ -52,10 +49,6 @@ public abstract class AbstractOptionsFieldImpl extends AbstractFieldImpl impleme
5249
@Nullable
5350
protected String[] enumNames;
5451

55-
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "areOptionsRichText")
56-
@Nullable
57-
private Boolean areOptionsRichText;
58-
5952
@Override
6053
public boolean isEnforceEnum() {
6154
return enforceEnum;
@@ -102,8 +95,6 @@ public Object[] getEnums() {
10295
}
10396

10497
@Override
105-
@Deprecated
106-
@JsonIgnore
10798
public String[] getEnumNames() {
10899
if (enumNames != null) {
109100
Map<Object, String> map = removeDuplicates();
@@ -117,29 +108,6 @@ public String[] getEnumNames() {
117108
return null;
118109
}
119110

120-
@Override
121-
public TextContent[] getEnumNamesAsTextContent() {
122-
if (enumNames != null) {
123-
Map<Object, String> map = removeDuplicates();
124-
String[] enumName = map.values().toArray(new String[0]);
125-
return Arrays.stream(enumName)
126-
.map(p -> new TextContent() {
127-
@Override
128-
@JsonInclude(JsonInclude.Include.NON_NULL)
129-
public @Nullable Boolean isRichText() {
130-
return areOptionsRichText;
131-
}
132-
133-
@Override
134-
public @Nullable String getValue() {
135-
return translate("enumNames", p);
136-
}
137-
})
138-
.toArray(TextContent[]::new);
139-
}
140-
return null;
141-
}
142-
143111
@Override
144112
public Object[] getDefault() {
145113
Object[] typedDefaultValue = null;

bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxGroupImplTest.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.commons.lang3.reflect.FieldUtils;
2626
import org.apache.sling.api.resource.Resource;
2727
import org.apache.sling.testing.mock.sling.servlet.MockSlingHttpServletRequest;
28-
import org.jetbrains.annotations.Nullable;
2928
import org.junit.jupiter.api.BeforeEach;
3029
import org.junit.jupiter.api.Test;
3130
import org.junit.jupiter.api.extension.ExtendWith;
@@ -297,44 +296,6 @@ void testGetType() {
297296
void testGetEnumNames() {
298297
CheckBoxGroup checkboxGroup = getCheckBoxGroupUnderTest(PATH_CHECKBOX_GROUP);
299298
assertArrayEquals(new String[] { "m", "f", "o" }, checkboxGroup.getEnumNames());
300-
TextContent textContent1 = new TextContent() {
301-
@Override
302-
public @Nullable Boolean isRichText() {
303-
return null;
304-
}
305-
306-
@Override
307-
public @Nullable String getValue() {
308-
return "m";
309-
}
310-
};
311-
TextContent textContent2 = new TextContent() {
312-
@Override
313-
public @Nullable Boolean isRichText() {
314-
return null;
315-
}
316-
317-
@Override
318-
public @Nullable String getValue() {
319-
return "f";
320-
}
321-
};
322-
TextContent textContent3 = new TextContent() {
323-
@Override
324-
public @Nullable Boolean isRichText() {
325-
return null;
326-
}
327-
328-
@Override
329-
public @Nullable String getValue() {
330-
return "o";
331-
}
332-
};
333-
TextContent[] textContent = new TextContent[] { textContent1, textContent2, textContent3 };
334-
for (int i = 0; i < checkboxGroup.getEnumNamesAsTextContent().length; i++) {
335-
assertEquals(textContent[i].getValue(), checkboxGroup.getEnumNamesAsTextContent()[i].getValue());
336-
assertEquals(textContent[i].isRichText(), checkboxGroup.getEnumNamesAsTextContent()[i].isRichText());
337-
}
338299
}
339300

340301
@Test
@@ -345,9 +306,6 @@ void testGetEnumNamesWithDuplicateEnumValues() {
345306
map.put("1", "Item 2");
346307
map.put("0", "Item 3");
347308
assertArrayEquals(map.values().toArray(new String[0]), checkboxGroup.getEnumNames());
348-
String[] checkboxGroupValues = Arrays.stream(checkboxGroup.getEnumNamesAsTextContent()).map(d -> d.getValue()).toArray(
349-
size -> new String[checkboxGroup.getEnumNamesAsTextContent().length]);
350-
assertArrayEquals(map.values().toArray(new String[0]), checkboxGroupValues);
351309
}
352310

353311
@Test
@@ -428,8 +386,5 @@ void testInsertionOrderForEnumNames() {
428386
Set<String> set = new LinkedHashSet<>(Arrays.asList("Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine",
429387
"Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen", "Twenty"));
430388
assertArrayEquals(set.toArray(new String[0]), checkboxGroup.getEnumNames());
431-
String[] checkboxGroupValues = Arrays.stream(checkboxGroup.getEnumNamesAsTextContent()).map(d -> d.getValue()).toArray(
432-
size -> new String[checkboxGroup.getEnumNamesAsTextContent().length]);
433-
assertArrayEquals(set.toArray(new String[0]), checkboxGroupValues);
434389
}
435390
}

bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/CheckBoxImplTest.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@
2727

2828
import com.adobe.cq.forms.core.Utils;
2929
import com.adobe.cq.forms.core.components.internal.form.FormConstants;
30-
import com.adobe.cq.forms.core.components.models.form.*;
30+
import com.adobe.cq.forms.core.components.models.form.Base;
31+
import com.adobe.cq.forms.core.components.models.form.CheckBox;
3132
import com.adobe.cq.forms.core.components.models.form.CheckBox.Orientation;
33+
import com.adobe.cq.forms.core.components.models.form.ConstraintType;
34+
import com.adobe.cq.forms.core.components.models.form.FieldType;
35+
import com.adobe.cq.forms.core.components.models.form.Label;
3236
import com.adobe.cq.forms.core.context.FormsCoreComponentTestContext;
3337
import com.adobe.cq.wcm.style.ComponentStyleInfo;
3438
import io.wcm.testing.mock.aem.junit5.AemContext;
@@ -305,16 +309,6 @@ void testGetEnum() {
305309

306310
}
307311

308-
@Test
309-
void testGetNullEnumNames() {
310-
CheckBox checkbox = getCheckBoxUnderTest(PATH_CHECKBOX);
311-
assertNull(checkbox.getEnumNamesAsTextContent());
312-
assertNull(checkbox.getEnumNames());
313-
CheckBox noEnumCheckbox = getCheckBoxUnderTest(PATH_CHECKBOX_NOENUM);
314-
assertNull(noEnumCheckbox.getEnumNamesAsTextContent());
315-
assertNull(noEnumCheckbox.getEnumNames());
316-
}
317-
318312
@Test
319313
void testGetNullEnum() {
320314
CheckBox noEnumCheckbox = getCheckBoxUnderTest(PATH_CHECKBOX_NOENUM);

0 commit comments

Comments
 (0)