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
Bugs with the new filter interface and api #8627
Comments
The same bunch of errors for me too. 👀
On Firefox & Safari, the
Slowly looking into the other issues listed... |
directus/app/src/interfaces/_system/system-filter/nodes.vue Lines 244 to 253 in fc87c0b
Seems like adding the following to the above if else statement will resolve this (may need more confirmation): else if (['_null', '_nnull', '_empty', '_nempty'].includes(newVal)) {
update(true);
}
This should be related to #7502 right? |
@azrikahar it does clear the error and work. 🤓 Somehow thereafter, the text field is clipped to 2 characters, think it is set to the |
@licitdev thanks for testing it! That's why I (luckily) mentioned need more confirmation 🙈 Also thanks a lot for looking into this and sharing updates/details on what you found. Definitely helps a ton! |
@azrikahar I think this issue could be solved through the app. Not sure if it's good to update the API as well. On a side note, I wonder if debounce will be useful here in reducing the number of server requests after almost every keystroke. 🤔 |
Just saw the following reference for function onClickOutside(e: any) {
if (e.composedPath().some((el) => el?.classList?.contains('v-menu-content'))) return false;
return true;
} |
Hmm could be, but I'm also not super sure as I haven't look into this deeply atm haha. I believe the intention to update the API (assuming you meant that linked PR) was to ensure other clients like the SDK, not just the App, will have the same outcome. Just a very high level assumption from me here 🤔
Does #8631 addresses this? Feel free to let me know if I missed other inputs in that PR 👍
Nice find! Seems like that is indeed the better solution going forward, as mentioned in the beginning of this SO answer, especially since Directus won't support IE anyway |
That issue occured with the search field. directus/api/src/utils/apply-query.ts Lines 524 to 533 in f64a5be
For filters, the check is done is directus/api/src/utils/validate-query.ts Lines 99 to 104 in f64a5be
Hence error n°3 in the bullet list.
Strongly agree with this. The database will already throw if the compare value is invalid, so doing the check on Directus side as well seems unnecessary. We would just need to make sure that the App sends correct compare values to the API.
I think this should happen at the interface level. For example, when using the input to type a number, no value should be emitted if the input contains non decimal characters. Actually, we shouldn't even be able to type them. Same goes for the uuid, where we'd need a mechanism in the
Totally agree with this 👍 When searching on a massive collection with lots of columns, the UI just get janked and I'm pretty sure the server doesn't like it either. |
I believe even after validating on API, an error will still be thrown, albeit a different error type.
Yep! The debouncing worked great~ 👍🏻
Yes, but the answer may not be correct as mentioned in this comment. function onClickOutside(e: any) {
const path = e.path || e.composedPath();
if (path.some((el) => el?.classList?.contains('v-menu-content'))) return false;
return true;
} |
Whoever working on this issue, please help to add in directus/app/src/interfaces/_system/system-filter/input-component.vue Lines 129 to 133 in fc87c0b
|
@Oreilles thanks for the detailed explanation!
Totally agree with this as well.
@licitdev that's true. Preventing invalid inputs as Oreilles mentioned above does make more sense in general. |
Preflight Checklist
Describe the Bug
Every time I click on a field name in the dropdown to add a filter element, the errorFixedUncaught TypeError: e.path is undefined
logs to the console.When clicking on a relational field in that dropdown (not on its right arrow to expand it), the same error occurs, and the element isn't added to the filter listFixedWhen adding any of the filtersFixednull
,nnull
,empty
,nempty
, the layout crashes with[INVALID_QUERY] "_empty" has to be a boolean
When setting a filter on a geometry field, the layout crashes withSomewhat fixed[INVALID_QUERY] The filter value for "_eq" has to be a string, number, or boolean
When setting anFixedequal
filter on a UUID field and typing a non-uuid-like string, the server throw an unhandled error with:invalid input syntax for type uuid: "justtypeanything"
That same error occurs as well if you try to compare aFixednumber
field to a string that cannot be parsed down to a number. I only tested for these two types, but I assume that a similar error will occur for any bad type casting.To Reproduce
Follow steps above.
What version of Directus are you using?
9.0.0-rc.96
What version of Node.js are you using?
16.8.0
What database are you using?
Postgres
What browser are you using?
Firefox
What operating system are you using?
macOS
How are you deploying Directus?
local
The text was updated successfully, but these errors were encountered: