Skip to content

Commit

Permalink
remove any type
Browse files Browse the repository at this point in the history
  • Loading branch information
sanglevinh committed Jul 28, 2023
1 parent ef4f09e commit 6d73d31
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
30 changes: 16 additions & 14 deletions frontend/src/components/Database/DatabaseCells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ const columns = (handleOpenDialog: (value: string[]) => void) => [
cursor: 'pointer',
display: 'flex',
}}
onClick={() => params.row?.cell_image_url && handleOpenDialog([params.row.cell_image_url])}
onClick={() =>
params.row?.cell_image_url &&
handleOpenDialog([params.row.cell_image_url])
}
>
{params.row?.cell_image_url && (
<img
Expand Down Expand Up @@ -134,7 +137,7 @@ const DatabaseCells = ({ user }: CellProps) => {

const fetchApi = () => {
const api = !user ? getCellsPublicDatabase : getCellsDatabase
dispatch(api({...dataParamsFilter, ...dataParams}))
dispatch(api({ ...dataParamsFilter, ...dataParams }))
}

useEffect(() => {
Expand Down Expand Up @@ -180,23 +183,22 @@ const DatabaseCells = ({ user }: CellProps) => {
[pagiFilter, getParamsData],
)

const handleFilter = (
model: GridFilterModel | any,
details: GridCallbackDetails,
) => {
const handleFilter = (model: GridFilterModel) => {
let filter: string
if (!!model.items[0]?.value) {
filter = model.items
.filter((item: { [key: string]: string }) => item.value)
.map((item: any) => {
return `${item.field}=${item?.value}`
})
.join('&')
.filter((item) => item.value)
.map((item: any) => {
return `${item.field}=${item?.value}`
})
.join('&')
} else {
filter = ''
}
const {sort} = dataParams
setParams(`${filter}&sort=${sort[0] || ''}&sort=${sort[1] || ''}&${pagiFilter}`)
const { sort } = dataParams
setParams(
`${filter}&sort=${sort[0] || ''}&sort=${sort[1] || ''}&${pagiFilter}`,
)
}

const getColumns = useMemo(() => {
Expand All @@ -211,7 +213,7 @@ const DatabaseCells = ({ user }: CellProps) => {
<Box sx={{ display: 'flex' }}>
{params.row.graph_urls?.[index]?.[0] ? (
<img
src={params.row.graph_urls?.[index]?.[0] }
src={params.row.graph_urls?.[index]?.[0]}
alt={''}
width={'100%'}
height={'100%'}
Expand Down
13 changes: 7 additions & 6 deletions frontend/src/components/Database/DatabaseExperiments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const DatabaseExperiments = ({ user, cellPath }: DatabaseProps) => {
}

const handleChangeAttributes = (event: any) => {
setDataDialog(pre => ({...pre, data: event.target.value}))
setDataDialog((pre) => ({ ...pre, data: event.target.value }))
}

const getParamsData = () => {
Expand Down Expand Up @@ -306,22 +306,23 @@ const DatabaseExperiments = ({ user, cellPath }: DatabaseProps) => {
)

const handleFilter = (
model: GridFilterModel | any,
details: GridCallbackDetails,
model: GridFilterModel,
) => {
let filter: string
if (!!model.items[0]?.value) {
filter = model.items
.filter((item: { [key: string]: string }) => item.value)
.filter((item) => item.value)
.map((item: any) => {
return `${item.field}=${item?.value}`
})
.join('&')
} else {
filter = ''
}
const {sort} = dataParams
setParams(`${filter}&sort=${sort[0] || ''}&sort=${sort[1] || ''}&${pagiFilter()}`)
const { sort } = dataParams
setParams(
`${filter}&sort=${sort[0] || ''}&sort=${sort[1] || ''}&${pagiFilter()}`,
)
}

const getColumns = useMemo(() => {
Expand Down

0 comments on commit 6d73d31

Please sign in to comment.