-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
fix: case court report modal ui changes #6185
Merged
compwron
merged 11 commits into
rubyforgood:main
from
alex-yi37:issue-5888-case-contact-details-ux
Jan 30, 2025
Merged
fix: case court report modal ui changes #6185
compwron
merged 11 commits into
rubyforgood:main
from
alex-yi37:issue-5888-case-contact-details-ux
Jan 30, 2025
Conversation
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
makes the generate doc select element required, validates on form submit, clears form errors when changing the select, clears the errors on modal close, adds styles to regular select as well as the select2 select element
…rts and /casa_cases/$case_number pages
github-actions
bot
added
javascript
for use by Github Labeler to mark pull requests that update Javascript code
erb
labels
Jan 23, 2025
alex-yi37
requested review from
schoork,
FireLemons,
elasticspoon and
compwron
as code owners
January 30, 2025 03:00
compwron
reviewed
Jan 30, 2025
$('select.siblings-casa-cases').on('change', () => { | ||
if ($('select.siblings-casa-cases').find(':selected').text()) { | ||
enableBtn($('button.copy-court-button')[0]) | ||
} else { | ||
disableBtn($('button.copy-court-button')[0]) | ||
} | ||
}) | ||
// modal id is defined in _generate_docx.html.erb so would like to be able to implement modal close logic in that file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good comment. I am not sure of the right solution here.
compwron
approved these changes
Jan 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great test comments!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
erb
javascript
for use by Github Labeler to mark pull requests that update Javascript code
ruby
Pull requests that update Ruby code
Tests! 🎉💖👏
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What github issue is this PR for, if any?
Resolves #5888, #6165
What changed, and why?
This PR changes the modal displayed at
/case_court_reports
by constraining the width of the select options seen when the modal is opened. Currently, if an option is long enough it will overflow through the side of the modal, after these changes it is truncated with ellipses. It also now displays an error message when a user tries to generate a report without first making a selection and clears the error when a selection is made or the modal is closed. Closing the modal will also reset the selected case.How is this tested? (please write tests!) 💖💪
Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system
Screenshots please :)
Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.
Before: signed in as admin, selecting a long case option - there is no border around the option and it overflows when too long
Before: signed in as admin, trying to generate a report with no case selected. Does not tell user that selection is required, and keeps selection when modal is closed
test-vid-1.mov
After: signed in as admin, selecting a long case option - there's a border around the select element and it gets truncated with ellipses
After: signed in as admin, trying to generate report with case selected displays an error message. Making a selection clears the error. Closing the modal clears the error and also resets the selection
Screen.Recording.2025-01-24.at.12.50.35.AM.mov
After: signed in as volunteer, select border styles are consistent with admin styles and error message still appears when trying to generate report without selecting an option
Feelings gif (optional)
What gif best describes your feeling working on this issue? https://giphy.com/
How to embed:
![alt text](https://media.giphy.com/media/1nP7ThJFes5pgXKUNf/giphy.gif)