-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixing flaky test * updating quickstart docker * Fixing flaky test
- Loading branch information
Showing
31 changed files
with
813 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
...rc/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PasswordImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
~ Copyright 2024 Adobe | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ | ||
|
||
package com.adobe.cq.forms.core.components.internal.models.v1.form; | ||
|
||
import org.apache.sling.api.SlingHttpServletRequest; | ||
import org.apache.sling.api.resource.Resource; | ||
import org.apache.sling.models.annotations.Default; | ||
import org.apache.sling.models.annotations.Exporter; | ||
import org.apache.sling.models.annotations.Model; | ||
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; | ||
|
||
import com.adobe.cq.export.json.ComponentExporter; | ||
import com.adobe.cq.export.json.ExporterConstants; | ||
import com.adobe.cq.forms.core.components.internal.form.FormConstants; | ||
import com.adobe.cq.forms.core.components.models.form.Password; | ||
import com.adobe.cq.forms.core.components.util.AbstractFieldImpl; | ||
|
||
@Model( | ||
adaptables = { SlingHttpServletRequest.class, Resource.class }, | ||
adapters = { Password.class, ComponentExporter.class }, | ||
resourceType = { FormConstants.RT_FD_FORM_PASSWORD_V1 }) | ||
@Exporter( | ||
name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, | ||
extensions = ExporterConstants.SLING_MODEL_EXTENSION) | ||
public class PasswordImpl extends AbstractFieldImpl implements Password { | ||
|
||
@ValueMapValue | ||
@Default(values = "") | ||
private String validationPattern; | ||
|
||
@Override | ||
public String getFieldType() { | ||
return super.getFieldType(); | ||
} | ||
|
||
@Override | ||
public Integer getMinLength() { | ||
return minLength; | ||
} | ||
|
||
@Override | ||
public Integer getMaxLength() { | ||
return maxLength; | ||
} | ||
|
||
@Override | ||
public Long getMinimum() { | ||
return minimum; | ||
} | ||
|
||
@Override | ||
public Long getMaximum() { | ||
return maximum; | ||
} | ||
|
||
@Override | ||
public Long getExclusiveMaximum() { | ||
return exclusiveMaximum; | ||
} | ||
|
||
@Override | ||
public Long getExclusiveMinimum() { | ||
return exclusiveMinimum; | ||
} | ||
|
||
@Override | ||
public String getFormat() { | ||
return displayFormat; | ||
} | ||
|
||
@Override | ||
public String getValidationPattern() { | ||
return validationPattern; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Password.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
~ Copyright 2024 Adobe | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ | ||
|
||
package com.adobe.cq.forms.core.components.models.form; | ||
|
||
import org.osgi.annotation.versioning.ConsumerType; | ||
|
||
@ConsumerType | ||
public interface Password extends Field, StringConstraint, NumberConstraint { | ||
|
||
/** | ||
* Returns the validation pattern (regex) for the password field. | ||
* | ||
* @return the validation pattern | ||
* @since com.adobe.cq.forms.core.components.models.form 1.0.0 | ||
*/ | ||
String getValidationPattern(); | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
...ts-examples/clientlibs/forms-clientlib-site/styles/components/adaptive-form/password.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.cmp-adaptiveform-password { | ||
.inputMixin(); | ||
} |
7 changes: 7 additions & 0 deletions
7
...ain/content/jcr_root/apps/forms-components-examples/components/form/password/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
jcr:primaryType="cq:Component" | ||
jcr:title="Adaptive Form Password Box" | ||
jcr:description="Add a field to capture passwords." | ||
sling:resourceSuperType="core/fd/components/form/password/v1/password" | ||
componentGroup="Core Components Examples - Adaptive Form"/> |
5 changes: 5 additions & 0 deletions
5
...content/jcr_root/apps/forms-components-examples/components/form/password/_cq_template.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" | ||
jcr:primaryType="nt:unstructured" | ||
jcr:title="Password" | ||
fieldType="password"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
jcr:primaryType="sling:Folder"/> |
4 changes: 4 additions & 0 deletions
4
ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" | ||
jcr:primaryType="nt:unstructured"> | ||
</jcr:root> |
8 changes: 8 additions & 0 deletions
8
.../src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
cq:icon="abc" | ||
jcr:description="Add a field to password strings." | ||
jcr:primaryType="cq:Component" | ||
jcr:title="Adaptive Form Password (v1)" | ||
sling:resourceSuperType="core/fd/components/form/base/v1/base" | ||
componentGroup=".core-adaptiveform"/> |
91 changes: 91 additions & 0 deletions
91
...in/content/jcr_root/apps/core/fd/components/form/password/v1/password/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<!-- | ||
Copyright 2022 Adobe | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
Adaptive Form Password (v1) | ||
==== | ||
Adaptive Form Password field component written in HTL. | ||
|
||
## Features | ||
|
||
* Provides the following type of input: | ||
* password | ||
|
||
* Custom constraint messages for the above types | ||
* Styles | ||
* Allows replacing this component with other component (as mentioned below). | ||
|
||
### Use Object | ||
The Form Password component uses the `com.adobe.cq.forms.core.components.models.form.Password` Sling Model for its Use-object. | ||
|
||
### Edit Dialog Properties | ||
The following properties are written to JCR for this Form Password component and are expected to be available as `Resource` properties: | ||
|
||
1. `./jcr:title` - defines the label to use for this field | ||
2. `./hideTitle` - if set to `true`, the label of this field will be hidden | ||
3. `./name` - defines the name of the field, which will be submitted with the form data | ||
4. `./default` - defines the default value of the field | ||
5. `./description` - defines a help message that can be rendered in the field as a hint for the user | ||
6. `./required` - if set to `true`, this field will be marked as required, not allowing the form to be submitted until the field has a value | ||
7. `./requiredMessage` - defines the message displayed as tooltip when submitting the form if the value is left empty | ||
8. `./readOnly` - if set to `true`, the filed will be read only | ||
|
||
## Client Libraries | ||
The component provides a `core.forms.components.password.v1.runtime` client library category that contains the Javascript runtime for the component. | ||
It should be added to a relevant site client library using the `embed` property. | ||
|
||
It also provides a `core.forms.components.password.v1.editor` editor client library category that includes | ||
JavaScript handling for dialog interaction. It is already included by its edit dialog. | ||
|
||
## BEM Description | ||
``` | ||
BLOCK cmp-adaptiveform-password | ||
ELEMENT cmp-adaptiveform-password__label | ||
ELEMENT cmp-adaptiveform-password__label-container | ||
ELEMENT cmp-adaptiveform-password__widget | ||
ELEMENT cmp-adaptiveform-password__questionmark | ||
ELEMENT cmp-adaptiveform-password__shortdescription | ||
ELEMENT cmp-adaptiveform-password__longdescription | ||
ELEMENT cmp-adaptiveform-password__errormessage | ||
``` | ||
|
||
### Note | ||
By placing the class names `cmp-adaptiveform-password__label` and `cmp-adaptiveform-password__questionmark` within the `cmp-adaptiveform-password__label-container` class, you create a logical grouping of the label and question mark elements. This approach simplifies the process of maintaining a consistent styling for both elements. | ||
|
||
## Replace feature: | ||
We support replace feature that allows replacing Reset Button component to any of the below components: | ||
|
||
* Button | ||
* Date Picker | ||
* Email Input | ||
* Number Input | ||
* Reset Button | ||
* Submit Button | ||
* Telephone Input | ||
* Text Box | ||
|
||
## JavaScript Data Attribute Bindings | ||
|
||
The following attributes must be added for the initialization of the password component in the form view: | ||
1. `data-cmp-is="adaptiveFormPassword"` | ||
2. `data-cmp-adaptiveformcontainer-path="${formstructparser.formContainerPath}"` | ||
|
||
|
||
The following are optional attributes that can be added to the component in the form view: | ||
1. `data-cmp-valid` having a boolean value to indicate whether the field is currently valid or not | ||
2. `data-cmp-required` having a boolean value to indicate whether the field is currently required or not | ||
3. `data-cmp-readonly` having a boolean value to indicate whether the field is currently readonly or not | ||
4. `data-cmp-active` having a boolean value to indicate whether the field is currently active or not | ||
5. `data-cmp-visible` having a boolean value to indicate whether the field is currently visible or not | ||
6. `data-cmp-enabled` having a boolean value to indicate whether the field is currently enabled or not |
78 changes: 78 additions & 0 deletions
78
...jcr_root/apps/core/fd/components/form/password/v1/password/_cq_design_dialog/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
~ Copyright 2024 Adobe | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> | ||
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" | ||
xmlns:granite="http://www.adobe.com/jcr/granite/1.0" | ||
jcr:primaryType="nt:unstructured" | ||
jcr:title="Adaptive Form Field" | ||
sling:resourceType="cq/gui/components/authoring/dialog" | ||
trackingFeature="core-components:design-dialog:adaptiveform-password:v1"> | ||
<content | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/coral/foundation/container"> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<tabs | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/coral/foundation/tabs" | ||
maximized="{Boolean}true"> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<formats | ||
jcr:primaryType="nt:unstructured" | ||
jcr:title="Formats" | ||
sling:resourceType="granite/ui/components/coral/foundation/container" | ||
margin="{Boolean}true"> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<column | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/coral/foundation/container"> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<customFormats | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="granite/ui/components/coral/foundation/form/multifield" | ||
fieldDescription="The text input formats that are allowed to be selected by an author." | ||
fieldLabel="Custom Formats" | ||
composite="true" | ||
name="./allowedCustomFormats"> | ||
<field | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType = "granite/ui/components/coral/foundation/container" | ||
name = "./allowedCustomFormats"> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<customFormatKey | ||
jcr:primaryType="nt:unstructured" | ||
fieldDescription="The text input format that will be displayed in formatter dropdown in dialog." | ||
fieldLabel="Custom Format Key" | ||
sling:resourceType = "granite/ui/components/coral/foundation/form/textfield" | ||
name = "customFormatKey"/> | ||
<customFormatExpression | ||
jcr:primaryType="nt:unstructured" | ||
fieldDescription="The text input format in unicode which will be used in runtime." | ||
fieldLabel="Custom Format Expression" | ||
sling:resourceType = "granite/ui/components/coral/foundation/form/textfield" | ||
name = "customFormatValue"/> | ||
</items> | ||
</field> | ||
</customFormats> | ||
</items> | ||
</column> | ||
</items> | ||
</formats> | ||
</items> | ||
</tabs> | ||
</items> | ||
</content> | ||
</jcr:root> |
Oops, something went wrong.