dabernathy89 / vue-query-builder

A UI component for building complex queries with nested conditionals.
https://dabernathy89.github.io/vue-query-builder/
MIT License
643 stars 157 forks source link

When logical operators changed - there is still "All" option selected #39

Closed alexeyeva closed 5 years ago

alexeyeva commented 5 years ago

Hi there!

Thanks for this plugin as it is great and saved a lot of time for me by not writing the whole query builder from scratch.

Despite, I'm having some problems with it and also have suggestions.

  1. Problem: When changing operator labels, there is still preselected 'All' value even if it is called in other way. Here I've made a cover (:)) on your sendbox, but added labels on the component. Under the query builder form you will see labels object that is used. https://codesandbox.io/s/q96zl47919?view=preview As you will see when page have just loaded - Match type selects are blank until you explicitly click on it and choose an option. Also this causes a problem as I'm expecting to get only AND or OR on the backend.

  2. Suggestion: It would be great to have ability to add more than two operators 'All' or 'Any'. Anyway, except they are used only as select options and as an attribute in query.

  3. Suggestion: It would be great to have operators when using select field type. It would be great to have two operators for the select type: ['=', '<>'] so there would be a possibility to choose what to exclude in query.

manuelteuber commented 5 years ago

For number 1 on your list, see my PR #38

+1 for more than these two logical operators

dabernathy89 commented 5 years ago

Thanks for the suggestions y'all! I'm try to take some time this weekend to look through this and some of the other open PRs/issues.

dabernathy89 commented 5 years ago

I've merged @memdev's fix for #1, and added the ability to customize the 'match type' labels. You can also now display operators for any rule - TBH i'm not sure why I restricted this in the first place.