-
Notifications
You must be signed in to change notification settings - Fork 3
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
Enhancement: Metadata edit confirmation dialog #898
Open
joshsadam
wants to merge
14
commits into
main
Choose a base branch
from
metadata-edit-confirm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+219
−41
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
This comment has been minimized.
This comment has been minimized.
- Added a confirmation dialog for metadata field edits in the samples table. - Updated inline_edit_controller to log click events. - Refactored HTML structure for the confirmation dialog with improved content and button actions. - Adjusted tests to verify the presence and functionality of the confirmation dialog during metadata edits.
- Added a class to the content span in the viral button component to disable pointer events. - Refactored the conditional rendering of icons in the viral button component for better readability. - Changed the trimmed content rendering in the pathogen button component to use a span for consistency in structure.
- Removed automatic selection of input field in inline_edit_controller.js to streamline user experience. - Updated confirmation dialog in _editing_field_cell.html.erb to include dynamic content and improved button labels for clarity. - Refined translations in en.yml for consistency and clarity across various UI elements. - Enhanced tests in samples_test.rb to verify the presence and functionality of the confirmation dialog during metadata edits.
…ed localization - Added a new target 'newValue' in inline_edit_controller.js to facilitate dynamic updates in the confirmation dialog. - Updated the confirmation dialog description in en.yml to use the new target for better clarity and maintainability. - Improved user experience by ensuring the new value is displayed correctly during inline edits.
- Extracted the logic for updating the new value target into a private method #updateNewValueTarget for better readability and maintainability. - Ensured that the new value is updated correctly during inline edits, enhancing the overall user experience.
…g button labels and value display - Modified assertions in samples_test.rb to use updated button labels for the confirmation dialog, enhancing localization. - Changed the selector for verifying the new value display to ensure it accurately reflects the updated UI structure.
…ts and improved structure - Added a new test to verify the confirmation dialog can be cancelled, ensuring the original value is retained. - Improved the organization of existing tests by clearly marking setup, actions, and verification sections for better readability. - Updated assertions to reflect the latest UI changes, ensuring accurate verification of button labels and value displays.
joshsadam
force-pushed
the
metadata-edit-confirm
branch
from
January 16, 2025 19:49
4a0833d
to
8388a6c
Compare
- Standardized quotation marks in English and French locale files for better consistency. - Added confirmation dialog metadata editing fields in both English and French locale files to enhance user experience. - Ensured all relevant error messages and descriptions are properly localized for improved clarity.
This comment has been minimized.
This comment has been minimized.
- Updated handleBlurEvent to reset input value to original if no changes are detected. - Enhanced #hasValueChanged method to ensure it only returns true for non-empty, modified values, improving validation logic.
- Adjusted indentation in action sections of tests to ensure consistent formatting.
- Simplified event handling in inline_edit_controller.js by consolidating methods for keyboard and blur events. - Replaced the previous handleBlurEvent and inputKeydown methods with more concise keydown and blur methods. - Enhanced the reset and submit logic to improve clarity and maintainability. - Updated the corresponding action attributes in _editing_field_cell.html.erb to reflect the new method names.
This comment has been minimized.
This comment has been minimized.
Code Metrics Report
Code coverage of files in pull request scope (100.0%)
Reported by octocov |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 does this PR do and why?
Describe in detail what your merge request does and why.
On the samples page, a confirmation dialogue will open when a metadata field is being edited and the user clicks away from a changed value. The user is presented with 2 options:
Save
: Save the updated value and revert the cell to the un-editing state, displaying the new value.Discard
: Discard the updated value and revert the cell to the original value and render the unediting state.Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other pull requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
PR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.