Skip to content

Conversation

@mjauvin
Copy link
Member

@mjauvin mjauvin commented Sep 25, 2022

This PR corrects the following problems:

object inspector type: properties using depends do not refresh.

objectList inspector type: itemProperties using depends do not work.

- get property value from root surface object
- pass objectlist property name to surface object
@mjauvin mjauvin added the enhancement PRs that implement a new feature or substantial change label Sep 25, 2022
@mjauvin mjauvin added this to the v1.2.2 milestone Sep 25, 2022
@mjauvin mjauvin self-assigned this Sep 25, 2022
@mjauvin mjauvin changed the title Fix inspector depends Fix inspector depends functionality. Sep 25, 2022
@bennothommo
Copy link
Member

@mjauvin could you add a test scenario to the Test plugin that demonstrates this?

@mjauvin
Copy link
Member Author

mjauvin commented Sep 30, 2022

@bennothommo I'll try, but I don't garanty anything

@mjauvin
Copy link
Member Author

mjauvin commented Sep 30, 2022

@bennothommo I'm frankly not sure how to approach this. The tests would need to create a inspector widget then simulate trigger events on the dropdown fields... any idea?

I could propably instanciate such a widget with cms/formwidgets/Components.php, but how do I programatically interact with it?

@LukeTowers
Copy link
Member

@mjauvin I assume you're using this functionality in a component in a plugin? We don't need an automated test case for this at the moment, just a reproduction of what the use case is that triggers the original issue so we can test the before / after of the fix. Can be implemented as a component within the test plugin I'd imagine.

@mjauvin
Copy link
Member Author

mjauvin commented Oct 1, 2022

yeah, I think this is a better approach.

@mjauvin
Copy link
Member Author

mjauvin commented Oct 1, 2022

@LukeTowers @bennothommo this commit (wintercms/wn-test-plugin@5e93893) adds a component to the Test plugin that can be added to a page/layout to demonstrate the problem.

  • When selecting a value from the Reference Dropdown property, this should update the items in the Object Test dropdown property. Currently, this only works after closing/re-opening the Inspector.

  • Also, If you open the ObjectList Test property and click Add, its dropdown should be populated with values related to the value selected in the Reference Dropdown property. This doesn't happen (even after a close/re-open of the Inspector)

This PR fixes both of the above issues.

@bennothommo
Copy link
Member

I'll have to give this a test in a couple of days - launching that major project I've been working on in the next day or two, so gotta focus on that going smooth :)

@mjauvin
Copy link
Member Author

mjauvin commented Oct 15, 2022

I'll have to give this a test in a couple of days - launching that major project I've been working on in the next day or two, so gotta focus on that going smooth :)

Did you get time to test this?

@bennothommo
Copy link
Member

I haven't, no. Thanks for the reminder.

@mjauvin mjauvin added maintenance PRs that fix bugs, are translation changes or make only minor changes and removed enhancement PRs that implement a new feature or substantial change labels Oct 16, 2022
@LukeTowers LukeTowers modified the milestones: v1.2.1, v1.2.2 Oct 20, 2022
@mjauvin
Copy link
Member Author

mjauvin commented Mar 28, 2023

Is that going to be superseded by the inspector widget rewrite ?

@bennothommo
Copy link
Member

bennothommo commented Mar 28, 2023

Most likely but the Inspector rewrite is a ways off still - if this works, I'm happy to merge it. It's all tested, I assume?

EDIT: I realise I was supposed to test it - d'oh! I'll get to that today.

@mjauvin
Copy link
Member Author

mjauvin commented Mar 28, 2023

@bennothommo Yes, it's been tested on my end and there's a procedure/PR to test this with the test plugin above.

@bennothommo bennothommo merged commit 0e506eb into develop Mar 28, 2023
@bennothommo bennothommo deleted the fix-inspector-depends branch March 28, 2023 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance PRs that fix bugs, are translation changes or make only minor changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants