Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding character counter to Text input textfield/textarea component #1081

Open
wants to merge 514 commits into
base: dev
Choose a base branch
from

Conversation

shubham-adobeaem
Copy link

@shubham-adobeaem shubham-adobeaem commented Feb 21, 2024

Description

Adds a character counter in textfield component.
image

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

AnurudraS and others added 30 commits September 11, 2023 13:14
* FORMS-10718 GuideBridge resolveNode API
- bumping af core version
@review @vdua
DOD(Yes)

* FORMS-10718 GuideBridge resolveNode API
    - bumping af core version
    @review @vdua
    DOD(Yes)

* Adding an intermitten error as whitelist

* Ignoring 403 intermittent error
* test cases for custom submit action with redirect parameters

* Update CustomAFSubmitService.java
…model, after validation rule deletion (adobe#859)

* FORMS-9492: when validation expression is empty, remove the property from json model

* FORMS-9492: test case added

* FORMS-9492: incorporated review comments

* FORMS-9492: update test-content.json
* [FORMS-10586] update html structure for RTL

* add rtl in datepickerwidget

* update class name

* review points

* update readme files

* imple v2 wizard core component

* update wizard test cases

---------

Co-authored-by: Amit Kumar <amitkumar@adobe.com>
…g to styles (adobe#830)

* Author UI dialog changes

* persisting data into crx in the right format

* Updating jcr property in runtime

* Support via template policy

* Servlet addons

* Policy to dropdown within dialog code

* Toggle additional properties - with bug of initial hide

* storing custom properties in field's property in jcr

* Fixed visibility toggle bug with jcr properties

* Groupname storage in jcr and separate additional property field

* Refactoring multifield hack

* Conditonal rendering of advanced tab in dialogs based on presence of custom properties in template policy

* Adding policy properties to headless json - WITH BUG: selecting multiple groups renders none

* Addition of custom properties in form json, and refactoring

* missed code rename from prev commit

* Removing crx property for addon checkbox

* Reverting removal of check in crx. Requirement exists in js

* removed constant

* code refactor

* Fixing imports

* Comment changes

* Advanced tab related js

* Implemented fix for edge case: Advanced tab will now be rendered on an additional constraint

* Added Java ans JSdoc comments

* comnvertToArray usecase replacement

* Validations in Edit dialog and Template for keys and group names

* Dialog warning on custom property delete on template policy

* Typp fix

* Support for panel and initial test cases

* Cypress tests for custom properties

* format changes

* Fixed flaky test

* Fix flaky test and cleanup of policy custom property

* Fixed test failure

* Test failure fixes

* another test fix

* fixing select blur test failure

* Field descriptions

* Custom properties support for Panel container via base ref

* Minor fix

* Container support

* Incorporated review comments

* Migration of logic to cq-guides

* Clean up and bug fixes

* Removed utiltiy functions

* Refactoring and clean up

* Space fix

* Fixing constants

* Support for accordion

* wizard support

* Support for both type of tabs and wizard

* Moved snippet of additonal cp to cq guides and incorporated review comments

* Fixing imports

* Reverted old changes that are not necessary anymore

* Incorporated review comments

* removed stray xml property

* change in internal function

* Test case selector fixes

* Supporting Omega tracking in design dialogs

* Pom changes to incorporate local forms sdk api - needs to be changed when release happens

* Updated aem-forms-sdk-api version

* Changed aem-forms-sdk-api version post bugfix in cq-guides

* Optional resolution of model package

* NoClassDef class exception handling

* Check in custom properties test to check for latest addon
* Releng moving to latest cloud ready quickstart

* Fixing flaky test and adding logs

* Fixing flaky test
* Update af-core version

* Fixed test cases
Pavitra Khatri and others added 7 commits April 18, 2024 09:05
* FORMS-12203: Added localization changes and test cases

* FORMS-12203: Updated test case

* FORMS-12203: Altered to contains instead of get

* FORMS-12203: Resolved comments

* FORMS-12203: Updated test cases

* FORMS-12203: Updated delete button

* FORMS-12203: Updated button

* Retry wizard.locale.spec.js tests

* FORMS-12203: Added theme request wait

* Update wizard.locale.spec.js

* Added latestaddon check

* Delete ui.tests/test-module/package-lock.json

* Update commands.js

* Revert "Delete ui.tests/test-module/package-lock.json"

This reverts commit fd97b53.

* Reverted package-lock.json changes

* FORMS-12203: Removed exception inline

* FORMS-12203: Resolved comments

* FORMS-12203: Update index.js

* FORMS-12203: Removed package-lock.json change

* Update index.js

* Update error message in index.js

* Update index.js

* Update wizard.locale.spec.js

* Removed an intercept

* Updated regex patterns

---------

Co-authored-by: Shivangi Mittal <shivangim@Shivangis-MacBook-Pro.local>
…be#1169)

* FORMS-13851 Support for language in date picker and number input
@review @vdua
DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
    @review @vdua
    DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
        @review @vdua
        DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
            @review @vdua
            DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                @review @vdua
                DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                    @review @vdua
                    DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                        @review @vdua
                        DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                            @review @vdua
                            DOD(Yes)

* Update space character for thousands separator in french lang

* FORMS-13851 Support for language in date picker and number input
                                @review @vdua
                                DOD(Yes)

---------

Co-authored-by: Varun Dua <vdua@adobe.com>
@@ -0,0 +1,6 @@
<template data-sly-template.characterCounter="${@ componentId, showCharCounter, maxLength, bemBlock}">
<div data-sly-test="${showCharCounter}" class="${bemBlock}__charcounter" aria-label="Character Counter">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Localize these like:
${'Character Counter' @ i18n, locale=request.locale}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly localize:

  1. Current Character Count
  2. Maximum Character Count

@@ -50,6 +50,8 @@ describe('Page - Authoring', function () {
// Check If Dialog Options Are Visible
cy.get("[name='./multiLine']")
.should("exist");
cy.get("[name='./showCharCounter']")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add test if the input is updated, count is also updated.

const updateCharacterCounter = () => {
const charCount = this.widget.value.length;
if (counterSpan) {
counterSpan.textContent = Granite.I18n.getMessage(charCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const charCount = this.widget.value.length;
if (counterSpan) {
counterSpan.textContent = Granite.I18n.getMessage(charCount);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also do the same for max character count, as authour can write a rule to modify that and then the modified value should show up and also will need to be localized.

Copy link
Contributor

@sakshi-arora1 sakshi-arora1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to take care of localization, tests and a few other minor things.

ui.af.apps/pom.xml Outdated Show resolved Hide resolved
@shubham-adobeaem shubham-adobeaem marked this pull request as ready for review May 1, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet