-
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: Edit line list metadata in place #864
Draft
joshsadam
wants to merge
16
commits into
main
Choose a base branch
from
feature/linelist-medata-edit
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.
+152
−12
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
joshsadam
changed the title
Feature: Edit line list metadata in place
Enhancement: Edit line list metadata in place
Dec 11, 2024
…nd form improvements - Added a new `update_field` action in the SamplesController to handle field updates. - Updated the `check_editable` method to pass the current value to the edit form. - Modified the `_edit_field_form` partial to include hidden fields for original value and format. - Updated routes to include the new `update_field` patch route for samples. - Improved the HTML structure of the edit field form for better integration with Turbo Streams.
…f sample fields - Added `EditableCell` component to streamline the rendering of editable table cells. - Refactored `table_component.html.erb` to utilize the new `EditableCell` for cleaner code and improved maintainability. - Updated `samples_controller.rb` to render Turbo Stream updates for editable fields. - Introduced `inline_edit_controller.js` to manage focus and submission of inline edit forms. - Enhanced `_edit_field_form.html.erb` to integrate with the new inline editing functionality. - Created `_editable_table_field.html.erb` partial to encapsulate editable cell rendering logic.
- Replaced direct update call with a new service object for handling metadata updates. - Enhanced the update process to better manage field updates and original values. - Improved code readability and maintainability by encapsulating update logic within a dedicated service.
…error handling and code organization - Introduced private methods to encapsulate logic for setting field variables and updating sample fields. - Enhanced error handling by rendering appropriate responses based on sample validation errors. - Improved code readability and maintainability by organizing the update process into dedicated methods.
…ction - Updated the styling of the submit button in the EditableCell component for improved visual consistency. - Refactored the update_field action in SamplesController to streamline the update process using a single service call. - Improved the HTML structure of the edit field form to enhance integration with Turbo Streams and maintain a consistent user experience.
- Introduced a new test case to verify the functionality of editing a sample field. - The test navigates to the sample's edit page, interacts with the metadata toggle, and checks for the correct display of the sample's metadata. - Ensures that the edit field button is functional and properly integrated with the existing sample editing features.
…and update_field actions - Added `check_editable` method in SamplesController to verify field editability and render appropriate forms. - Introduced `update_field` action to handle updates for sample fields, utilizing a dedicated service for processing. - Created `_edit_field_form.html.erb` partial for inline editing, including necessary hidden fields for seamless updates. - Added `_editable_table_field.html.erb` partial to encapsulate editable cell rendering logic. - Updated routes to include new paths for `check_editable` and `update_field` actions. - Enhanced `_table.html.erb` to integrate the new editable functionality, improving user experience with Turbo Streams.
…d field visibility - Modified the test in `samples_test.rb` to assert the presence of the sample's metadata value directly. - Changed the interaction from clicking an edit field button to clicking a button that directly represents the sample's value, enhancing the test's accuracy and clarity. - Added an assertion to verify that the field is correctly displayed after the interaction, ensuring the test covers the expected behavior of the inline editing feature.
…iginal value handling - Added `original` value support in `inline_edit_controller.js` to store the initial input value. - Implemented `cancel` method to revert changes on Escape key press, improving user experience. - Updated `_edit_field_form.html.erb` and `_edit_field_form.html.erb` to pass original value to the inline edit controller. - Modified input field actions to include cancel functionality, allowing users to easily discard edits.
joshsadam
force-pushed
the
feature/linelist-medata-edit
branch
from
December 13, 2024 02:31
0393c62
to
bb00771
Compare
…lidation - Introduced `field_editable?` method to determine if a field is editable based on its provenance. - Enhanced the model's capability to manage user-specific metadata, improving the inline editing functionality.
- Renamed test to clarify it checks inline editing of a sample metadata field. - Added assertions to verify the presence of metadata toggle label and correct sample values in the table. - Enhanced test coverage for inline editing interactions, ensuring accurate representation of sample data.
- Updated `EditableCell` component to remove the `check_editable_url` parameter, streamlining the initialization process. - Refactored `SamplesController` to eliminate `check_editable` and `update_field` actions, consolidating field update logic into the `metadata/fields_controller`. - Introduced new `editable` and `update_value` actions in `fields_controller` to handle inline editing more effectively. - Removed obsolete partials related to inline editing and updated views to reflect the new structure. - Enhanced Turbo Stream responses for editable fields, improving user experience during inline edits.
…e editing - Modified assertions in `samples_test.rb` to check for button elements instead of table cell text for sample metadata values. - Ensured that the test accurately reflects the current inline editing functionality by verifying the presence of buttons for sample values.
…iting - Modified assertions in `samples_test.rb` to check for button elements instead of table cell text for sample metadata values. - Ensured the test accurately reflects the current inline editing functionality by verifying the presence of buttons for sample values.
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.
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.