Skip to content

Commit

Permalink
Filter credentials by createUser property
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslaw Szwajkowski <[email protected]>
  • Loading branch information
rszwajko committed Jul 11, 2024
1 parent caac127 commit f69ec0f
Showing 1 changed file with 14 additions and 28 deletions.
42 changes: 14 additions & 28 deletions client/src/app/pages/identities/identities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ export const Identities: React.FC = () => {
description: t("terms.description"),
type: t("terms.type"),

//TODO: Enable conditional rendering for createdBy column
// ...(isAuthRequired && { createdBy: t("terms.createdBy") }
// ? { createdBy: t("terms.createdBy") }
// : {}),
createdBy: t("terms.createdBy"),
},
isFilterEnabled: true,
isSortEnabled: true,
Expand Down Expand Up @@ -182,29 +179,23 @@ export const Identities: React.FC = () => {
return item.kind || "";
},
},
//TODO: Enable conditional rendering for createdBy column
// ...(isAuthRequired
// ? [
// {
// categoryKey: "createdBy",
// title: "Created By",
// type: FilterType.search,
// placeholderText: "Filter by created by User...",
// getItemValue: (item: Identity) => {
// return item.createUser || "";
// },
// } as const,
// ]
// : []),
{
categoryKey: "createdBy",
title: "Created By",
type: FilterType.search,
placeholderText: "Filter by created by User...",
getItemValue: (item: Identity) => {
return item.createUser || "";
},
},
],
initialItemsPerPage: 10,
sortableColumns: ["name", "type"],
initialSort: { columnKey: "name", direction: "asc" },
getSortValues: (item) => ({
name: item?.name || "",
type: item?.kind || "",
//TODO: Enable conditional rendering for createdBy column
// ...(isAuthRequired && { createdBy: item?.createUser } ? { createdBy: item?.createUser } : {}),
createdBy: item?.createUser,
}),
isLoading: isFetching,
});
Expand Down Expand Up @@ -275,10 +266,7 @@ export const Identities: React.FC = () => {
{...getThProps({ columnKey: "description" })}
/>
<Th width={25} {...getThProps({ columnKey: "type" })} />

{/*
//TODO: Enable conditional rendering for createdBy column
<Th {...getThProps({ columnKey: "createdBy" })} /> */}
<Th {...getThProps({ columnKey: "createdBy" })} />
</TableHeaderContentWithControls>
</Tr>
</Thead>
Expand Down Expand Up @@ -340,14 +328,12 @@ export const Identities: React.FC = () => {
>
{typeFormattedString?.value}
</Td>
{/*
Todo: Enable conditional rendering for createdBy column
<Td
width={10}
{...getTdProps({ columnKey: "createdBy" })}
>
{identity.createdBy}
</Td> */}
{identity.createUser}
</Td>
<AppTableActionButtons
isDeleteEnabled={
trackers.some(
Expand Down

0 comments on commit f69ec0f

Please sign in to comment.