-
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
Metadata Templates Selection UI #914
Open
joshsadam
wants to merge
72
commits into
main
Choose a base branch
from
metadata-templates/dropdown
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.
Open
+596
−200
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
force-pushed
the
metadata-templates/dropdown
branch
3 times, most recently
from
January 31, 2025 01:42
7cc8fc8
to
3c4f208
Compare
joshsadam
force-pushed
the
metadata-templates/dropdown
branch
from
February 3, 2025 13:59
8073a23
to
e97b192
Compare
Code Metrics Report
Code coverage of files in pull request scope (95.3%)Reported by octocov |
…thorization checks - Added `create_metadata_template?` method to `GroupPolicy` and `ProjectNamespacePolicy` for authorization. - Removed the obsolete `MetadataTemplatePolicy` class. - Enhanced `CreateService` to include authorization logic for creating metadata templates. - Updated locale files to include new activity messages for metadata template creation.
…ndling - Introduced parameter validation in CreateService to ensure required fields are present before creating a metadata template. - Added custom error handling for missing name and fields, improving user feedback during template creation. - Updated tests to cover new validation scenarios, ensuring robust functionality for metadata template creation. - Standardized quotation marks in locale files for consistency across English and French translations.
…ror handling and validation - Initialized @metadata_template to streamline template creation process. - Simplified error handling by directly adding errors to the namespace instead of the template. - Refined parameter validation to ensure required fields are checked before template creation. - Updated tests to reflect changes in error handling and validation logic, ensuring robust functionality.
- Added support for displaying metadata template creation activities in both group and project activity components. - Introduced a new method `metadata_template_link` in the activity components to check for metadata template creation actions. - Updated HTML templates to render appropriate translations for metadata template activities, ensuring user clarity. - Refactored locale files to standardize the use of `template_name` in activity messages for consistency across English and French translations. - Improved parameter handling in the `track_activity` concern to include metadata template details during activity tracking.
… error handling - Updated CreateService to enforce validation rules ensuring fields are either present as an array or raise appropriate errors. - Enhanced error messages in locale files for better user feedback during template creation. - Added tests to cover scenarios for missing fields, unauthorized access, and duplicate template names, ensuring robust functionality. - Standardized quotation marks in locale files for consistency across English and French translations.
…ncements - Added a new `DestroyService` for handling the destruction of metadata templates, including authorization checks. - Updated `ProjectNamespacePolicy` to include `destroy_metadata_template?` method for permission validation. - Enhanced tests for both the `DestroyService` and `ProjectNamespacePolicy` to ensure correct permission handling and functionality. - Improved clarity in policy and service interactions for better maintainability and user feedback.
- Refactored `create_metadata_template?` and `destroy_metadata_template?` methods to use effective access level checks for authorization. - Updated tests to include assertions for the new permission methods, ensuring proper functionality and coverage. - Improved clarity in permission handling for metadata template operations.
…ermissions - Introduced `UpdateService` for handling updates to metadata templates, including authorization checks. - Added `update_metadata_template?` method to `GroupPolicy` and `ProjectNamespacePolicy` for permission validation. - Updated activity components to recognize metadata template update actions. - Enhanced locale files to include new activity messages for metadata template updates. - Added tests for `UpdateService` to ensure correct functionality and permission handling.
…a templates - Eliminated the `validate_params` method from the `UpdateService`, simplifying the update process. - Streamlined the execution flow by directly handling updates without pre-validation of parameters. - Maintained authorization checks to ensure proper permissions during metadata template updates.
- Changed the update method to use `update!` for better error management during metadata template updates. - Updated error handling to capture `ActiveRecord::RecordInvalid` exceptions and add relevant error messages to the template. - Modified tests to reflect the new error handling behavior, ensuring accurate assertions for invalid update scenarios.
…mplate updates - Fixed a typo in the test description for invalid parameter updates. - Updated the test for numerical fields to assert specific error messages returned by the metadata template, ensuring accurate validation feedback. - Improved clarity and accuracy in test cases related to metadata template updates.
- Changed the save method in CreateService to use `save!` for better error management. - Added new validation error messages for the `name` attribute in both English and French locale files. - Updated tests to assert the presence of specific error messages for invalid metadata template creation scenarios, ensuring accurate feedback for users.
- Refactored methods to modularize the addition of sample activity and metadata template parameters. - Replaced conditional merges with dedicated methods for clarity and maintainability. - Introduced a new method to handle bulk sample parameters for 'sample_destroy_multiple' action. - Improved overall readability and structure of the parameter handling logic.
- Eliminated redundant blank lines in the `create_service.rb` file to improve code readability. - Ensured that the file maintains a clean and consistent formatting style.
…services - Changed the save method in CreateService to use `save` instead of `save!`, raising a custom error with detailed messages on failure. - Updated the update method in UpdateService to use `update` instead of `update!`, removing the rescue block for `ActiveRecord::RecordInvalid`. - Adjusted tests to reflect the new error handling logic, ensuring accurate assertions for invalid metadata template creation scenarios.
…wn component Remove unnecessary `puts` debugging output in the component initialization method, improving code cleanliness and removing potential performance overhead
Update en.yml and fr.yml to use consistent single quotes for string values, improving code readability and maintaining a uniform style across localization files
Remove unnecessary metadata toggle label translations from both English and French locale files, cleaning up unused localization entries
Remove unused `fields_for_namespace` method and update `WorkflowExecutions::SubmissionsController` to use `fields_for_namespace_or_template`
Modify system test to assert the presence of the metadata template select dropdown instead of the import metadata button
Replace metadata toggle label click with select dropdown interaction in system tests, ensuring consistent test coverage for the new metadata template selection method
…ject namespace policy
Replace metadata toggle label click with select dropdown interaction across multiple test scenarios, ensuring consistent test coverage for the new metadata template selection method
Modify system test to replace metadata toggle label click with select dropdown interaction, ensuring consistent test coverage for the new metadata template selection method
Modify system test to change metadata template dropdown selection from 'all' to 'none' and remove redundant selection steps
Update system test to select 'none' in the metadata template dropdown instead of 'all', maintaining test coverage for dropdown interaction
Add a collection route `get :list` to metadata_templates resources for both group and project route configurations
joshsadam
force-pushed
the
metadata-templates/dropdown
branch
from
February 5, 2025 12:30
4a909a6
to
ca0df4a
Compare
- Update metadata template dropdown to use shared partial and URL generation - Modify localization keys for metadata template fields - Add new shared metadata templates list view - Adjust samples controller and views to support new dropdown approach
- Correct localization key for metadata template fields - Add margin class to metadata template dropdown button - Simplify metadata template handling in samples controllers
…asses - Refactor button styling to use Tailwind utility classes - Add responsive width and improved visual states - Maintain dark mode compatibility - Preserve existing dropdown functionality
…tion - Extract metadata template list view methods into separate helper methods - Add section headers for metadata fields and templates in dropdown - Update localization keys to provide clearer labels - Enhance dropdown view with conditional rendering and improved structure
- Add loading spinner for metadata templates - Enhance dropdown button with label and increased offset - Add hover states to metadata template list items - Improve visual hierarchy and interaction design
- Modify 'none' and 'all' labels in English and French localization files - Swap order of 'none' and 'all' keys in metadata template fields section - Ensure consistent localization for metadata template dropdown
- Add new localization key for metadata template dropdown label in English and French - Update metadata template dropdown to use translated label - Remove hardcoded "Metadata Templates" text in dropdown partial
- Replace blue color classes with primary color classes - Maintain consistent styling for radio buttons in metadata templates list - Preserve dark mode and focus ring compatibility
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.
[email protected]
and create a new projectuser = User.find_by(email: "[email protected]")
namespace = Project.last.namespace
template = MetadataTemplates::CreateService.new(user, namespace, {name: "template1", fields: ['b', 'c']}).execute
PR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.