From 5879a1b6cad8783be1ca34650d0024b1e8b92843 Mon Sep 17 00:00:00 2001 From: Elizabeth Danzberger Date: Fri, 1 Mar 2024 16:17:41 -0500 Subject: [PATCH] made ImportResults into reusable component Signed-off-by: Elizabeth Danzberger --- lib/AppInfo/Application.php | 4 +- lib/Listener/LoadAdditionalListener.php | 13 ++- src/file-actions.js | 2 +- src/modules/modals/FileActionImport.vue | 53 +++++++---- src/modules/modals/ImportResults.vue | 116 +++++++++++------------- 5 files changed, 99 insertions(+), 89 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 6c8c9aaba..5e3d40c24 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -6,6 +6,7 @@ use OCA\Analytics\Datasource\DatasourceEvent; use OCA\Tables\Capabilities; use OCA\Tables\Listener\AnalyticsDatasourceListener; +use OCA\Tables\Listener\LoadAdditionalListener; use OCA\Tables\Listener\TablesReferenceListener; use OCA\Tables\Listener\UserDeletedListener; use OCA\Tables\Reference\ContentReferenceProvider; @@ -22,9 +23,8 @@ use OCP\Server; use OCP\User\Events\BeforeUserDeletedEvent; use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; -use OCA\Tables\Listener\LoadAdditionalListener; +use Psr\Container\NotFoundExceptionInterface; class Application extends App implements IBootstrap { public const APP_ID = 'tables'; diff --git a/lib/Listener/LoadAdditionalListener.php b/lib/Listener/LoadAdditionalListener.php index b59188166..6978f047b 100644 --- a/lib/Listener/LoadAdditionalListener.php +++ b/lib/Listener/LoadAdditionalListener.php @@ -10,12 +10,11 @@ /** @template-implements IEventListener */ class LoadAdditionalListener implements IEventListener { - public function handle(Event $event): void { - if (!($event instanceof LoadAdditionalScriptsEvent)) { - return; - } + public function handle(Event $event): void { + if (!($event instanceof LoadAdditionalScriptsEvent)) { + return; + } - Util::addScript(Application::APP_ID, 'tables-files', 'files'); - } + Util::addScript(Application::APP_ID, 'tables-files', 'files'); + } } - diff --git a/src/file-actions.js b/src/file-actions.js index 6d57aacc6..6bd2b24a7 100644 --- a/src/file-actions.js +++ b/src/file-actions.js @@ -26,7 +26,7 @@ const fileAction = new FileAction({ }, exec: async (file) => { - spawnDialog(FileActionImport, { t, file }) + spawnDialog(FileActionImport, { file }) return null }, }) diff --git a/src/modules/modals/FileActionImport.vue b/src/modules/modals/FileActionImport.vue index 2d8aacec6..e73983a72 100644 --- a/src/modules/modals/FileActionImport.vue +++ b/src/modules/modals/FileActionImport.vue @@ -1,5 +1,5 @@