diff --git a/apps/console/src/__generated__/iam/SignUpFromInvitationPageMutation.graphql.ts b/apps/console/src/__generated__/iam/ActivateAccountPageMutation.graphql.ts similarity index 57% rename from apps/console/src/__generated__/iam/SignUpFromInvitationPageMutation.graphql.ts rename to apps/console/src/__generated__/iam/ActivateAccountPageMutation.graphql.ts index e814bbf38..b0fe3c796 100644 --- a/apps/console/src/__generated__/iam/SignUpFromInvitationPageMutation.graphql.ts +++ b/apps/console/src/__generated__/iam/ActivateAccountPageMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<59df18257cc2bae52aefd576c20f03cf>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -9,24 +9,23 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type SignUpFromInvitationInput = { - fullName: string; +export type ActivateAccountInput = { password: string; token: string; }; -export type SignUpFromInvitationPageMutation$variables = { - input: SignUpFromInvitationInput; +export type ActivateAccountPageMutation$variables = { + input: ActivateAccountInput; }; -export type SignUpFromInvitationPageMutation$data = { - readonly signUpFromInvitation: { - readonly identity: { +export type ActivateAccountPageMutation$data = { + readonly activateAccount: { + readonly profile: { readonly id: string; } | null | undefined; } | null | undefined; }; -export type SignUpFromInvitationPageMutation = { - response: SignUpFromInvitationPageMutation$data; - variables: SignUpFromInvitationPageMutation$variables; +export type ActivateAccountPageMutation = { + response: ActivateAccountPageMutation$data; + variables: ActivateAccountPageMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -47,17 +46,17 @@ v1 = [ "variableName": "input" } ], - "concreteType": "SignUpFromInvitationPayload", + "concreteType": "ActivateAccountPayload", "kind": "LinkedField", - "name": "signUpFromInvitation", + "name": "activateAccount", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "Identity", + "concreteType": "Profile", "kind": "LinkedField", - "name": "identity", + "name": "profile", "plural": false, "selections": [ { @@ -79,7 +78,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "SignUpFromInvitationPageMutation", + "name": "ActivateAccountPageMutation", "selections": (v1/*: any*/), "type": "Mutation", "abstractKey": null @@ -88,20 +87,20 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "SignUpFromInvitationPageMutation", + "name": "ActivateAccountPageMutation", "selections": (v1/*: any*/) }, "params": { - "cacheID": "9bdca3bd56cb86a2e9c0627379f7f58f", + "cacheID": "57d92d0ae2a6220af84fbd9fe27f7aa3", "id": null, "metadata": {}, - "name": "SignUpFromInvitationPageMutation", + "name": "ActivateAccountPageMutation", "operationKind": "mutation", - "text": "mutation SignUpFromInvitationPageMutation(\n $input: SignUpFromInvitationInput!\n) {\n signUpFromInvitation(input: $input) {\n identity {\n id\n }\n }\n}\n" + "text": "mutation ActivateAccountPageMutation(\n $input: ActivateAccountInput!\n) {\n activateAccount(input: $input) {\n profile {\n id\n }\n }\n}\n" } }; })(); -(node as any).hash = "418fe53fbdc92e4ce5d2256062f08322"; +(node as any).hash = "0e073ce00eb7c435a875b5797f3e6db0"; export default node; diff --git a/apps/console/src/__generated__/iam/InvitationCardFragment.graphql.ts b/apps/console/src/__generated__/iam/InvitationCardFragment.graphql.ts deleted file mode 100644 index c9b260a60..000000000 --- a/apps/console/src/__generated__/iam/InvitationCardFragment.graphql.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ReaderFragment } from 'relay-runtime'; -export type MembershipRole = "ADMIN" | "AUDITOR" | "EMPLOYEE" | "OWNER" | "VIEWER"; -import { FragmentRefs } from "relay-runtime"; -export type InvitationCardFragment$data = { - readonly createdAt: string; - readonly id: string; - readonly organization: { - readonly id: string; - readonly name: string; - }; - readonly role: MembershipRole; - readonly " $fragmentType": "InvitationCardFragment"; -}; -export type InvitationCardFragment$key = { - readonly " $data"?: InvitationCardFragment$data; - readonly " $fragmentSpreads": FragmentRefs<"InvitationCardFragment">; -}; - -const node: ReaderFragment = (function(){ -var v0 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null -}; -return { - "argumentDefinitions": [], - "kind": "Fragment", - "metadata": null, - "name": "InvitationCardFragment", - "selections": [ - (v0/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "role", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "kind": "RequiredField", - "field": { - "alias": null, - "args": null, - "concreteType": "Organization", - "kind": "LinkedField", - "name": "organization", - "plural": false, - "selections": [ - (v0/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - } - ], - "storageKey": null - }, - "action": "THROW" - } - ], - "type": "Invitation", - "abstractKey": null -}; -})(); - -(node as any).hash = "57aedeabc62e474c6e5b995af1d31888"; - -export default node; diff --git a/apps/console/src/__generated__/iam/InvitationCardMutation.graphql.ts b/apps/console/src/__generated__/iam/InvitationCardMutation.graphql.ts deleted file mode 100644 index 6e8f5b33e..000000000 --- a/apps/console/src/__generated__/iam/InvitationCardMutation.graphql.ts +++ /dev/null @@ -1,205 +0,0 @@ -/** - * @generated SignedSource<<8369cd1e8f928481ea43a4e09f11a3f4>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type AcceptInvitationInput = { - invitationId: string; -}; -export type InvitationCardMutation$variables = { - input: AcceptInvitationInput; - pendingInvitationConnections: ReadonlyArray; -}; -export type InvitationCardMutation$data = { - readonly acceptInvitation: { - readonly invitation: { - readonly id: string; - }; - readonly membership: { - readonly id: string; - readonly " $fragmentSpreads": FragmentRefs<"MembershipCardFragment">; - }; - } | null | undefined; -}; -export type InvitationCardMutation = { - response: InvitationCardMutation$data; - variables: InvitationCardMutation$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" - }, - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "pendingInvitationConnections" - } -], -v1 = [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } -], -v2 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "InvitationCardMutation", - "selections": [ - { - "alias": null, - "args": (v1/*: any*/), - "concreteType": "AcceptInvitationPayload", - "kind": "LinkedField", - "name": "acceptInvitation", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Invitation", - "kind": "LinkedField", - "name": "invitation", - "plural": false, - "selections": [ - (v2/*: any*/) - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "Membership", - "kind": "LinkedField", - "name": "membership", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "args": null, - "kind": "FragmentSpread", - "name": "MembershipCardFragment" - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "InvitationCardMutation", - "selections": [ - { - "alias": null, - "args": (v1/*: any*/), - "concreteType": "AcceptInvitationPayload", - "kind": "LinkedField", - "name": "acceptInvitation", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Invitation", - "kind": "LinkedField", - "name": "invitation", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "alias": null, - "args": null, - "filters": null, - "handle": "deleteEdge", - "key": "", - "kind": "ScalarHandle", - "name": "id", - "handleArgs": [ - { - "kind": "Variable", - "name": "connections", - "variableName": "pendingInvitationConnections" - } - ] - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "Membership", - "kind": "LinkedField", - "name": "membership", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "alias": null, - "args": null, - "concreteType": "Session", - "kind": "LinkedField", - "name": "lastSession", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "expiresAt", - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "bebfc1241803845587648eaad4988fcb", - "id": null, - "metadata": {}, - "name": "InvitationCardMutation", - "operationKind": "mutation", - "text": "mutation InvitationCardMutation(\n $input: AcceptInvitationInput!\n) {\n acceptInvitation(input: $input) {\n invitation {\n id\n }\n membership {\n id\n ...MembershipCardFragment\n }\n }\n}\n\nfragment MembershipCardFragment on Membership {\n lastSession {\n id\n expiresAt\n }\n}\n" - } -}; -})(); - -(node as any).hash = "32d7fb0d26660c95e87012d3b31068e8"; - -export default node; diff --git a/apps/console/src/__generated__/iam/InvitationListFragment.graphql.ts b/apps/console/src/__generated__/iam/InvitationListFragment.graphql.ts deleted file mode 100644 index e1fdb11ad..000000000 --- a/apps/console/src/__generated__/iam/InvitationListFragment.graphql.ts +++ /dev/null @@ -1,236 +0,0 @@ -/** - * @generated SignedSource<<86ac079914ad21b757e635e4e68fc382>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ReaderFragment } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type InvitationListFragment$data = { - readonly id: string; - readonly invitations: { - readonly __id: string; - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; - readonly " $fragmentSpreads": FragmentRefs<"InvitationListItemFragment">; - }; - }>; - }; - readonly " $fragmentType": "InvitationListFragment"; -}; -export type InvitationListFragment$key = { - readonly " $data"?: InvitationListFragment$data; - readonly " $fragmentSpreads": FragmentRefs<"InvitationListFragment">; -}; - -import InvitationListFragment_RefetchQuery_graphql from './InvitationListFragment_RefetchQuery.graphql'; - -const node: ReaderFragment = (function(){ -var v0 = [ - "invitations" -], -v1 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null -}; -return { - "argumentDefinitions": [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "after" - }, - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "before" - }, - { - "defaultValue": 20, - "kind": "LocalArgument", - "name": "first" - }, - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "last" - }, - { - "defaultValue": { - "direction": "DESC", - "field": "CREATED_AT" - }, - "kind": "LocalArgument", - "name": "order" - } - ], - "kind": "Fragment", - "metadata": { - "connection": [ - { - "count": null, - "cursor": null, - "direction": "bidirectional", - "path": (v0/*: any*/) - } - ], - "refetch": { - "connection": { - "forward": { - "count": "first", - "cursor": "after" - }, - "backward": { - "count": "last", - "cursor": "before" - }, - "path": (v0/*: any*/) - }, - "fragmentPathInResult": [ - "node" - ], - "operation": InvitationListFragment_RefetchQuery_graphql, - "identifierInfo": { - "identifierField": "id", - "identifierQueryVariableName": "id" - } - } - }, - "name": "InvitationListFragment", - "selections": [ - { - "kind": "RequiredField", - "field": { - "alias": "invitations", - "args": [ - { - "kind": "Variable", - "name": "orderBy", - "variableName": "order" - } - ], - "concreteType": "InvitationConnection", - "kind": "LinkedField", - "name": "__InvitationListFragment_invitations_connection", - "plural": false, - "selections": [ - { - "kind": "RequiredField", - "field": { - "alias": null, - "args": null, - "concreteType": "InvitationEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Invitation", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v1/*: any*/), - { - "args": null, - "kind": "FragmentSpread", - "name": "InvitationListItemFragment" - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__typename", - "storageKey": null - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "cursor", - "storageKey": null - } - ], - "storageKey": null - }, - "action": "THROW" - }, - { - "alias": null, - "args": null, - "concreteType": "PageInfo", - "kind": "LinkedField", - "name": "pageInfo", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "endCursor", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasNextPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasPreviousPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "startCursor", - "storageKey": null - } - ], - "storageKey": null - }, - { - "kind": "ClientExtension", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__id", - "storageKey": null - } - ] - } - ], - "storageKey": null - }, - "action": "THROW" - }, - (v1/*: any*/) - ], - "type": "Organization", - "abstractKey": null -}; -})(); - -(node as any).hash = "5ff19da7145701e33a81275e009c56f7"; - -export default node; diff --git a/apps/console/src/__generated__/iam/InvitationListFragment_RefetchQuery.graphql.ts b/apps/console/src/__generated__/iam/InvitationListFragment_RefetchQuery.graphql.ts deleted file mode 100644 index 1f53343bf..000000000 --- a/apps/console/src/__generated__/iam/InvitationListFragment_RefetchQuery.graphql.ts +++ /dev/null @@ -1,374 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type InvitationOrderField = "ACCEPTED_AT" | "CREATED_AT" | "EMAIL" | "EXPIRES_AT" | "FULL_NAME" | "ROLE"; -export type OrderDirection = "ASC" | "DESC"; -export type InvitationOrder = { - direction: OrderDirection; - field: InvitationOrderField; -}; -export type InvitationListFragment_RefetchQuery$variables = { - after?: string | null | undefined; - before?: string | null | undefined; - first?: number | null | undefined; - id: string; - last?: number | null | undefined; - order?: InvitationOrder | null | undefined; -}; -export type InvitationListFragment_RefetchQuery$data = { - readonly node: { - readonly " $fragmentSpreads": FragmentRefs<"InvitationListFragment">; - } | null | undefined; -}; -export type InvitationListFragment_RefetchQuery = { - response: InvitationListFragment_RefetchQuery$data; - variables: InvitationListFragment_RefetchQuery$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "after" -}, -v1 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "before" -}, -v2 = { - "defaultValue": 20, - "kind": "LocalArgument", - "name": "first" -}, -v3 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "id" -}, -v4 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "last" -}, -v5 = { - "defaultValue": { - "direction": "DESC", - "field": "CREATED_AT" - }, - "kind": "LocalArgument", - "name": "order" -}, -v6 = [ - { - "kind": "Variable", - "name": "id", - "variableName": "id" - } -], -v7 = { - "kind": "Variable", - "name": "after", - "variableName": "after" -}, -v8 = { - "kind": "Variable", - "name": "before", - "variableName": "before" -}, -v9 = { - "kind": "Variable", - "name": "first", - "variableName": "first" -}, -v10 = { - "kind": "Variable", - "name": "last", - "variableName": "last" -}, -v11 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__typename", - "storageKey": null -}, -v12 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null -}, -v13 = [ - (v7/*: any*/), - (v8/*: any*/), - (v9/*: any*/), - (v10/*: any*/), - { - "kind": "Variable", - "name": "orderBy", - "variableName": "order" - } -]; -return { - "fragment": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/), - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/), - (v5/*: any*/) - ], - "kind": "Fragment", - "metadata": null, - "name": "InvitationListFragment_RefetchQuery", - "selections": [ - { - "alias": null, - "args": (v6/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - { - "args": [ - (v7/*: any*/), - (v8/*: any*/), - (v9/*: any*/), - (v10/*: any*/), - { - "kind": "Variable", - "name": "order", - "variableName": "order" - } - ], - "kind": "FragmentSpread", - "name": "InvitationListFragment" - } - ], - "storageKey": null - } - ], - "type": "Query", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/), - (v2/*: any*/), - (v4/*: any*/), - (v5/*: any*/), - (v3/*: any*/) - ], - "kind": "Operation", - "name": "InvitationListFragment_RefetchQuery", - "selections": [ - { - "alias": null, - "args": (v6/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v11/*: any*/), - (v12/*: any*/), - { - "kind": "InlineFragment", - "selections": [ - { - "alias": null, - "args": (v13/*: any*/), - "concreteType": "InvitationConnection", - "kind": "LinkedField", - "name": "invitations", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "InvitationEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Invitation", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v12/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "fullName", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "email", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "role", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "status", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "acceptedAt", - "storageKey": null - }, - { - "alias": "canDelete", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "iam:invitation:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"iam:invitation:delete\")" - }, - (v11/*: any*/) - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "cursor", - "storageKey": null - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "PageInfo", - "kind": "LinkedField", - "name": "pageInfo", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "endCursor", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasNextPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasPreviousPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "startCursor", - "storageKey": null - } - ], - "storageKey": null - }, - { - "kind": "ClientExtension", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__id", - "storageKey": null - } - ] - } - ], - "storageKey": null - }, - { - "alias": null, - "args": (v13/*: any*/), - "filters": [ - "orderBy" - ], - "handle": "connection", - "key": "InvitationListFragment_invitations", - "kind": "LinkedHandle", - "name": "invitations" - } - ], - "type": "Organization", - "abstractKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "fa35a507d94c15f0839f276dc42dfd89", - "id": null, - "metadata": {}, - "name": "InvitationListFragment_RefetchQuery", - "operationKind": "query", - "text": "query InvitationListFragment_RefetchQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 20\n $last: Int = null\n $order: InvitationOrder = {direction: DESC, field: CREATED_AT}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...InvitationListFragment_16fISc\n id\n }\n}\n\nfragment InvitationListFragment_16fISc on Organization {\n invitations(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n ...InvitationListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment InvitationListItemFragment on Invitation {\n id\n fullName\n email\n role\n status\n createdAt\n acceptedAt\n canDelete: permission(action: \"iam:invitation:delete\")\n}\n" - } -}; -})(); - -(node as any).hash = "5ff19da7145701e33a81275e009c56f7"; - -export default node; diff --git a/apps/console/src/__generated__/iam/InvitationListItemFragment.graphql.ts b/apps/console/src/__generated__/iam/InvitationListItemFragment.graphql.ts deleted file mode 100644 index 99777cbaf..000000000 --- a/apps/console/src/__generated__/iam/InvitationListItemFragment.graphql.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @generated SignedSource<<0ea0836cf3619cc6dc1017ed5dd24cb0>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ReaderFragment } from 'relay-runtime'; -export type InvitationStatus = "ACCEPTED" | "EXPIRED" | "PENDING"; -export type MembershipRole = "ADMIN" | "AUDITOR" | "EMPLOYEE" | "OWNER" | "VIEWER"; -import { FragmentRefs } from "relay-runtime"; -export type InvitationListItemFragment$data = { - readonly acceptedAt: string | null | undefined; - readonly canDelete: boolean; - readonly createdAt: string; - readonly email: string; - readonly fullName: string; - readonly id: string; - readonly role: MembershipRole; - readonly status: InvitationStatus; - readonly " $fragmentType": "InvitationListItemFragment"; -}; -export type InvitationListItemFragment$key = { - readonly " $data"?: InvitationListItemFragment$data; - readonly " $fragmentSpreads": FragmentRefs<"InvitationListItemFragment">; -}; - -const node: ReaderFragment = { - "argumentDefinitions": [], - "kind": "Fragment", - "metadata": null, - "name": "InvitationListItemFragment", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "fullName", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "email", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "role", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "status", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "acceptedAt", - "storageKey": null - }, - { - "alias": "canDelete", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "iam:invitation:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"iam:invitation:delete\")" - } - ], - "type": "Invitation", - "abstractKey": null -}; - -(node as any).hash = "07748312ae877349e46cc169e5473408"; - -export default node; diff --git a/apps/console/src/__generated__/iam/InvitationListItem_DeleteInvitationMutation.graphql.ts b/apps/console/src/__generated__/iam/InvitationListItem_DeleteInvitationMutation.graphql.ts deleted file mode 100644 index e86a9f30d..000000000 --- a/apps/console/src/__generated__/iam/InvitationListItem_DeleteInvitationMutation.graphql.ts +++ /dev/null @@ -1,133 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type DeleteInvitationInput = { - invitationId: string; - organizationId: string; -}; -export type InvitationListItem_DeleteInvitationMutation$variables = { - connections: ReadonlyArray; - input: DeleteInvitationInput; -}; -export type InvitationListItem_DeleteInvitationMutation$data = { - readonly deleteInvitation: { - readonly deletedInvitationId: string; - } | null | undefined; -}; -export type InvitationListItem_DeleteInvitationMutation = { - response: InvitationListItem_DeleteInvitationMutation$data; - variables: InvitationListItem_DeleteInvitationMutation$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "connections" -}, -v1 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" -}, -v2 = [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } -], -v3 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedInvitationId", - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/) - ], - "kind": "Fragment", - "metadata": null, - "name": "InvitationListItem_DeleteInvitationMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "DeleteInvitationPayload", - "kind": "LinkedField", - "name": "deleteInvitation", - "plural": false, - "selections": [ - (v3/*: any*/) - ], - "storageKey": null - } - ], - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [ - (v1/*: any*/), - (v0/*: any*/) - ], - "kind": "Operation", - "name": "InvitationListItem_DeleteInvitationMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "DeleteInvitationPayload", - "kind": "LinkedField", - "name": "deleteInvitation", - "plural": false, - "selections": [ - (v3/*: any*/), - { - "alias": null, - "args": null, - "filters": null, - "handle": "deleteEdge", - "key": "", - "kind": "ScalarHandle", - "name": "deletedInvitationId", - "handleArgs": [ - { - "kind": "Variable", - "name": "connections", - "variableName": "connections" - } - ] - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "35736b4156c15bb9eeb863b4d40fc4e6", - "id": null, - "metadata": {}, - "name": "InvitationListItem_DeleteInvitationMutation", - "operationKind": "mutation", - "text": "mutation InvitationListItem_DeleteInvitationMutation(\n $input: DeleteInvitationInput!\n) {\n deleteInvitation(input: $input) {\n deletedInvitationId\n }\n}\n" - } -}; -})(); - -(node as any).hash = "2191c08f6c6bf5bace0d70a6481124bb"; - -export default node; diff --git a/apps/console/src/__generated__/iam/MembershipsDropdown_viewerFragment.graphql.ts b/apps/console/src/__generated__/iam/MembershipsDropdown_viewerFragment.graphql.ts deleted file mode 100644 index d2c4d5fdd..000000000 --- a/apps/console/src/__generated__/iam/MembershipsDropdown_viewerFragment.graphql.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @generated SignedSource<<842fffc896db6311ff3c5901eae70176>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ReaderFragment } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type MembershipsDropdown_viewerFragment$data = { - readonly pendingInvitations: { - readonly totalCount: number; - }; - readonly " $fragmentType": "MembershipsDropdown_viewerFragment"; -}; -export type MembershipsDropdown_viewerFragment$key = { - readonly " $data"?: MembershipsDropdown_viewerFragment$data; - readonly " $fragmentSpreads": FragmentRefs<"MembershipsDropdown_viewerFragment">; -}; - -const node: ReaderFragment = { - "argumentDefinitions": [], - "kind": "Fragment", - "metadata": null, - "name": "MembershipsDropdown_viewerFragment", - "selections": [ - { - "kind": "RequiredField", - "field": { - "alias": null, - "args": null, - "concreteType": "InvitationConnection", - "kind": "LinkedField", - "name": "pendingInvitations", - "plural": false, - "selections": [ - { - "kind": "RequiredField", - "field": { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "totalCount", - "storageKey": null - }, - "action": "THROW" - } - ], - "storageKey": null - }, - "action": "THROW" - } - ], - "type": "Identity", - "abstractKey": null -}; - -(node as any).hash = "96b64fbc2481273728051e42d74bc8b5"; - -export default node; diff --git a/apps/console/src/__generated__/iam/MembershipsPageQuery.graphql.ts b/apps/console/src/__generated__/iam/MembershipsPageQuery.graphql.ts index 1817c4797..e49b6b6ac 100644 --- a/apps/console/src/__generated__/iam/MembershipsPageQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/MembershipsPageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<68acd1fa60fc1efe40e3983441ae01da>> * @lightSyntaxTransform * @nogrep */ @@ -13,17 +13,7 @@ import { FragmentRefs } from "relay-runtime"; export type MembershipsPageQuery$variables = Record; export type MembershipsPageQuery$data = { readonly viewer: { - readonly pendingInvitations: { - readonly __id: string; - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; - readonly " $fragmentSpreads": FragmentRefs<"InvitationCardFragment">; - }; - }>; - }; readonly profiles: { - readonly __id: string; readonly edges: ReadonlyArray<{ readonly node: { readonly id: string; @@ -106,41 +96,13 @@ v5 = { ], "storageKey": null }, -v6 = { - "kind": "ClientExtension", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__id", - "storageKey": null - } - ] -}, -v7 = { - "kind": "Literal", - "name": "orderBy", - "value": { - "direction": "DESC", - "field": "CREATED_AT" - } -}, -v8 = { - "kind": "Literal", - "name": "first", - "value": 1000 -}, -v9 = [ - (v8/*: any*/), +v6 = [ + { + "kind": "Literal", + "name": "first", + "value": 1000 + }, (v0/*: any*/) -], -v10 = [ - "orderBy" -], -v11 = [ - (v8/*: any*/), - (v7/*: any*/) ]; return { "fragment": { @@ -241,65 +203,11 @@ return { }, "action": "THROW" }, - (v5/*: any*/), - (v6/*: any*/) + (v5/*: any*/) ], "storageKey": "__MembershipsPage_profiles_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" }, "action": "THROW" - }, - { - "kind": "RequiredField", - "field": { - "alias": "pendingInvitations", - "args": [ - (v7/*: any*/) - ], - "concreteType": "InvitationConnection", - "kind": "LinkedField", - "name": "__MembershipsPage_pendingInvitations_connection", - "plural": false, - "selections": [ - { - "kind": "RequiredField", - "field": { - "alias": null, - "args": null, - "concreteType": "InvitationEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Invitation", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v1/*: any*/), - { - "args": null, - "kind": "FragmentSpread", - "name": "InvitationCardFragment" - }, - (v3/*: any*/) - ], - "storageKey": null - }, - (v4/*: any*/) - ], - "storageKey": null - }, - "action": "THROW" - }, - (v5/*: any*/), - (v6/*: any*/) - ], - "storageKey": "__MembershipsPage_pendingInvitations_connection(orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})" - }, - "action": "THROW" } ], "storageKey": null @@ -326,7 +234,7 @@ return { "selections": [ { "alias": null, - "args": (v9/*: any*/), + "args": (v6/*: any*/), "concreteType": "ProfileConnection", "kind": "LinkedField", "name": "profiles", @@ -408,94 +316,21 @@ return { ], "storageKey": null }, - (v5/*: any*/), - (v6/*: any*/) + (v5/*: any*/) ], "storageKey": "profiles(first:1000,orderBy:{\"direction\":\"ASC\",\"field\":\"ORGANIZATION_NAME\"})" }, { "alias": null, - "args": (v9/*: any*/), - "filters": (v10/*: any*/), + "args": (v6/*: any*/), + "filters": [ + "orderBy" + ], "handle": "connection", "key": "MembershipsPage_profiles", "kind": "LinkedHandle", "name": "profiles" }, - { - "alias": null, - "args": (v11/*: any*/), - "concreteType": "InvitationConnection", - "kind": "LinkedField", - "name": "pendingInvitations", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "InvitationEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Invitation", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v1/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "role", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "Organization", - "kind": "LinkedField", - "name": "organization", - "plural": false, - "selections": [ - (v1/*: any*/), - (v2/*: any*/) - ], - "storageKey": null - }, - (v3/*: any*/) - ], - "storageKey": null - }, - (v4/*: any*/) - ], - "storageKey": null - }, - (v5/*: any*/), - (v6/*: any*/) - ], - "storageKey": "pendingInvitations(first:1000,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})" - }, - { - "alias": null, - "args": (v11/*: any*/), - "filters": (v10/*: any*/), - "handle": "connection", - "key": "MembershipsPage_pendingInvitations", - "kind": "LinkedHandle", - "name": "pendingInvitations" - }, (v1/*: any*/) ], "storageKey": null @@ -503,7 +338,7 @@ return { ] }, "params": { - "cacheID": "7bcb990f0e847ce0528d9df9ef6c1c94", + "cacheID": "d3ee4e9e305c7a2f57179cf540f4cd6c", "id": null, "metadata": { "connection": [ @@ -515,25 +350,16 @@ return { "viewer", "profiles" ] - }, - { - "count": null, - "cursor": null, - "direction": "forward", - "path": [ - "viewer", - "pendingInvitations" - ] } ] }, "name": "MembershipsPageQuery", "operationKind": "query", - "text": "query MembershipsPageQuery {\n viewer {\n profiles(first: 1000, orderBy: {direction: ASC, field: ORGANIZATION_NAME}) {\n edges {\n node {\n id\n membership {\n ...MembershipCardFragment\n id\n }\n organization {\n name\n ...MembershipCard_organizationFragment\n id\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n pendingInvitations(first: 1000, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n ...InvitationCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n }\n}\n\nfragment InvitationCardFragment on Invitation {\n id\n role\n createdAt\n organization {\n id\n name\n }\n}\n\nfragment MembershipCardFragment on Membership {\n lastSession {\n id\n expiresAt\n }\n}\n\nfragment MembershipCard_organizationFragment on Organization {\n id\n name\n logoUrl\n}\n" + "text": "query MembershipsPageQuery {\n viewer {\n profiles(first: 1000, orderBy: {direction: ASC, field: ORGANIZATION_NAME}) {\n edges {\n node {\n id\n membership {\n ...MembershipCardFragment\n id\n }\n organization {\n name\n ...MembershipCard_organizationFragment\n id\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n }\n}\n\nfragment MembershipCardFragment on Membership {\n lastSession {\n id\n expiresAt\n }\n}\n\nfragment MembershipCard_organizationFragment on Organization {\n id\n name\n logoUrl\n}\n" } }; })(); -(node as any).hash = "84f5ab240bec94caf75e9ae163117e3d"; +(node as any).hash = "c87fe091011b4d5e5bffe0309eb4211f"; export default node; diff --git a/apps/console/src/__generated__/iam/PeopleListFragment_RefetchQuery.graphql.ts b/apps/console/src/__generated__/iam/PeopleListFragment_RefetchQuery.graphql.ts index 025ce557f..2c37477d8 100644 --- a/apps/console/src/__generated__/iam/PeopleListFragment_RefetchQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/PeopleListFragment_RefetchQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -119,6 +119,64 @@ v13 = [ "name": "orderBy", "variableName": "order" } +], +v14 = [ + { + "kind": "Literal", + "name": "first", + "value": 1 + }, + { + "kind": "Literal", + "name": "orderBy", + "value": { + "direction": "DESC", + "field": "CREATED_AT" + } + } +], +v15 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null +}, +v16 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "cursor", + "storageKey": null +}, +v17 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "endCursor", + "storageKey": null +}, +v18 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null +}, +v19 = { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] +}, +v20 = [ + "orderBy" ]; return { "fragment": { @@ -243,20 +301,6 @@ return { "name": "fullName", "storageKey": null }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "kind", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "position", - "storageKey": null - }, { "alias": null, "args": null, @@ -285,19 +329,6 @@ return { "kind": "ScalarField", "name": "permission", "storageKey": "permission(action:\"iam:membership:update\")" - }, - { - "alias": "canDelete", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "iam:membership-profile:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"iam:membership-profile:delete\")" } ], "storageKey": null @@ -322,12 +353,80 @@ return { "storageKey": null }, { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null + "alias": "lastInvitation", + "args": (v14/*: any*/), + "concreteType": "InvitationConnection", + "kind": "LinkedField", + "name": "pendingInvitations", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "InvitationEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Invitation", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v12/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "expiresAt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "acceptedAt", + "storageKey": null + }, + (v15/*: any*/), + (v11/*: any*/) + ], + "storageKey": null + }, + (v16/*: any*/) + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + (v17/*: any*/), + (v18/*: any*/) + ], + "storageKey": null + }, + (v19/*: any*/) + ], + "storageKey": "pendingInvitations(first:1,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})" }, + { + "alias": "lastInvitation", + "args": (v14/*: any*/), + "filters": (v20/*: any*/), + "handle": "connection", + "key": "PeopleListItem_lastInvitation", + "kind": "LinkedHandle", + "name": "pendingInvitations" + }, + (v15/*: any*/), { "alias": "canUpdate", "args": [ @@ -341,17 +440,37 @@ return { "name": "permission", "storageKey": "permission(action:\"iam:membership-profile:update\")" }, + { + "alias": "canInvite", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "iam:invitation:create" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"iam:invitation:create\")" + }, + { + "alias": "canDelete", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "iam:membership-profile:delete" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"iam:membership-profile:delete\")" + }, (v11/*: any*/) ], "storageKey": null }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "cursor", - "storageKey": null - } + (v16/*: any*/) ], "storageKey": null }, @@ -363,20 +482,8 @@ return { "name": "pageInfo", "plural": false, "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "endCursor", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasNextPage", - "storageKey": null - }, + (v17/*: any*/), + (v18/*: any*/), { "alias": null, "args": null, @@ -394,27 +501,14 @@ return { ], "storageKey": null }, - { - "kind": "ClientExtension", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__id", - "storageKey": null - } - ] - } + (v19/*: any*/) ], "storageKey": null }, { "alias": null, "args": (v13/*: any*/), - "filters": [ - "orderBy" - ], + "filters": (v20/*: any*/), "handle": "connection", "key": "PeopleListFragment_profiles", "kind": "LinkedHandle", @@ -430,12 +524,12 @@ return { ] }, "params": { - "cacheID": "cc77d44877ae736c858e7458b525d75a", + "cacheID": "f25ca8641478e79fb2ccf6fa825fe042", "id": null, "metadata": {}, "name": "PeopleListFragment_RefetchQuery", "operationKind": "query", - "text": "query PeopleListFragment_RefetchQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 20\n $last: Int = null\n $order: ProfileOrder = {direction: ASC, field: FULL_NAME}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...PeopleListFragment_16fISc\n id\n }\n}\n\nfragment PeopleListFragment_16fISc on Organization {\n profiles(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n totalCount\n edges {\n node {\n id\n ...PeopleListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment PeopleListItemFragment on Profile {\n id\n source\n state\n fullName\n kind\n position\n membership {\n id\n role\n canUpdate: permission(action: \"iam:membership:update\")\n canDelete: permission(action: \"iam:membership-profile:delete\")\n }\n identity {\n email\n id\n }\n createdAt\n canUpdate: permission(action: \"iam:membership-profile:update\")\n}\n" + "text": "query PeopleListFragment_RefetchQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 20\n $last: Int = null\n $order: ProfileOrder = {direction: ASC, field: FULL_NAME}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...PeopleListFragment_16fISc\n id\n }\n}\n\nfragment PeopleListFragment_16fISc on Organization {\n profiles(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n totalCount\n edges {\n node {\n id\n ...PeopleListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment PeopleListItemFragment on Profile {\n id\n source\n state\n fullName\n membership {\n id\n role\n canUpdate: permission(action: \"iam:membership:update\")\n }\n identity {\n email\n id\n }\n lastInvitation: pendingInvitations(first: 1, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n expiresAt\n acceptedAt\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n createdAt\n canUpdate: permission(action: \"iam:membership-profile:update\")\n canInvite: permission(action: \"iam:invitation:create\")\n canDelete: permission(action: \"iam:membership-profile:delete\")\n}\n" } }; })(); diff --git a/apps/console/src/__generated__/iam/PeopleListItemFragment.graphql.ts b/apps/console/src/__generated__/iam/PeopleListItemFragment.graphql.ts index e8b587ae2..7492030e9 100644 --- a/apps/console/src/__generated__/iam/PeopleListItemFragment.graphql.ts +++ b/apps/console/src/__generated__/iam/PeopleListItemFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<67410bc0aa6e9426f4534a0938429b6e>> + * @generated SignedSource<<91bec60a40a9170868272814635ea3fa>> * @lightSyntaxTransform * @nogrep */ @@ -10,10 +10,11 @@ import { ReaderFragment } from 'relay-runtime'; export type MembershipRole = "ADMIN" | "AUDITOR" | "EMPLOYEE" | "OWNER" | "VIEWER"; -export type ProfileKind = "CONTRACTOR" | "EMPLOYEE" | "SERVICE_ACCOUNT"; export type ProfileState = "ACTIVE" | "INACTIVE"; import { FragmentRefs } from "relay-runtime"; export type PeopleListItemFragment$data = { + readonly canDelete: boolean; + readonly canInvite: boolean; readonly canUpdate: boolean; readonly createdAt: string; readonly fullName: string; @@ -21,14 +22,22 @@ export type PeopleListItemFragment$data = { readonly identity: { readonly email: string; }; - readonly kind: ProfileKind; + readonly lastInvitation: { + readonly __id: string; + readonly edges: ReadonlyArray<{ + readonly node: { + readonly acceptedAt: string | null | undefined; + readonly createdAt: string; + readonly expiresAt: string; + readonly id: string; + }; + }>; + }; readonly membership: { - readonly canDelete: boolean; readonly canUpdate: boolean; readonly id: string; readonly role: MembershipRole; }; - readonly position: string | null | undefined; readonly source: string; readonly state: ProfileState; readonly " $fragmentType": "PeopleListItemFragment"; @@ -45,11 +54,29 @@ var v0 = { "kind": "ScalarField", "name": "id", "storageKey": null +}, +v1 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null }; return { "argumentDefinitions": [], "kind": "Fragment", - "metadata": null, + "metadata": { + "connection": [ + { + "count": null, + "cursor": null, + "direction": "forward", + "path": [ + "lastInvitation" + ] + } + ] + }, "name": "PeopleListItemFragment", "selections": [ (v0/*: any*/), @@ -74,20 +101,6 @@ return { "name": "fullName", "storageKey": null }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "kind", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "position", - "storageKey": null - }, { "kind": "RequiredField", "field": { @@ -118,19 +131,6 @@ return { "kind": "ScalarField", "name": "permission", "storageKey": "permission(action:\"iam:membership:update\")" - }, - { - "alias": "canDelete", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "iam:membership-profile:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"iam:membership-profile:delete\")" } ], "storageKey": null @@ -160,12 +160,119 @@ return { "action": "THROW" }, { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null + "kind": "RequiredField", + "field": { + "alias": "lastInvitation", + "args": [ + { + "kind": "Literal", + "name": "orderBy", + "value": { + "direction": "DESC", + "field": "CREATED_AT" + } + } + ], + "concreteType": "InvitationConnection", + "kind": "LinkedField", + "name": "__PeopleListItem_lastInvitation_connection", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "InvitationEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Invitation", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "expiresAt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "acceptedAt", + "storageKey": null + }, + (v1/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "cursor", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "endCursor", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null + } + ], + "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] + } + ], + "storageKey": "__PeopleListItem_lastInvitation_connection(orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})" + }, + "action": "THROW" }, + (v1/*: any*/), { "alias": "canUpdate", "args": [ @@ -178,6 +285,32 @@ return { "kind": "ScalarField", "name": "permission", "storageKey": "permission(action:\"iam:membership-profile:update\")" + }, + { + "alias": "canInvite", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "iam:invitation:create" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"iam:invitation:create\")" + }, + { + "alias": "canDelete", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "iam:membership-profile:delete" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"iam:membership-profile:delete\")" } ], "type": "Profile", @@ -185,6 +318,6 @@ return { }; })(); -(node as any).hash = "ad9ed05edf606ec084c6f53462530b8b"; +(node as any).hash = "b276a06948260a9d89947b386c6392d1"; export default node; diff --git a/apps/console/src/__generated__/iam/InviteUserDialogMutation.graphql.ts b/apps/console/src/__generated__/iam/PeopleListItem_inviteMutation.graphql.ts similarity index 64% rename from apps/console/src/__generated__/iam/InviteUserDialogMutation.graphql.ts rename to apps/console/src/__generated__/iam/PeopleListItem_inviteMutation.graphql.ts index c8ac9a911..4242bb5b3 100644 --- a/apps/console/src/__generated__/iam/InviteUserDialogMutation.graphql.ts +++ b/apps/console/src/__generated__/iam/PeopleListItem_inviteMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<5c890fa68733de0a9a1b5475cd45b1a1>> * @lightSyntaxTransform * @nogrep */ @@ -9,34 +9,29 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type MembershipRole = "ADMIN" | "AUDITOR" | "EMPLOYEE" | "OWNER" | "VIEWER"; export type InviteUserInput = { organizationId: string; profileId: string; }; -export type InviteUserDialogMutation$variables = { +export type PeopleListItem_inviteMutation$variables = { connections: ReadonlyArray; input: InviteUserInput; }; -export type InviteUserDialogMutation$data = { +export type PeopleListItem_inviteMutation$data = { readonly inviteUser: { readonly invitationEdge: { readonly node: { readonly acceptedAt: string | null | undefined; - readonly canDelete: boolean; readonly createdAt: string; - readonly email: string; readonly expiresAt: string; - readonly fullName: string; readonly id: string; - readonly role: MembershipRole; }; }; } | null | undefined; }; -export type InviteUserDialogMutation = { - response: InviteUserDialogMutation$data; - variables: InviteUserDialogMutation$variables; +export type PeopleListItem_inviteMutation = { + response: PeopleListItem_inviteMutation$data; + variables: PeopleListItem_inviteMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -80,27 +75,6 @@ v3 = { "name": "id", "storageKey": null }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "email", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "fullName", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "role", - "storageKey": null - }, { "alias": null, "args": null, @@ -121,19 +95,6 @@ v3 = { "kind": "ScalarField", "name": "createdAt", "storageKey": null - }, - { - "alias": "canDelete", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "iam:invitation:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"iam:invitation:delete\")" } ], "storageKey": null @@ -149,7 +110,7 @@ return { ], "kind": "Fragment", "metadata": null, - "name": "InviteUserDialogMutation", + "name": "PeopleListItem_inviteMutation", "selections": [ { "alias": null, @@ -174,7 +135,7 @@ return { (v0/*: any*/) ], "kind": "Operation", - "name": "InviteUserDialogMutation", + "name": "PeopleListItem_inviteMutation", "selections": [ { "alias": null, @@ -207,16 +168,16 @@ return { ] }, "params": { - "cacheID": "685e0bc12871b33065d1fe03334110b6", + "cacheID": "adf65c15aebb17087c5701c9b83e6711", "id": null, "metadata": {}, - "name": "InviteUserDialogMutation", + "name": "PeopleListItem_inviteMutation", "operationKind": "mutation", - "text": "mutation InviteUserDialogMutation(\n $input: InviteUserInput!\n) {\n inviteUser(input: $input) {\n invitationEdge {\n node {\n id\n email\n fullName\n role\n expiresAt\n acceptedAt\n createdAt\n canDelete: permission(action: \"iam:invitation:delete\")\n }\n }\n }\n}\n" + "text": "mutation PeopleListItem_inviteMutation(\n $input: InviteUserInput!\n) {\n inviteUser(input: $input) {\n invitationEdge {\n node {\n id\n expiresAt\n acceptedAt\n createdAt\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "70766e9b81d0ade0f128fae2e15aac62"; +(node as any).hash = "7ce62bafa9a5ec7a965c048fe7ef1763"; export default node; diff --git a/apps/console/src/__generated__/iam/PeoplePageQuery.graphql.ts b/apps/console/src/__generated__/iam/PeoplePageQuery.graphql.ts index 2d9ab1102..99a650522 100644 --- a/apps/console/src/__generated__/iam/PeoplePageQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/PeoplePageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -17,15 +17,7 @@ export type PeoplePageQuery$data = { readonly organization: { readonly __typename: "Organization"; readonly canCreateUser: boolean; - readonly canInviteUser: boolean; - readonly invitations: { - readonly $updatableFragmentSpreads: FragmentRefs<"PeoplePage_invitationsTotalCountFragment">; - readonly totalCount: number | null | undefined; - }; - readonly profiles: { - readonly totalCount: number | null | undefined; - }; - readonly " $fragmentSpreads": FragmentRefs<"InvitationListFragment" | "PeopleListFragment">; + readonly " $fragmentSpreads": FragmentRefs<"PeopleListFragment">; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. @@ -73,136 +65,73 @@ v3 = { "storageKey": "permission(action:\"iam:membership-profile:create\")" }, v4 = { - "alias": "canInviteUser", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "iam:invitation:create" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"iam:invitation:create\")" -}, -v5 = { "kind": "Literal", "name": "first", "value": 20 }, -v6 = { +v5 = { "direction": "ASC", "field": "FULL_NAME" }, -v7 = [ - (v5/*: any*/), - { - "kind": "Literal", - "name": "orderBy", - "value": (v6/*: any*/) - } -], -v8 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "totalCount", - "storageKey": null -}, -v9 = { - "direction": "DESC", - "field": "CREATED_AT" -}, -v10 = [ - (v5/*: any*/), - { - "kind": "Literal", - "name": "orderBy", - "value": (v9/*: any*/) - } -], -v11 = { +v6 = { "alias": null, "args": null, "kind": "ScalarField", "name": "id", "storageKey": null }, -v12 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "fullName", - "storageKey": null -}, -v13 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "role", - "storageKey": null -}, -v14 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "email", - "storageKey": null -}, -v15 = { +v7 = [ + (v4/*: any*/), + { + "kind": "Literal", + "name": "orderBy", + "value": (v5/*: any*/) + } +], +v8 = [ + { + "kind": "Literal", + "name": "first", + "value": 1 + }, + { + "kind": "Literal", + "name": "orderBy", + "value": { + "direction": "DESC", + "field": "CREATED_AT" + } + } +], +v9 = { "alias": null, "args": null, "kind": "ScalarField", "name": "createdAt", "storageKey": null }, -v16 = { +v10 = { "alias": null, "args": null, "kind": "ScalarField", "name": "cursor", "storageKey": null }, -v17 = { +v11 = { "alias": null, "args": null, - "concreteType": "PageInfo", - "kind": "LinkedField", - "name": "pageInfo", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "endCursor", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasNextPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "hasPreviousPage", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "startCursor", - "storageKey": null - } - ], + "kind": "ScalarField", + "name": "endCursor", "storageKey": null }, -v18 = { +v12 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null +}, +v13 = { "kind": "ClientExtension", "selections": [ { @@ -214,7 +143,7 @@ v18 = { } ] }, -v19 = [ +v14 = [ "orderBy" ]; return { @@ -239,67 +168,17 @@ return { "kind": "InlineFragment", "selections": [ (v3/*: any*/), - (v4/*: any*/), - { - "kind": "RequiredField", - "field": { - "alias": null, - "args": (v7/*: any*/), - "concreteType": "ProfileConnection", - "kind": "LinkedField", - "name": "profiles", - "plural": false, - "selections": [ - (v8/*: any*/) - ], - "storageKey": "profiles(first:20,orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})" - }, - "action": "THROW" - }, { "args": [ - (v5/*: any*/), + (v4/*: any*/), { "kind": "Literal", "name": "order", - "value": (v6/*: any*/) + "value": (v5/*: any*/) } ], "kind": "FragmentSpread", "name": "PeopleListFragment" - }, - { - "kind": "RequiredField", - "field": { - "alias": null, - "args": (v10/*: any*/), - "concreteType": "InvitationConnection", - "kind": "LinkedField", - "name": "invitations", - "plural": false, - "selections": [ - (v8/*: any*/), - { - "args": null, - "kind": "FragmentSpread", - "name": "PeoplePage_invitationsTotalCountFragment" - } - ], - "storageKey": "invitations(first:20,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})" - }, - "action": "THROW" - }, - { - "args": [ - (v5/*: any*/), - { - "kind": "Literal", - "name": "order", - "value": (v9/*: any*/) - } - ], - "kind": "FragmentSpread", - "name": "InvitationListFragment" } ], "type": "Organization", @@ -329,12 +208,11 @@ return { "plural": false, "selections": [ (v2/*: any*/), - (v11/*: any*/), + (v6/*: any*/), { "kind": "InlineFragment", "selections": [ (v3/*: any*/), - (v4/*: any*/), { "alias": null, "args": (v7/*: any*/), @@ -343,7 +221,13 @@ return { "name": "profiles", "plural": false, "selections": [ - (v8/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "totalCount", + "storageKey": null + }, { "alias": null, "args": null, @@ -360,7 +244,7 @@ return { "name": "node", "plural": false, "selections": [ - (v11/*: any*/), + (v6/*: any*/), { "alias": null, "args": null, @@ -375,19 +259,11 @@ return { "name": "state", "storageKey": null }, - (v12/*: any*/), { "alias": null, "args": null, "kind": "ScalarField", - "name": "kind", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "position", + "name": "fullName", "storageKey": null }, { @@ -398,8 +274,14 @@ return { "name": "membership", "plural": false, "selections": [ - (v11/*: any*/), - (v13/*: any*/), + (v6/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "role", + "storageKey": null + }, { "alias": "canUpdate", "args": [ @@ -412,19 +294,6 @@ return { "kind": "ScalarField", "name": "permission", "storageKey": "permission(action:\"iam:membership:update\")" - }, - { - "alias": "canDelete", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "iam:membership-profile:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"iam:membership-profile:delete\")" } ], "storageKey": null @@ -437,12 +306,92 @@ return { "name": "identity", "plural": false, "selections": [ - (v14/*: any*/), - (v11/*: any*/) + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "email", + "storageKey": null + }, + (v6/*: any*/) ], "storageKey": null }, - (v15/*: any*/), + { + "alias": "lastInvitation", + "args": (v8/*: any*/), + "concreteType": "InvitationConnection", + "kind": "LinkedField", + "name": "pendingInvitations", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "InvitationEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Invitation", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v6/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "expiresAt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "acceptedAt", + "storageKey": null + }, + (v9/*: any*/), + (v2/*: any*/) + ], + "storageKey": null + }, + (v10/*: any*/) + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + (v11/*: any*/), + (v12/*: any*/) + ], + "storageKey": null + }, + (v13/*: any*/) + ], + "storageKey": "pendingInvitations(first:1,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})" + }, + { + "alias": "lastInvitation", + "args": (v8/*: any*/), + "filters": (v14/*: any*/), + "handle": "connection", + "key": "PeopleListItem_lastInvitation", + "kind": "LinkedHandle", + "name": "pendingInvitations" + }, + (v9/*: any*/), { "alias": "canUpdate", "args": [ @@ -456,72 +405,18 @@ return { "name": "permission", "storageKey": "permission(action:\"iam:membership-profile:update\")" }, - (v2/*: any*/) - ], - "storageKey": null - }, - (v16/*: any*/) - ], - "storageKey": null - }, - (v17/*: any*/), - (v18/*: any*/) - ], - "storageKey": "profiles(first:20,orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})" - }, - { - "alias": null, - "args": (v7/*: any*/), - "filters": (v19/*: any*/), - "handle": "connection", - "key": "PeopleListFragment_profiles", - "kind": "LinkedHandle", - "name": "profiles" - }, - { - "alias": null, - "args": (v10/*: any*/), - "concreteType": "InvitationConnection", - "kind": "LinkedField", - "name": "invitations", - "plural": false, - "selections": [ - (v8/*: any*/), - (v2/*: any*/), - { - "alias": null, - "args": null, - "concreteType": "InvitationEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Invitation", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v11/*: any*/), - (v12/*: any*/), - (v14/*: any*/), - (v13/*: any*/), { - "alias": null, - "args": null, + "alias": "canInvite", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "iam:invitation:create" + } + ], "kind": "ScalarField", - "name": "status", - "storageKey": null - }, - (v15/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "acceptedAt", - "storageKey": null + "name": "permission", + "storageKey": "permission(action:\"iam:invitation:create\")" }, { "alias": "canDelete", @@ -529,34 +424,60 @@ return { { "kind": "Literal", "name": "action", - "value": "iam:invitation:delete" + "value": "iam:membership-profile:delete" } ], "kind": "ScalarField", "name": "permission", - "storageKey": "permission(action:\"iam:invitation:delete\")" + "storageKey": "permission(action:\"iam:membership-profile:delete\")" }, (v2/*: any*/) ], "storageKey": null }, - (v16/*: any*/) + (v10/*: any*/) ], "storageKey": null }, - (v17/*: any*/), - (v18/*: any*/) + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + (v11/*: any*/), + (v12/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasPreviousPage", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "startCursor", + "storageKey": null + } + ], + "storageKey": null + }, + (v13/*: any*/) ], - "storageKey": "invitations(first:20,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})" + "storageKey": "profiles(first:20,orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})" }, { "alias": null, - "args": (v10/*: any*/), - "filters": (v19/*: any*/), + "args": (v7/*: any*/), + "filters": (v14/*: any*/), "handle": "connection", - "key": "InvitationListFragment_invitations", + "key": "PeopleListFragment_profiles", "kind": "LinkedHandle", - "name": "invitations" + "name": "profiles" } ], "type": "Organization", @@ -568,16 +489,16 @@ return { ] }, "params": { - "cacheID": "3aef3e0e345bd04d2432c7167c87aa8d", + "cacheID": "a5d551184b2abe39feea3dfb05bfe21d", "id": null, "metadata": {}, "name": "PeoplePageQuery", "operationKind": "query", - "text": "query PeoplePageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n canCreateUser: permission(action: \"iam:membership-profile:create\")\n canInviteUser: permission(action: \"iam:invitation:create\")\n profiles(first: 20, orderBy: {direction: ASC, field: FULL_NAME}) {\n totalCount\n }\n ...PeopleListFragment_8lnpd\n invitations(first: 20, orderBy: {direction: DESC, field: CREATED_AT}) {\n totalCount\n __typename\n }\n ...InvitationListFragment_1PypFi\n }\n id\n }\n}\n\nfragment InvitationListFragment_1PypFi on Organization {\n invitations(first: 20, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n ...InvitationListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment InvitationListItemFragment on Invitation {\n id\n fullName\n email\n role\n status\n createdAt\n acceptedAt\n canDelete: permission(action: \"iam:invitation:delete\")\n}\n\nfragment PeopleListFragment_8lnpd on Organization {\n profiles(first: 20, orderBy: {direction: ASC, field: FULL_NAME}) {\n totalCount\n edges {\n node {\n id\n ...PeopleListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment PeopleListItemFragment on Profile {\n id\n source\n state\n fullName\n kind\n position\n membership {\n id\n role\n canUpdate: permission(action: \"iam:membership:update\")\n canDelete: permission(action: \"iam:membership-profile:delete\")\n }\n identity {\n email\n id\n }\n createdAt\n canUpdate: permission(action: \"iam:membership-profile:update\")\n}\n" + "text": "query PeoplePageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n canCreateUser: permission(action: \"iam:membership-profile:create\")\n ...PeopleListFragment_8lnpd\n }\n id\n }\n}\n\nfragment PeopleListFragment_8lnpd on Organization {\n profiles(first: 20, orderBy: {direction: ASC, field: FULL_NAME}) {\n totalCount\n edges {\n node {\n id\n ...PeopleListItemFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment PeopleListItemFragment on Profile {\n id\n source\n state\n fullName\n membership {\n id\n role\n canUpdate: permission(action: \"iam:membership:update\")\n }\n identity {\n email\n id\n }\n lastInvitation: pendingInvitations(first: 1, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n expiresAt\n acceptedAt\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n createdAt\n canUpdate: permission(action: \"iam:membership-profile:update\")\n canInvite: permission(action: \"iam:invitation:create\")\n canDelete: permission(action: \"iam:membership-profile:delete\")\n}\n" } }; })(); -(node as any).hash = "a89fa762bef0dcc31d05543a782f9aaf"; +(node as any).hash = "096ed215c8310f05d842827b5f3aec68"; export default node; diff --git a/apps/console/src/__generated__/iam/PeoplePage_invitationsTotalCountFragment.graphql.ts b/apps/console/src/__generated__/iam/PeoplePage_invitationsTotalCountFragment.graphql.ts deleted file mode 100644 index adbd01279..000000000 --- a/apps/console/src/__generated__/iam/PeoplePage_invitationsTotalCountFragment.graphql.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @generated SignedSource<<8e60217d0397fc8690fc79915bdfdc6c>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ReaderFragment } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type PeoplePage_invitationsTotalCountFragment$data = { - totalCount: number | null | undefined; - readonly " $fragmentType": "PeoplePage_invitationsTotalCountFragment"; -}; -export type PeoplePage_invitationsTotalCountFragment$key = { - readonly " $data"?: PeoplePage_invitationsTotalCountFragment$data; - readonly $updatableFragmentSpreads: FragmentRefs<"PeoplePage_invitationsTotalCountFragment">; -}; - -const node: ReaderFragment = { - "argumentDefinitions": [], - "kind": "Fragment", - "metadata": null, - "name": "PeoplePage_invitationsTotalCountFragment", - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "totalCount", - "storageKey": null - } - ], - "type": "InvitationConnection", - "abstractKey": null -}; - -(node as any).hash = "8881fd3459c738d64d70370fd317fe5d"; - -export default node; diff --git a/apps/console/src/__generated__/iam/PersonForm_createMutation.graphql.ts b/apps/console/src/__generated__/iam/PersonForm_createMutation.graphql.ts index a85d55540..360409669 100644 --- a/apps/console/src/__generated__/iam/PersonForm_createMutation.graphql.ts +++ b/apps/console/src/__generated__/iam/PersonForm_createMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<5148e84724d7649be7a0ccf0fe813893>> + * @generated SignedSource<<85bf3907699ac605e0603c8d1ae6ef8b>> * @lightSyntaxTransform * @nogrep */ @@ -65,6 +65,28 @@ v3 = { "kind": "ScalarField", "name": "id", "storageKey": null +}, +v4 = [ + { + "kind": "Literal", + "name": "first", + "value": 1 + }, + { + "kind": "Literal", + "name": "orderBy", + "value": { + "direction": "DESC", + "field": "CREATED_AT" + } + } +], +v5 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null }; return { "fragment": { @@ -173,20 +195,6 @@ return { "name": "fullName", "storageKey": null }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "kind", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "position", - "storageKey": null - }, { "alias": null, "args": null, @@ -215,19 +223,6 @@ return { "kind": "ScalarField", "name": "permission", "storageKey": "permission(action:\"iam:membership:update\")" - }, - { - "alias": "canDelete", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "iam:membership-profile:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"iam:membership-profile:delete\")" } ], "storageKey": null @@ -252,12 +247,117 @@ return { "storageKey": null }, { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null + "alias": "lastInvitation", + "args": (v4/*: any*/), + "concreteType": "InvitationConnection", + "kind": "LinkedField", + "name": "pendingInvitations", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "InvitationEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Invitation", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "expiresAt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "acceptedAt", + "storageKey": null + }, + (v5/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "cursor", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "endCursor", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null + } + ], + "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] + } + ], + "storageKey": "pendingInvitations(first:1,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})" }, + { + "alias": "lastInvitation", + "args": (v4/*: any*/), + "filters": [ + "orderBy" + ], + "handle": "connection", + "key": "PeopleListItem_lastInvitation", + "kind": "LinkedHandle", + "name": "pendingInvitations" + }, + (v5/*: any*/), { "alias": "canUpdate", "args": [ @@ -270,6 +370,32 @@ return { "kind": "ScalarField", "name": "permission", "storageKey": "permission(action:\"iam:membership-profile:update\")" + }, + { + "alias": "canInvite", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "iam:invitation:create" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"iam:invitation:create\")" + }, + { + "alias": "canDelete", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "iam:membership-profile:delete" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"iam:membership-profile:delete\")" } ], "storageKey": null @@ -299,12 +425,12 @@ return { ] }, "params": { - "cacheID": "ff3f29c40614a067d108d55df828f7c0", + "cacheID": "afbd8ffc5b5ae7156a108a2d1b25440b", "id": null, "metadata": {}, "name": "PersonForm_createMutation", "operationKind": "mutation", - "text": "mutation PersonForm_createMutation(\n $input: CreateUserInput!\n) {\n createUser(input: $input) {\n profileEdge {\n node {\n ...PeopleListItemFragment\n id\n }\n }\n }\n}\n\nfragment PeopleListItemFragment on Profile {\n id\n source\n state\n fullName\n kind\n position\n membership {\n id\n role\n canUpdate: permission(action: \"iam:membership:update\")\n canDelete: permission(action: \"iam:membership-profile:delete\")\n }\n identity {\n email\n id\n }\n createdAt\n canUpdate: permission(action: \"iam:membership-profile:update\")\n}\n" + "text": "mutation PersonForm_createMutation(\n $input: CreateUserInput!\n) {\n createUser(input: $input) {\n profileEdge {\n node {\n ...PeopleListItemFragment\n id\n }\n }\n }\n}\n\nfragment PeopleListItemFragment on Profile {\n id\n source\n state\n fullName\n membership {\n id\n role\n canUpdate: permission(action: \"iam:membership:update\")\n }\n identity {\n email\n id\n }\n lastInvitation: pendingInvitations(first: 1, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n expiresAt\n acceptedAt\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n createdAt\n canUpdate: permission(action: \"iam:membership-profile:update\")\n canInvite: permission(action: \"iam:invitation:create\")\n canDelete: permission(action: \"iam:membership-profile:delete\")\n}\n" } }; })(); diff --git a/apps/console/src/__generated__/iam/ViewerMembershipLayoutQuery.graphql.ts b/apps/console/src/__generated__/iam/ViewerMembershipLayoutQuery.graphql.ts index 485235676..b42bcd1f3 100644 --- a/apps/console/src/__generated__/iam/ViewerMembershipLayoutQuery.graphql.ts +++ b/apps/console/src/__generated__/iam/ViewerMembershipLayoutQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<6bcbc60c4f6fe80fc82937a5f53ee509>> * @lightSyntaxTransform * @nogrep */ @@ -32,10 +32,6 @@ export type ViewerMembershipLayoutQuery$data = { }; readonly viewer: { readonly email: string; - readonly pendingInvitations: { - readonly totalCount: number; - }; - readonly " $fragmentSpreads": FragmentRefs<"MembershipsDropdown_viewerFragment">; }; }; export type ViewerMembershipLayoutQuery = { @@ -90,13 +86,6 @@ v6 = { "storageKey": null }, v7 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "totalCount", - "storageKey": null -}, -v8 = { "alias": null, "args": null, "kind": "ScalarField", @@ -200,32 +189,7 @@ return { "name": "viewer", "plural": false, "selections": [ - (v6/*: any*/), - { - "args": null, - "kind": "FragmentSpread", - "name": "MembershipsDropdown_viewerFragment" - }, - { - "kind": "RequiredField", - "field": { - "alias": null, - "args": null, - "concreteType": "InvitationConnection", - "kind": "LinkedField", - "name": "pendingInvitations", - "plural": false, - "selections": [ - { - "kind": "RequiredField", - "field": (v7/*: any*/), - "action": "THROW" - } - ], - "storageKey": null - }, - "action": "THROW" - } + (v6/*: any*/) ], "storageKey": null }, @@ -294,11 +258,11 @@ return { "name": "permission", "storageKey": "permission(action:\"iam:personal-api-key:list\")" }, - (v8/*: any*/) + (v7/*: any*/) ], "storageKey": null }, - (v8/*: any*/), + (v7/*: any*/), { "alias": null, "args": null, @@ -308,7 +272,7 @@ return { "plural": false, "selections": [ (v5/*: any*/), - (v8/*: any*/) + (v7/*: any*/) ], "storageKey": null } @@ -586,7 +550,7 @@ return { "type": "Organization", "abstractKey": null }, - (v8/*: any*/) + (v7/*: any*/) ], "storageKey": null }, @@ -599,35 +563,23 @@ return { "plural": false, "selections": [ (v6/*: any*/), - { - "alias": null, - "args": null, - "concreteType": "InvitationConnection", - "kind": "LinkedField", - "name": "pendingInvitations", - "plural": false, - "selections": [ - (v7/*: any*/) - ], - "storageKey": null - }, - (v8/*: any*/) + (v7/*: any*/) ], "storageKey": null } ] }, "params": { - "cacheID": "63f113e3848e77978d2caee55ca07ed4", + "cacheID": "4f0eae19e470f2dd64ac495cb2612a19", "id": null, "metadata": {}, "name": "ViewerMembershipLayoutQuery", "operationKind": "query", - "text": "query ViewerMembershipLayoutQuery(\n $organizationId: ID!\n $hideSidebar: Boolean!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n ...MembershipsDropdown_organizationFragment\n ...ViewerMembershipDropdownFragment\n ...SidebarFragment @skip(if: $hideSidebar)\n viewer {\n fullName\n membership {\n role\n id\n }\n id\n }\n }\n id\n }\n viewer {\n email\n ...MembershipsDropdown_viewerFragment\n pendingInvitations {\n totalCount\n }\n id\n }\n}\n\nfragment MembershipsDropdown_organizationFragment on Organization {\n name\n}\n\nfragment MembershipsDropdown_viewerFragment on Identity {\n pendingInvitations {\n totalCount\n }\n}\n\nfragment SidebarFragment on Organization {\n canListMeetings: permission(action: \"core:meeting:list\")\n canListTasks: permission(action: \"core:task:list\")\n canListMeasures: permission(action: \"core:measure:list\")\n canListRisks: permission(action: \"core:risk:list\")\n canListFrameworks: permission(action: \"core:framework:list\")\n canListMembers: permission(action: \"iam:membership:list\")\n canListVendors: permission(action: \"core:vendor:list\")\n canListDocuments: permission(action: \"core:document:list\")\n canListAssets: permission(action: \"core:asset:list\")\n canListData: permission(action: \"core:datum:list\")\n canListAudits: permission(action: \"core:audit:list\")\n canListNonconformities: permission(action: \"core:nonconformity:list\")\n canListObligations: permission(action: \"core:obligation:list\")\n canListContinualImprovements: permission(action: \"core:continual-improvement:list\")\n canListProcessingActivities: permission(action: \"core:processing-activity:list\")\n canListRightsRequests: permission(action: \"core:rights-request:list\")\n canListSnapshots: permission(action: \"core:snapshot:list\")\n canGetTrustCenter: permission(action: \"core:trust-center:get\")\n canUpdateOrganization: permission(action: \"iam:organization:update\")\n canListStatesOfApplicability: permission(action: \"core:state-of-applicability:list\")\n}\n\nfragment ViewerMembershipDropdownFragment on Organization {\n viewer {\n fullName\n identity {\n email\n canListAPIKeys: permission(action: \"iam:personal-api-key:list\")\n id\n }\n id\n }\n}\n" + "text": "query ViewerMembershipLayoutQuery(\n $organizationId: ID!\n $hideSidebar: Boolean!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n ...MembershipsDropdown_organizationFragment\n ...ViewerMembershipDropdownFragment\n ...SidebarFragment @skip(if: $hideSidebar)\n viewer {\n fullName\n membership {\n role\n id\n }\n id\n }\n }\n id\n }\n viewer {\n email\n id\n }\n}\n\nfragment MembershipsDropdown_organizationFragment on Organization {\n name\n}\n\nfragment SidebarFragment on Organization {\n canListMeetings: permission(action: \"core:meeting:list\")\n canListTasks: permission(action: \"core:task:list\")\n canListMeasures: permission(action: \"core:measure:list\")\n canListRisks: permission(action: \"core:risk:list\")\n canListFrameworks: permission(action: \"core:framework:list\")\n canListMembers: permission(action: \"iam:membership:list\")\n canListVendors: permission(action: \"core:vendor:list\")\n canListDocuments: permission(action: \"core:document:list\")\n canListAssets: permission(action: \"core:asset:list\")\n canListData: permission(action: \"core:datum:list\")\n canListAudits: permission(action: \"core:audit:list\")\n canListNonconformities: permission(action: \"core:nonconformity:list\")\n canListObligations: permission(action: \"core:obligation:list\")\n canListContinualImprovements: permission(action: \"core:continual-improvement:list\")\n canListProcessingActivities: permission(action: \"core:processing-activity:list\")\n canListRightsRequests: permission(action: \"core:rights-request:list\")\n canListSnapshots: permission(action: \"core:snapshot:list\")\n canGetTrustCenter: permission(action: \"core:trust-center:get\")\n canUpdateOrganization: permission(action: \"iam:organization:update\")\n canListStatesOfApplicability: permission(action: \"core:state-of-applicability:list\")\n}\n\nfragment ViewerMembershipDropdownFragment on Organization {\n viewer {\n fullName\n identity {\n email\n canListAPIKeys: permission(action: \"iam:personal-api-key:list\")\n id\n }\n id\n }\n}\n" } }; })(); -(node as any).hash = "1ca4734452833d75388f7409315cf715"; +(node as any).hash = "00ae11d725a9aacd5389ef00381faf98"; export default node; diff --git a/apps/console/src/pages/iam/auth/sign-up/SignUpFromInvitationPage.tsx b/apps/console/src/pages/iam/auth/ActivateAccountPage.tsx similarity index 89% rename from apps/console/src/pages/iam/auth/sign-up/SignUpFromInvitationPage.tsx rename to apps/console/src/pages/iam/auth/ActivateAccountPage.tsx index 51e5cfb38..1495c6b12 100644 --- a/apps/console/src/pages/iam/auth/sign-up/SignUpFromInvitationPage.tsx +++ b/apps/console/src/pages/iam/auth/ActivateAccountPage.tsx @@ -7,14 +7,15 @@ import { Link, useNavigate, useSearchParams } from "react-router"; import { graphql } from "relay-runtime"; import { z } from "zod"; +import type { ActivateAccountPageMutation } from "#/__generated__/iam/ActivateAccountPageMutation.graphql"; import { useFormWithSchema } from "#/hooks/useFormWithSchema"; -const signUpFromIvitationMutation = graphql` - mutation SignUpFromInvitationPageMutation( - $input: SignUpFromInvitationInput! +const activateAccountMutation = graphql` + mutation ActivateAccountPageMutation( + $input: ActivateAccountInput! ) { - signUpFromInvitation(input: $input) { - identity { + activateAccount(input: $input) { + profile { id } } @@ -28,7 +29,7 @@ const schema = z.object({ type FormData = z.infer; -export default function SignUpFromInvitationPage() { +export default function ActivateAccountPage() { const { __ } = useTranslate(); const { toast } = useToast(); const navigate = useNavigate(); @@ -44,7 +45,7 @@ export default function SignUpFromInvitationPage() { }, }); - const [signUpFromInvitation] = useMutation(signUpFromIvitationMutation); + const [activateAccount] = useMutation(activateAccountMutation); const onSubmit = (data: FormData) => { const token = searchParams.get("token"); @@ -57,7 +58,7 @@ export default function SignUpFromInvitationPage() { return; } - signUpFromInvitation({ + activateAccount({ variables: { input: { token, diff --git a/apps/console/src/pages/iam/auth/sign-up/SignUpPage.tsx b/apps/console/src/pages/iam/auth/SignUpPage.tsx similarity index 100% rename from apps/console/src/pages/iam/auth/sign-up/SignUpPage.tsx rename to apps/console/src/pages/iam/auth/SignUpPage.tsx diff --git a/apps/console/src/pages/iam/memberships/MembershipsPage.tsx b/apps/console/src/pages/iam/memberships/MembershipsPage.tsx index e6b1f3dc5..a9c9ec420 100644 --- a/apps/console/src/pages/iam/memberships/MembershipsPage.tsx +++ b/apps/console/src/pages/iam/memberships/MembershipsPage.tsx @@ -12,7 +12,6 @@ import { graphql, type PreloadedQuery, usePreloadedQuery } from "react-relay"; import type { MembershipsPageQuery } from "#/__generated__/iam/MembershipsPageQuery.graphql"; -import { InvitationCard } from "./_components/InvitationCard"; import { MembershipCard } from "./_components/MembershipCard"; export const membershipsPageQuery = graphql` @@ -24,7 +23,6 @@ export const membershipsPageQuery = graphql` ) @connection(key: "MembershipsPage_profiles") @required(action: THROW) { - __id edges @required(action: THROW) { node { id @@ -38,20 +36,6 @@ export const membershipsPageQuery = graphql` } } } - pendingInvitations( - first: 1000 - orderBy: { direction: DESC, field: CREATED_AT } - ) - @connection(key: "MembershipsPage_pendingInvitations") - @required(action: THROW) { - __id - edges @required(action: THROW) { - node { - id - ...InvitationCardFragment - } - } - } } } `; @@ -68,10 +52,6 @@ export function MembershipsPage(props: { const { viewer: { profiles: { edges: initialProfiles }, - pendingInvitations: { - __id: pendingInvitationsConnectionId, - edges: invitations, - }, }, } = usePreloadedQuery(membershipsPageQuery, queryRef); @@ -91,22 +71,6 @@ export function MembershipsPage(props: { {__("Select an organization")}
- {invitations.length > 0 && ( -
-

- {__("Pending invitations")} -

- {invitations.map(({ node }) => ( - - ))} -
- )} {initialProfiles.length > 0 && (

diff --git a/apps/console/src/pages/iam/memberships/_components/InvitationCard.tsx b/apps/console/src/pages/iam/memberships/_components/InvitationCard.tsx deleted file mode 100644 index 230fab119..000000000 --- a/apps/console/src/pages/iam/memberships/_components/InvitationCard.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import { formatDate, formatError } from "@probo/helpers"; -import { useTranslate } from "@probo/i18n"; -import { Button, Card, useToast } from "@probo/ui"; -import { useFragment, useMutation } from "react-relay"; -import { type DataID, graphql } from "relay-runtime"; - -import type { InvitationCardFragment$key } from "#/__generated__/iam/InvitationCardFragment.graphql"; -import type { InvitationCardMutation } from "#/__generated__/iam/InvitationCardMutation.graphql"; - -const fragment = graphql` - fragment InvitationCardFragment on Invitation { - id - role - createdAt - organization @required(action: THROW) { - id - name - } - } -`; - -const acceptMutation = graphql` - mutation InvitationCardMutation( - $input: AcceptInvitationInput! - # FIXME: profiles - # $membershipConnections: [ID!]! - $pendingInvitationConnections: [ID!]! - ) { - acceptInvitation(input: $input) { - invitation { - id @deleteEdge(connections: $pendingInvitationConnections) - } - membership { - id - ...MembershipCardFragment - } - } - } -`; - -interface InvitationCardProps { - pendingInvitationsConnectionId: DataID; - fKey: InvitationCardFragment$key; -} - -export function InvitationCard(props: InvitationCardProps) { - const { pendingInvitationsConnectionId, fKey } - = props; - - const { __ } = useTranslate(); - const { toast } = useToast(); - - const invitation = useFragment(fragment, fKey); - - const [acceptInvitation, isAccepting] - = useMutation(acceptMutation); - - const handleAccept = () => { - acceptInvitation({ - variables: { - input: { - invitationId: invitation.id, - }, - pendingInvitationConnections: [pendingInvitationsConnectionId], - }, - onCompleted: (_, e) => { - if (e) { - toast({ - title: __("Request failed"), - description: formatError(__("Cannot accept invitation"), e), - variant: "error", - }); - return; - } - }, - onError: (e) => { - toast({ - title: __("Request failed"), - description: e.message, - variant: "error", - }); - }, - }); - }; - - return ( - -
-
-

- {invitation.organization.name} -

-

- {__("Role")} - : - {invitation.role} -

-

- {__("Invited on")} - {" "} - {formatDate(invitation.createdAt)} -

-
- -
-
- ); -} diff --git a/apps/console/src/pages/iam/organizations/ViewerMembershipLayout.tsx b/apps/console/src/pages/iam/organizations/ViewerMembershipLayout.tsx index d946a1181..b8ffaeee0 100644 --- a/apps/console/src/pages/iam/organizations/ViewerMembershipLayout.tsx +++ b/apps/console/src/pages/iam/organizations/ViewerMembershipLayout.tsx @@ -1,8 +1,8 @@ import { useTranslate } from "@probo/i18n"; -import { Badge, Button, IconPeopleAdd, Layout, Skeleton } from "@probo/ui"; +import { Layout, Skeleton } from "@probo/ui"; import { Suspense } from "react"; import { graphql, type PreloadedQuery, usePreloadedQuery } from "react-relay"; -import { Link, Outlet } from "react-router"; +import { Outlet } from "react-router"; import type { ViewerMembershipLayoutQuery } from "#/__generated__/iam/ViewerMembershipLayoutQuery.graphql"; import { CoreRelayProvider } from "#/providers/CoreRelayProvider"; @@ -33,10 +33,6 @@ export const viewerMembershipLayoutQuery = graphql` } viewer @required(action: THROW) { email - ...MembershipsDropdown_viewerFragment - pendingInvitations @required(action: THROW) { - totalCount @required(action: THROW) - } } } `; @@ -61,24 +57,7 @@ export function ViewerMembershipLayout(props: { return ( - - {viewer.pendingInvitations.totalCount > 0 && ( - -

- {pendingInvitationCount > 0 && ( - - - - {__("Invitations")} - - {pendingInvitationCount} - - - - )} diff --git a/apps/console/src/pages/iam/organizations/people/PeoplePage.tsx b/apps/console/src/pages/iam/organizations/people/PeoplePage.tsx index 6ff7c85e4..3b9db1b92 100644 --- a/apps/console/src/pages/iam/organizations/people/PeoplePage.tsx +++ b/apps/console/src/pages/iam/organizations/people/PeoplePage.tsx @@ -1,5 +1,5 @@ import { useTranslate } from "@probo/i18n"; -import { Button, PageHeader, TabBadge, TabItem, Tabs } from "@probo/ui"; +import { Button, PageHeader } from "@probo/ui"; import { useState } from "react"; import { type PreloadedQuery, usePreloadedQuery } from "react-relay"; import { ConnectionHandler, type DataID, graphql } from "relay-runtime"; @@ -8,8 +8,6 @@ import type { PeoplePageQuery } from "#/__generated__/iam/PeoplePageQuery.graphq import { useOrganizationId } from "#/hooks/useOrganizationId"; import { AddPersonDialog } from "./_components/AddPersonDialog"; -import { InvitationList } from "./_components/InvitationList"; -import { InviteUserDialog } from "./_components/InviteUserDialog"; import { PeopleList } from "./_components/PeopleList"; export const peoplePageQuery = graphql` @@ -18,32 +16,13 @@ export const peoplePageQuery = graphql` __typename ... on Organization { canCreateUser: permission(action: "iam:membership-profile:create") - canInviteUser: permission(action: "iam:invitation:create") - profiles(first: 20, orderBy: { direction: ASC, field: FULL_NAME }) - @required(action: THROW) { - totalCount - } ...PeopleListFragment @arguments(first: 20, order: { direction: ASC, field: FULL_NAME }) - invitations(first: 20, orderBy: { direction: DESC, field: CREATED_AT }) - @required(action: THROW) { - totalCount - ...PeoplePage_invitationsTotalCountFragment - } - ...InvitationListFragment - @arguments(first: 20, order: { direction: DESC, field: CREATED_AT }) } } } `; -export const invitationCountFragment = graphql` - fragment PeoplePage_invitationsTotalCountFragment on InvitationConnection - @updatable { - totalCount - } -`; - export function PeoplePage(props: { queryRef: PreloadedQuery; }) { @@ -52,14 +31,11 @@ export function PeoplePage(props: { const organizationId = useOrganizationId(); const { __ } = useTranslate(); - const [activeTab, setActiveTab] = useState<"people" | "invitations">( - "people", - ); const [connectionId, setConnectionId] = useState( ConnectionHandler.getConnectionID( organizationId, "PeopleListFragment_profiles", - { orderBy: { direction: "ASC", field: "CREATED_AT" } }, + { orderBy: { direction: "ASC", field: "FULL_NAME" } }, ), ); @@ -71,14 +47,6 @@ export function PeoplePage(props: { throw new Error("node is of invalid type"); } - const [invitationListConnectionId, setInvitationListConnectionId] = useState( - ConnectionHandler.getConnectionID( - organizationId, - "InvitationListFragment_invitations", - { orderBy: { direction: "ASC", field: "CREATED_AT" } }, - ), - ); - return (
@@ -88,53 +56,13 @@ export function PeoplePage(props: { )} - {organization.canInviteUser && ( - - - - )} - - setActiveTab("people")} - > - {__("People")} - {(organization.profiles.totalCount ?? 0) > 0 && ( - {organization.profiles.totalCount} - )} - - setActiveTab("invitations")} - > - {__("Invitations")} - {(organization.invitations.totalCount ?? 0) > 0 && ( - {organization.invitations.totalCount} - )} - - -
- {activeTab === "people" && ( - - )} - - {activeTab === "invitations" && ( - - )} +
); diff --git a/apps/console/src/pages/iam/organizations/people/_components/InvitationList.tsx b/apps/console/src/pages/iam/organizations/people/_components/InvitationList.tsx deleted file mode 100644 index c5952e7db..000000000 --- a/apps/console/src/pages/iam/organizations/people/_components/InvitationList.tsx +++ /dev/null @@ -1,140 +0,0 @@ -import { useTranslate } from "@probo/i18n"; -import { Tbody, Td, Th, Thead, Tr } from "@probo/ui"; -import { type ComponentProps } from "react"; -import { ConnectionHandler, graphql, usePaginationFragment } from "react-relay"; - -import type { InvitationListFragment$key } from "#/__generated__/iam/InvitationListFragment.graphql"; -import type { InvitationListFragment_RefetchQuery } from "#/__generated__/iam/InvitationListFragment_RefetchQuery.graphql"; -import type { PeoplePage_invitationsTotalCountFragment$key } from "#/__generated__/iam/PeoplePage_invitationsTotalCountFragment.graphql"; -import { - type Order, - SortableTable, - SortableTh, -} from "#/components/SortableTable"; -import { useOrganizationId } from "#/hooks/useOrganizationId"; - -import { InvitationListItem } from "./InvitationListItem"; - -const fragment = graphql` - fragment InvitationListFragment on Organization - @refetchable(queryName: "InvitationListFragment_RefetchQuery") - @argumentDefinitions( - first: { type: "Int", defaultValue: 20 } - order: { - type: "InvitationOrder" - defaultValue: { direction: DESC, field: CREATED_AT } - } - after: { type: "CursorKey", defaultValue: null } - before: { type: "CursorKey", defaultValue: null } - last: { type: "Int", defaultValue: null } - ) { - invitations( - first: $first - after: $after - last: $last - before: $before - orderBy: $order - ) - @connection( - key: "InvitationListFragment_invitations" - filters: ["orderBy"] - ) - @required(action: THROW) { - __id - edges @required(action: THROW) { - node { - id - ...InvitationListItemFragment - } - } - } - } -`; - -export function InvitationList(props: { - fKey: InvitationListFragment$key; - onConnectionIdChange: (connectionId: string) => void; - totalCount: number; - totalCountFKey: PeoplePage_invitationsTotalCountFragment$key; -}) { - const { fKey, onConnectionIdChange, totalCount, totalCountFKey } = props; - - const organizationId = useOrganizationId(); - const { __ } = useTranslate(); - - const invitationsPagination = usePaginationFragment< - InvitationListFragment_RefetchQuery, - InvitationListFragment$key - >(fragment, fKey); - - const refetchInvitations = () => { - invitationsPagination.refetch({}, { fetchPolicy: "network-only" }); - }; - - const handleOrderChange = (order: Order) => { - onConnectionIdChange( - ConnectionHandler.getConnectionID( - organizationId, - "InvitationListFragment_invitations", - { orderBy: order }, - ), - ); - }; - - return ( - ["refetch"] - } - pageSize={20} - > - - - - {__("Name")} - - - {__("Email")} - - - {__("Role")} - - - {__("Invited")} - - {__("Status")} - - {__("Accepted at")} - - - - - - {totalCount === 0 - ? ( - - - {__("No invitations")} - - - ) - : ( - invitationsPagination.data.invitations.edges.map( - ({ node: invitation }) => ( - - ), - ) - )} - - - ); -} diff --git a/apps/console/src/pages/iam/organizations/people/_components/InvitationListItem.tsx b/apps/console/src/pages/iam/organizations/people/_components/InvitationListItem.tsx deleted file mode 100644 index 311eae9f6..000000000 --- a/apps/console/src/pages/iam/organizations/people/_components/InvitationListItem.tsx +++ /dev/null @@ -1,158 +0,0 @@ -import { sprintf } from "@probo/helpers"; -import { useTranslate } from "@probo/i18n"; -import { - Badge, - Button, - IconTrashCan, - Spinner, - Td, - Tr, - useConfirm, -} from "@probo/ui"; -import { clsx } from "clsx"; -import { useFragment } from "react-relay"; -import { graphql } from "relay-runtime"; - -import type { InvitationListItemFragment$key } from "#/__generated__/iam/InvitationListItemFragment.graphql"; -import type { PeoplePage_invitationsTotalCountFragment$key } from "#/__generated__/iam/PeoplePage_invitationsTotalCountFragment.graphql"; -import { useMutationWithToasts } from "#/hooks/useMutationWithToasts"; -import { useOrganizationId } from "#/hooks/useOrganizationId"; - -import { invitationCountFragment } from "../PeoplePage"; - -const fragment = graphql` - fragment InvitationListItemFragment on Invitation { - id - fullName - email - role - status - createdAt - acceptedAt - canDelete: permission(action: "iam:invitation:delete") - } -`; - -const deleteInvitationMutation = graphql` - mutation InvitationListItem_DeleteInvitationMutation( - $input: DeleteInvitationInput! - $connections: [ID!]! - ) { - deleteInvitation(input: $input) { - deletedInvitationId @deleteEdge(connections: $connections) - } - } -`; - -export function InvitationListItem(props: { - connectionId: string; - fKey: InvitationListItemFragment$key; - totalCountFKey: PeoplePage_invitationsTotalCountFragment$key; - onRefetch: () => void; -}) { - const { connectionId, fKey, totalCountFKey } = props; - - const organizationId = useOrganizationId(); - const { __ } = useTranslate(); - const confirm = useConfirm(); - - const invitation = useFragment( - fragment, - fKey, - ); - - const [deleteInvitation, isDeleting] = useMutationWithToasts( - deleteInvitationMutation, - { - successMessage: __("Invitation deleted successfully"), - errorMessage: __("Failed to delete invitation"), - }, - ); - - const handleDelete = () => { - confirm( - () => { - return deleteInvitation({ - variables: { - input: { - organizationId, - invitationId: invitation.id, - }, - connections: [connectionId], - }, - updater: (store) => { - const { updatableData } - = store.readUpdatableFragment( - invitationCountFragment, - totalCountFKey, - ); - - if (typeof updatableData.totalCount === "number") { - updatableData.totalCount -= 1; - } - }, - }); - }, - { - message: sprintf( - __("Are you sure you want to delete the invitation for %s?"), - invitation.fullName, - ), - }, - ); - }; - - return ( - - -
{invitation.fullName}
- - {invitation.email} - - {invitation.role} - - {new Date(invitation.createdAt).toLocaleDateString()} - - {invitation.status === "ACCEPTED" - ? ( - {__("Accepted")} - ) - : invitation.status === "EXPIRED" - ? ( - {__("Expired")} - ) - : ( - {__("Pending")} - )} - - - {invitation.acceptedAt - ? new Date(invitation.acceptedAt).toLocaleDateString() - : "-"} - - -
e.stopPropagation()} - > - {isDeleting - ? ( - - ) - : ( - invitation.canDelete - && invitation.status !== "ACCEPTED" && ( -
- - - ); -} diff --git a/apps/console/src/pages/iam/organizations/people/_components/InviteUserDialog.tsx b/apps/console/src/pages/iam/organizations/people/_components/InviteUserDialog.tsx deleted file mode 100644 index 3f5176546..000000000 --- a/apps/console/src/pages/iam/organizations/people/_components/InviteUserDialog.tsx +++ /dev/null @@ -1,206 +0,0 @@ -import { getAssignableRoles } from "@probo/helpers"; -import { useTranslate } from "@probo/i18n"; -import { - Button, - Dialog, - DialogContent, - DialogFooter, - Field, - Option, - Select, - useDialogRef, -} from "@probo/ui"; -import { type PropsWithChildren, use } from "react"; -import { Controller } from "react-hook-form"; -import { graphql } from "relay-runtime"; -import { z } from "zod"; - -import type { InviteUserDialogMutation } from "#/__generated__/iam/InviteUserDialogMutation.graphql"; -import type { PeoplePage_invitationsTotalCountFragment$key } from "#/__generated__/iam/PeoplePage_invitationsTotalCountFragment.graphql"; -import { useFormWithSchema } from "#/hooks/useFormWithSchema"; -import { useMutationWithToasts } from "#/hooks/useMutationWithToasts"; -import { useOrganizationId } from "#/hooks/useOrganizationId"; -import { CurrentUser } from "#/providers/CurrentUser"; - -import { invitationCountFragment } from "../PeoplePage"; - -const inviteMutation = graphql` - mutation InviteUserDialogMutation( - $input: InviteUserInput! - $connections: [ID!]! - ) { - inviteUser(input: $input) { - invitationEdge @prependEdge(connections: $connections) { - node { - id - email - fullName - role - expiresAt - acceptedAt - createdAt - canDelete: permission(action: "iam:invitation:delete") - } - } - } - } -`; - -// const totalCountFragment = graphql` -// fragment InviteUserDialog_totalCountFragment on InvitationConnection -// @updatable { -// totalCount -// } -// `; - -const schema = z.object({ - email: z.string().email(), - fullName: z.string(), - role: z - .enum(["OWNER", "ADMIN", "VIEWER", "AUDITOR", "EMPLOYEE"]) - .default("VIEWER"), -}); - -type InviteUserDialogProps = PropsWithChildren<{ - connectionId: string; - fKey: PeoplePage_invitationsTotalCountFragment$key; -}>; - -export function InviteUserDialog(props: InviteUserDialogProps) { - const { children, connectionId, fKey } = props; - - const organizationId = useOrganizationId(); - const { __ } = useTranslate(); - const dialogRef = useDialogRef(); - - const { role } = use(CurrentUser); - const [inviteUser, isInviting] - = useMutationWithToasts(inviteMutation, { - successMessage: __("Invitation sent successfully"), - errorMessage: __("Failed to send invitation"), - }); - - const assignableRoles = getAssignableRoles(role); - - const { register, handleSubmit, formState, reset, control } - = useFormWithSchema(schema, { - defaultValues: { role: "VIEWER" }, - }); - - const onSubmit = async (data: z.infer) => { - await inviteUser({ - variables: { - input: { - organizationId, - email: data.email, - fullName: data.fullName, - role: data.role, - }, - connections: [connectionId], - }, - onCompleted: () => { - reset(); - dialogRef.current?.close(); - }, - updater: (store) => { - const { updatableData } - = store.readUpdatableFragment( - invitationCountFragment, - fKey, - ); - - if (typeof updatableData.totalCount === "number") { - updatableData.totalCount += 1; - } - }, - }); - }; - - return ( - -
void handleSubmit(onSubmit)(e)}> - -

- Send an invitation to join your workspace. -

- - - - ( - <> - -
- {field.value === "OWNER" && ( -

{__("Full access to everything")}

- )} - {field.value === "ADMIN" && ( -

- {__( - "Full access except organization setup and API keys", - )} -

- )} - {field.value === "VIEWER" && ( -

{__("Read-only access")}

- )} - {field.value === "AUDITOR" && ( -

- {__( - "Read-only access without settings, tasks and meetings", - )} -

- )} - {field.value === "EMPLOYEE" && ( -

{__("Access to employee page")}

- )} -
- - )} - /> -
-
- - - -
-
- ); -} diff --git a/apps/console/src/pages/iam/organizations/people/_components/PeopleList.tsx b/apps/console/src/pages/iam/organizations/people/_components/PeopleList.tsx index d60a3f707..fe1520afe 100644 --- a/apps/console/src/pages/iam/organizations/people/_components/PeopleList.tsx +++ b/apps/console/src/pages/iam/organizations/people/_components/PeopleList.tsx @@ -43,8 +43,8 @@ const fragment = graphql` `; export function PeopleList(props: { - onConnectionIdChange: (connectionId: string) => void; fKey: PeopleListFragment$key; + onConnectionIdChange: (connectionId: string) => void; }) { const { fKey, onConnectionIdChange } = props; @@ -83,11 +83,10 @@ export function PeopleList(props: { {__("Name")} + {__("Status")} {__("Email")} - {__("Type")} {__("Role")} - {__("Joined")} - {__("Position")} + {__("Created on")} diff --git a/apps/console/src/pages/iam/organizations/people/_components/PeopleListItem.tsx b/apps/console/src/pages/iam/organizations/people/_components/PeopleListItem.tsx index 05e955725..8c4f07298 100644 --- a/apps/console/src/pages/iam/organizations/people/_components/PeopleListItem.tsx +++ b/apps/console/src/pages/iam/organizations/people/_components/PeopleListItem.tsx @@ -1,12 +1,14 @@ import { getAssignableRoles, sprintf } from "@probo/helpers"; import { useTranslate } from "@probo/i18n"; import { + ActionDropdown, Badge, Button, + DropdownItem, + IconMail, IconTrashCan, Option, Select, - Spinner, Td, Tr, useConfirm, @@ -16,6 +18,7 @@ import { use } from "react"; import { useFragment } from "react-relay"; import { type DataID, graphql } from "relay-runtime"; +import type { PeopleListItem_inviteMutation } from "#/__generated__/iam/PeopleListItem_inviteMutation.graphql"; import type { PeopleListItemFragment$key } from "#/__generated__/iam/PeopleListItemFragment.graphql"; import { useMutationWithToasts } from "#/hooks/useMutationWithToasts"; import { useOrganizationId } from "#/hooks/useOrganizationId"; @@ -27,19 +30,49 @@ const fragment = graphql` source state fullName - kind - position membership @required(action: THROW) { id role canUpdate: permission(action: "iam:membership:update") - canDelete: permission(action: "iam:membership-profile:delete") } identity @required(action: THROW) { email } + lastInvitation: pendingInvitations(first: 1, orderBy: { field: CREATED_AT, direction: DESC }) + @required(action: THROW) + @connection(key: "PeopleListItem_lastInvitation") { + __id + edges { + node { + id + expiresAt + acceptedAt + createdAt + } + } + } createdAt canUpdate: permission(action: "iam:membership-profile:update") + canInvite: permission(action: "iam:invitation:create") + canDelete: permission(action: "iam:membership-profile:delete") + } +`; + +const inviteUserMutation = graphql` + mutation PeopleListItem_inviteMutation( + $input: InviteUserInput! + $connections: [ID!]! + ) { + inviteUser(input: $input) { + invitationEdge @prependEdge(connections: $connections) { + node { + id + expiresAt + acceptedAt + createdAt + } + } + } } `; @@ -73,16 +106,22 @@ export function PeopleListItem(props: { const { fKey, connectionId } = props; const organizationId = useOrganizationId(); - const { __ } = useTranslate(); + const { __, dateTimeFormat } = useTranslate(); const confirm = useConfirm(); const { role } = use(CurrentUser); const availableRoles = getAssignableRoles(role); const profile = useFragment(fragment, fKey); + const lastInvitation = profile.lastInvitation.edges[0]?.node; const isInactive = profile.state === "INACTIVE"; + const [inviteUser, isInviting] + = useMutationWithToasts(inviteUserMutation, { + successMessage: __("Invitation sent successfully"), + errorMessage: __("Failed to send invitation"), + }); const [updateMembership, isUpdatingRole] = useMutationWithToasts( updateRoleMutation, { @@ -98,6 +137,29 @@ export function PeopleListItem(props: { }, ); + const handleInvite = () => { + confirm( + () => { + return inviteUser({ + variables: { + input: { + organizationId, + profileId: profile.id, + }, + connections: [profile.lastInvitation.__id], + }, + }); + }, + { + label: __("Send"), + variant: "primary", + message: sprintf( + __("Send the activation email to %s?"), + profile.fullName, + ), + }, + ); + }; const handleUpdateRole = async (role: string) => { await updateMembership({ variables: { @@ -109,7 +171,6 @@ export function PeopleListItem(props: { }, }); }; - const handleRemove = () => { confirm( () => { @@ -134,27 +195,35 @@ export function PeopleListItem(props: { return ( <> - + - -
- {profile.fullName} - {isInactive && {__("Inactive")}} -
+ > + {profile.fullName} + {profile.state} + +
{profile.identity.email} {profile.source}
- {profile.kind} - +