Skip to content

File Metrics: Download Count#1012

Open
ChengShi-1 wants to merge 6 commits into
developfrom
1009-file-metrics-integration
Open

File Metrics: Download Count#1012
ChengShi-1 wants to merge 6 commits into
developfrom
1009-file-metrics-integration

Conversation

@ChengShi-1

@ChengShi-1 ChengShi-1 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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 getAllDownloadCount was added before, and the download count was added to the file metadata as as well

Suggestions on how to test this:

  • Add a file to a dataset, and download to see if the number of download in file page increases

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

image

Is there a release notes or changelog update needed for this change?:

Additional documentation:

@ChengShi-1 ChengShi-1 linked an issue Jul 2, 2026 that may be closed by this pull request
@github-actions github-actions Bot added GREI Re-arch GREI re-architecture-related SPA labels Jul 2, 2026
@coveralls

coveralls commented Jul 2, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 97.351% (+0.008%) from 97.343% — 1009-file-metrics-integration into develop

@ChengShi-1 ChengShi-1 added Size: 3 A percentage of a sprint. 2.1 hours. FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) labels Jul 2, 2026
@ChengShi-1 ChengShi-1 marked this pull request as ready for review July 2, 2026 17:18
@ChengShi-1 ChengShi-1 requested a review from Copilot July 2, 2026 17:18
@ChengShi-1 ChengShi-1 self-assigned this Jul 2, 2026
@ChengShi-1 ChengShi-1 moved this to In Progress 💻 in IQSS Dataverse Project Jul 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FileMetrics UI + useGetFileDownloadCount hook to fetch and render the file’s download count.
  • Extend FileRepository and implement getFileDownloadCount in 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.

Comment thread src/sections/file/file-metrics/useGetFileDownloadCount.ts Outdated
Comment thread src/sections/file/File.tsx Outdated
Comment thread tests/e2e-integration/integration/files/FileJSDataverseRepository.spec.ts Outdated
@ChengShi-1 ChengShi-1 removed their assignment Jul 2, 2026
@ChengShi-1 ChengShi-1 moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) GREI Re-arch GREI re-architecture-related Size: 3 A percentage of a sprint. 2.1 hours. SPA

Projects

Status: Ready for Review ⏩

Development

Successfully merging this pull request may close these issues.

File Metrics Integration

3 participants