Skip to content

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

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open

Conversation

Elessar1802
Copy link
Contributor

@Elessar1802 Elessar1802 commented Mar 28, 2025

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • Test A
  • Test B

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@github-actions github-actions bot added the PR:Issue-verification-failed PR:Issue-verification-failed label Mar 28, 2025
@Elessar1802 Elessar1802 changed the title Feat/table storybook feat: table component storybook Mar 28, 2025
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"
Copy link
Member

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

@github-actions github-actions bot added PR:Ready-to-Review PR:Ready-to-Review and removed PR:Issue-verification-failed PR:Issue-verification-failed labels Apr 2, 2025
@Elessar1802 Elessar1802 requested a review from Copilot April 2, 2025 11:04
Copy link

@Copilot Copilot AI left a 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

return () => {
signals.removeEventListener(TableSignalEnum.ENTER_PRESSED, rowEnterPressedCallback)
signals.removeEventListener(TableSignalEnum.DELETE_PRESSED, deletePressedCallback)
signals.addEventListener(TableSignalEnum.OPEN_CONTEXT_MENU, openContextMenuCallback)
Copy link
Preview

Copilot AI Apr 2, 2025

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)'.

Suggested change
signals.addEventListener(TableSignalEnum.OPEN_CONTEXT_MENU, openContextMenuCallback)
signals.removeEventListener(TableSignalEnum.OPEN_CONTEXT_MENU, openContextMenuCallback)

Copilot uses AI. Check for mistakes.

Copy link

sonarqubecloud bot commented Apr 2, 2025

@@ -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",
Copy link
Contributor

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add argTypes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR:Ready-to-Review PR:Ready-to-Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants