-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use downloads renderer in next batch of classes, run [hexpm homebrewdownloads jenkinsplugininstalls jetbrainsdownloads jsdelivr modrinth]] #7210
Conversation
@@ -27,6 +29,7 @@ function renderDownloadsBadge({ | |||
labelOverride, | |||
colorOverride, | |||
messageSuffixOverride, | |||
versionedLabelPrefix = 'downloads', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to support use cases where classes want to support tag/version specific download counts but are using a label other than downloads
|
static _getSchema(version) { | ||
if (version) { | ||
return schemaInstallationsPerVersion | ||
} else { | ||
return schemaInstallations | ||
} | ||
} | ||
|
||
static _getLabel(version) { | ||
if (version) { | ||
return `installs@${version}` | ||
} else { | ||
return 'installs' | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to keep the diff focused on the refactoring to utilize the new render helper, but felt inclined to update this one with our more canonical fetch/transform/render separation of concerns and applied some broader refactoring to that end
Continuation from #7163