-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add export feature using v2 endpoint for instance reports #685
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
Open
marqode
wants to merge
47
commits into
main
Choose a base branch
from
feat/reports-tsv-export
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
a0a4e2f
feat: redesign the reports side panel on the V2 endpoint
yuriy-vasilyev 4c615d2
initial tsv exports
rubinaga 2d3f4ba
refine
rubinaga 1530d37
add UI fixes
rubinaga bc57fc2
improve tests
rubinaga a81ddb6
add changeset
rubinaga c077098
copilot fixes
rubinaga aaf0eda
add more copilot fixes
rubinaga 8e1dcb3
add retry button
rubinaga fc590c8
prettier fixes
rubinaga d8993cc
change export id to number
rubinaga 594067b
fix eslint
rubinaga 3d084c6
Merge branch 'main' into feat/reports-tsv-export
marqode 33b0929
Merge branch 'main' into feat/reports-tsv-export
marqode 14ea3c9
merge in tsv-exports
marqode a8f9c1f
add tsv export form and mock handler for reports
marqode edb8148
add tests for report export
marqode ef0e2c1
add changeset
marqode c707b3a
run prettier, fix lint error
marqode c49d5e2
integrate changes from other feature branches, add tests
marqode 48186d9
remove extra changeset
marqode ed390b2
Apply suggestions from code review
marqode a79cbdf
add Other tooltip to form, close side panel on export download
marqode 1adc3aa
remove dead code
marqode d2bc0ac
Apply suggestions from code review
marqode 81d87e6
change progressbar design
rubinaga e4866d8
prettier fixes
rubinaga 14fe183
add copilot suggestions
rubinaga 811fb23
update by_cve report export format
marqode a6a5d99
update form and detail view with description field, fields for by_cve…
marqode 6490fb2
merge feature/tsv-exports
marqode 8f2da0e
Apply suggestions from code review
marqode d54bbed
merge main, fix failing test
marqode 0442bbf
update description field
marqode 1fb0957
fix failing tests
marqode 5f40b9e
run prettier
marqode 29ace65
Apply suggestions from code review
marqode 3beae26
update exportsList label and tests
marqode 5565745
update sample description
marqode ec88683
add cve fields to default selection for instance compliance reports
marqode 7d2759b
Merge branch 'main' into feat/reports-tsv-export
marqode c448b7b
display primary identity group before compliance in report export fields
marqode 54837eb
merge in field updates, fix tests
marqode acbb008
restore empty changeset from main
marqode ab9f51d
fix failing test
marqode 43a7e4a
fix: pagination for mirrors (#686)
marqode 87552f2
feat: restore LRO Mirrors and Publications onto main (#693)
yurii-vasyliev 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "landscape-ui": minor | ||
| --- | ||
|
|
||
| Redesign the instances reports side panel on a single V2 `computers/report` endpoint, with deep-linked counts and a working CSV download. Gated behind the `instance-reports` feature flag (on by default). | ||
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "landscape-ui": minor | ||
| --- | ||
|
|
||
| Add tsv export feature using v2 endpoint for instance reports |
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
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 |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ dist-ssr | |
| .venv | ||
| .vite-node | ||
| coverage | ||
| reports | ||
| /reports | ||
| src/**/*.module.scss.d.ts | ||
|
|
||
| # Cache | ||
|
|
||
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
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 |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import useFetch from "@/hooks/useFetch"; | ||
| import type { ApiError } from "@/types/api/ApiError"; | ||
| import { useMutation, useQueryClient } from "@tanstack/react-query"; | ||
| import type { AxiosError, AxiosResponse } from "axios"; | ||
| import type { ActivitiesExportJob } from "../types/ActivitiesExportJob"; | ||
|
|
||
| interface CreateActivitiesExportJobParams { | ||
| readonly name: string; | ||
| readonly query: string; | ||
| readonly selected_field_ids: string[]; | ||
| readonly retain_until: string; | ||
| } | ||
|
|
||
| export const useExportActivitiesTsv = () => { | ||
| const authFetch = useFetch(); | ||
| const queryClient = useQueryClient(); | ||
|
|
||
| const { isPending, mutateAsync } = useMutation< | ||
| AxiosResponse<ActivitiesExportJob>, | ||
| AxiosError<ApiError>, | ||
| CreateActivitiesExportJobParams | ||
| >({ | ||
| mutationFn: async (params) => | ||
| authFetch.post<ActivitiesExportJob>("activities/exports", params), | ||
| onSuccess: async () => { | ||
| await queryClient.invalidateQueries({ | ||
| queryKey: ["all-export-jobs"], | ||
| }); | ||
| }, | ||
| }); | ||
|
|
||
| return { | ||
| exportActivitiesTsv: mutateAsync, | ||
| isExportActivitiesTsvLoading: isPending, | ||
| }; | ||
| }; |
21 changes: 21 additions & 0 deletions
21
src/features/activities/components/Activities/Activities.module.scss
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 |
|---|---|---|
| @@ -1,3 +1,24 @@ | ||
| @import "vanilla-framework/scss/settings_spacing"; | ||
| @import "vanilla-framework/scss/settings_colors"; | ||
|
|
||
| .description { | ||
| width: 40%; | ||
| } | ||
|
|
||
| .subhead { | ||
| background: $colors--theme--background-alt; | ||
| border-bottom: 1px solid $colors--theme--border-low-contrast; | ||
| display: flex; | ||
| gap: $sph--large; | ||
| padding: $spv--small 0 $spv--small 2.5rem; | ||
|
|
||
| > .buttons { | ||
| display: flex; | ||
| gap: $sph--large; | ||
|
|
||
| > :not(:last-child) { | ||
| border-right: 1px solid $colors--theme--border-low-contrast; | ||
| padding-right: $sph--large !important; | ||
| } | ||
| } | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.