Skip to content

Commit

Permalink
Hide document button in reference table (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
adammertel authored Mar 20, 2024
1 parent f4d9185 commit ea0b427
Showing 1 changed file with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,56 +257,56 @@ export const EntityReferenceTable: React.FC<EntityReferenceTable> = ({
);
},
},
{
id: "text reference",
Cell: ({ row }: CellType) => {
const reference = row.original;
const resourceEntity = entities[reference.resource];
// {
// id: "text reference",
// Cell: ({ row }: CellType) => {
// const reference = row.original;
// const resourceEntity = entities[reference.resource];

const document =
resourceEntity && documents
? documents.find(
(doc) => doc.id === resourceEntity.data.documentId
)
: undefined;
// const document =
// resourceEntity && documents
// ? documents.find(
// (doc) => doc.id === resourceEntity.data.documentId
// )
// : undefined;

return (
<>
{resourceEntity ? (
resourceEntity.data.documentId ? (
document?.referencedEntityIds.includes(entityId) ? (
<Button
tooltipLabel="with entity"
icon={<GrDocumentVerified />}
inverted
color="primary"
noBorder
/>
) : (
<Button
tooltipLabel="no reference in document found"
icon={<GrDocument />}
inverted
color="plain"
noBorder
/>
)
) : (
<Button
icon={<GrDocumentMissing />}
tooltipLabel="no document assigned for this resource"
color="danger"
noBorder
inverted
/>
)
) : (
<></>
)}
</>
);
},
},
// return (
// <>
// {resourceEntity ? (
// resourceEntity.data.documentId ? (
// document?.referencedEntityIds.includes(entityId) ? (
// <Button
// tooltipLabel="with entity"
// icon={<GrDocumentVerified />}
// inverted
// color="primary"
// noBorder
// />
// ) : (
// <Button
// tooltipLabel="no reference in document found"
// icon={<GrDocument />}
// inverted
// color="plain"
// noBorder
// />
// )
// ) : (
// <Button
// icon={<GrDocumentMissing />}
// tooltipLabel="no document assigned for this resource"
// color="danger"
// noBorder
// inverted
// />
// )
// ) : (
// <></>
// )}
// </>
// );
// },
// },
{
id: "reference buttons",
Cell: ({ row }: CellType) => {
Expand Down

0 comments on commit ea0b427

Please sign in to comment.