Skip to content

Commit 10fed3a

Browse files
committed
fix type errors
1 parent c02127a commit 10fed3a

File tree

1 file changed

+8
-13
lines changed
  • packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage

1 file changed

+8
-13
lines changed

packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,7 @@ function ListTable ({
576576
}) {
577577
const list = useList(listKey)
578578
const { query } = useRouter()
579-
const shouldShowLinkIcon =
580-
!list.fields[selectedFields.keys().next().value].views.Cell.supportsLinkTo
579+
const shouldShowLinkIcon = selectedFields.keys().some((k, i) => !list.fields[k].views.Cell.supportsLinkTo && i === 0)
581580
return (
582581
<Box paddingBottom="xlarge">
583582
<TableContainer>
@@ -620,9 +619,7 @@ function ListTable ({
620619
{shouldShowLinkIcon && <TableHeaderCell />}
621620
{[...selectedFields].map(path => {
622621
const label = list.fields[path].label
623-
if (!orderableFields.has(path)) {
624-
return <TableHeaderCell key={path}>{label}</TableHeaderCell>
625-
}
622+
if (!orderableFields.has(path)) return <TableHeaderCell key={path}>{label}</TableHeaderCell>
626623
return (
627624
<TableHeaderCell key={path}>
628625
<Link
@@ -706,11 +703,9 @@ function ListTable ({
706703
)}
707704
{[...selectedFields].map((path, i) => {
708705
const field = list.fields[path]
709-
let { Cell } = list.fields[path].views
706+
const { Cell } = list.fields[path].views
710707
const itemForField: Record<string, any> = {}
711-
for (const graphqlField of getRootGraphQLFieldsFromFieldController(
712-
field.controller
713-
)) {
708+
for (const graphqlField of getRootGraphQLFieldsFromFieldController(field.controller)) {
714709
const fieldGetter = itemGetter.get(graphqlField)
715710
if (fieldGetter.errors) {
716711
const errorMessage = fieldGetter.errors[0].message
@@ -759,7 +754,7 @@ function ListTable ({
759754
)
760755
}
761756

762-
const TableContainer = ({ children }: { children: ReactNode }) => {
757+
function TableContainer ({ children }: { children: ReactNode }) {
763758
return (
764759
<table
765760
css={{
@@ -775,15 +770,15 @@ const TableContainer = ({ children }: { children: ReactNode }) => {
775770
)
776771
}
777772

778-
const TableHeaderRow = ({ children }: { children: ReactNode }) => {
773+
function TableHeaderRow ({ children }: { children: ReactNode }) {
779774
return (
780775
<thead>
781776
<tr>{children}</tr>
782777
</thead>
783778
)
784779
}
785780

786-
const TableHeaderCell = (props: HTMLAttributes<HTMLElement>) => {
781+
function TableHeaderCell (props: HTMLAttributes<HTMLElement>) {
787782
const { colors, spacing, typography } = useTheme()
788783
return (
789784
<th
@@ -803,7 +798,7 @@ const TableHeaderCell = (props: HTMLAttributes<HTMLElement>) => {
803798
)
804799
}
805800

806-
const TableBodyCell = (props: HTMLAttributes<HTMLElement>) => {
801+
function TableBodyCell (props: HTMLAttributes<HTMLElement>) {
807802
const { colors, typography } = useTheme()
808803
return (
809804
<td

0 commit comments

Comments
 (0)