Skip to content
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

Make StatusWidget tools dropdown extensible #3189

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make StatusWidget tools extensible
  • Loading branch information
rafaucau committed Dec 7, 2021
commit 641c5f7272bdd714db597dbabc38ea07b5c3a3ed
13 changes: 12 additions & 1 deletion js/src/admin/components/StatusWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class StatusWidget extends DashboardWidget {
buttonClassName="Button"
menuClassName="Dropdown-menu--right"
>
<Button onclick={this.handleClearCache.bind(this)}>{app.translator.trans('core.admin.dashboard.clear_cache_button')}</Button>
{this.toolsItems().toArray()}
</Dropdown>
);

Expand All @@ -37,6 +37,17 @@ export default class StatusWidget extends DashboardWidget {
return items;
}

toolsItems() {
const items = new ItemList();
davwheat marked this conversation as resolved.
Show resolved Hide resolved

items.add(
'clearCache',
<Button onclick={this.handleClearCache.bind(this)}>{app.translator.trans('core.admin.dashboard.clear_cache_button')}</Button>
);

return items;
}

handleClearCache(e) {
app.modal.show(LoadingModal);

Expand Down