File Metrics: Download Count#1012
Open
ChengShi-1 wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a File Metrics panel to the File page that displays the download count for the current file, backed by a new FileRepository.getFileDownloadCount method and localized strings, with component/E2E test coverage.
Changes:
- Add
FileMetricsUI +useGetFileDownloadCounthook to fetch and render the file’s download count. - Extend
FileRepositoryand implementgetFileDownloadCountin the JS Dataverse and mock repositories. - Add component + E2E/integration tests and update i18n + changelog.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e-integration/integration/files/FileJSDataverseRepository.spec.ts | Adds integration coverage for fetching download count. |
| tests/e2e-integration/e2e/sections/file/File.spec.tsx | Verifies download count appears/updates on the File page. |
| tests/component/sections/file/File.spec.tsx | Updates component test to expect metrics + repository call. |
| tests/component/sections/file/file-metrics/useGetFileDownloadCount.spec.tsx | Adds hook-level tests for loading/success/error cases. |
| src/stories/file/FileMockRepository.ts | Implements getFileDownloadCount in the story/mock repository. |
| src/sections/file/File.tsx | Renders FileMetrics on the File page. |
| src/sections/file/file-metrics/useGetFileDownloadCount.ts | New hook to fetch download count via repository + use case. |
| src/sections/file/file-metrics/FileMetrics.tsx | New UI component to display File Metrics + tooltips + skeleton. |
| src/sections/file/file-metrics/FileMetrics.module.scss | Styling for the File Metrics panel. |
| src/files/infrastructure/FileJSDataverseRepository.ts | Implements getFileDownloadCount using dataverse-client-javascript. |
| src/files/domain/useCases/getFileDownloadCount.ts | New domain use case wrapper for repository method. |
| src/files/domain/repositories/FileRepository.ts | Adds getFileDownloadCount to the repository interface. |
| public/locales/es/file.json | Spanish translations for File Metrics. |
| public/locales/en/file.json | English translations for File Metrics. |
| CHANGELOG.md | Changelog entry for File Metrics download count. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What this PR does / why we need it:
In file page, there is a section of File Metrics and include the number of downloads of the specific file
Which issue(s) this PR closes:
Special notes for your reviewer:
The use case
getAllDownloadCountwas added before, and the download count was added to the file metadata as as wellSuggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes or changelog update needed for this change?:
Additional documentation: