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

Field's condition filter Directus interface does not allow to input the correct filter #12753

Closed
Pachat opened this issue Apr 14, 2022 · 2 comments

Comments

@Pachat
Copy link

Pachat commented Apr 14, 2022

Describe the Bug

Because of dynamic-variables limitations concerning the use of $CURRENT_USER in conditions filters, we can however refer to user_created in the way described below.

The problem is that the Directus interface does not allow to input the correct filter and you have to Edit the raw.

A solution could be by documenting the way of doing things,
or, better, by having the click on user_created not only opening the nested properties but also feeding the filter.
Event better, a double click on user_created feeding the filter with user_created is a logical solution from the user POV

Use case:

  • online student homework with a hidden field for the professor's exclusive use.

To Reproduce

  1. A collection with user_created, input_field1 and input_field2
  2. To have input_field2 not accessible to the user_created, the filter that works and you want to build is
{
	"_or": [
		{
			"user_created": {
				"_eq": "$CURRENT_USER"
			}
		},
		{
			"user_created": {
				"_null": true
			}
		}
	]
}

and check Hidden on Detail

Errors Shown

The Directus Interface does not allow to build such a filter: clicking on User Created only opens the nested properties. So you end with:

{
	"_or": [
		{
			"user_created": {
				"id": {
					"_eq": "$CURRENT_USER"
				}
			}
		},
		{
			"user_created": {
				"id": {
					"_null": true
				}
			}
		}
	]
}

which does not work.

What version of Directus are you using?

9.7.1

What version of Node.js are you using?

16.14.0

What database are you using?

SQLite version 3.37.0

What browser are you using?

Firefox and Edge

How are you deploying Directus?

locally

@azrikahar
Copy link
Contributor

The Directus Interface does not allow to build such a filter: clicking on User Created only opens the nested properties.

This is the same issue as #12040, and the good news is it was fixed by #12320 in v9.8.0!

With that said, I do acknowledge that you may have held off from the upgrade due to #10842 (just an assumption based on your version & database). However, technically this particular filter interface issue has been fixed so I'll have to mark this as resolved. Hope that's understandable 👍

@Pachat
Copy link
Author

Pachat commented Apr 14, 2022

Thanks for your reply. Nice to hear that it has been fixed.
I hope to be able soon to follow the updates as soon as #10842 is fixed,
or to have a path to manually migrate the database.

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

No branches or pull requests

2 participants