Merged
Conversation
Closed
Contributor
There was a problem hiding this comment.
Pull Request Overview
Introduces a new BitAlert component with customizable types, dismissible behavior, Title/child content support, along with accompanying Storybook stories and tests.
- Added
BitAlertcomponent implementation (.razor&.razor.cs) withAlertType, dismissible and close event support - Created Storybook stories demonstrating usage scenarios
- Built unit tests (rendering & behavioral) covering alert types, headings, close button behavior, and default aria-label
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/BitBlazor.Test/Components/Alert/BitAlertTest.Rendering.razor | Rendering tests for type classes, headings, close button and removal |
| tests/BitBlazor.Test/Components/Alert/BitAlertTest.Behaviors.cs | Behavioral tests for OnClose and OnClosed callbacks |
| stories/BitBlazor.Stories/Components/Stories/Components/BitAlert.stories.razor | Storybook examples for default, types, links, additional content, and dismissible alerts |
| src/BitBlazor/Components/Alert/BitAlert.razor | Razor markup for BitAlert component |
| src/BitBlazor/Components/Alert/BitAlert.razor.cs | Component logic: CSS computation, parameter defaults, close handling |
| src/BitBlazor/Components/Alert/AlertType.cs | Enum defining available alert types |
Comments suppressed due to low confidence (3)
src/BitBlazor/Components/Alert/BitAlert.razor.cs:56
- [nitpick] Private field
dismissibleClassesshould follow C# naming conventions (e.g.,_dismissibleClasses).
private List<string> dismissibleClasses = [];
src/BitBlazor/Components/Alert/BitAlert.razor.cs:56
- Invalid C# syntax: you cannot initialize a List using
[]. Replace withnew List<string>()ornew List<string> { }.
private List<string> dismissibleClasses = [];
src/BitBlazor/Components/Alert/BitAlert.razor.cs:65
- Invalid C# syntax: to populate a List, use
new List<string> { "alert-dismissible", "fade", "show" }instead of[].
dismissibleClasses = ["alert-dismissible", "fade", "show"];
stories/BitBlazor.Stories/Components/Stories/Components/BitAlert.stories.razor
Show resolved
Hide resolved
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.
This pull request introduces a new
BitAlertcomponent to theBitBlazorlibrary, implementing a customizable alert system with various types, dismissible functionality, and support for additional content. It also includes corresponding stories and unit tests to ensure proper behavior and rendering.New Component Implementation:
BitAlertComponent:BitAlertcomponent inBitAlert.razorandBitAlert.razor.cs, which supports different alert types (Primary,Info,Success,Warning,Danger) via theAlertTypeenum. It includes parameters forTitle,Dismissible,CloseButtonAriaLabel, and event callbacks (OnClose,OnClosed) to handle dismissible alerts. [1] [2] [3]User Stories:
BitAlert.stories.razorto demonstrate the component's usage, including examples for alert types, alerts with links, additional content, and dismissible alerts.Testing:
BitAlertTest.Behaviors.csto verifyOnCloseandOnClosedevent callbacks are triggered correctly when the close button is clicked.BitAlertTest.Rendering.razorto ensure the component renders correctly for different alert types, titles, dismissible functionality, and removal of markup when closed.