-
Notifications
You must be signed in to change notification settings - Fork 32
Refactor applies_to #1878
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
Refactor applies_to #1878
Conversation
8b3f7a7 to
3c1f7ad
Compare
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.
Pull Request Overview
This PR refactors the ApplicableToComponent.cshtml view by extracting the complex rendering logic into separate classes, making the view much simpler and more maintainable.
Key changes:
- Extracted rendering logic from the Razor view into dedicated C# classes
- Created centralized mappings for product definitions and versioning systems
- Simplified the view template to use a clean iteration pattern
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/authoring/Applicability/ApplicableToComponent.fs | Added test case for product preview functionality |
| src/Elastic.Markdown/Myst/Components/ApplicableToViewModel.cs | Added methods to process applicability items and extract logic from view |
| src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml | Simplified view template by removing inline logic and using extracted methods |
| src/Elastic.Markdown/Myst/Components/ApplicabilityRenderer.cs | New class containing rendering logic for applicability badges and tooltips |
| src/Elastic.Markdown/Myst/Components/ApplicabilityMappings.cs | New static class providing centralized product definition mappings |
| src/Elastic.Markdown/Myst/Components/ApplicabilityItem.cs | New record type for encapsulating applicability data |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Mpdreamz
left a comment
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.
Small nits nothing blocking.
Great to see logic moved out of the views.
Changes
Refactor the applies_to view to contain less logic.
Context
We added comprehensive tests beforehand in #1873