Repository navigation
Refactor applies_to - #1878
Merged
Merged
Refactor applies_to#1878
Conversation
reakaleek
force-pushed
the
feature/refactor-applies-to
branch
from
September 12, 2025 09:51
8b3f7a7 to
3c1f7ad
Compare
reakaleek
marked this pull request as ready for review
September 12, 2025 09:54
Contributor
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Mpdreamz
approved these changes
Sep 14, 2025
Mpdreamz
left a comment
Member
There was a problem hiding this comment.
Small nits nothing blocking.
Great to see logic moved out of the views.
This file contains hidden or 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
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.
Changes
Refactor the applies_to view to contain less logic.
Context
We added comprehensive tests beforehand in #1873