-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Expose download counts (#3880) * Expose download counts for collections and legacy roles Issue: AAH-2241 * DownloadCount - show number of downloads, use for legacy roles * Collections - use DownloadCount, check insights mode and reorganize the CollectionHeader page controls to look the same but allow for an extra row and start pulling the collection api in loadCollection and warn about collection count applying to all versions (won't do anything without pulp_ansible#1477) * fix title .. show be on the top even if the line gets larger * repositoryBasePath for querying collection api * move collection count to right side of version header (cherry picked from commit 18dfe82) * remove actuallyCollection, collection download counts not supported in 4.7 * remove insights logic --------- Co-authored-by: Martin Hradil <[email protected]>
- Loading branch information
1 parent
2d8603e
commit 62cbfa6
Showing
18 changed files
with
203 additions
and
153 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expose legacy role download count in the UI |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Trans, t } from '@lingui/macro'; | ||
import { DownloadIcon } from '@patternfly/react-icons'; | ||
import React from 'react'; | ||
import { Tooltip } from 'src/components'; | ||
import { language } from 'src/l10n'; | ||
|
||
interface IProps { | ||
item?: { download_count?: number }; | ||
} | ||
|
||
export const DownloadCount = ({ item }: IProps) => { | ||
if (!item?.download_count) { | ||
return null; | ||
} | ||
|
||
const downloadCount = new Intl.NumberFormat(language).format( | ||
item.download_count, | ||
); | ||
|
||
return ( | ||
<Tooltip | ||
content={t`Download count is the sum of all versions' download counts`} | ||
> | ||
<DownloadIcon /> <Trans>{downloadCount} Downloads</Trans> | ||
</Tooltip> | ||
); | ||
}; |
This file contains 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
This file contains 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
Oops, something went wrong.