Skip to content

Commit

Permalink
fix: table ids & loading (#26594)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Dec 4, 2024
1 parent 85919f1 commit 9890231
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export const scene: SceneExport = {

export function ErrorTrackingConfigurationScene(): JSX.Element {
const { missingSymbolSets, validSymbolSets } = useValues(errorTrackingSymbolSetLogic)
const { loadSymbolSets } = useActions(errorTrackingSymbolSetLogic)

useEffect(() => {
loadSymbolSets()
}, [loadSymbolSets])

return (
<div className="space-y-4">
Expand All @@ -27,18 +32,22 @@ export function ErrorTrackingConfigurationScene(): JSX.Element {
automatically retrieves source maps where possible. Cases where it was not possible are listed below.
Source maps can be uploaded retroactively but changes will only apply to all future exceptions ingested.
</p>
{missingSymbolSets.length > 0 && <SymbolSetTable dataSource={missingSymbolSets} pageSize={5} missing />}
{validSymbolSets.length > 0 && <SymbolSetTable dataSource={validSymbolSets} pageSize={10} />}
{missingSymbolSets.length > 0 && (
<SymbolSetTable id="missing" dataSource={missingSymbolSets} pageSize={5} missing />
)}
{validSymbolSets.length > 0 && <SymbolSetTable id="valid" dataSource={validSymbolSets} pageSize={10} />}
<SymbolSetUploadModal />
</div>
)
}

const SymbolSetTable = ({
id,
dataSource,
pageSize,
missing,
}: {
id: string
dataSource: ErrorTrackingSymbolSet[]
pageSize: number
missing?: boolean
Expand Down Expand Up @@ -98,6 +107,7 @@ const SymbolSetTable = ({

return (
<LemonTable
id={id}
showHeader={missing}
pagination={{ pageSize }}
columns={columns}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { lemonToast } from '@posthog/lemon-ui'
import { actions, afterMount, kea, path, reducers, selectors } from 'kea'
import { actions, kea, path, reducers, selectors } from 'kea'
import { forms } from 'kea-forms'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
Expand Down Expand Up @@ -103,8 +103,4 @@ export const errorTrackingSymbolSetLogic = kea<errorTrackingSymbolSetLogicType>(
},
},
})),

afterMount(({ actions }) => {
actions.loadSymbolSets()
}),
])

0 comments on commit 9890231

Please sign in to comment.