Repository navigation
Migrate UI components from partial views to TagHelpers - #836
Merged
Merged
Conversation
Replaces Razor partials with backward-compatibility shims that delegate to new Tag Helpers and View Components for layout, meta, alerts, and comments. Moves rendering logic into C# classes, introduces strongly-typed view models, and encourages direct use of new components. No business logic changes; improves maintainability and reusability.
Replaced several Razor partials in _Layout.cshtml and _BlogItem.cshtml with custom Tag Helpers and View Components for improved maintainability. Introduced DefaultCredentialsWarningTagHelper to render admin security alerts, replacing the old partial. Modernized meta, RSS, and consent components for consistency.
Replaced Razor partial views with tag helpers and view components in _BlogItem.cshtml and _Layout.cshtml. Updated delete modal, comment block, head/meta, and cookie consent to use modern components for improved maintainability and consistency.
Renamed and expanded main page test to check title, meta, feed links, and cookie consent banner. Added TagHelperMigrationSmokeTests for Open Graph, Twitter Card, JSON-LD schema, comment toggle, and admin warning behaviors. Included helper methods for meta assertions and login. Expand Playwright tests for head/meta and TagHelpers Refactored and expanded PlaywrightPageTests to check for key <head> elements including title, meta description, RSS/Atom links, and cookie consent. Added TagHelperMigrationSmokeTests to verify Open Graph, Twitter Card, JSON-LD schema, comment toggles, and dev-only suppression of default credentials warning. Includes helper methods for meta tag checks and login.
Updated comments in Razor partials to explicitly mark them as obsolete and retained only for backward compatibility. Each now recommends using the corresponding TagHelper or ViewComponent in new code, with a note that removal is not planned. No functional changes were made.
- Move CookieConsent and TagHelper styles from inline to site.css - Add default CSS hooks for TagHelpers/ViewComponents - Use Bootstrap d-none for comment success alert visibility - Update JS to toggle d-none instead of display style - Apply dbc-delete-post-form class for modal form layout
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.
PR Classification
Code cleanup and modernization: migrates UI components from partial views to TagHelpers and ViewComponents for improved maintainability and reusability.
PR Summary
This PR replaces legacy partial views with new TagHelpers and ViewComponents for common UI elements, updates all references, and retains obsolete partials for backward compatibility.