Skip to content
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

Conversation

sunnysoumya
Copy link
Contributor

Description

image
image

Related issues/PRs

Todos

  • Tests
  • Documentation
  • Release note

Release Note

TBD

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.

@sunnysoumya sunnysoumya requested a review from a team as a code owner March 10, 2025 18:20
@marvin-tigera marvin-tigera added this to the Calico v3.30.0 milestone Mar 10, 2025
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Mar 10, 2025
@@ -74,4 +96,5 @@ export const getTableColumns = () => [
minWidth: 20,
accessor: 'dest_port',
},
getCustomizerHeader(onColumnCustomizerOpen),
Copy link
Contributor

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]);
Copy link
Contributor

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]]);
}

@@ -0,0 +1,14 @@
import { createIcon } from '@chakra-ui/icons';

const CalicoCatIcon = createIcon({
Copy link
Contributor

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'
Copy link
Contributor

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(() => {
Copy link
Contributor

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

@caseydavenport caseydavenport added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact labels Mar 11, 2025
@marvin-tigera marvin-tigera removed release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Mar 11, 2025
@caseydavenport caseydavenport merged commit 86cb721 into projectcalico:master Mar 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants