-
Notifications
You must be signed in to change notification settings - Fork 800
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
ThreatsDataViews: Add ToggleGroupControl #39901
Merged
dkmyta
merged 36 commits into
trunk
from
add/component/threats-data-view-toggle-group-control-alt
Nov 8, 2024
Merged
Changes from 28 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
6c3c360
Components: add hoverShow prop to IconTooltip
dkmyta 81d25c6
changelog
nateweller f919501
Add ThreatsDataView
nateweller aaa4bed
Add ToggleGroupControl filters to ThreatsDataView
dkmyta 9b5bdd2
Components: add hoverShow prop to IconTooltip
dkmyta 18277d1
changelog
nateweller 2ebc6a0
Add ThreatsDataView
nateweller 2d529b8
Rebase, fix conflicts
dkmyta df3ce66
Fix rebase issues
dkmyta 81594ac
Fixes, updates
dkmyta 65fd9e3
Improve type checks
dkmyta e353eef
Components: add hoverShow prop to IconTooltip
dkmyta 0802197
changelog
nateweller f27d02f
Add ThreatsDataView
nateweller e87dbbf
Rebase
dkmyta ae443bf
Story fixes
dkmyta 02e98fc
Update toggle text
dkmyta 2031331
Rebase, fix conflicts
dkmyta 78c626e
Fix story data
dkmyta f5eb54c
Merge branch 'trunk' into add/component/threats-data-view-toggle-grou…
dkmyta 2fffd3b
changelog
dkmyta dd7cee7
Fix changelog entry
dkmyta c2b6b0f
Fix types
dkmyta e047efc
Update approach to counting threats
dkmyta 2f17bb7
Fix tests
dkmyta 1806863
Update lock file
dkmyta 3dcbe6c
Revert lock file changes
dkmyta e55e556
Set __nextHasNoMarginBottom to avoid deprecation warning
dkmyta 9752c68
Move toggle to dedicated file
dkmyta 1fa9179
Add default filters to stories
dkmyta f2e4c56
Wrap experimental component rendering in try/catch
dkmyta 8b491ed
Update projects/js-packages/components/components/threats-data-views/…
dkmyta 23e531b
Update projects/js-packages/components/components/threats-data-views/…
dkmyta 9314e35
Update projects/js-packages/components/components/threats-data-views/…
dkmyta ec476f6
Update projects/js-packages/components/components/threats-data-views/…
dkmyta ac20168
Fix lint errors
dkmyta 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
4 changes: 4 additions & 0 deletions
4
...cts/js-packages/components/changelog/add-component-threats-data-view-toggle-group-control
This file contains 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,4 @@ | ||
Significance: minor | ||
Type: changed | ||
|
||
Add ToggleGroupControl to ThreatsDataViews for easily toggling between Active and Historical threats |
This file contains 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor - we could update the |
This file contains 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 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 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 |
---|---|---|
|
@@ -42,7 +42,6 @@ const data = [ | |
type: 'plugin' as const, | ||
}, | ||
fixedIn: '3.2.4', | ||
status: 'current' as const, | ||
}, | ||
]; | ||
|
||
|
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.
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.
Idea - could we extract the
<ThreatsStatusToggleGroupControl>
component into a separate file?It could be passed
data: Threats[]
andview: View
properties, and compute/memoize its own values for counts/selected/etc.It could also accept the existing
onChangeView: ( newView: View ) => void
callback, and call it with the full updated view objects on click.The objective being to keep this main index file clean and straightforward, and isolate this custom functionality in its own file. Using the data/view/onChangeView properties directly essentially make it like a mini plugin/extension for the DataViews.
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.
Second idea - since these are experimental components, what do you think about wrapping this component with a
try/catch
or React Error Boundary?This will not help in the case of import errors, but if any breaking changes are missed, it will prevent the component from crashing the entire scan screen.