eric-briscoe commented on code in PR #21520: URL: https://github.com/apache/superset/pull/21520#discussion_r1015795281
########## superset-frontend/src/components/Table/cell-renderers/ActionCell/ActionCell.overview.mdx: ########## @@ -0,0 +1,70 @@ +import { Meta, Source, Story, ArgsTable } from '@storybook/addon-docs'; + +<Meta title="Design System/Components/Table/Cell Renderers/ActionCell/Overview" /> + +# ActionCell + +An ActionCell is used to display overflow icon that opens a menu allowing the user to take actions +specific to the data in thae table rowthat the cell is a member of. + +### [Basic example](./?path=/docs/design-system-components-table-cell-renderers-actioncell--basic) + +<Story id="design-system-components-table-cell-renderers-actioncell--basic" /> + +--- + +## Usage + +The action cell accepts an arry of objects that define the label, tooltip, an onClick callback functions +and an optional data payload to be provided back to the onClick handler function. + +### [Basic example](./?path=/docs/design-system-components-table-cell-renderers-actioncell--basic) + +<Story id="design-system-components-table-cell-renderers-actioncell--basic" /> + +``` +import { ActionMenuItem } from 'src/components/Table/cell-renderers/index'; + +export const exampleMenuOptions: ActionMenuItem[] = [ + { + label: 'Action 1', + tooltip: "This is a tip, don't spend it all in one place", + onClick: (item: ActionMenuItem) => { + // eslint-disable-next-line no-alert + alert(JSON.stringify(item)); + }, + payload: { + taco: 'spicy chicken', + }, + }, + { + label: 'Action 2', + tooltip: 'This is another tip', + onClick: (item: ActionMenuItem) => { + // eslint-disable-next-line no-alert + alert(JSON.stringify(item)); + }, + payload: { + taco: 'saucy tofu', + }, + }, +]; + +``` + +Within context of ading an action cell to cell definitions provided to the table using the ActionCell component +for the return valueform the render function on the cell definition. See the [Basic example](./?path=/docs/design-system-components-table-examples--basic) + +``` +import ActionCell from './index'; + +// NOTE: include the other columns you Review Comment: removing comment in next comit -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org