Put back sorting columns on invitation and members
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<26a05edf635e281469d5498e24879e00>>
|
||||
* @generated SignedSource<<e8e0e8e378c0a308255a8e2f3918b758>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type InvitationOrderField = "ACCEPTED_AT" | "CREATED_AT" | "EMAIL" | "EXPIRES_AT" | "ROLE";
|
||||
export type InvitationOrderField = "ACCEPTED_AT" | "CREATED_AT" | "EMAIL" | "EXPIRES_AT" | "FULL_NAME" | "ROLE";
|
||||
export type OrderDirection = "ASC" | "DESC";
|
||||
export type InvitationOrder = {
|
||||
direction: OrderDirection;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<d9ec1da794fdbe09fbffc7ed32d22707>>
|
||||
* @generated SignedSource<<e01416ecd129c81e31f5da90bf797ff7>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type MembershipOrderField = "CREATED_AT" | "ROLE";
|
||||
export type MembershipOrderField = "CREATED_AT" | "EMAIL_ADDRESS" | "FULL_NAME" | "ROLE";
|
||||
export type OrderDirection = "ASC" | "DESC";
|
||||
export type MembershipOrder = {
|
||||
direction: OrderDirection;
|
||||
|
||||
@@ -5,6 +5,7 @@ import { graphql, usePaginationFragment } from "react-relay";
|
||||
import { InvitationListItem } from "./InvitationListItem";
|
||||
import type { InvitationListFragment$key } from "/__generated__/iam/InvitationListFragment.graphql";
|
||||
import type { InvitationListFragment_RefetchQuery } from "/__generated__/iam/InvitationListFragment_RefetchQuery.graphql";
|
||||
import type { ComponentProps } from "react";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment InvitationListFragment on Organization
|
||||
@@ -57,23 +58,11 @@ export function InvitationList(props: { fKey: InvitationListFragment$key }) {
|
||||
return (
|
||||
<SortableTable
|
||||
{...invitationsPagination}
|
||||
refetch={({ order }: { order: { direction: string; field: string } }) => {
|
||||
invitationsPagination.refetch({
|
||||
order: {
|
||||
direction: order.direction as "ASC" | "DESC",
|
||||
field: order.field as
|
||||
| "CREATED_AT"
|
||||
| "EXPIRES_AT"
|
||||
// FIXME: put back
|
||||
// | "FULL_NAME"
|
||||
| "EMAIL"
|
||||
| "ROLE"
|
||||
// FIXME: put back
|
||||
// | "STATUS"
|
||||
| "ACCEPTED_AT",
|
||||
},
|
||||
});
|
||||
}}
|
||||
refetch={
|
||||
invitationsPagination.refetch as ComponentProps<
|
||||
typeof SortableTable
|
||||
>["refetch"]
|
||||
}
|
||||
pageSize={20}
|
||||
>
|
||||
<Thead>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { SortableTable, SortableTh } from "/components/SortableTable";
|
||||
import type { MemberListFragment_RefetchQuery } from "/__generated__/iam/MemberListFragment_RefetchQuery.graphql";
|
||||
import { MemberListItem } from "./MemberListItem";
|
||||
import type { MemberListFragment$key } from "/__generated__/iam/MemberListFragment.graphql";
|
||||
import type { ComponentProps } from "react";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment MemberListFragment on Organization
|
||||
@@ -55,19 +56,11 @@ export function MemberList(props: { fKey: MemberListFragment$key }) {
|
||||
return (
|
||||
<SortableTable
|
||||
{...membersPagination}
|
||||
refetch={({ order }: { order: { direction: string; field: string } }) => {
|
||||
membersPagination.refetch({
|
||||
order: {
|
||||
direction: order.direction as "ASC" | "DESC",
|
||||
field: order.field as
|
||||
| "CREATED_AT"
|
||||
// FIXME: add those back
|
||||
// | "FULL_NAME"
|
||||
// | "EMAIL_ADDRESS"
|
||||
| "ROLE",
|
||||
},
|
||||
});
|
||||
}}
|
||||
refetch={
|
||||
membersPagination.refetch as ComponentProps<
|
||||
typeof SortableTable
|
||||
>["refetch"]
|
||||
}
|
||||
pageSize={20}
|
||||
>
|
||||
<Thead>
|
||||
|
||||
Reference in New Issue
Block a user