Skip to content

Commit

Permalink
Make StatusWidget tools extensible (#3189)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaucau authored Dec 7, 2021
1 parent 7bab6ed commit 0f2824e
Showing 1 changed file with 12 additions and 1 deletion.
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();

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

0 comments on commit 0f2824e

Please sign in to comment.