Closed nya-elimu closed 1 month ago
[!CAUTION]
Review failed
The pull request is closed.
The changes introduce a new feature in the web application, allowing users to export contributor data and their impact percentages to a CSV file. A new controller class handles HTTP requests to generate and download the CSV file, while the front-end includes a button to trigger this export, providing a better user experience.
Files/Paths | Change Summary |
---|---|
src/main/java/ai/elimu/web/content/contributor/ContributorCsvExportController.java |
Introduced a new controller class that handles HTTP requests for exporting contributor data to CSV. It fetches data from DAOs, calculates impact percentages, and writes the CSV content to the HTTP response output stream. |
src/main/webapp/WEB-INF/jsp/content/contributor/list.jsp |
Added an export to CSV button with associated JavaScript functionality to display a toast message when clicked, providing a direct export option for contributor data in CSV format. |
sequenceDiagram
participant User
participant Browser
participant WebServer as Web Server
participant CtrDao as ContributorDao
participant LtrCtrDao as LetterContributionEventDao
participant NumCtrDao as NumberContributionEventDao
participant StbCtrDao as StoryBookContributionEventDao
participant WrdCtrDao as WordContributionEventDao
User->>Browser: Clicks on 'Export to CSV' button
Browser->>WebServer: HTTP GET /content/contributor/list/contributors.csv
WebServer->>CtrDao: Fetch contributor data
WebServer->>LtrCtrDao: Fetch letter contribution events
WebServer->>NumCtrDao: Fetch number contribution events
WebServer->>StbCtrDao: Fetch storybook contribution events
WebServer->>WrdCtrDao: Fetch word contribution events
WebServer: Calculate impact percentages
WebServer: Generate CSV content
WebServer->>Browser: Send CSV file
Browser->>User: Prompts download dialog
Objective | Addressed | Explanation |
---|---|---|
Export CSV with contributors and impact percentages (#41) | ✅ |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 3.84615%
with 50 lines
in your changes missing coverage. Please review.
Project coverage is 15.18%. Comparing base (
36f0a01
) to head (e623452
).
Files | Patch % | Lines |
---|---|---|
...nt/contributor/ContributorCsvExportController.java | 3.84% | 50 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Calculates the percentage impact per contributor.
close https://github.com/elimu-ai/web3-wiki/issues/41