Skip to content

Commit

Permalink
Make the type machine happy
Browse files Browse the repository at this point in the history
  • Loading branch information
illusional committed Jun 19, 2024
1 parent f01fb12 commit d346dc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions web/src/pages/project/DictEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Button } from 'semantic-ui-react'
import { ThemeContext } from '../../shared/components/ThemeProvider'

type InputValue = null | string | number | boolean | InputValue[] | { [key: string]: InputValue }
type Input = { [key: string]: InputValue } | string
export type DictEditorInput = { [key: string]: InputValue } | string

interface DictEditorProps {
input: Input
input: DictEditorInput
onChange: (json: object) => void
}

const getStringFromValue = (input: Input) => {
const getStringFromValue = (input: DictEditorInput) => {
// if it's a string, return it
if (typeof input === 'string') {
return input
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/project/ProjectColumnOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
ProjectParticipantGridFilter,
ProjectParticipantGridResponse,
} from '../../sm-api'
import { DictEditor } from './DictEditor'
import { DictEditor, DictEditorInput } from './DictEditor'
import {
headerGroupOrder,
metaSeachEntityPrefixToFilterKey,
Expand Down Expand Up @@ -81,7 +81,7 @@ export const ProjectColumnOptions: React.FC<ProjectColumnOptionsProps> = ({
To filter the data, you can use the <FilterAltIcon /> button at the top of
each column.
</Message>
<DictEditor input={filterValues} onChange={updateFilters} />
<DictEditor input={filterValues as DictEditorInput} onChange={updateFilters} />
<br />
<Grid container divided>
{headerGroupOrder.map((headerGroup) => {
Expand Down

0 comments on commit d346dc4

Please sign in to comment.