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

Rename GridFilterModel['linkOperator'] to GridFilterModel['logicOperator'] and same for translations #7270

Closed
Tracked by #3287
cherniavskii opened this issue Dec 20, 2022 · 5 comments · Fixed by #7310
Assignees
Labels
breaking change component: data grid This is the name of the generic UI component, not the React module! v6.x

Comments

@cherniavskii
Copy link
Member

cherniavskii commented Dec 20, 2022

Context: #3915 (comment)

@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Dec 20, 2022
@cherniavskii cherniavskii self-assigned this Dec 23, 2022
@kkirsche
Copy link

kkirsche commented Jan 5, 2023

Is there truly a need for a prefix like logic or link at all? In the context of a filter model, wouldn't this be implied that it's the filter operator to apply when applying multiple filters?

I say this because when you abstract away the client-side stuff, as an external dev using server-side everything, the prefix is irrelevant and honestly more confusing when explaining to the team than not. Explaining to people that it's just a generic operator name that is mapped to the actual operator, especially in other languages and when applied via ORM's

The context read, from the discussion of operators and rules, like you may choose to separate those which I think would make the server-side pagination model more challenging to work with.

EDIT:
Example Python 3.7+ usage:
https://github.com/kkirsche/mui-data-grid/blob/132f38b4f86e2347fcea0631051bb5177d82a75c/src/mui/v5/integrations/sqlalchemy/filter/apply_items.py#L51

@kkirsche
Copy link

I think "linkOperator" is more explicit as it has the notion of "linking" multiple filters.

I would disagree. For me, it implies that it is composable. There can't be multiple operators between filters to do a ((x AND y) or z) to my knowledge. So it's composing a single large filter, not linking anything per se.

@cherniavskii
Copy link
Member Author

The "logicOperator" seems to be more explicit than the generic "operator". I don't think we should aim to map everything to server-side naming or conventions.
For example, MongoDB uses "Logical Query Operators" naming: https://www.mongodb.com/docs/manual/reference/operator/query-logical/

@kkirsche
Copy link

That's fair.

I don't view it as catering only to server-side as you state, in client-only mode you aren't adding any unique functionality that differs from server-side to say that this is making it about the server-side only.

If you'd like to follow Mongo though, have at it, nothing I will really be able to say to change your thoughts on an opinion-only topic, just weighing in that at least one customer disagrees with this change. 🤷‍♂️

@cherniavskii
Copy link
Member Author

Naming things is hard 🙂
The team has already agreed on the logicOperator, so we'll proceed with it.
Thanks for sharing your opinion though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: data grid This is the name of the generic UI component, not the React module! v6.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants