Add profile state sorting

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-19 15:11:27 +04:00
parent 587f59d167
commit a9e4e991b3
8 changed files with 41 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<a32e2b4330ac1d54762817127289b51d>>
* @generated SignedSource<<167a4c7cc44ce2cc44e9b4680b6fc285>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,7 +11,7 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type OrderDirection = "ASC" | "DESC";
export type ProfileOrderField = "CREATED_AT" | "FULL_NAME" | "KIND" | "ORGANIZATION_NAME";
export type ProfileOrderField = "CREATED_AT" | "FULL_NAME" | "KIND" | "ORGANIZATION_NAME" | "STATE";
export type ProfileOrder = {
direction: OrderDirection;
field: ProfileOrderField;

View File

@@ -106,7 +106,7 @@ export function PersonPage(props: { queryRef: PreloadedQuery<PersonPageQuery> })
<div className="text-lg text-txt-secondary">{person.emailAddress}</div>
</div>
</div>
{person.canDelete && (
{person.canDelete && person.source !== "SCIM" && (
<ActionDropdown variant="secondary">
<DropdownItem
variant="danger"

View File

@@ -83,7 +83,7 @@ export function PeopleList(props: {
<Thead>
<Tr>
<SortableTh field="FULL_NAME" onOrderChange={handleOrderChange}>{__("Name")}</SortableTh>
<SortableTh field="STATUS">{__("Status")}</SortableTh>
<SortableTh field="STATE">{__("Status")}</SortableTh>
<SortableTh field="EMAIL_ADDRESS" onOrderChange={handleOrderChange}>{__("Email")}</SortableTh>
<SortableTh field="ROLE" onOrderChange={handleOrderChange}>{__("Role")}</SortableTh>
<SortableTh field="CREATED_AT" onOrderChange={handleOrderChange}>{__("Created on")}</SortableTh>

View File

@@ -112,6 +112,9 @@ export function PeopleListItem(props: {
const isInactive = profile.state === "INACTIVE";
const canSendActivationMail = isInactive && profile.source !== "SCIM" && profile.canInvite;
const canDelete = profile.canDelete && profile.source !== "SCIM";
const [inviteUser]
= useMutationWithToasts<PeopleListItem_inviteMutation>(inviteUserMutation, {
successMessage: __("Invitation sent successfully"),
@@ -248,25 +251,27 @@ export function PeopleListItem(props: {
{new Date(profile.createdAt).toLocaleDateString()}
</Td>
<Td noLink width={160} className="text-end">
<ActionDropdown>
{isInactive && profile.source !== "SCIM" && profile.canInvite && (
<DropdownItem
onClick={handleInvite}
icon={IconMail}
>
{lastInvitation ? __("Resend activation mail") : __("Send activation mail")}
</DropdownItem>
)}
{profile.canDelete && profile.source !== "SCIM" && (
<DropdownItem
onClick={handleRemove}
variant="danger"
icon={IconTrashCan}
>
{__("Remove person")}
</DropdownItem>
)}
</ActionDropdown>
{(canSendActivationMail || canDelete) && (
<ActionDropdown>
{canSendActivationMail && (
<DropdownItem
onClick={handleInvite}
icon={IconMail}
>
{lastInvitation ? __("Resend activation mail") : __("Send activation mail")}
</DropdownItem>
)}
{canDelete && (
<DropdownItem
onClick={handleRemove}
variant="danger"
icon={IconTrashCan}
>
{__("Remove person")}
</DropdownItem>
)}
</ActionDropdown>
)}
</Td>
</Tr>
);