Skip to content

feat: table in RB #732

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

Merged
merged 78 commits into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
5c39760
yoyoy
Elessar1802 May 7, 2025
a0d351a
feat: table in RB
Elessar1802 May 13, 2025
3747f38
fix: keep rows loading until rows is provided
Elessar1802 May 15, 2025
99010be
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 May 19, 2025
98a1615
fix: popup menu ref
Elessar1802 May 19, 2025
0d590b3
revert: change in useAsync
Elessar1802 May 19, 2025
b5820c6
fix: RB table bulk actions props
Elessar1802 May 20, 2025
cf594e3
fix: sticky columns in table
Elessar1802 May 21, 2025
a28de9b
fix: loading state of table & checkbox alignment
Elessar1802 May 21, 2025
a2ee314
fix: alignment for CellComponents
Elessar1802 May 21, 2025
06f0059
feat: add icons to Icon component & fix style in table
Elessar1802 May 27, 2025
53d3548
fix: uat changes
Elessar1802 May 28, 2025
6fcae35
fix: loading during search causes search bar focus loss
Elessar1802 May 28, 2025
e83ae75
feat(Icon): add speedometer icon and update icon map
AbhishekA1509 Jun 5, 2025
5d34558
feat(ResourceBrowser): add ResourceRecommenderHeaderType and related …
AbhishekA1509 Jun 6, 2025
a2cbb09
fix(ResourceBrowser.Types): update K8sResourceDetailDataType to handl…
AbhishekA1509 Jun 6, 2025
17a32de
feat(Helpers): add getGroupVersionFromApiVersion function to parse AP…
AbhishekA1509 Jun 6, 2025
2f10c26
feat(Icon): add ic-minus icon and update icon map
AbhishekA1509 Jun 6, 2025
fb1d4a2
feat: add GVKOptionValueType
AbhishekA1509 Jun 7, 2025
fde0bd6
feat: add GetResourceRecommenderResourceListPropsType
AbhishekA1509 Jun 7, 2025
8a75222
feat(BulkSelectionActionWidget): add resource recommendation view and…
AbhishekA1509 Jun 7, 2025
2f99511
feat: add container registry icon and update related components
AbhishekA1509 Jun 8, 2025
425615b
fix: update K8sResourceDetailDataType to use string for value in curr…
AbhishekA1509 Jun 8, 2025
4c275b9
feat(GetResourceRecommenderResourceListPropsType): update props to in…
AbhishekA1509 Jun 9, 2025
7fcfd77
feat: add width mapping for resource recommender headers
AbhishekA1509 Jun 9, 2025
d2ea89d
Merge branch 'main' of https://github.com/devtron-labs/devtron-fe-com…
AbhishekA1509 Jun 10, 2025
b817cf1
fix: update K8sResourceDetailDataType to allow 'none' as a valid valu…
AbhishekA1509 Jun 10, 2025
206f0f3
feat: add gavel icon and update icon map
AbhishekA1509 Jun 10, 2025
42a5441
chore: update version to 1.15.1-beta-1 in package.json and package-lo…
AbhishekA1509 Jun 10, 2025
b8a37ff
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Jun 11, 2025
ec408e0
Merge branch 'feat/rb-table' into fix/rb-table
Elessar1802 Jun 11, 2025
041865c
fix: uat changes
Elessar1802 Jun 11, 2025
8ef90b3
feat: scale resize-btn on hover
Elessar1802 Jun 11, 2025
08ffe92
chore: override sortable-table-cell__resize-btn from table css
Elessar1802 Jun 11, 2025
fbcd109
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Jun 12, 2025
509f9b3
feat: add ic-two-cubes icon and update icon map
AbhishekA1509 Jun 12, 2025
1e4ef0e
fix: adjust opacity for readonly input fields in rjsfForm.scss
AbhishekA1509 Jun 12, 2025
d433cef
refactor: remove unused resource recommender header mappings from con…
AbhishekA1509 Jun 13, 2025
9ff305b
fix: add abort controller reference to createNewResource function
AbhishekA1509 Jun 13, 2025
42f5460
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Jun 13, 2025
fe3db8d
Merge branch 'feat/rb-table' into fix/rb-table
Elessar1802 Jun 13, 2025
a20748f
chore: update version to 1.15.1-beta-5 in package.json and package-lo…
AbhishekA1509 Jun 16, 2025
2f2e1e5
Merge branch 'develop' of https://github.com/devtron-labs/devtron-fe-…
AbhishekA1509 Jun 18, 2025
985ef2f
feat: add new API status code and update types for resource recommend…
AbhishekA1509 Jun 18, 2025
47b078d
feat: update button size handling in InfoBlock component
AbhishekA1509 Jun 18, 2025
2d4e6ef
fix: add optional chaining for buttonProps in InfoBlock component
AbhishekA1509 Jun 18, 2025
ebfb583
feat: add route for editing cluster environment in global config
AbhishekA1509 Jun 18, 2025
c8de7d5
feat(css): uat
Elessar1802 Jun 18, 2025
0c2fd13
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Jun 18, 2025
a33217e
Merge branch 'develop' of https://github.com/devtron-labs/devtron-fe-…
AbhishekA1509 Jun 19, 2025
451cc0b
feat: add defaultUrl property to CommonTabArgsType for tab reset func…
AbhishekA1509 Jun 19, 2025
306753e
fix: scrollTo func instead of scrollToTop prop
Elessar1802 Jun 19, 2025
d1bf390
fix: bulk select all if not paginated
Elessar1802 Jun 23, 2025
9b8f2a9
Merge branch 'feat/resource-recommender-develop' of github.com:devtro…
Elessar1802 Jun 23, 2025
da9d3d9
fix: new pagination const
Elessar1802 Jun 24, 2025
eb2b1b0
fix: bulk selection count logic
Elessar1802 Jun 24, 2025
fa075f8
feat: add download icon and update icon map; add ResourceRecommenderA…
AbhishekA1509 Jun 24, 2025
b954eff
Merge branch 'fix/rb-table' of https://github.com/devtron-labs/devtro…
AbhishekA1509 Jun 24, 2025
e15749b
fix: filter if filter func provided
Elessar1802 Jun 25, 2025
f22829a
fix: add new clearFilters prop to table props
Elessar1802 Jun 26, 2025
74c4046
fix: update version from 1.15.3-pre-4 to 1.15.3-beta-3 in package.jso…
AbhishekA1509 Jun 26, 2025
2e1f380
fix: update version from 1.15.3-beta-3 to 1.15.3-beta-4 in package.js…
AbhishekA1509 Jun 26, 2025
5acb7b9
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Jun 27, 2025
07ee634
fix: retain previous active element on backdrop open/close
Elessar1802 Jul 1, 2025
f545d66
chore: bump version
Elessar1802 Jul 1, 2025
959491c
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Jul 1, 2025
e3bce42
Merge branch 'feat/rb-table' into fix/rb-table
Elessar1802 Jul 1, 2025
0a7d2ec
fix: review comments
Elessar1802 Jul 1, 2025
b86da2f
chore: expose URL_FILTER_KEYS
Elessar1802 Jul 1, 2025
654fca7
Merge branch 'feat/rb-table' into fix/rb-table
Elessar1802 Jul 1, 2025
44d758f
fix: review comments
Elessar1802 Jul 1, 2025
1cb7a9c
fix: dont scroll to view on horizontal scroll
Elessar1802 Jul 1, 2025
1f18d07
chore: bump version
Elessar1802 Jul 1, 2025
d4dc889
chore: conditional wrap in bulk selection
Elessar1802 Jul 2, 2025
a30adde
Update src/Shared/Components/BulkSelection/types.tsx
Elessar1802 Jul 2, 2025
ec6a4c9
Merge branch 'feat/rb-table' into fix/rb-table
Elessar1802 Jul 2, 2025
fbb3975
Merge pull request #804 from devtron-labs/fix/rb-table
Elessar1802 Jul 2, 2025
23cf3f9
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Jul 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Assets/IconV2/ic-info-filled-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Common/Helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ export const getBranchIcon = (sourceType, _isRegex?: boolean, webhookEventName?:
return <ICPullRequest className="scn-6" />
}
if (webhookEventName === WebhookEventNameType.TAG_CREATION) {
return <ICTag className="scn-6" />
return <ICTag className="scn-6" />
}
return <ICWebhook />
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ const UseRegisterShortcutProvider = ({
}, [])

const handleKeydownEvent = useCallback((event: KeyboardEvent) => {
if (preventDefault) {
event.preventDefault()
}

if (
// NOTE: in case of custom events generated by password managers autofill, the event.key is not set
!event.key ||
Expand All @@ -132,6 +128,10 @@ const UseRegisterShortcutProvider = ({
return
}

if (preventDefault) {
event.preventDefault()
}

keysDownRef.current.add(event.key.toUpperCase() as Uppercase<string>)

if (event.ctrlKey) {
Expand Down
24 changes: 19 additions & 5 deletions src/Common/PopupMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import React, { useEffect } from 'react'
import React, { forwardRef, useEffect } from 'react'
import { Modal } from './Modals/Modal'
import { PopupMenuBodyType, PopupMenuButtonType, PopupMenuType } from './Types'

Expand Down Expand Up @@ -155,19 +155,33 @@ const PopupMenu = ({
)
}

const Button = ({
const Button = forwardRef(({
children = null,
disabled = false,
rootClassName = '',
tabIndex = 0,
onHover = false,
isKebab = false,
dataTestId = '',
}: PopupMenuButtonType) => {
}: PopupMenuButtonType, forwardedRef) => {
const { handleOpen, popupPosition, buttonRef, initialiseButtonWidth } = usePopupContext()

const refCallback = (node) => {
buttonRef.current = node

if (typeof forwardedRef === 'function') {
forwardedRef(node)
return
}

if (forwardedRef && typeof forwardedRef === 'object') {
forwardedRef.current = node
}
}

return (
<button
ref={initialiseButtonWidth}
ref={refCallback}
type="button"
tabIndex={tabIndex}
disabled={disabled}
Expand All @@ -181,7 +195,7 @@ const Button = ({
{children}
</button>
)
}
})

const Body = ({
children = null,
Expand Down
135 changes: 70 additions & 65 deletions src/Shared/Components/BulkSelection/BulkSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

import { forwardRef } from 'react'

import { ReactComponent as ICCheckAll } from '../../../Assets/Icon/ic-check-all.svg'
import { ReactComponent as ICCheckSquare } from '../../../Assets/Icon/ic-check-square.svg'
import { ReactComponent as ICChevronDown } from '../../../Assets/Icon/ic-chevron-down.svg'
Expand All @@ -24,74 +26,77 @@ import { useBulkSelection } from './BulkSelectionProvider'
import { BULK_DROPDOWN_TEST_ID, BulkSelectionOptionsLabels } from './constants'
import { BulkSelectionDropdownItemsType, BulkSelectionEvents, BulkSelectionProps } from './types'

const BulkSelection = <T,>({ showPagination, disabled = false, showChevronDownIcon = true }: BulkSelectionProps) => {
const { handleBulkSelection, isChecked, checkboxValue, getSelectedIdentifiersCount } = useBulkSelection<T>()
const areOptionsSelected = getSelectedIdentifiersCount() > 0
const BulkSelectionItems: BulkSelectionDropdownItemsType[] = [
{
locator: BulkSelectionEvents.SELECT_ALL_ON_PAGE,
label: BulkSelectionOptionsLabels[BulkSelectionEvents.SELECT_ALL_ON_PAGE],
isSelected: isChecked && checkboxValue === CHECKBOX_VALUE.CHECKED,
icon: ICCheckSquare,
},
...(showPagination
? [
{
locator: BulkSelectionEvents.SELECT_ALL_ACROSS_PAGES,
label: BulkSelectionOptionsLabels[BulkSelectionEvents.SELECT_ALL_ACROSS_PAGES],
isSelected: isChecked && checkboxValue === CHECKBOX_VALUE.BULK_CHECKED,
icon: ICCheckAll,
},
]
: []),
...(areOptionsSelected
? [
{
locator: BulkSelectionEvents.CLEAR_ALL_SELECTIONS,
label: BulkSelectionOptionsLabels[BulkSelectionEvents.CLEAR_ALL_SELECTIONS],
isSelected: false,
icon: ICClose,
iconClass: 'icon-use-fill-n6',
},
]
: []),
]
const BulkSelection = forwardRef(
({ showPagination, disabled = false, showChevronDownIcon = true }: BulkSelectionProps, forwardedRef) => {
const { handleBulkSelection, isChecked, checkboxValue, getSelectedIdentifiersCount } = useBulkSelection()
const areOptionsSelected = getSelectedIdentifiersCount() > 0
const BulkSelectionItems: BulkSelectionDropdownItemsType[] = [
{
locator: BulkSelectionEvents.SELECT_ALL_ON_PAGE,
label: BulkSelectionOptionsLabels[BulkSelectionEvents.SELECT_ALL_ON_PAGE],
isSelected: isChecked && checkboxValue === CHECKBOX_VALUE.CHECKED,
icon: ICCheckSquare,
},
...(showPagination
? [
{
locator: BulkSelectionEvents.SELECT_ALL_ACROSS_PAGES,
label: BulkSelectionOptionsLabels[BulkSelectionEvents.SELECT_ALL_ACROSS_PAGES],
isSelected: isChecked && checkboxValue === CHECKBOX_VALUE.BULK_CHECKED,
icon: ICCheckAll,
},
]
: []),
...(areOptionsSelected
? [
{
locator: BulkSelectionEvents.CLEAR_ALL_SELECTIONS,
label: BulkSelectionOptionsLabels[BulkSelectionEvents.CLEAR_ALL_SELECTIONS],
isSelected: false,
icon: ICClose,
iconClass: 'icon-use-fill-n6',
},
]
: []),
]

return (
<PopupMenu autoClose>
<PopupMenu.Button
isKebab
rootClassName="h-20 flexbox p-0 dc__no-background dc__no-border dc__outline-none-imp"
dataTestId={BULK_DROPDOWN_TEST_ID}
disabled={disabled}
>
<Checkbox
isChecked={isChecked}
onChange={noop}
rootClassName="icon-dim-20 m-0"
value={checkboxValue}
return (
<PopupMenu autoClose>
<PopupMenu.Button
ref={forwardedRef}
isKebab
rootClassName="h-20 flexbox p-0 dc__no-background dc__no-border dc__outline-none-imp"
dataTestId={BULK_DROPDOWN_TEST_ID}
disabled={disabled}
// Ideally should be disabled but was giving issue with cursor
/>
>
<Checkbox
isChecked={isChecked}
onChange={noop}
rootClassName="icon-dim-20 m-0"
value={checkboxValue}
disabled={disabled}
// Ideally should be disabled but was giving issue with cursor
/>

{showChevronDownIcon && <ICChevronDown className="icon-dim-20 fcn-6 dc__no-shrink" />}
</PopupMenu.Button>
{showChevronDownIcon && <ICChevronDown className="icon-dim-20 fcn-6 dc__no-shrink" />}
</PopupMenu.Button>

<PopupMenu.Body rootClassName="dc__top-22 w-150 dc__right-0 pt-4 pb-4 pl-0 pr-0 bg__primary flex column dc__content-start dc__align-start dc__position-abs bg__primary dc__border dc__border-radius-4-imp">
{BulkSelectionItems.map((item) => (
<BulkSelectionDropdownItems<T>
key={item.locator}
locator={item.locator}
label={item.label}
isSelected={item.isSelected}
icon={item.icon}
handleBulkSelection={handleBulkSelection}
iconClass={item.iconClass}
/>
))}
</PopupMenu.Body>
</PopupMenu>
)
}
<PopupMenu.Body rootClassName="dc__top-22 w-150 dc__right-0 pt-4 pb-4 pl-0 pr-0 bg__primary flex column dc__content-start dc__align-start dc__position-abs bg__primary dc__border dc__border-radius-4-imp">
{BulkSelectionItems.map((item) => (
<BulkSelectionDropdownItems
key={item.locator}
locator={item.locator}
label={item.label}
isSelected={item.isSelected}
icon={item.icon}
handleBulkSelection={handleBulkSelection}
iconClass={item.iconClass}
/>
))}
</PopupMenu.Body>
</PopupMenu>
)
},
)

export default BulkSelection
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

import { BulkSelectionDropdownItemsProps } from './types'

const BulkSelectionDropdownItems = <T,>({
const BulkSelectionDropdownItems = ({
locator,
label,
isSelected,
handleBulkSelection,
icon: Icon,
iconClass,
}: BulkSelectionDropdownItemsProps<T>) => {
}: BulkSelectionDropdownItemsProps<unknown>) => {
const handleSelect = () => {
handleBulkSelection({
action: locator,
Expand Down
2 changes: 2 additions & 0 deletions src/Shared/Components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ import { ReactComponent as ICHelpOutline } from '@IconsV2/ic-help-outline.svg'
import { ReactComponent as ICHibernate } from '@IconsV2/ic-hibernate.svg'
import { ReactComponent as ICInProgress } from '@IconsV2/ic-in-progress.svg'
import { ReactComponent as ICInfoFilled } from '@IconsV2/ic-info-filled.svg'
import { ReactComponent as ICInfoFilledColor } from '@IconsV2/ic-info-filled-color.svg'
import { ReactComponent as ICInfoOutline } from '@IconsV2/ic-info-outline.svg'
import { ReactComponent as ICInstall } from '@IconsV2/ic-install.svg'
import { ReactComponent as ICJobColor } from '@IconsV2/ic-job-color.svg'
Expand Down Expand Up @@ -245,6 +246,7 @@ export const iconMap = {
'ic-help-outline': ICHelpOutline,
'ic-hibernate': ICHibernate,
'ic-in-progress': ICInProgress,
'ic-info-filled-color': ICInfoFilledColor,
'ic-info-filled': ICInfoFilled,
'ic-info-outline': ICInfoOutline,
'ic-install': ICInstall,
Expand Down
13 changes: 11 additions & 2 deletions src/Shared/Components/Table/BulkSelectionActionWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2024. Devtron Inc.
*/

import { useEffect } from 'react'
import { MouseEvent, useEffect } from 'react'

import { ReactComponent as ICClose } from '@Icons/ic-close.svg'
import { DraggableButton, DraggablePositionVariant, DraggableWrapper } from '@Common/DraggableWrapper'
Expand All @@ -18,6 +18,8 @@ const BulkSelectionActionWidget = ({
handleClearBulkSelection,
parentRef,
BulkActionsComponent,
bulkActionsData,
setBulkActionState,
}: BulkSelectionActionWidgetProps) => {
const { registerShortcut, unregisterShortcut } = useRegisterShortcut()

Expand All @@ -29,6 +31,13 @@ const BulkSelectionActionWidget = ({
}
}, [])

const onActionClick = (event: MouseEvent<HTMLButtonElement>) => {
const {
dataset: { key },
} = event.currentTarget
setBulkActionState(key)
}

return (
<DraggableWrapper
dragSelector={`.${DRAG_SELECTOR_IDENTIFIER}`}
Expand All @@ -46,7 +55,7 @@ const BulkSelectionActionWidget = ({
</div>
</div>

<BulkActionsComponent />
<BulkActionsComponent onActionClick={onActionClick} bulkActionsData={bulkActionsData} />

<Button
icon={<ICClose />}
Expand Down
Loading