VSB-TUO/Make item view - Total Downloads - configurable#996
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR makes the Total Downloads feature configurable in the item view by checking a configuration property before displaying the downloads count. The feature is now controlled by the item.view.total.downloads.enabled configuration setting.
- Adds configuration service integration to check if total downloads should be displayed
- Introduces conditional rendering based on configuration value
- Restructures the component to first check configuration before fetching download statistics
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| total-downloads.component.ts | Adds configuration service dependency and logic to check item.view.total.downloads.enabled before fetching download statistics |
| total-downloads.component.html | Adds conditional rendering using *ngIf to show downloads only when enabled via configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/app/item-page/simple/field-components/file-section/total-downloads.component.ts
Outdated
Show resolved
Hide resolved
src/app/item-page/simple/field-components/file-section/total-downloads.component.ts
Outdated
Show resolved
Hide resolved
src/app/item-page/simple/field-components/file-section/total-downloads.component.ts
Outdated
Show resolved
Hide resolved
src/app/item-page/simple/field-components/file-section/total-downloads.component.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/app/item-page/simple/field-components/file-section/total-downloads.component.ts
Show resolved
Hide resolved
src/app/item-page/simple/field-components/file-section/total-downloads.component.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/app/item-page/simple/field-components/file-section/total-downloads.component.ts
Show resolved
Hide resolved
src/app/item-page/simple/field-components/file-section/total-downloads.component.ts
Show resolved
Hide resolved
* Implemented configurable showing of component
* VSB-TUO/Display total downloads for each item (#961) * Added new feature for downloads of item's bitstreams * Fixed Copilot's suggestions: any type & redundant property access pattern * VSB-TUO/Make item view - Total Downloads - configurable (#996) * Implemented configurable showing of component * refactor: provide UsageReportDataService as singleton to avoid duplicate instances
Problem description
Displaying the Total Downloads feature in item view, by calling API request for .cfg key
item.view.total.downloads.enabledand checking if true.