-
Notifications
You must be signed in to change notification settings - Fork 55
feat: table component storybook #2600
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
base: develop
Are you sure you want to change the base?
Conversation
yarn.lock
Outdated
version "7.26.9" | ||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.9.tgz#aa4c6facc65b9cb3f87d75125ffd47781b475433" | ||
integrity sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg== | ||
version "7.27.0" |
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.
Pls check if changes in yarn.lock is expected
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.
Pull Request Overview
This PR introduces a new Storybook story for the table component to demonstrate its features and behaviors as part of the feature request. Key changes include:
- Adding Table.stories.tsx with custom cell components and event handling.
- Enhancing bulk actions with appropriate buttons.
- Updating .storybook/preview.tsx to include an extra modal element.
Reviewed Changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/stories/Table.stories.tsx | Introduces new story for the Table component with event listeners and custom rendering. |
.storybook/preview.tsx | Adds a new modal container element to the Storybook preview. |
Files not reviewed (3)
- package.json: Language not supported
- src/css/forms.scss: Language not supported
- src/css/iconTheming.scss: Language not supported
src/stories/Table.stories.tsx
Outdated
return () => { | ||
signals.removeEventListener(TableSignalEnum.ENTER_PRESSED, rowEnterPressedCallback) | ||
signals.removeEventListener(TableSignalEnum.DELETE_PRESSED, deletePressedCallback) | ||
signals.addEventListener(TableSignalEnum.OPEN_CONTEXT_MENU, openContextMenuCallback) |
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.
In the cleanup function within useEffect, the 'openContextMenuCallback' is mistakenly added instead of being removed. Please update this to 'signals.removeEventListener(TableSignalEnum.OPEN_CONTEXT_MENU, openContextMenuCallback)'.
signals.addEventListener(TableSignalEnum.OPEN_CONTEXT_MENU, openContextMenuCallback) | |
signals.removeEventListener(TableSignalEnum.OPEN_CONTEXT_MENU, openContextMenuCallback) |
Copilot uses AI. Check for mistakes.
|
@@ -66,7 +66,7 @@ | |||
"test:ci": "jest --watchAll=false --ci --json --coverage --testLocationInResults --outputFile=report.json", | |||
"jest": "jest", | |||
"lint-staged": "lint-staged", | |||
"storybook": "IS_STORYBOOK=true storybook dev -p 6006", | |||
"storybook": "IS_STORYBOOK=true GENERATE_SOURCEMAP=true storybook dev -p 6006", |
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.
Nice add-on!
@@ -0,0 +1,245 @@ | |||
import { useEffect } from 'react' |
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.
add story for generic info card
] | ||
|
||
const meta = { | ||
component: Table, |
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.
add argTypes
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes https://github.com/devtron-labs/sprint-tasks/issues/2035
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: