Skip to content

Commit

Permalink
Allow configuration of oh- components in modals
Browse files Browse the repository at this point in the history
Fixes #927.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 committed Sep 26, 2023
1 parent 885e363 commit 208def7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default {
root: component,
store: this.$store.getters.trackedItems,
props: this.modalConfig,
vars: this.vars
vars: this.vars,
modalConfig: this.modalConfig // For configuration of oh- components
}
},
modalStyle () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ export default {
config () {
if (!this.context || !this.context.component) return null
let evalConfig = {}
if (this.context.component.config) {
const sourceConfig = this.context.component.config
// Fallback to modelConfig for oh- components to allow configuring them in modals
const sourceConfig = this.context.component.config || (this.componentType.startsWith('oh-') ? this.context.modalConfig : {})
if (sourceConfig) {
if (typeof sourceConfig !== 'object') return {}
for (const key in sourceConfig) {
if (key === 'visible' || key === 'visibleTo' || key === 'stylesheet') continue
Expand Down

0 comments on commit 208def7

Please sign in to comment.