mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
DEV: Allow custom site activity items in the new /about page (#28400)
This commit introduces a new frontend API to add custom items to the "Site activity" section in the new /about page. The new API is called `addAboutPageActivity` and it works along side the `register_stat` serve-side API which serializes the data that the frontend API consumes. More details of how the two APIs work together is in the JSDoc comment above the API function definition. Internal topic: t/128545/9.
This commit is contained in:
@ -1121,6 +1121,9 @@ class Plugin::Instance
|
||||
# group of stats is shown on the site About page in the Site Statistics
|
||||
# table. Some stats may be needed purely for reporting purposes and thus
|
||||
# do not need to be shown in the UI to admins/users.
|
||||
#
|
||||
# TODO(osama): deprecate show_in_ui when experimental_redesigned_about_page_groups
|
||||
# is removed
|
||||
def register_stat(name, show_in_ui: false, expose_via_api: false, &block)
|
||||
# We do not want to register and display the same group multiple times.
|
||||
return if DiscoursePluginRegistry.stats.any? { |stat| stat.name == name }
|
||||
|
Reference in New Issue
Block a user