-
Notifications
You must be signed in to change notification settings - Fork 450
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
Fleet UI: Query report (table, buttons, api calls, etc) #14325
Fleet UI: Query report (table, buttons, api calls, etc) #14325
Conversation
2ede82a
to
8f1bb1c
Compare
👀 |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 7766-frontend #14325 +/- ##
================================================
Coverage ? 58.79%
================================================
Files ? 909
Lines ? 74568
Branches ? 2142
================================================
Hits ? 43840
Misses ? 27230
Partials ? 3498
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
frontend/pages/queries/details/QueryDetailsPage/QueryDetailsPage.tsx
Outdated
Show resolved
Hide resolved
frontend/pages/queries/details/QueryDetailsPage/QueryDetailsPage.tsx
Outdated
Show resolved
Hide resolved
} | ||
); | ||
|
||
const isLoading = isStoredQueryLoading || isQueryReportLoading; // TODO: Add || isCachedResultsLoading for new API response |
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.
Should these TODOs be done?
frontend/pages/queries/details/QueryDetailsPage/QueryDetailsPage.tsx
Outdated
Show resolved
Hide resolved
frontend/pages/queries/details/QueryDetailsPage/QueryDetailsPage.tsx
Outdated
Show resolved
Hide resolved
frontend/pages/queries/details/components/QueryReport/QueryReport.tsx
Outdated
Show resolved
Hide resolved
frontend/pages/queries/details/components/QueryReport/QueryReport.tsx
Outdated
Show resolved
Hide resolved
frontend/pages/queries/details/components/QueryReport/QueryReport.tsx
Outdated
Show resolved
Hide resolved
To create headers, use JS set to create an array of all unique column names */ | ||
const uniqueColumnNames = Array.from( | ||
results.reduce( | ||
(s, o) => Object.keys(o).reduce((t, k) => t.add(k), s), |
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.
This could be clearer. The single var names are tricky to reason about when combined with the nested reduce
s. Maybe:
s
–> uniqueColumns
o
–> resultColumns
and then add each key of resultColumns
to uniqueColumns
before returning uniqueColumns
. You might do a return new Set.from([...uniqueColumns, ...Object.keys(resultColumns))]
.
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.
Just the variable renames would be nice. Not necessary for now though.
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.
Yeah, this can be prioritized later for a refactor if need be. I'm going to leave this as is since it was my solution for a bug in QueryResultsTableConfig.tsx (where we were only displaying columns from the first row of results and not all columns returned) and would require out of scope refactoring. Currently it's just being used in these two spots.
import { buildQueryStringFromParams } from "utilities/url"; | ||
|
||
// Mock API requests to be used in developing FE for #7766 in parallel with BE development | ||
import { sendRequest } from "services/mock_service/service/service"; |
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.
TODO - use the real service
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.
- We want "on" to be bolded on QueryDetailsPage > 218
QueryDetailsPage
> 94 – why do we need to useas
? This should definitely be a number right?IQueryReportResultRow.columns
can be typed better
Issue
Cerra #13472
Description
/queries/{id}
routeScreen recordings (Uses mock data)
Screen.Recording.2023-10-09.at.12.21.17.PM.mov
Screen.Recording.2023-10-09.at.12.20.11.PM.mov
Checklist for submitter
If some of the following don't apply, delete the relevant line.