Skip to content

Commit

Permalink
refactor(24143): fix publish
Browse files Browse the repository at this point in the history
  • Loading branch information
vanch3d committed Jul 19, 2024
1 parent 673f0e0 commit cb65ef3
Showing 1 changed file with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@ import { RJSFSchema } from '@rjsf/utils/src/types.ts'
import { FC, useCallback, useEffect, useMemo, useState } from 'react'
import { AdapterContext } from '@/modules/ProtocolAdapters/types.ts'
import { JSONSchema7 } from 'json-schema'
import {
ColumnDef,
flexRender,
getCoreRowModel,
getFilteredRowModel,
getPaginationRowModel,
RowData,
Table,
useReactTable,
} from '@tanstack/react-table'
import { ColumnDef, flexRender, getCoreRowModel, RowData, Table, useReactTable } from '@tanstack/react-table'
import { Box, chakra as Chakra, Input } from '@chakra-ui/react'

import IconButton from '@/components/Chakra/IconButton.tsx'
Expand Down Expand Up @@ -162,12 +153,11 @@ const CompactArrayField: FC<FieldProps<unknown, RJSFSchema, AdapterContext>> = (
meta: {
updateData: (rowIndex, columnId, value) => {
setRawData((old) => {
if (old.length === 0) return [{ [columnId]: value }]
if (old.length === 0) return old

const ret = [...old]
ret[rowIndex] = { ...ret[rowIndex], [columnId]: value }

return ret
const newData = [...old]
newData[rowIndex] = { ...newData[rowIndex], [columnId]: value }
return newData
})
// No access to "submit" event so need to store the data back in FormData
props.onChange(rawData)
Expand Down

0 comments on commit cb65ef3

Please sign in to comment.