Skip to content

Commit

Permalink
Merge pull request #34 from Amsterdam/improvement/add-onclickrow-to-t…
Browse files Browse the repository at this point in the history
…ask-overview-table

Adde onclickrow to task overview table
  • Loading branch information
remyvdwereld authored Aug 12, 2024
2 parents c330129 + f5684c4 commit a9ebe14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/__generated__/apiSchema.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/pages/CasesPage/CasesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const columns: ColumnType<Components.Schemas.Case>[] = [
header: "",
dataIndex: "id",
width: 100,
render: () => <LinkButton label="Zaakdetails" path="" />
render: () => <LinkButton label="Zaakdetails" />
}
]

Expand Down
5 changes: 4 additions & 1 deletion src/app/pages/TasksPage/TaskPage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useNavigate } from "react-router-dom"
import { ColumnType, LinkButton, PageHeading, Table } from "app/components"
import { useTasks } from "app/state/rest"
import { formatDate } from "app/utils/dates"
Expand Down Expand Up @@ -27,12 +28,13 @@ const columns: ColumnType<Components.Schemas.CaseUserTask>[] = [
header: "",
dataIndex: "case",
width: 100,
render: (caseId) => <LinkButton label="Zaakdetails" path={ `/zaken/${ caseId }`} />
render: () => <LinkButton label="Zaakdetails" />
}
]

export const TasksPage: React.FC = () => {
const [data, { isBusy }] = useTasks()
const navigate = useNavigate()

return (
<>
Expand All @@ -41,6 +43,7 @@ export const TasksPage: React.FC = () => {
columns={ columns }
data={ data as Components.Schemas.CaseUserTask[] }
loading={ isBusy }
onClickRow={(obj) => navigate(`/zaken/${ obj.case }`)}
/>
</>
)
Expand Down

0 comments on commit a9ebe14

Please sign in to comment.