Bugzilla – Attachment 187636 Details for
Bug 39320
Create a 'landing page' for ERM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39320: VueJS framework: Add option to have a component in dialog
Bug-39320-VueJS-framework-Add-option-to-have-a-com.patch (text/plain), 4.86 KB, created by
Pedro Amorim
on 2025-10-09 09:01:27 UTC
(
hide
)
Description:
Bug 39320: VueJS framework: Add option to have a component in dialog
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-10-09 09:01:27 UTC
Size:
4.86 KB
patch
obsolete
>From 22ee2fe8f4ebcfb940f7f7737a174cec65dce48c Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Tue, 7 Oct 2025 08:57:01 +0000 >Subject: [PATCH] Bug 39320: VueJS framework: Add option to have a component in > dialog > >Sponsored-by: UKHSA (UK Health Security Agency) > >Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk> >--- > .../prog/js/vue/components/Dialog.vue | 56 +++++++++++++++++++ > .../intranet-tmpl/prog/js/vue/stores/main.js | 6 ++ > 2 files changed, 62 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue >index 4e48f53d311..919ab0d401f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue >@@ -95,6 +95,40 @@ > </div> > </div> > </div> >+ <div >+ class="component modal" >+ role="dialog" >+ v-if="componentDialog" >+ id="component" >+ > >+ <div class="modal-dialog"> >+ <div class="modal-content modal-lg"> >+ <div class="modal-header alert-warning component"> >+ <h1 v-html="componentDialog.title"></h1> >+ </div> >+ <div class="modal-body"> >+ <component >+ v-if="requiredComponent" >+ :is="requiredComponent" >+ v-bind="componentDialog.componentProps" >+ v-on="componentDialog.componentListeners" >+ /> >+ </div> >+ <div class="modal-footer"> >+ <button >+ id="close_modal" >+ class="btn btn-default deny cancel" >+ type="button" >+ data-bs-dismiss="modal" >+ @click="removeConfirmationMessages" >+ > >+ <i class="fa fa-fw fa-remove"></i> >+ <span v-html="componentDialog.cancel_label"></span> >+ </button> >+ </div> >+ </div> >+ </div> >+ </div> > > <div class="modal_centered" v-if="is_submitting"> > <div class="spinner alert alert-warning"> >@@ -115,9 +149,11 @@ import { > reactive, > computed, > useTemplateRef, >+ defineAsyncComponent, > } from "vue"; > import { storeToRefs } from "pinia"; > import FormElement from "./FormElement.vue"; >+import { loadComponent } from "@koha-vue/loaders/componentResolver"; > > export default { > setup() { >@@ -127,6 +163,7 @@ export default { > error, > warning, > confirmation, >+ componentDialog, > accept_callback, > is_submitting, > is_loading, >@@ -186,11 +223,29 @@ export default { > }); > }); > >+ watch(componentDialog, newComponentDialog => { >+ if (!newComponentDialog) { >+ $("#component.modal").modal("hide"); >+ return; >+ } >+ nextTick(() => { >+ $("#component.modal").modal("show"); >+ }); >+ }); >+ >+ const requiredComponent = computed(() => { >+ if (!componentDialog.value?.componentPath) return null; >+ return defineAsyncComponent( >+ loadComponent(componentDialog.value.componentPath) >+ ); >+ }); >+ > return { > message, > error, > warning, > confirmation, >+ componentDialog, > accept_callback, > is_submitting, > is_loading, >@@ -199,6 +254,7 @@ export default { > fp_config, > submit, > inputFields, >+ requiredComponent, > }; > }, > components: { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js >index b60a95bd976..fd45f0617eb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js >@@ -10,6 +10,7 @@ export const useMainStore = defineStore("main", () => { > accept_callback: null, > previousMessage: null, > previousError: null, >+ componentDialog: null, > displayed_already: false, > is_submitting: false, > is_loading: false, >@@ -66,6 +67,11 @@ export const useMainStore = defineStore("main", () => { > this.displayed_already = > displayed; /* Is displayed on the current view */ > }, >+ setComponentDialog(componentDialog, displayed = true) { >+ this.componentDialog = componentDialog; >+ this.displayed_already = >+ displayed; /* Is displayed on the current view */ >+ }, > removeMessages() { > if (this.displayed_already) { > this.error = null; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39320
:
187513
|
187514
|
187515
|
187516
|
187517
|
187518
|
187519
|
187520
|
187521
|
187522
|
187563
|
187568
|
187635
|
187636
|
187637
|
187638
|
187639
|
187640
|
187641
|
187642
|
187643
|
187644
|
187645
|
188094
|
188095
|
188096
|
188097
|
188098
|
188099
|
188100
|
188101
|
188102
|
188103
|
188104
|
188151
|
188279
|
188280
|
188281
|
188282
|
188283
|
188284
|
188285
|
188312
|
188315
|
188372
|
188375
|
188376
|
188637
|
188638
|
188639
|
188640
|
188641
|
188830
|
188831
|
188832
|
188833
|
188834
|
188835
|
188836
|
188837
|
188838
|
188839
|
188840
|
188841
|
188842
|
188843
|
188844
|
188845
|
188846
|
188847
|
188848
|
188849
|
188850
|
188851
|
188852
|
188853
|
188854
|
188855
|
188856
|
188857
|
188858
|
188859
|
188860
|
188861
|
188862
|
188863
|
188864