From 8789baf871f9dc86d35ecb1193072a5604a28f56 Mon Sep 17 00:00:00 2001 From: Alexei Peters Date: Wed, 27 Nov 2024 10:35:17 -0800 Subject: [PATCH] refine pluing def, re #6 --- afrc/media/js/views/afrc-search.js | 26 ---------------- .../components/plugins/afrc-search-plugin.js | 12 ------- .../views/components/plugins/afrc-search.js | 31 +++++++++++++++++++ afrc/migrations/0002_plugin.py | 4 +-- .../components/plugins/afrc-search-plugin.htm | 1 - .../views/components/plugins/afrc-search.htm | 1 + 6 files changed, 34 insertions(+), 41 deletions(-) delete mode 100644 afrc/media/js/views/afrc-search.js delete mode 100644 afrc/media/js/views/components/plugins/afrc-search-plugin.js create mode 100644 afrc/media/js/views/components/plugins/afrc-search.js delete mode 100644 afrc/templates/views/components/plugins/afrc-search-plugin.htm create mode 100644 afrc/templates/views/components/plugins/afrc-search.htm diff --git a/afrc/media/js/views/afrc-search.js b/afrc/media/js/views/afrc-search.js deleted file mode 100644 index 5bfc6bb..0000000 --- a/afrc/media/js/views/afrc-search.js +++ /dev/null @@ -1,26 +0,0 @@ -import createVueApplication from 'arches/arches/app/media/js/utils/create-vue-application'; - -import { definePreset } from '@primevue/themes'; -import Aura from '@primevue/themes/aura'; - -import Search from '@/afrc/Search/SearchPage.vue'; - -export function createAFRCApp() { - const EditableReportPreset = definePreset(Aura, { - components: { - toast: { - summary: { fontSize: '1.5rem' }, - detail: { fontSize: '1.25rem' }, - }, - }, - }); - - const EditableReportTheme = { - theme: { - preset: EditableReportPreset, - }, - }; - createVueApplication(Search, EditableReportTheme).then(vueApp => { - vueApp.mount('#search-mounting-point'); - }); -} \ No newline at end of file diff --git a/afrc/media/js/views/components/plugins/afrc-search-plugin.js b/afrc/media/js/views/components/plugins/afrc-search-plugin.js deleted file mode 100644 index 59d495e..0000000 --- a/afrc/media/js/views/components/plugins/afrc-search-plugin.js +++ /dev/null @@ -1,12 +0,0 @@ -define([ - 'knockout', - 'views/afrc-search', - 'templates/views/components/plugins/afrc-search-plugin.htm', -], function(ko, AFRCSEarchComponent, AFRCSEarchTemplate) { - return ko.components.register('afrc-search-plugin', { - viewModel: function() { - AFRCSEarchComponent.createAFRCApp(); - }, - template: AFRCSEarchTemplate, - }); -}); \ No newline at end of file diff --git a/afrc/media/js/views/components/plugins/afrc-search.js b/afrc/media/js/views/components/plugins/afrc-search.js new file mode 100644 index 0000000..e453741 --- /dev/null +++ b/afrc/media/js/views/components/plugins/afrc-search.js @@ -0,0 +1,31 @@ +import ko from 'knockout'; +import createVueApplication from 'arches/arches/app/media/js/utils/create-vue-application'; + +import { definePreset } from '@primevue/themes'; +import Aura from '@primevue/themes/aura'; + +import Search from '@/afrc/Search/SearchPage.vue'; +import AFRCSEarchTemplate from 'templates/views/components/plugins/afrc-search.htm'; + +ko.components.register('afrc-search', { + viewModel: function() { + const EditableReportPreset = definePreset(Aura, { + components: { + toast: { + summary: { fontSize: '1.5rem' }, + detail: { fontSize: '1.25rem' }, + }, + }, + }); + + const EditableReportTheme = { + theme: { + preset: EditableReportPreset, + }, + }; + createVueApplication(Search, EditableReportTheme).then(vueApp => { + vueApp.mount('#search-mounting-point'); + }); + }, + template: AFRCSEarchTemplate, +}); \ No newline at end of file diff --git a/afrc/migrations/0002_plugin.py b/afrc/migrations/0002_plugin.py index 33a3ba8..6e8e64e 100644 --- a/afrc/migrations/0002_plugin.py +++ b/afrc/migrations/0002_plugin.py @@ -13,8 +13,8 @@ class Migration(migrations.Migration): VALUES ('929e1b9b-a9dc-4603-ae0a-f129d89d8b66', '{"en": "Search Reference Collections"}', 'fa fa-search', - 'views/components/plugins/afrc-search-plugin', - 'afrc-search-plugin', + 'views/components/plugins/afrc-search', + 'afrc-search', '{"show": true, "description": {"en": null}, "i18n_properties": ["description"]}', 'afrc-search', 1, diff --git a/afrc/templates/views/components/plugins/afrc-search-plugin.htm b/afrc/templates/views/components/plugins/afrc-search-plugin.htm deleted file mode 100644 index 5e4a096..0000000 --- a/afrc/templates/views/components/plugins/afrc-search-plugin.htm +++ /dev/null @@ -1 +0,0 @@ -
\ No newline at end of file diff --git a/afrc/templates/views/components/plugins/afrc-search.htm b/afrc/templates/views/components/plugins/afrc-search.htm new file mode 100644 index 0000000..0760954 --- /dev/null +++ b/afrc/templates/views/components/plugins/afrc-search.htm @@ -0,0 +1 @@ +
\ No newline at end of file