-
Notifications
You must be signed in to change notification settings - Fork 160
fix(query-builder): returnFields should be '*' on entity change / all fileds are selected #15445
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
Merged
gedinakova
merged 6 commits into
master
from
thristodorova/query-builder-fix-return-fields
Mar 12, 2025
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dd9823f
fix(query-builder): returnFields should be '*' on entity change
teodosiah 84d4916
Merge branch 'master' into thristodorova/query-builder-fix-return-fields
teodosiah 232d9fc
Merge branch 'master' into thristodorova/query-builder-fix-return-fields
teodosiah c14b3eb
fix(query-builder): on select all click return fields should be *
teodosiah 8240572
Merge branch 'master' into thristodorova/query-builder-fix-return-fields
teodosiah 551aa9e
Merge branch 'master' into thristodorova/query-builder-fix-return-fields
gedinakova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -444,6 +444,32 @@ describe('IgxQueryBuilder', () => { | |
| expect((dropdownItems[4] as HTMLElement).innerText).toBe('Released'); | ||
| })); | ||
|
|
||
| it('ReturnFields should be properly calculated.', fakeAsync(() => { | ||
| queryBuilder.expressionTree = QueryBuilderFunctions.generateExpressionTree(); | ||
| queryBuilder.showEntityChangeDialog = false; | ||
| fix.detectChanges(); | ||
|
|
||
| // Verify the returnFields | ||
| let exprTreeReturnFields = JSON.stringify(fix.componentInstance.queryBuilder.expressionTree.returnFields); | ||
| expect(exprTreeReturnFields).toBe(`["*"]`); | ||
|
|
||
| // Change the selected return fields | ||
| QueryBuilderFunctions.selectFieldsInEditModeExpression(fix, [1]); | ||
| tick(100); | ||
| fix.detectChanges(); | ||
|
|
||
| // Verify the returnFields | ||
| exprTreeReturnFields = JSON.stringify(fix.componentInstance.queryBuilder.expressionTree.returnFields); | ||
| expect(exprTreeReturnFields).toBe(`["OrderId"]`); | ||
|
|
||
| // Change the entity | ||
| QueryBuilderFunctions.selectEntityAndClickInitialAddCondition(fix, 0); | ||
|
|
||
| // Verify the returnFields | ||
| exprTreeReturnFields = JSON.stringify(fix.componentInstance.queryBuilder.expressionTree.returnFields); | ||
| expect(exprTreeReturnFields).toBe(`["*"]`); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about the case when all fields get explicitly checked again or via the "Select All" checkbox (for the same entity)? This is not covered in a test and doesn't seem to work yet. |
||
| })); | ||
|
|
||
| it('Column dropdown should contain proper fields based on the entity.', fakeAsync(() => { | ||
| const queryBuilderElement: HTMLElement = fix.debugElement.queryAll(By.css(`.${QueryBuilderSelectors.QUERY_BUILDER_TREE}`))[0].nativeElement; | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could be done with a ternary expression as well.