mirror of
https://github.com/Unleash/unleash.git
synced 2025-03-18 00:19:49 +01:00
fix: Addons toggle (#4312)
## Issue - When you you enable/disable an addon, in the same time another one is disabled/enabled - Sometimes, when clicking enable/disable an addon the toggle switches quick back to the initial state ## About the changes - Stable table sorting - Switch toggle `key` Closes https://linear.app/unleash/issue/1-1154/addons-enabledisable-action-misbehaves-changing-other-items
This commit is contained in:
parent
c8231d3efd
commit
ddbd619394
@ -67,7 +67,7 @@ export const ConfiguredAddons = () => {
|
|||||||
const columns = useMemo(
|
const columns = useMemo(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
id: 'Icon',
|
accessor: 'id',
|
||||||
Cell: ({
|
Cell: ({
|
||||||
row: {
|
row: {
|
||||||
original: { provider },
|
original: { provider },
|
||||||
@ -75,6 +75,7 @@ export const ConfiguredAddons = () => {
|
|||||||
}: any) => (
|
}: any) => (
|
||||||
<IconCell icon={<AddonIcon name={provider as string} />} />
|
<IconCell icon={<AddonIcon name={provider as string} />} />
|
||||||
),
|
),
|
||||||
|
disableSortBy: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Name',
|
Header: 'Name',
|
||||||
@ -108,6 +109,7 @@ export const ConfiguredAddons = () => {
|
|||||||
row: { original: IAddon };
|
row: { original: IAddon };
|
||||||
}) => (
|
}) => (
|
||||||
<ConfiguredAddonsActionsCell
|
<ConfiguredAddonsActionsCell
|
||||||
|
key={original.id}
|
||||||
setShowDelete={setShowDelete}
|
setShowDelete={setShowDelete}
|
||||||
toggleAddon={toggleAddon}
|
toggleAddon={toggleAddon}
|
||||||
setDeletedAddon={setDeletedAddon}
|
setDeletedAddon={setDeletedAddon}
|
||||||
@ -127,7 +129,10 @@ export const ConfiguredAddons = () => {
|
|||||||
|
|
||||||
const initialState = useMemo(
|
const initialState = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
sortBy: [{ id: 'provider', desc: false }],
|
sortBy: [
|
||||||
|
{ id: 'provider', desc: false },
|
||||||
|
{ id: 'id', desc: false },
|
||||||
|
],
|
||||||
hiddenColumns: ['description'],
|
hiddenColumns: ['description'],
|
||||||
}),
|
}),
|
||||||
[]
|
[]
|
||||||
|
Loading…
Reference in New Issue
Block a user