2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-15 05:32:21 +00:00

[UI] About InvenTree Tweak (#10565)

- Hide version entries without data
This commit is contained in:
Oliver
2025-10-13 13:08:49 +11:00
committed by GitHub
parent 6badc0148f
commit ea868b3179

View File

@@ -68,23 +68,25 @@ const AboutContent = ({
}); });
function fillTable(lookup: AboutLookupRef[], data: any, alwaysLink = false) { function fillTable(lookup: AboutLookupRef[], data: any, alwaysLink = false) {
return lookup.map((map: AboutLookupRef, idx) => ( return lookup
.filter((entry: AboutLookupRef) => !!data[entry.ref])
.map((entry: AboutLookupRef, idx) => (
<Table.Tr key={idx}> <Table.Tr key={idx}>
<Table.Td>{map.title}</Table.Td> <Table.Td>{entry.title}</Table.Td>
<Table.Td> <Table.Td>
<Group justify='space-between' gap='xs'> <Group justify='space-between' gap='xs'>
{alwaysLink ? ( {alwaysLink ? (
<Anchor href={data[map.ref]} target='_blank'> <Anchor href={data[entry.ref]} target='_blank'>
{data[map.ref]} {data[entry.ref]}
</Anchor> </Anchor>
) : map.link ? ( ) : entry.link ? (
<Anchor href={map.link} target='_blank'> <Anchor href={entry.link} target='_blank'>
{data[map.ref]} {data[entry.ref]}
</Anchor> </Anchor>
) : ( ) : (
data[map.ref] data[entry.ref]
)} )}
{map.copy && <CopyButton value={data[map.ref]} />} {entry.copy && <CopyButton value={data[entry.ref]} />}
</Group> </Group>
</Table.Td> </Table.Td>
</Table.Tr> </Table.Tr>