Sitegeist.Monocle icon indicating copy to clipboard operation
Sitegeist.Monocle copied to clipboard

Bug: Inspector prop values only reflect `default` useCase values

Open mhsdesign opened this issue 3 years ago • 4 comments

Build a simple component:

prototype(Foo.Bar:Block.Thing) < prototype(Neos.Fusion:Component) {
    @styleguide {
        title = 'Thing'
        props {
            option = true
        }
        useCases {
            blablabla {
                title = "Blablabla"
                props {
                    option = false
                }
            }
        }
    }
    renderer = afx`
        {Json.stringify(props)}
    `
}

Open it in monocle

  • expect rendering to be {"option":true}
  • expect inpector to correctly reflect option with checkbox marked

Select usecase Blablabla

  • expect rendering to be {"option":false}
  • expect inpector to correctly reflect option with checkbox not marked -> fails!

Bildschirmaufzeichnung vom 10.10.2022, 22:05:33.webm

I looked at the code and \Sitegeist\Monocle\Domain\PrototypeDetails\Props\PropsCollectionFactory only takes into account the current default for the initial page load - and there is simply no update inspector logic in place ...

mhsdesign avatar Oct 10 '22 20:10 mhsdesign

The UseCase even seems to have a overrides property key value pair, but it seems unused ...

mhsdesign avatar Oct 10 '22 20:10 mhsdesign

Hello

I have also noticed this error several times and it has been reported to me several times. Would be nice if this could be corrected in the next release. Thank you very much

KPeschke avatar Dec 04 '23 15:12 KPeschke

@KPeschke we are open for contributions ;)

I’m currently occupied fixing other $things ;)

mhsdesign avatar Dec 04 '23 18:12 mhsdesign

I have the same issue. Also useCase props seem to reset all props specified above, i.e. for

prototype(Foo.Bar:Block.Thing) < prototype(Neos.Fusion:Component) {
    @styleguide {
        title = 'Thing'
        props {
            option = true
            someValue = 'default'
        }
        useCases {
            blablabla {
                title = "Blablabla"
                props {
                    option = false
                }
            }
        }
    }
    renderer = afx`
        {Json.stringify(props)}
    `
}

the result of the "Blablabla" useCase is

{"option":false}

instead of (what I would expect):

{"option":false,"someValue":"default"}

bwaidelich avatar Apr 16 '24 11:04 bwaidelich