Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix format of stored field conditions value #19799

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

paescuj
Copy link
Member

@paescuj paescuj commented Sep 25, 2023

Fixes #19757

Regression introduced with #19639:

v-form requires the conditions value to be passed in form of { conditions }.
But instead of retrieving it that way in the getter, it was incorrectly stored in this form.
The form of the stored value shouldn't be changed as otherwise the conditions have no effect.

Review Guide

  1. Verify the interface in the "Conditions" tab of Field configuration works as expected, i.e. values can be saved and displayed again
  2. Verify the conditions take effect when editing a corresponding item

@changeset-bot
Copy link

changeset-bot bot commented Sep 25, 2023

🦋 Changeset detected

Latest commit: 3e424a4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@directus/app Patch
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@DanielBiegler DanielBiegler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe my findings are out of scope for this PR but wanted to still share for a future issue maybe:

My fields had conditions before this PR, so this happened for me on first opening:

image

But after you open the new dialog and close it, it disappears. (reappears when closing+reopening the side drawer)

and it also bugs out the first time you add a new condition but subsequent conditions work it's a lil' finicky, see the following video 😄

Screencast.from.25.09.2023.18.09.04.webm

@paescuj
Copy link
Member Author

paescuj commented Sep 25, 2023

Maybe my findings are out of scope for this PR but wanted to still share for a future issue maybe:

My fields had conditions before this PR, so this happened for me on first opening:

image

But after you open the new dialog and close it, it disappears. (reappears when closing+reopening the side drawer)

and it also bugs out the first time you add a new condition but subsequent conditions work it's a lil' finicky, see the following video 😄
Screencast.from.25.09.2023.18.09.04.webm

Yeah, this is to be expected, unfortunately, if you added conditions under v10.6.2. You could manually "fix" the format in such a case via "Raw Editor".

Copy link
Member

@br41nslug br41nslug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm this fixes basic conditions

firefox_TQKKRHeioK.mp4

We will need to mention somewhere, i suppose in the release notes, that any conditions created or edited since the 10.6.2 release last week will need to be adjusted/fixed/recreated.

I was thinking if we could catch/fix these incorrectly saved conditions with a migration or similar but i suspect that would cause more issues than it'd solve.

Copy link
Contributor

@DanielBiegler DanielBiegler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested multiple scenarios and all the basic ones and nested fields inside groups worked for me also. Sadly the expansion of groups still doesnt work see #19571 but thats a different issue - Awesome fix nice one! ❤️

@paescuj
Copy link
Member Author

paescuj commented Sep 25, 2023

We will need to mention somewhere, i suppose in the release notes, that any conditions created or edited since the 10.6.2 release last week will need to be adjusted/fixed/recreated.

I was thinking if we could catch/fix these incorrectly saved conditions with a migration or similar but i suspect that would cause more issues than it'd solve.

Exactly, I would rather avoid that in favor of a simple note in the release notes.

@rijkvanzanten rijkvanzanten merged commit d50e52f into main Sep 25, 2023
6 checks passed
@rijkvanzanten rijkvanzanten deleted the fix-field-conditions-store-format branch September 25, 2023 16:41
@github-actions github-actions bot added this to the Next Release milestone Sep 25, 2023
@br41nslug
Copy link
Member

Exactly, I would rather avoid that in favor of a simple note in the release notes.

A note on the breaking changes page in the docs then perhaps?

@paescuj paescuj mentioned this pull request Sep 25, 2023
br-rafaelbarros pushed a commit to personal-forks/directus-source that referenced this pull request Nov 7, 2023
* Fix format of stored field conditions value

* Add changeset
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conditions in v10.6.2
4 participants