({
relationshipId,
relationships,
editable,
customCells,
extraCellsBefore,
extraCellsAfter,
className,
headerRow,
idColumn = true,
}: RelationshipInHtmlTableProps & HtmlTableProps)
| 95 | }; |
| 96 | |
| 97 | export const RelationshipInHtmlTable = ({ |
| 98 | relationshipId, |
| 99 | relationships, |
| 100 | editable, |
| 101 | customCells, |
| 102 | extraCellsBefore, |
| 103 | extraCellsAfter, |
| 104 | className, |
| 105 | headerRow, |
| 106 | idColumn = true, |
| 107 | }: RelationshipInHtmlTableProps & HtmlTableProps): any => { |
| 108 | const [resolvedRelationships, store, localTableId, remoteTableId] = |
| 109 | getRelationshipsStoreTableIds( |
| 110 | useRelationshipsOrRelationshipsById(relationships), |
| 111 | relationshipId, |
| 112 | ); |
| 113 | const cells = useCells( |
| 114 | [ |
| 115 | ...useDottedCellIds(localTableId, store), |
| 116 | ...useDottedCellIds(remoteTableId, store), |
| 117 | ], |
| 118 | customCells, |
| 119 | editable ? EditableCellView : CellView, |
| 120 | ); |
| 121 | const params = useParams( |
| 122 | idColumn, |
| 123 | cells, |
| 124 | localTableId, |
| 125 | remoteTableId, |
| 126 | relationshipId, |
| 127 | resolvedRelationships, |
| 128 | store, |
| 129 | extraCellsBefore, |
| 130 | extraCellsAfter, |
| 131 | ); |
| 132 | return ( |
| 133 | <table className={className}> |
| 134 | {isFalse(headerRow) ? null : ( |
| 135 | <thead> |
| 136 | <tr> |
| 137 | {extraHeaders(extraCellsBefore)} |
| 138 | {isFalse(idColumn) ? null : ( |
| 139 | <> |
| 140 | <th>{localTableId}.Id</th> |
| 141 | <th>{remoteTableId}.Id</th> |
| 142 | </> |
| 143 | )} |
| 144 | {objToArray(cells, ({label}, cellId) => ( |
| 145 | <th key={cellId}>{label}</th> |
| 146 | ))} |
| 147 | {extraHeaders(extraCellsAfter, 1)} |
| 148 | </tr> |
| 149 | </thead> |
| 150 | )} |
| 151 | <tbody> |
| 152 | {arrayMap(useRowIds(localTableId as Id, store), (localRowId) => ( |
| 153 | <RelationshipInHtmlRow |
| 154 | key={localRowId} |
nothing calls this directly
no test coverage detected
searching dependent graphs…