From 9b47c9065d0631d487ea98190f775738ba1e0373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ca=C5=82ka?= Date: Tue, 7 Dec 2021 01:34:08 +0100 Subject: [PATCH] Make StatusWidget tools extendable --- js/dist-typings/admin/components/StatusWidget.d.ts | 1 + js/src/admin/components/StatusWidget.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/js/dist-typings/admin/components/StatusWidget.d.ts b/js/dist-typings/admin/components/StatusWidget.d.ts index 4bd9db03278..5fb59c65ae5 100644 --- a/js/dist-typings/admin/components/StatusWidget.d.ts +++ b/js/dist-typings/admin/components/StatusWidget.d.ts @@ -1,5 +1,6 @@ export default class StatusWidget extends DashboardWidget { items(): ItemList; + toolsItems(): ItemList; handleClearCache(e: any): void; } import DashboardWidget from "./DashboardWidget"; diff --git a/js/src/admin/components/StatusWidget.js b/js/src/admin/components/StatusWidget.js index 65f9b323b67..7ced35b47ca 100644 --- a/js/src/admin/components/StatusWidget.js +++ b/js/src/admin/components/StatusWidget.js @@ -26,7 +26,7 @@ export default class StatusWidget extends DashboardWidget { buttonClassName="Button" menuClassName="Dropdown-menu--right" > - + {this.toolsItems().toArray()} ); @@ -37,6 +37,17 @@ export default class StatusWidget extends DashboardWidget { return items; } + toolsItems() { + const items = new ItemList(); + + items.add( + 'clearCache', + + ); + + return items; + } + handleClearCache(e) { app.modal.show(LoadingModal);