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

🐛 Handle confirm deletes with multiple spaces #1572

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

sjd78
Copy link
Member

@sjd78 sjd78 commented Nov 27, 2023

Resolves: https://issues.redhat.com/browse/MTA-1725

When confirming the deletion of an entity by requiring the user to enter the name of the entity, the string check needs to ignore differences in white space.

The entity name may contain multiple spaces between words, but not show the spaces when viewing the name outside of an input box. HTML normally collapses multiple spaces into a single space. Also if the confirming name gets an extra space typed, that can cause a hard to see string mismatch. Trimming and then collapsing multiple spaces into a single space before comparing the string avoids this problem.

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c7c6d7c) 39.41% compared to head (89a84b4) 39.55%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1572      +/-   ##
==========================================
+ Coverage   39.41%   39.55%   +0.13%     
==========================================
  Files         146      146              
  Lines        4775     4786      +11     
  Branches     1138     1143       +5     
==========================================
+ Hits         1882     1893      +11     
  Misses       2879     2879              
  Partials       14       14              
Flag Coverage Δ
client 39.55% <100.00%> (+0.13%) ⬆️
server ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sjd78
Copy link
Member Author

sjd78 commented Nov 27, 2023

Screen shot (entering spaces in the confirm field):
screenshot-localhost_9000-2023 11 27-11_26_49

Resolves: https://issues.redhat.com/browse/MTA-1725

When confirming the deletion of an entity by requiring the user to
enter the name of the entity, the string check needs to ignore
differences in white space.

The entity name may contain multiple spaces between words, but not
show the spaces when viewing the name outside of an input box.  HTML
normally collapses multiple spaces into a single space.  Also if
the confirming name gets an extra space typed, that can cause a hard
to see string mismatch.  Trimming and then collapsing multiple spaces
into a single space before comparing the string avoids this problem.

Signed-off-by: Scott J Dickerson <[email protected]>
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.

2 participants