-
-
Notifications
You must be signed in to change notification settings - Fork 362
feat(IDom2ImageService): add IDom2ImageService interface #6661
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 GuideThis PR adds a new DOM-to-image export feature by introducing the IDom2ImageService interface and its service registration, provides a full Blazor sample with interaction methods, integrates the feature into localizations and menu, and cleans up obsolete injections from the existing Html2Images sample. Sequence diagram for Dom2Images export interactionssequenceDiagram
actor User
participant Dom2Images
participant IDom2ImageService
User->>Dom2Images: Clicks 'GetUrl' button
Dom2Images->>IDom2ImageService: GetUrlAsync("#table-9527")
IDom2ImageService-->>Dom2Images: Returns image data
Dom2Images-->>User: Displays image
User->>Dom2Images: Clicks 'Download' button
Dom2Images->>IDom2ImageService: DownloadAsync("#table-9527", fileName)
IDom2ImageService-->>Dom2Images: (Download triggered)
User->>Dom2Images: Clicks 'Full' button
Dom2Images->>IDom2ImageService: DownloadAsync(".tabs-body-content:not(.d-none)", fileName)
IDom2ImageService-->>Dom2Images: (Download triggered)
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 there - I've reviewed your changes - here's some feedback:
- Make sure the new Dom2Image library is added as a PackageReference in the server .csproj so that AddBootstrapBlazorDom2ImageService and IDom2ImageService resolve correctly.
- Add all missing localization keys (e.g. Dom2ImageTitle, Dom2ImageIntro, Dom2ImageNormalTitle, etc.) to your en-US.json and zh-CN.json so the new sample page texts load without errors.
- Consider unifying the component naming (Dom2Image vs Dom2Images) and extracting your CSS selectors (like "#table-9527") into constants to avoid magic strings and improve maintainability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Make sure the new Dom2Image library is added as a PackageReference in the server .csproj so that AddBootstrapBlazorDom2ImageService and IDom2ImageService resolve correctly.
- Add all missing localization keys (e.g. Dom2ImageTitle, Dom2ImageIntro, Dom2ImageNormalTitle, etc.) to your en-US.json and zh-CN.json so the new sample page texts load without errors.
- Consider unifying the component naming (Dom2Image vs Dom2Images) and extracting your CSS selectors (like "#table-9527") into constants to avoid magic strings and improve maintainability.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6661 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 739 739
Lines 31667 31667
Branches 4459 4459
=========================================
Hits 31667 31667
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 #6660
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Introduce a new Dom2Image export service by defining the IDom2ImageService interface, registering it in DI, and showcasing its usage with a dedicated demo component and menu entry, along with localization and documentation updates.
New Features:
Enhancements:
Documentation:
Chores: