Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a fix to navigate when the Label col is hidden in the list page of admin UI. #3366

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/khaki-pumas-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@keystonejs/app-admin-ui': patch
---

Added a fix to navigate when the `Label` column is hidden in list page of admin UI.

In the list page of admin UI, the `Label` column was used to open up the detailed view of a single item.
Thus, hiding the `Label` column was preventing the user to navigate to detailed view.

This was happening because inside `ListTable`, the default value for `linkField` was set to `_label_`.
To fix this, we have now added the path of first field as default value to `linkField`.
2 changes: 1 addition & 1 deletion packages/app-admin-ui/client/components/ListTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export default function ListTable({
currentPage,
filters,
search,
linkField = '_label_',
linkField = fields[0].path,
}) {
const [sortBy, onSortChange] = useListSort();

Expand Down