Skip to content

Conversation

@dehru
Copy link
Contributor

@dehru dehru commented Jan 21, 2021

What does this PR do?

This PR address this issue that was introduced in newly published version 50.14.0. The issue is captured here. #120

What issues does this PR fix or reference?

#120

@codecov
Copy link

codecov bot commented Jan 21, 2021

Codecov Report

Merging #125 (2c386c0) into develop (ed869fc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #125   +/-   ##
========================================
  Coverage    87.61%   87.62%           
========================================
  Files           46       46           
  Lines         1470     1471    +1     
  Branches       322      334   +12     
========================================
+ Hits          1288     1289    +1     
  Misses         180      180           
  Partials         2        2           
Flag Coverage Δ
language-server 98.65% <ø> (ø)
soql-builder-ui 92.43% <100.00%> (+0.01%) ⬆️
soql-model 80.32% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...dules/querybuilder/services/toolingModelService.ts 94.94% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed869fc...2c386c0. Read the comment docs.

limit: string;
errors: List<Map>;
unsupported: List<Map>;
originalSoqlStatement: string;
Copy link
Contributor Author

@dehru dehru Jan 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preview component is reactive to this property. Previously, we were only displaying the soql query from the text document when we got a onDidChangeTextDocument event. But when the user interacts with the UI, we also generate the soql statement. So we can use the soql statement generated by the user interaction with the form to also display the soql statement in the preview by adding this property to the immutable model when we update it.

"name": "@salesforce/soql-builder-ui",
"description": "SOQL Builder UI with LWC",
"version": "0.0.28",
"version": "0.0.29",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ready to publish a new version once this is QAd

Copy link
Contributor

@jonnyhork jonnyhork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks good. I can't remember why we didn't do it this way before? Also, do we know the source of the bug, when and what changed?

@dehru
Copy link
Contributor Author

dehru commented Jan 21, 2021

Nice, this looks good. I can't remember why we didn't do it this way before? Also, do we know the source of the bug, when and what changed?

So we used to always show the preview from the soql statement that was generated by the UI. But then we had that issue where the user could open a soql query from a text editor that we didn't support...but we still wanted to show them the soql statement and allow them to run what they see. So we switched it to only update the preview from the incoming soql statement.

I think what we want is show the soql statement from the text editor when the change event happens. But also, when the user interacts with our form, immediately update the soql statement. Since we are sending that to the text editor anyway.

It's like the best of both worlds now. I hope.

@jonnyhork
Copy link
Contributor

QA Passed for me

@dehru dehru merged commit 067133e into develop Jan 22, 2021
@dehru dehru deleted the dehru/soql-issue-120 branch January 22, 2021 15:52
jgellin-sf added a commit that referenced this pull request Jan 29, 2021
* Fix preview not updating when autosave is off - issue 120 (#125)

* add soql-statement to model
* verify that we include the soql statement in the model
* update the package version so we can publish and consume

* Add smarter completion on GROUP BY clause and WHERE literals (#126)

* Initial support for Aggregate functions.

Also:
 * Fix: Propose "COUNT()" only if right after "SELECT"
 * Remove special-case for "SELECT (SELECT ), | FROM Foo". Not worth it

* Add completion inside function expression

Example: SELECT AVG(|) FROM

Also:
 * Improve ANTLR error recovery to better extract FROM expresssions

* Make completions inside function expression type-aware

* Add smarter completion on GROUP BY clause

Also:
 * Complete only with "groupable" fields.
 * Give priority to complete GROUP BY with fields which appear
   on SELECT and are not aggregated or groupped.
 * On ORDER BY: Complete only with "sortable" fields
 * Add completion on semi-join SELECTs (in WHERE clauses)
 * Fix defect when cursor is around multiple newlines
 * Improve query analysis impl
 * Pre-select "WHERE" option if provided

* Improve support for queries with semi-joins

* Refactor: move soql operator semantics to LSP server-side

* Add more code-completion proposals for literal values

Including:

* Range date literals (LAST_YEAR, YESTERDAY, LAST_N_DAYS:n, etc.)
* Simple templates for: int, double, string, currency

* Quiet completion on HAVING clause

* Add a space before opening parenthesis after INCLUDES/EXCLUDES

* New soql lsp version 0.3.3 (#140)

Co-authored-by: dehru <599418+dehru@users.noreply.github.com>
Co-authored-by: Fernando Dobladez <fernandodobladez@salesforce.com>
jgellin-sf pushed a commit that referenced this pull request Feb 2, 2021
* Fix preview not updating when autosave is off - issue 120 (#125)

* add soql-statement to model
* verify that we include the soql statement in the model
* update the package version so we can publish and consume

* Add smarter completion on GROUP BY clause and WHERE literals (#126)

* Initial support for Aggregate functions.

Also:
 * Fix: Propose "COUNT()" only if right after "SELECT"
 * Remove special-case for "SELECT (SELECT ), | FROM Foo". Not worth it

* Add completion inside function expression

Example: SELECT AVG(|) FROM

Also:
 * Improve ANTLR error recovery to better extract FROM expresssions

* Make completions inside function expression type-aware

* Add smarter completion on GROUP BY clause

Also:
 * Complete only with "groupable" fields.
 * Give priority to complete GROUP BY with fields which appear
   on SELECT and are not aggregated or groupped.
 * On ORDER BY: Complete only with "sortable" fields
 * Add completion on semi-join SELECTs (in WHERE clauses)
 * Fix defect when cursor is around multiple newlines
 * Improve query analysis impl
 * Pre-select "WHERE" option if provided

* Improve support for queries with semi-joins

* Refactor: move soql operator semantics to LSP server-side

* Add more code-completion proposals for literal values

Including:

* Range date literals (LAST_YEAR, YESTERDAY, LAST_N_DAYS:n, etc.)
* Simple templates for: int, double, string, currency

* Quiet completion on HAVING clause

* Add a space before opening parenthesis after INCLUDES/EXCLUDES

* New soql lsp version 0.3.3 (#140)

* Feature/custom select (#148)

* Jhork/custom select fields (#111)
* Jhork/custom select from (#130)
* Jhork/custom select order by (#134)

* set the error overlay to be on top of all other form elements (#150)

* set the error overlay to be on top of all other form elements
* add z-index to .unsupported-syntax

* prepare to publish 0 .0.30 (#151)

Co-authored-by: Fernando Dobladez <fernandodobladez@salesforce.com>
Co-authored-by: Jonny Hork <jhork@salesforce.com>
dehru added a commit that referenced this pull request Feb 5, 2021
* Jhork: Support for Simple WHERE Expressions (#101)
* move rule to css common (#108)
* Preventing webview re-rendering when soql statement has not changed (#105)
* Revert "Disable WHERE in model (#113)"
* Type-aware where (#109)
* Fix preview not updating when autosave is off - issue 120 (#125)
* Recognize recoverable where errors (#116)
* Operator and Criteria Error Tooltips (#122)
* Support IN, NOT IN, INCLUDES, EXCLUDE operators (#123)
* Add smarter completin on GROUP BY clause and WHERE literals (#126)
* Feature/custom select (#148)
* Jhork/custom select fields (#111)
* Jhork/custom select from (#130)
* Jhork/custom select order by (#134)
* set the error overlay to be on top of all other form elements (#150)
* prepare to publish 0 .0.30 (#151)
* Feature/where (#154)
* Jhork: Support for Simple WHERE Expressions (#101)
* move rule to css common (#108)
* Preventing webview re-rendering when soql statement has not changed (#105)
* Revert "Disable WHERE in model (#113)"
* Type-aware where (#109)
* Recognize recoverable where errors (#116)
* Operator and Criteria Error Tooltips (#122)
* Support IN, NOT IN, INCLUDES, EXCLUDE operators (#123)
* Revert "Feature/where (#154)" (#157)
* Add support for line comments ( `//` ) at the top of SOQL files (#132)
* Jhork/where custom select (#161)
* Fix: 'undefined' in SOQL string (#162)
* Clear tooltip when object changes, fix empty soql statement error blocker (#165)
* Track to force render on condition change - fix rebase conflict (#166)
* do not send event when user still adding input' (#169)
* Jhork/clear modifier field bug fix (#168)
* handle a option selection event (#178)
* cler tooltip error when X is clicked (#180)
* Jhork/workflow updates (#163)
* Bump versions for release (#181)

Co-authored-by: Jonny Hork <jhork@salesforce.com>
Co-authored-by: dehru <599418+dehru@users.noreply.github.com>
Co-authored-by: Dehru Cromer <dehru.cromer@salesforce.com>
Co-authored-by: Fernando Dobladez <fernandodobladez@salesforce.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants