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

feat(next-queries): add next query preview logic #611

Merged
merged 17 commits into from
Jul 28, 2022

Conversation

ajperezbau
Copy link
Contributor

@ajperezbau ajperezbau self-assigned this Jul 19, 2022
@ajperezbau ajperezbau requested a review from a team as a code owner July 19, 2022 07:37
@tiborux tiborux self-requested a review July 19, 2022 08:34
@tiborux tiborux self-assigned this Jul 19, 2022
Comment on lines +18 to +20
if (!query) {
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The query is a required parameter for this action, so no checks should be needed. We can trust TypeScript. With this I believe we can simplify the return type and just set a SearchResponse

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even if the query is a required parameter, nothing avoids calling the function with an empty string, although that would not be a legit use of this function 🤔
Should I remove that comprobation anyway?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think Abraham is right, and I would leave the empty string check. Specially thinking of reusing the wire with custom wiring config in setups. Better prevent an error request to API

const request: SearchRequest = {
query,
rows: state.config.resultsPreviewCount,
extraParams: state.params
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add an origin to these requests? Even if it is hardcoded I remember talking about it but I can't find the info in the JIRA task 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ook, which should be the origin?
Something like next_query:results?

Copy link
Contributor

@tiborux tiborux Jul 21, 2022

Choose a reason for hiding this comment

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

Im not sure because the query feature is the next-query, but the feature location is the predictive_layer? Because in this case, they are not still the query inside the grid, but im not sure about this or if we should create a new feature location?

@luismmdev luismmdev requested a review from tiborux July 21, 2022 06:49
- Rename NextQueryPreviewResults to PreviewResults
- Add query to PreviewResults
- Change event used to reset the preview results

EX-6119
@ajperezbau ajperezbau requested a review from tiborux July 27, 2022 09:45
Comment on lines +18 to +20
if (!query) {
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think Abraham is right, and I would leave the empty string check. Specially thinking of reusing the wire with custom wiring config in setups. Better prevent an error request to API

tiborux
tiborux previously approved these changes Jul 27, 2022
@javieri-empathy javieri-empathy removed their request for review July 28, 2022 10:44
@tiborux tiborux merged commit fc611fa into main Jul 28, 2022
@tiborux tiborux deleted the feature/EX-6119-add-next-query-preview-logic branch July 28, 2022 10:49
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.

4 participants