-
-
Notifications
You must be signed in to change notification settings - Fork 372
doc(CardUpload): add ActionButtonTemplate parameter documentation #7042
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a new ActionButtonTemplate demo to the CardUpload component, implements sample click handlers, and updates corresponding localization entries. Sequence diagram for ActionButtonTemplate button click handlingsequenceDiagram
actor User
participant CardUpload
participant Button
participant "UploadCards.razor.cs"
participant ToastService
User->>CardUpload: Uploads file
CardUpload->>Button: Renders action buttons (flag, home)
User->>Button: Clicks flag/home button
Button->>"UploadCards.razor.cs": Calls OnTest1Click/OnTest2Click(file)
"UploadCards.razor.cs"->>ToastService: Show information toast with file name
Class diagram for new click handler methods in UploadCards.razor.csclassDiagram
class UploadCards {
+OnCardUpload(file: UploadFile): Task
+OnTest1Click(file: UploadFile): Task
+OnTest2Click(file: UploadFile): Task
+SaveToFile(file: UploadFile): Task
}
class ToastService {
+Information(title: string, message: string): void
}
UploadCards --> ToastService: uses
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7042 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 743 743
Lines 32475 32475
Branches 4500 4500
=========================================
Hits 32475 32475
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 adds support for customizing action buttons in the CardUpload component with two new template parameters (ActionButtonTemplate and BeforeActionButtonTemplate), and updates several package dependencies to stable versions.
- Adds new template parameters for custom action buttons in CardUpload component
- Updates three package dependencies from pre-release to stable versions
- Adds localized strings and demo sample for the new template feature
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/BootstrapBlazor.Server/Locales/zh-CN.json | Adds Chinese localization strings for the new action button template feature |
| src/BootstrapBlazor.Server/Locales/en-US.json | Adds English localization strings for the new action button template feature |
| src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs | Adds two event handler methods for demonstrating custom action buttons |
| src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor | Adds a new demo block showcasing the ActionButtonTemplate feature |
| src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj | Updates three package references to stable versions |
Comments suppressed due to low confidence (11)
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:76
- Call to 'System.IO.Path.Combine'.
var uploaderFolder = Path.Combine(WebsiteOption.Value.WebRootPath, "images", "uploader");
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:78
- Call to 'System.IO.Path.Combine'.
var fileName = Path.Combine(uploaderFolder, file.FileName);
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:101
- Poor error handling: empty catch block.
catch (OperationCanceledException)
{
}
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:14
- Field '_isDirectory' can be 'readonly'.
private bool _isDirectory = false;
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:15
- Field '_isDisabled' can be 'readonly'.
private bool _isDisabled = false;
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:16
- Field '_isUploadButtonAtFirst' can be 'readonly'.
private bool _isUploadButtonAtFirst = false;
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:17
- Field '_showProgress' can be 'readonly'.
private bool _showProgress = true;
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:18
- Field '_showZoomButton' can be 'readonly'.
private bool _showZoomButton = true;
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:19
- Field '_showDeleteButton' can be 'readonly'.
private bool _showDeleteButton = true;
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:20
- Field '_showDownloadButton' can be 'readonly'.
private bool _showDownloadButton = true;
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor.cs:13
- Field '_isMultiple' can be 'readonly'.
private bool _isMultiple = true;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "UploadsWasmError": "In wasm mode, please call the api to save" | ||
| "UploadsWasmError": "In wasm mode, please call the api to save", | ||
| "UploadActionButtonTemplateTitle": "Custom action button", | ||
| "UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `<code>ActionButtonTemplate</code>` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `<code>BeforeActionButtonTemplate</code>` parameter (insert it before the default button)." |
Copilot
AI
Oct 31, 2025
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.
Grammar issue: 'insert it before' should be 'inserting it before' to match the parallel structure with 'appending it to the end'.
| "UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `<code>ActionButtonTemplate</code>` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `<code>BeforeActionButtonTemplate</code>` parameter (insert it before the default button)." | |
| "UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `<code>ActionButtonTemplate</code>` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `<code>BeforeActionButtonTemplate</code>` parameter (inserting it before the default button)." |
| "UploadsWasmError": "In wasm mode, please call the api to save" | ||
| "UploadsWasmError": "In wasm mode, please call the api to save", | ||
| "UploadActionButtonTemplateTitle": "Custom action button", | ||
| "UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `<code>ActionButtonTemplate</code>` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `<code>BeforeActionButtonTemplate</code>` parameter (insert it before the default button)." |
Copilot
AI
Oct 31, 2025
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.
The backticks before <code> tags are unnecessary. Change `<code>ActionButtonTemplate</code>` to <code>ActionButtonTemplate</code> and `<code>BeforeActionButtonTemplate</code>` to <code>BeforeActionButtonTemplate</code>.
| "UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the `<code>ActionButtonTemplate</code>` parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the `<code>BeforeActionButtonTemplate</code>` parameter (insert it before the default button)." | |
| "UploadActionButtonTemplateIntro": "Customize the action buttons on the card by setting the <code>ActionButtonTemplate</code> parameter (appending it to the end of the default button), and customize the action buttons on the card by setting the <code>BeforeActionButtonTemplate</code> parameter (insert it before the default button)." |
Link issues
fixes #7041
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add documentation and sample code for the ActionButtonTemplate parameter in the CardUpload component
Enhancements:
Documentation: