From e3af4a0b565f13eba668f227173c4258831fde68 Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Tue, 19 Mar 2024 09:56:28 +0100 Subject: [PATCH 1/5] feat: optimize tree --- config/routes.php | 15 ++ locales/default.pot | 23 +- locales/en_US/default.po | 23 +- locales/it_IT/default.po | 23 +- .../js/app/components/tree-view/tree-view.vue | 114 +++++--- src/Controller/TreeController.php | 216 ++++++++++++++- .../Controller/TreeControllerTest.php | 255 ++++++++++++++++-- 7 files changed, 592 insertions(+), 77 deletions(-) diff --git a/config/routes.php b/config/routes.php index 125622b14..9116b6b07 100644 --- a/config/routes.php +++ b/config/routes.php @@ -101,6 +101,21 @@ ['controller' => 'Tree', 'action' => 'get'], ['_name' => 'tree:get'] ); + $routes->connect( + '/tree/node/{id}', + ['controller' => 'Tree', 'action' => 'node'], + ['_name' => 'tree:node', 'pass' => ['id']] + ); + $routes->connect( + '/tree/parent/{id}', + ['controller' => 'Tree', 'action' => 'parent'], + ['_name' => 'tree:parent', 'pass' => ['id']] + ); + $routes->connect( + '/tree/parents/{type}/{id}', + ['controller' => 'Tree', 'action' => 'parents'], + ['_name' => 'tree:parents', 'pass' => ['type', 'id']] + ); // Admin. $routes->prefix('admin', ['_namePrefix' => 'admin:'], function (RouteBuilder $routes) { diff --git a/locales/default.pot b/locales/default.pot index b491aad3f..4bd214b28 100644 --- a/locales/default.pot +++ b/locales/default.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: BEdita 4 \n" -"POT-Creation-Date: 2024-02-26 14:54:49 \n" +"POT-Creation-Date: 2024-03-19 07:51:20 \n" "MIME-Version: 1.0 \n" "Content-Transfer-Encoding: 8bit \n" "Language-Team: BEdita I18N & I10N Team \n" @@ -1221,9 +1221,30 @@ msgstr "" msgid "Canonical" msgstr "" +msgid "Loading branches for position" +msgstr "" + +msgid "Loading children for folder" +msgstr "" + +msgid "Loading folder" +msgstr "" + +msgid "Loading parent for folder" +msgstr "" + +msgid "Loading positions for object" +msgstr "" + +msgid "Loading root folders" +msgstr "" + msgid "Menu" msgstr "" +msgid "page" +msgstr "" + msgid "View" msgstr "" diff --git a/locales/en_US/default.po b/locales/en_US/default.po index c03c7d0df..b54b699e1 100644 --- a/locales/en_US/default.po +++ b/locales/en_US/default.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: BEdita Manager \n" -"POT-Creation-Date: 2024-02-26 14:54:49 \n" +"POT-Creation-Date: 2024-03-19 07:51:20 \n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: BEdita I18N & I10N Team \n" @@ -1224,9 +1224,30 @@ msgstr "" msgid "Canonical" msgstr "" +msgid "Loading branches for position" +msgstr "" + +msgid "Loading children for folder" +msgstr "" + +msgid "Loading folder" +msgstr "" + +msgid "Loading parent for folder" +msgstr "" + +msgid "Loading positions for object" +msgstr "" + +msgid "Loading root folders" +msgstr "" + msgid "Menu" msgstr "" +msgid "page" +msgstr "" + msgid "View" msgstr "" diff --git a/locales/it_IT/default.po b/locales/it_IT/default.po index e7aa96935..a8e3b02fb 100644 --- a/locales/it_IT/default.po +++ b/locales/it_IT/default.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: BEdita Manager \n" -"POT-Creation-Date: 2024-02-26 14:54:49 \n" +"POT-Creation-Date: 2024-03-19 07:51:20 \n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: BEdita I18N & I10N Team \n" @@ -1236,9 +1236,30 @@ msgstr "Utente" msgid "Canonical" msgstr "Canonica" +msgid "Loading branches for position" +msgstr "Caricamento rami per posizione" + +msgid "Loading children for folder" +msgstr "Caricamento contenuti per cartella" + +msgid "Loading folder" +msgstr "Caricamento cartella" + +msgid "Loading parent for folder" +msgstr "Caricamento genitore per cartella" + +msgid "Loading positions for object" +msgstr "Caricamento posizioni per oggetto" + +msgid "Loading root folders" +msgstr "Caricamento cartelle principali" + msgid "Menu" msgstr "MenĂ¹" +msgid "page" +msgstr "pagina" + msgid "View" msgstr "Vedi" diff --git a/resources/js/app/components/tree-view/tree-view.vue b/resources/js/app/components/tree-view/tree-view.vue index 87517de31..2c02bf7d5 100644 --- a/resources/js/app/components/tree-view/tree-view.vue +++ b/resources/js/app/components/tree-view/tree-view.vue @@ -1,7 +1,10 @@