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

M2-7457: Character Counter #851

Merged

Conversation

felipeMetaLab
Copy link
Contributor

@felipeMetaLab felipeMetaLab commented Aug 26, 2024

📝 Description

🔗 Jira Ticket M2-7457
Creating CharacterCounter component and adding it to Paragraph text

Changes include:

  • New component.
  • implemented on paragraph

📸 Screenshots

Simulator Screenshot - mindLogger - 2024-08-26 at 14 46 32
Simulator Screenshot - mindLogger - 2024-08-26 at 14 46 27
Simulator Screenshot - mindLogger - 2024-08-27 at 11 02 28

🪤 Peer Testing

1 - crating a paragraph text
2 - the counter must appears on bottom right
3 - validate the color behavios when onFocus and onBlur
4 - validate the number of typed character and limit

@felipeMetaLab felipeMetaLab changed the title feat/M2-7457-Creating_Character_Counter M2-7457-Creating_Character_Counter Aug 26, 2024
@felipeMetaLab felipeMetaLab changed the title M2-7457-Creating_Character_Counter M2-7457: Creating_Character_Counter Aug 26, 2024
@felipeMetaLab felipeMetaLab changed the title M2-7457: Creating_Character_Counter M2-7457: Character Counter Aug 26, 2024
src/shared/ui/survey/CharacterCounter.tsx Outdated Show resolved Hide resolved
src/shared/ui/survey/ParagraphText.tsx Outdated Show resolved Hide resolved
src/shared/ui/survey/CharacterCounter.tsx Outdated Show resolved Hide resolved
src/shared/ui/CharacterCounterText.tsx Outdated Show resolved Hide resolved
src/shared/ui/survey/tests/CharacterCounter.test.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@BamMironov BamMironov left a comment

Choose a reason for hiding this comment

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

Please consider a couple of comments from my side. But generally, it looks good to me

src/shared/ui/CharacterCounter.tsx Outdated Show resolved Hide resolved
src/shared/ui/survey/ParagraphText.tsx Outdated Show resolved Hide resolved
src/shared/ui/CharacterCounter.tsx Show resolved Hide resolved
@felipeMetaLab felipeMetaLab changed the base branch from dev to release/2.2.2 August 27, 2024 16:17
@ChaconC
Copy link
Contributor

ChaconC commented Aug 27, 2024

@felipeMetaLab can you review the failing test cases

Copy link
Contributor

@ChaconC ChaconC left a comment

Choose a reason for hiding this comment

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

Ran tests locally and all is passing.
I'm fine as far as my comments, but curious for @BamMironov to take a final pass.

@felipeMetaLab
Copy link
Contributor Author

@BamMironov I added some validations, when you have a chance, can you validate again and check if every thing is good for you ?
Thanks :)

@BamMironov
Copy link
Contributor

BamMironov commented Aug 28, 2024

@felipeMetaLab The code looks great!

However, when I ran the app from your git branch to test the component I noticed that I was not able to enter more symbols than limit.

Simulator.Screen.Recording.-.iPhone.15.-.2024-08-28.at.09.30.39.mp4

According to Acceptance Criteria 1 from M2-7457:

Given: Respondent accesses Paragraph Text Item

When: The inputted text reaches the max characters limit set in the Admin Panel

Then: The respondent is still capable to enter any more symbols/ text to overflow the max character limit

AND
The text box enters into an error state, and respondent cannot move to next item

@felipeMetaLab
Copy link
Contributor Author

felipeMetaLab commented Aug 28, 2024

@BamMironov that's right, it is the normal behavior of paragraph, the fact is that the component "character counter" accepts more then the limit, we can force some fake limit in paragraph to test the character counter like the image I sent, and the box is expanding as long you add more text but the min height is 170px, for you test the box expanding you should have a greater limit, and insert more text.
Simulator Screenshot - mindLogger - 2024-08-28 at 09 47 25

@BamMironov
Copy link
Contributor

@felipeMetaLab I see, thanks! Okay, so if maxLength is relevant only for tablets please make sure to specify that in the ticket so that the QA team is aware.

@felipeMetaLab
Copy link
Contributor Author

felipeMetaLab commented Aug 28, 2024

You are right @BamMironov I was look at the old criteria, it had a limit implicit, but I noticed it changed, sorry, I will make this adjustment.

…ng next button when number of character is higher than limit
@felipeMetaLab felipeMetaLab merged commit c934c61 into release/2.2.2 Aug 30, 2024
4 checks passed
@felipeMetaLab felipeMetaLab deleted the feat/M2-7457-Add_Character_Counter_To_ParagrathText branch August 30, 2024 19:21
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.

3 participants