Add support to display both count and percentage on reaction plugins
This commit is contained in:
@@ -18,7 +18,7 @@ The *reactions* plugin displays overall reactions on your recent issues and issu
|
||||
with:
|
||||
# ... other options
|
||||
plugin_reactions: yes
|
||||
plugin_reactions_limit: 200 # Compute reactions over last 200 issue comments
|
||||
plugin_reactions_days: 14 # Compute reactions on issue comments posted less than 14 days ago
|
||||
plugin_reactions_details: percentage # Display reactions percentage
|
||||
plugin_reactions_limit: 200 # Compute reactions over last 200 issue comments
|
||||
plugin_reactions_days: 14 # Compute reactions on issue comments posted less than 14 days ago
|
||||
plugin_reactions_details: count, percentage # Display reactions count and percentage
|
||||
```
|
||||
@@ -42,7 +42,7 @@
|
||||
list[reaction] = (list[reaction] ?? 0) + 1
|
||||
const max = Math.max(...Object.values(list))
|
||||
for (const [key, value] of Object.entries(list))
|
||||
list[key] = {value, score:value/(display === "relative" ? max : reactions.length)}
|
||||
list[key] = {value, percentage:value/reactions.length, score:value/(display === "relative" ? max : reactions.length)}
|
||||
|
||||
//Results
|
||||
return {list, comments:comments.length, details, days, twemoji:q["config.twemoji"]}
|
||||
|
||||
@@ -41,11 +41,13 @@ inputs:
|
||||
- relative
|
||||
|
||||
# Additional details
|
||||
# If multiple values are specified, emphasis will be set on first value
|
||||
plugin_reactions_details:
|
||||
description: Additional details
|
||||
type: string
|
||||
default: none
|
||||
type: array
|
||||
format: comma-separated
|
||||
default: ""
|
||||
example: count, percentage
|
||||
values:
|
||||
- none
|
||||
- count
|
||||
- percentage
|
||||
Reference in New Issue
Block a user