Missing node dialog revamp (#322)

* Basic rework of load workflow warning dialog

* Better style

* Add vue jest support

* Mock vue component in jest test

* nit

* Make dialog maximizable
This commit is contained in:
Chenlei Hu
2024-08-06 20:11:05 -04:00
committed by GitHub
parent 6fe2297cc1
commit 79469bd2b1
10 changed files with 599 additions and 55 deletions

38
src/stores/dialogStore.ts Normal file
View File

@@ -0,0 +1,38 @@
// We should consider moving to https://primevue.org/dynamicdialog/ once everything is in Vue.
// Currently we need to bridge between legacy app code and Vue app with a Pinia store.
import { defineStore } from 'pinia'
import { Component } from 'vue'
interface DialogState {
isVisible: boolean
title: string
component: Component | null
props: Record<string, any>
}
export const useDialogStore = defineStore('dialog', {
state: (): DialogState => ({
isVisible: false,
title: '',
component: null,
props: {}
}),
actions: {
showDialog(options: {
title?: string
component: Component
props?: Record<string, any>
}) {
this.title = options.title
this.component = options.component
this.props = options.props || {}
this.isVisible = true
},
closeDialog() {
this.isVisible = false
}
}
})