Skip to content

feat: Add composable table variant#60

Draft
bastilian wants to merge 1 commit intomainfrom
tablevariants_intro
Draft

feat: Add composable table variant#60
bastilian wants to merge 1 commit intomainfrom
tablevariants_intro

Conversation

@bastilian
Copy link
Owner

No description provided.

@qltysh
Copy link

qltysh bot commented Jul 12, 2025

Diff Coverage: The code coverage on the diff in this pull request is 74.4%.

Total Coverage: This PR will decrease coverage by 0.75%.

File Coverage Changes
Path File Coverage Δ Indirect
src/components/TableToolsTable/components/ComposableTable/ComposableTable.js 44.4
src/components/TableToolsTable/components/ComposableTable/components/Cell.js 85.7
src/components/TableToolsTable/components/ComposableTable/components/TableBody.js 70.0
src/components/TableToolsTable/components/ComposableTable/components/TableHead.js 66.7
src/components/TableToolsTable/components/ComposableTable/hooks/useTableToolsForComposable.js 50.0
src/components/TableToolsTable/components/Table.js 100.0
src/components/TableToolsTable/components/Toolbar.js 100.0
src/components/TableToolsTable/constants.js 100.0
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@qltysh
Copy link

qltysh bot commented Jul 12, 2025

❌ 40 blocking issues (40 total)

Tool Category Rule Count
eslint Lint 'bulkSelect' is missing in props validation 8
eslint Lint 'useContext' is defined but never used. 3
eslint Lint 'useContext' is defined but never used. 3
eslint Lint Missing JSDoc @returns description. 2
eslint Lint Missing JSDoc @param "options.bulkSelect" declaration. 12
eslint Lint Missing @param "options.toolbarProps.pagination" 12

* but eventually we will want to make the returns of it and it's hooks less aligned with any specific variant and
* try to make as generic as possible and have an adapter hook like this that will specifics to the return.
*
* @param {object} [options] AsyncTableTools options
Copy link

@qltysh qltysh bot Jul 12, 2025

Choose a reason for hiding this comment

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

Found 11 issues:

1. Missing @param "options.toolbarProps.pagination" [eslint:jsdoc/check-param-names]


2. Missing @param "options.loading" [eslint:jsdoc/check-param-names]


3. Missing @param "options.tableProps" [eslint:jsdoc/check-param-names]


4. Missing @param "options.tableProps.cells" [eslint:jsdoc/check-param-names]


5. Missing @param "options.tableProps.rows" [eslint:jsdoc/check-param-names]


6. Missing @param "options.tableProps.tableTree" [eslint:jsdoc/check-param-names]


7. Missing @param "options.toolbarProps" [eslint:jsdoc/check-param-names]


8. Missing @param "options.bulkSelect" [eslint:jsdoc/check-param-names]


9. Missing @param "options.total" [eslint:jsdoc/check-param-names]


10. Missing @param "options.view" [eslint:jsdoc/check-param-names]


11. Missing @param "options.expandable" [eslint:jsdoc/check-param-names]

*
* @param {object} [options] AsyncTableTools options
*
* @returns {object}
Copy link

Choose a reason for hiding this comment

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

Missing JSDoc @returns description. [eslint:jsdoc/require-returns-description]

@bastilian bastilian force-pushed the tablevariants_intro branch from 1e26ffd to 0cdabc3 Compare July 15, 2025 18:16

import Cell from './Cell';

const TableBody = ({ total, columns, rows, bulkSelect, expandable }) => (
Copy link

@qltysh qltysh bot Jul 15, 2025

Choose a reason for hiding this comment

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

Found 3 issues:

1. 'bulkSelect' is missing in props validation [eslint:react/prop-types]


2. 'expandable' is missing in props validation [eslint:react/prop-types]


3. 'total' is missing in props validation [eslint:react/prop-types]

? {
expand: {
rowIndex: idx,
isExpanded: expandable.isExpanded(row?.item?.itemId),
Copy link

Choose a reason for hiding this comment

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

'expandable.isExpanded' is missing in props validation [eslint:react/prop-types]

expand: {
rowIndex: idx,
isExpanded: expandable.isExpanded(row?.item?.itemId),
onToggle: () => expandable.onToggle(row?.item?.itemId),
Copy link

Choose a reason for hiding this comment

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

'expandable.onToggle' is missing in props validation [eslint:react/prop-types]

? {
select: {
rowIndex: idx,
onSelect: () => bulkSelect.selectOne(row?.item),
Copy link

Choose a reason for hiding this comment

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

'bulkSelect.selectOne' is missing in props validation [eslint:react/prop-types]

select: {
rowIndex: idx,
onSelect: () => bulkSelect.selectOne(row?.item),
isSelected: bulkSelect.isItemSelected(row?.item?.itemId),
Copy link

Choose a reason for hiding this comment

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

'bulkSelect.isItemSelected' is missing in props validation [eslint:react/prop-types]

* This hook is an adapter to put required props into the right place and
* form to be consumable by the ComposableTable components
*
* @param {object} [options] AsyncTableTools options
Copy link

Choose a reason for hiding this comment

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

Expected @param names to be "tableToolsProps". Got "options". [eslint:jsdoc/check-param-names]

*
* @param {object} [options] AsyncTableTools options
*
* @returns {object}
Copy link

Choose a reason for hiding this comment

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

Missing JSDoc @returns description. [eslint:jsdoc/require-returns-description]

@bastilian bastilian force-pushed the tablevariants_intro branch from 0cdabc3 to 3ed7ce9 Compare July 15, 2025 20:14
@bastilian bastilian self-assigned this Jul 15, 2025
@@ -1,23 +1,17 @@
import React from 'react';
import React, { useContext } from 'react';
Copy link

Choose a reason for hiding this comment

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

Found 2 issues:

1. 'useContext' is defined but never used. [eslint:@typescript-eslint/no-unused-vars]


2. 'useContext' is defined but never used. [eslint:no-unused-vars]

Suggested change
import React, { useContext } from 'react';
import React from 'react';

Remove unused variable 'useContext'.

import { TableContext } from '~/hooks/useTableContext/constants';
import { TableStateProvider, FilterModal } from '~/components';

import { variants, queryClient } from './constants';
Copy link

Choose a reason for hiding this comment

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

Found 2 issues:

1. 'queryClient' is defined but never used. [eslint:@typescript-eslint/no-unused-vars]


2. 'queryClient' is defined but never used. [eslint:no-unused-vars]

Suggested change
import { variants, queryClient } from './constants';
import { variants } from './constants';

Remove unused variable 'queryClient'.

Comment on lines +3 to +12
/**
* This hook is an adapter to put required props into the right place and
* form to be consumable by the ComposableTable components
*
* @param {object} [options] AsyncTableTools options
*
* @returns {object}
*
* @group Hooks
*
Copy link

Choose a reason for hiding this comment

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

Found 11 issues:

1. Missing JSDoc @param "options.bulkSelect" declaration. [eslint:jsdoc/require-param]


2. Missing JSDoc @param "options.expandable" declaration. [eslint:jsdoc/require-param]


3. Missing JSDoc @param "options.loading" declaration. [eslint:jsdoc/require-param]


4. Missing JSDoc @param "options.tableProps" declaration. [eslint:jsdoc/require-param]


5. Missing JSDoc @param "options.tableProps.cells" declaration. [eslint:jsdoc/require-param]


6. Missing JSDoc @param "options.tableProps.rows" declaration. [eslint:jsdoc/require-param]


7. Missing JSDoc @param "options.tableProps.tableTree" declaration. [eslint:jsdoc/require-param]


8. Missing JSDoc @param "options.toolbarProps" declaration. [eslint:jsdoc/require-param]


9. Missing JSDoc @param "options.toolbarProps.pagination" declaration. [eslint:jsdoc/require-param]


10. Missing JSDoc @param "options.total" declaration. [eslint:jsdoc/require-param]


11. Missing JSDoc @param "options.view" declaration. [eslint:jsdoc/require-param]

Comment on lines +5 to +14
/**
* This hook is an adapter to put required props into the right place and
* form to be consumable by the ComposableTable components
*
* @param {object} [options] AsyncTableTools options
*
* @returns {object}
*
* @group Hooks
*
Copy link

Choose a reason for hiding this comment

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

Missing JSDoc @param "tableToolsProps" declaration. [eslint:jsdoc/require-param]

*
*/
const useTableToolsForTable = (tableToolsProps) => {
const { loading, total, bulkSelect, toolbarProps, tableProps } =
Copy link

Choose a reason for hiding this comment

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

Found 2 issues:

1. 'loading' is assigned a value but never used. [eslint:@typescript-eslint/no-unused-vars]


2. 'loading' is assigned a value but never used. [eslint:no-unused-vars]

Suggested change
const { loading, total, bulkSelect, toolbarProps, tableProps } =
const { total, bulkSelect, toolbarProps, tableProps } =

Remove unused variable 'loading'.

@bastilian bastilian added enhancement New feature or request needs investigation Issues labeled with this need more investigation to determine what needs to be done exactly labels Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs investigation Issues labeled with this need more investigation to determine what needs to be done exactly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant