Skip to content

Commit 9f2f6d3

Browse files
committed
chore: update common-lib version
1 parent 5170f92 commit 9f2f6d3

File tree

4 files changed

+172
-148
lines changed

4 files changed

+172
-148
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.10.1",
7+
"@devtron-labs/devtron-fe-common-lib": "1.10.1-beta-1",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/css/forms.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,14 @@ p.sentence-case:first-letter {
291291
}
292292
}
293293

294+
.form__checkbox-parent {
295+
&--active, &:hover {
296+
.form__checkbox-container {
297+
background-image: url('../assets/icons/ic-checkbox-hover.svg');
298+
}
299+
}
300+
}
301+
294302
.form__checkbox:checked[value='INTERMEDIATE'] ~ .form__checkbox-container {
295303
background-image: url('../assets/icons/ic-checkbox-intermediate.svg');
296304
}

src/stories/Table.stories.tsx

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useEffect } from 'react'
12
import { Meta, StoryObj } from '@storybook/react'
23
import {
34
Button,
@@ -18,24 +19,13 @@ import {
1819
import { ReactComponent as ICPlay } from '@Icons/ic-play-outline.svg'
1920
import { ReactComponent as ICPause } from '@Icons/ic-pause.svg'
2021
import { ReactComponent as ICWarning } from '@Icons/ic-warning-y6.svg'
21-
import { useEffect, useState } from 'react'
22-
23-
const CellComponent = ({ field, value, signals, row }: TableCellComponentProps) => {
24-
const [isRowActive, setIsRowActive] = useState(false)
2522

23+
const CellComponent = ({ field, value, signals, row, isRowActive }: TableCellComponentProps) => {
2624
const handleButtonClick = () => {
2725
alert(`Row ${value} clicked`)
2826
}
2927

3028
useEffect(() => {
31-
const rowChangeCallback = ({
32-
detail: {
33-
activeRowData: { id },
34-
},
35-
}) => {
36-
setIsRowActive(id === row.id)
37-
}
38-
3929
const rowEnterPressedCallback = ({
4030
detail: {
4131
activeRowData: { id },
@@ -46,13 +36,9 @@ const CellComponent = ({ field, value, signals, row }: TableCellComponentProps)
4636
}
4737
}
4838

49-
signals.addEventListener(TableSignalEnum.ACTIVE_ROW_CHANGED, rowChangeCallback)
50-
5139
signals.addEventListener(TableSignalEnum.ENTER_PRESSED, rowEnterPressedCallback)
5240

5341
return () => {
54-
signals.removeEventListener(TableSignalEnum.ACTIVE_ROW_CHANGED, rowChangeCallback)
55-
5642
signals.removeEventListener(TableSignalEnum.ENTER_PRESSED, rowEnterPressedCallback)
5743
}
5844
}, [])
@@ -166,7 +152,7 @@ export default meta
166152
type Story = StoryObj<typeof meta>
167153

168154
const BulkActionsComponent = () => (
169-
<>
155+
<div className="flexbox dc__gap-4">
170156
<Button
171157
icon={<ICPause />}
172158
dataTestId="rb-bulk-action__action-widget--cordon"
@@ -190,7 +176,7 @@ const BulkActionsComponent = () => (
190176
onClick={() => alert('Play clicked!')}
191177
showAriaLabelInTippy
192178
/>
193-
</>
179+
</div>
194180
)
195181

196182
const ViewWrapper = ({ children, handleSearch, searchKey }: TableViewWrapperProps) => (
@@ -237,5 +223,8 @@ export const TableTemplate: Story = {
237223
showSeparatorBetweenRows: true,
238224
},
239225
ViewWrapper,
226+
additionalFilterProps: {
227+
initialSortKey: 'name',
228+
},
240229
} as TableProps,
241230
}

0 commit comments

Comments
 (0)