-
Notifications
You must be signed in to change notification settings - Fork 159
feat(query-builder): support for nested queries and other improvements #14647
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
36e04c1 to
28a92c3
Compare
Expected result: The buttons should be aligned with the inputs. |
Result: The changes are discarded. |
@AnjiManova Since this is by design, I am unsure how to proceed. The problem is that those are icon buttons, and they are big, even in small variant. Maybe we can use just icons instead? We already have just icons here |
Can we just try to apply align-item: flex-end and align the buttons to the bottom instead of changing the used components? |
Won't work, since the buttons are very big and there are labels on top of the inputs. the only way to align the buttons with the inputs is to use icons, I can try to make the buttons absolute and play with the position, but i don't like this idea Or maybe we can override the size of the buttons to match the size of the inputs in the context of the query builder |
If it's up to me I will not override the size of the buttons. The problem is only in the Large size in Bootstrap and in the Small size in Fluent and it is because of the fixed size of the Input Group components (Small size) in the Advanced Filtering and the Query Builder. We could consider future improvment here. About the buttons misalignment we will discuss your concerns with the team and we will come back to you, but for now it can stay as it is. In addition we added visual examples in all sizes for the Query Builder for all themes in the Figma file. |
QueryBuilder_bug1.mp4 |
Result: The + button does not show up on the group. Expected: One should be allowed to add new conditions to groups. |
Result: The condition remains in edit mode although the parent condition's commit button gets enabled. On attempting to commit the parent the following error is thrown: Expected result: Adding an In/Not condition should be working fine. |
Result: Both conditions get updated with the newly selected field. |
|
@desig9stein , please add background to 'Select All' item (when selected) and align the item: |
projects/igniteui-angular/src/lib/core/styles/components/dialog/_dialog-theme.scss
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-theme.scss
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss
Show resolved
Hide resolved
...ects/igniteui-angular/src/lib/core/styles/components/query-builder/_query-builder-theme.scss
Show resolved
Hide resolved
...ects/igniteui-angular/src/lib/core/styles/components/query-builder/_query-builder-theme.scss
Show resolved
Hide resolved
- Remove qb overriders from igx-dialog theme, - Remove unused variables related to the qb from igx-grid theme
- fix typography - make sure that creating a global button theme will not override the and and or buttons
…e handled in separate issue
damyanpetev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving some comments, most of those can be addressed later (thus non-blocking for now)
| /** | ||
| * Returns an array of names of the conditions which are visible in the UI | ||
| * Returns an array of names of the conditions which are visible in the filtering UI | ||
| */ | ||
| public conditionList(): string[] { | ||
| return this.operations.filter(f => !f.hidden && !f.isNestedQuery).map((element) => element.name); | ||
| } | ||
|
|
||
| /** | ||
| * Returns an array of names of the conditions which are visible in the UI, including "In" and "Not In", allowing the creation of sub-queries. | ||
| */ | ||
| public extendedConditionList(): string[] { | ||
| return this.operations.filter(f => !f.hidden).map((element) => element.name); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since IgxFilteringOperand is very much public (customers are advised to extend for custom scenarios), I'm not sure about this change. At least would consider a middle ground that doesn't disturb the API (like a flag to include queries), but also operations are also public so it's super simple to access externally and our internal utils really don't belong in public user configs.
Quite similar to the find methods of the expression tree IIRC and perhaps worth of similar fate (to be phased out).
| * @hidden | ||
| */ | ||
| protected findValueInSet(target: any, searchVal: Set<any>) { | ||
| public findValueInSet(target: any, searchVal: Set<any>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also not sure why this became public, can't see any external use and we've already got enough of those visible :)
| }]; | ||
|
|
||
| this.operations = newOperations.concat(this.operations); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're changing this wouldn't mind also just ...this.operations and the end. With those array sizes and this running once, it'll negligible diff, if any :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also empty line with indents
|
|
||
| /** | ||
| * @hidden @internal | ||
| */ | ||
| public generateEntity() { | ||
| const entities = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need any more of those semi-public things for templates anymore
| /** | |
| * @hidden @internal | |
| */ | |
| public generateEntity() { | |
| const entities = [ | |
| protected generateEntity() { | |
| const entities = [ |
Also, and I can't say the old code was any better in this regard, not really the best option to have a function generate this array basically on every change detection. Pretty much guarantees whatever logic is behind entities is ran too. Both the filter and entity transform are probably best done by a pipe.
| } | ||
|
|
||
| public set searchVal(value: any) { | ||
| this.expressionUI.expression.searchVal = value ? new Date(Date.parse(value.toString())) : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ough, always a bit sketchy seeing a direct Date.parse/new Date on what I'm assuming is user data directly? Those tend to have oddities with both formats against locales and time offsets with date-only ISO. For examples: our own internal DateUtil has such parseISODate and you can have a look behind Angular's toDate which is used for formatDate/DatePipe
Regardless, would love if not every small grid component does its own parsing however, but have a single util that definitely supports what we need (eventually I guess). At the very least, I see some of the filtering strategy going to core/utils parseDate so we can at least try to move towards standardizing on that for the Grids?
projects/igniteui-angular/src/lib/query-builder/query-builder-drag.service.ts
Outdated
Show resolved
Hide resolved
| /** | ||
| * @hidden @internal | ||
| */ | ||
| public fieldSelectOverlaySettings: OverlaySettings = { | ||
| scrollStrategy: new AbsoluteScrollStrategy(), | ||
| modal: false, | ||
| closeOnOutsideClick: false | ||
| }; | ||
| @ContentChild(IgxQueryBuilderSearchValueTemplateDirective, { read: TemplateRef }) | ||
| public searchValueTemplate: TemplateRef<any>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, would prefer if these props were directly private/protected
| this.deselectParentRecursive(parent); | ||
| } | ||
| } | ||
| const inIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M560-280H120v-400h720v120h-80v-40H200v240h360v80Zm-360-80v-240 240Zm560 200v-120H640v-80h120v-120h80v120h120v80H840v120h-80Z"/></svg>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are those supposed to go into the actual package at some point?
| igx_query_builder_create_and_group?: string; | ||
| igx_query_builder_create_or_group?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing those is technically a breaking change, however small. The resource interfaces are public API, just sayin :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added migration in this PR - #15381
…b.com/IgniteUI/igniteui-angular into dmdimitrov/query-builder-improvements
* fix(*): Renamed nested query condtions
…ader title (#15381) * feat(query-builder): expose disableReturnFieldsChange prop on root level * feat(query-builder): hide header, remove title RS, update CHANGELOG and README.md * chore(*): Move header variants down in the dev demo. --------- Co-authored-by: igdmdimitrov <[email protected]> Co-authored-by: desig9stein <[email protected]> Co-authored-by: Galina Edinakova <[email protected]>























Closes #14642
Closes #14979
Closes #15389
Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)