-
-
Notifications
You must be signed in to change notification settings - Fork 363
feat(PdfViewer): add UseGoogleDocs parameter #6170
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 GuideIntroduce a Sequence Diagram for Toggling UseGoogleDocs OptionsequenceDiagram
actor User
participant Switch
participant PdfViewersPage as "PdfViewers.razor Page"
participant PdfViewerComponent as "PdfViewer Component"
User->>Switch: Toggles 'UseGoogleDocs' switch
Switch->>PdfViewersPage: Updates _useGoogleDocs value via @bind-Value
alt Re-render
PdfViewersPage->>PdfViewerComponent: Passes new UseGoogleDocs=@_useGoogleDocs value
PdfViewerComponent->>PdfViewerComponent: (Internally) Re-renders PDF with new setting
end
Class Diagram for PdfViewer Component ChangesclassDiagram
class PdfViewers {
-ToastService toastService
-_useGoogleDocs: bool
+OnLoaded(): Task
+NotSupportCallback(): Task
}
class PdfViewer {
+Url: string
+Height: string
+NotSupportCallback: EventCallback
+OnLoaded: EventCallback
+UseGoogleDocs: bool
}
PdfViewers ..> PdfViewer : uses and configures
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.
Hey @ArgoZhang - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| <PackageTips Name="BootstrapBlazor.PdfViewer" /> | ||
|
|
||
| <DemoBlock Title="@Localizer["PdfViewerNormalTitle"]" Introduction="@Localizer["PdfViewerNormalIntro"]" Name="Normal"> | ||
| <section ignore> |
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.
suggestion: Using a non-standard ignore attribute may not behave as expected
Consider replacing the non-standard ignore attribute with an @if block, a CSS class like d-none, or a framework-supported directive to control visibility.
Suggested implementation:
<section class="d-none">
<div class="row g-3">
<div class="col-12 col-sm-6">
If you want to control the visibility dynamically, you can use an @if block or bind the class to a variable. For example:
@if (showSection)
{
<section>
...
</section>
}
or
<section class="@(showSection ? "" : "d-none")">
...
</section>
Replace showSection with your actual condition.
| <div class="row g-3"> | ||
| <div class="col-12 col-sm-6"> | ||
| <BootstrapInputGroup> | ||
| <BootstrapInputGroupLabel DisplayText="UseGoogleDocs"></BootstrapInputGroupLabel> |
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.
suggestion: Label text should be localized
Use the Localizer for the label text to support localization, e.g., DisplayText="@localizer["UseGoogleDocs"]".
| <BootstrapInputGroupLabel DisplayText="UseGoogleDocs"></BootstrapInputGroupLabel> | |
| <BootstrapInputGroupLabel DisplayText="@Localizer["UseGoogleDocs"]"></BootstrapInputGroupLabel> |
|
|
||
| private bool _useGoogleDocs = true; | ||
|
|
||
| private Task OnLoaded() => ToastService.Success("Pdf Viewer", Localizer["PdfViewerToastSuccessfulContent"]); |
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.
issue: Toast title is hard-coded and inconsistent
The success and error toasts use different titles ('Pdf Viewer' vs. 'PdfViewer'). Please standardize and consider localizing the title for consistency.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6170 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 704 704
Lines 31099 31099
Branches 4394 4394
=========================================
Hits 31099 31099
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:
|
Link issues
fixes #6169
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Introduce a new UseGoogleDocs parameter to the PdfViewer component and update the sample to include a toggle for this option.
New Features: