-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[TSLA-8560] column customizer modal for flow logs table #9959
[TSLA-8560] column customizer modal for flow logs table #9959
Conversation
@@ -74,4 +96,5 @@ export const getTableColumns = () => [ | |||
minWidth: 20, | |||
accessor: 'dest_port', | |||
}, | |||
getCustomizerHeader(onColumnCustomizerOpen), |
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.
Does this need to be in a function? I think it's fine to put it inline
title='Customize Columns' | ||
items={columns.filter((c) => !c.disableReordering)} | ||
onSave={(list) => { | ||
setColumns([expandoColumn, ...list, customizerColumn]); |
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.
Instead of creating the column objects in this component, you could just use indices since this list is hard coded
const expandoIndex = 0;
const customizerIndex = X;
const FlowLogsList = () => {
// stuff
<ReorderableCheckList
onSave={(list) => {
setColumns([columns[expandoIndex], ...list, columns[customizerIndex]]);
}
whisker/src/icons/DndIcon.tsx
Outdated
@@ -0,0 +1,14 @@ | |||
import { createIcon } from '@chakra-ui/icons'; | |||
|
|||
const CalicoCatIcon = createIcon({ |
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.
Make sure to rename the const too
path: ( | ||
<path | ||
d='M15.0312 0.90625H0.937109C0.473047 0.90625 0.125 1.28594 0.125 1.71836C0.125004 2.21406 0.504688 2.59375 0.937109 2.59375H15.0312C15.4953 2.59375 15.875 2.21406 15.875 1.78164C15.875 1.28594 15.4953 0.90625 15.0312 0.90625ZM15.0312 5.40625H0.937109C0.473047 5.40625 0.125 5.78594 0.125 6.21836C0.125 6.65078 0.504688 7.09375 0.937109 7.09375H15.0312C15.4953 7.09375 15.875 6.71406 15.875 6.28164C15.875 5.84922 15.4953 5.40625 15.0312 5.40625Z' | ||
fill='#5F5F5F' |
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 possible, pass this using icon props
|
||
const styles = useMultiStyleConfig('ReorderableCheckList', rest); | ||
|
||
useEffect(() => { |
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.
is this necessary? I'm wondering could this cause issues if the parent component re-renders. Items will always be different on every render since it's an object
Description
Related issues/PRs
Todos
Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*
label.docs-pr-required
: This change requires a change to the documentation that has not been completed yet.docs-completed
: This change has all necessary documentation completed.docs-not-required
: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*
label.release-note-required
: This PR has user-facing changes. Most PRs should have this label.release-note-not-required
: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate
: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr
: This PR is related to install and requires a corresponding change to the operator.