From abc545f5a80db908bc7c697cbfa6727214850b4c Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Thu, 6 Jun 2024 16:29:39 +0100 Subject: [PATCH] feat: allow defining supported databases --- .../core/js/src/admin/AdminApplication.tsx | 1 + .../js/src/admin/components/ExtensionPage.tsx | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/framework/core/js/src/admin/AdminApplication.tsx b/framework/core/js/src/admin/AdminApplication.tsx index 474013041d..978f92e158 100644 --- a/framework/core/js/src/admin/AdminApplication.tsx +++ b/framework/core/js/src/admin/AdminApplication.tsx @@ -32,6 +32,7 @@ export type Extension = { extra: { 'flarum-extension': { title: string; + 'database-support': undefined | string[]; }; }; require?: Record; diff --git a/framework/core/js/src/admin/components/ExtensionPage.tsx b/framework/core/js/src/admin/components/ExtensionPage.tsx index 9626b8cb20..8d1a42fa4d 100644 --- a/framework/core/js/src/admin/components/ExtensionPage.tsx +++ b/framework/core/js/src/admin/components/ExtensionPage.tsx @@ -225,6 +225,27 @@ export default class ExtensionPage { + return ( + { + mysql: 'MySQL', + sqlite: 'SQLite', + pgsql: 'PostgreSQL', + }[database] || database + ); + }); + + items.add( + 'database-support', + + + {supportedDatabases.join(', ')} + + ); + } + const extension = this.extension; items.add( 'readme',