-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(multi-query): Add charts and tables to multi query mode #85303
Conversation
Bundle ReportChanges will increase total bundle size by 20.63kB (0.06%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: app-webpack-bundle-array-pushAssets Changed:
Files in
|
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.
lgtm, just had a few questions
@@ -130,8 +131,9 @@ function getUpdatedLocationWithQueries( | |||
location: Location, | |||
queries: WritableExploreQueryParts[] | null | undefined | |||
) { | |||
let targetQueries: string[] | null = 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.
nit: I think you can simplify this even further using a ternary operator now that the else if condition is removed. Something like const targetQueries = defined(queries) ? queries.map(query => ...) : null;
for (const groupBy of queryToUpdate.groupBys) { | ||
const value = row[groupBy]; | ||
search.setFilterValues(groupBy, [value]); | ||
} |
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.
minor nit, feels slightly more readable to me:
for (const groupBy of queryToUpdate.groupBys) { | |
const value = row[groupBy]; | |
search.setFilterValues(groupBy, [value]); | |
} | |
queryToUpdate.groupBys.forEach(groupBy => { | |
search.setFilterValues(groupBy, [row[groupBy]]); | |
}); |
index, | ||
}: MultiQueryFieldProps) { | ||
const queries = useReadQueriesFromLocation(); | ||
const userQuery = queries[index]!.query; |
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.
Would it be safer to do something like this instead queries[index]?.query ?? ''
? If there's a possibility that queries[index]
is undefined somehow
const allFields: string[] = []; | ||
|
||
for (const groupBy of groupBys) { | ||
if (allFields.includes(groupBy)) { | ||
continue; | ||
} | ||
allFields.push(groupBy); | ||
} | ||
|
||
for (const yAxis of yAxes) { | ||
if (allFields.includes(yAxis)) { | ||
continue; | ||
} | ||
allFields.push(yAxis); | ||
} |
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 im understanding this correctly, I think you could use a Set
here? So you don't have to check for existence and just drop everything into an allFields
Set
blindly. Unless the order matters, but there might be a datastructure for that
State is currently persisted in the URL, but this is just for the first pass.
We'll need to store backend state eventually.
Needs follow up for: