From f002916ffdb1170bfe1e44ccbfffe02d243d7528 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Wed, 26 Jan 2022 16:18:13 -0300 Subject: [PATCH 01/11] Prototype implementatin of set_tainacan_admin_options filter. #659 --- src/views/admin/js/admin-main.js | 2 +- src/views/class-tainacan-admin.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/admin/js/admin-main.js b/src/views/admin/js/admin-main.js index d8c539d87..d979426b0 100644 --- a/src/views/admin/js/admin-main.js +++ b/src/views/admin/js/admin-main.js @@ -87,7 +87,7 @@ export default (element) => { // Mount only if the div exists and it is not already mounted if ( pageElement && pageElement.classList && !pageElement.classList.contains('has-mounted') ) { - + console.log(pageElement.dataset); /* Registers Extra Vue Plugins passed to the window.tainacan_extra_plugins */ if (typeof window.tainacan_extra_plugins != "undefined") { for (let [extraVuePluginName, extraVuePluginObject] of Object.entries(window.tainacan_extra_plugins)) diff --git a/src/views/class-tainacan-admin.php b/src/views/class-tainacan-admin.php index 86971ea38..ec76d1c10 100644 --- a/src/views/class-tainacan-admin.php +++ b/src/views/class-tainacan-admin.php @@ -369,9 +369,10 @@ class Admin { function admin_page() { global $TAINACAN_BASE_URL; - + $admin_options = apply_filters('set_tainacan_admin_options', $_GET); + $admin_options = json_encode($admin_options); // TODO move it to a separate file and start the Vue project - echo "
"; + echo "
"; } function register_user_meta() { From 8422a63d3cca0f478e060dc3925988633512477d Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Mon, 31 Jan 2022 18:19:17 -0300 Subject: [PATCH 02/11] Uses new AdminOptions helper plugin to load options from data attributes. #659 --- src/views/admin/admin.vue | 19 ++---- .../edition/item-bulk-edition-form.vue | 5 +- .../components/edition/item-edition-form.vue | 18 ++---- .../admin/components/lists/items-list.vue | 62 +++++++++---------- .../components/lists/related-items-list.vue | 7 +-- .../relationship/Relationship.vue | 9 +-- src/views/admin/js/admin-main.js | 6 +- src/views/admin/js/admin-utilities.js | 20 ++++++ src/views/admin/pages/lists/items-page.vue | 20 +++--- .../admin/pages/singles/collection-page.vue | 12 +--- .../dynamic-and-carousel-items-modal.js | 4 +- .../blocks/carousel-items-list/edit.js | 2 - .../blocks/carousel-items-list/theme.vue | 2 - .../blocks/dynamic-items-list/edit.js | 2 - .../blocks/dynamic-items-list/theme.vue | 4 +- .../blocks/faceted-search/theme.js | 4 +- .../blocks/item-submission-form/theme.js | 3 +- .../blocks/items-list/items-modal.js | 4 +- .../related-items-list/related-items-modal.js | 4 +- 19 files changed, 89 insertions(+), 118 deletions(-) diff --git a/src/views/admin/admin.vue b/src/views/admin/admin.vue index f04ba93d1..9f8a3321e 100644 --- a/src/views/admin/admin.vue +++ b/src/views/admin/admin.vue @@ -3,16 +3,16 @@ id="tainacan-admin-app" class="has-mounted columns is-fullheight" :class="{ - 'tainacan-admin-iframe-mode': isIframeMode, - 'tainacan-admin-mobile-mode': isMobileMode, - 'tainacan-admin-read-mode': isReadMode + 'tainacan-admin-iframe-mode': $adminOptions.iframemode, + 'tainacan-admin-mobile-mode': $adminOptions.mobilemode, + 'tainacan-admin-read-mode': $adminOptions.readmode }">