Fix uneeded assume + assume after invite accept
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<8c8ece60966bd2f39668d4ee4459ae86>>
|
* @generated SignedSource<<2d970c5558233522bbd695a075469cad>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,17 +9,27 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
|
import { FragmentRefs } from "relay-runtime";
|
||||||
export type AcceptInvitationInput = {
|
export type AcceptInvitationInput = {
|
||||||
invitationId: string;
|
invitationId: string;
|
||||||
};
|
};
|
||||||
export type InvitationCardMutation$variables = {
|
export type InvitationCardMutation$variables = {
|
||||||
input: AcceptInvitationInput;
|
input: AcceptInvitationInput;
|
||||||
|
membershipConnections: ReadonlyArray<string>;
|
||||||
|
pendingInvitationConnections: ReadonlyArray<string>;
|
||||||
};
|
};
|
||||||
export type InvitationCardMutation$data = {
|
export type InvitationCardMutation$data = {
|
||||||
readonly acceptInvitation: {
|
readonly acceptInvitation: {
|
||||||
|
readonly invitation: {
|
||||||
|
readonly id: string;
|
||||||
|
};
|
||||||
readonly membershipEdge: {
|
readonly membershipEdge: {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
|
readonly organization: {
|
||||||
|
readonly name: string;
|
||||||
|
} | null | undefined;
|
||||||
|
readonly " $fragmentSpreads": FragmentRefs<"MembershipCardFragment">;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} | null | undefined;
|
} | null | undefined;
|
||||||
@@ -35,23 +45,66 @@ var v0 = [
|
|||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
"kind": "LocalArgument",
|
"kind": "LocalArgument",
|
||||||
"name": "input"
|
"name": "input"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultValue": null,
|
||||||
|
"kind": "LocalArgument",
|
||||||
|
"name": "membershipConnections"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultValue": null,
|
||||||
|
"kind": "LocalArgument",
|
||||||
|
"name": "pendingInvitationConnections"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v1 = [
|
v1 = [
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": [
|
|
||||||
{
|
{
|
||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
"name": "input",
|
"name": "input",
|
||||||
"variableName": "input"
|
"variableName": "input"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
v2 = {
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "id",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
v3 = {
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "name",
|
||||||
|
"storageKey": null
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
"fragment": {
|
||||||
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
|
"kind": "Fragment",
|
||||||
|
"metadata": null,
|
||||||
|
"name": "InvitationCardMutation",
|
||||||
|
"selections": [
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": (v1/*: any*/),
|
||||||
"concreteType": "AcceptInvitationPayload",
|
"concreteType": "AcceptInvitationPayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "acceptInvitation",
|
"name": "acceptInvitation",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"concreteType": "Invitation",
|
||||||
|
"kind": "LinkedField",
|
||||||
|
"name": "invitation",
|
||||||
|
"plural": false,
|
||||||
|
"selections": [
|
||||||
|
(v2/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -68,11 +121,22 @@ v1 = [
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
|
(v2/*: any*/),
|
||||||
|
{
|
||||||
|
"args": null,
|
||||||
|
"kind": "FragmentSpread",
|
||||||
|
"name": "MembershipCardFragment"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"concreteType": "Organization",
|
||||||
"name": "id",
|
"kind": "LinkedField",
|
||||||
|
"name": "organization",
|
||||||
|
"plural": false,
|
||||||
|
"selections": [
|
||||||
|
(v3/*: any*/)
|
||||||
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -84,14 +148,7 @@ v1 = [
|
|||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
];
|
],
|
||||||
return {
|
|
||||||
"fragment": {
|
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
|
||||||
"kind": "Fragment",
|
|
||||||
"metadata": null,
|
|
||||||
"name": "InvitationCardMutation",
|
|
||||||
"selections": (v1/*: any*/),
|
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
},
|
},
|
||||||
@@ -100,19 +157,137 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "InvitationCardMutation",
|
"name": "InvitationCardMutation",
|
||||||
"selections": (v1/*: any*/)
|
"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": "MembershipEdge",
|
||||||
|
"kind": "LinkedField",
|
||||||
|
"name": "membershipEdge",
|
||||||
|
"plural": false,
|
||||||
|
"selections": [
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"concreteType": "Membership",
|
||||||
|
"kind": "LinkedField",
|
||||||
|
"name": "node",
|
||||||
|
"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
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"concreteType": "Organization",
|
||||||
|
"kind": "LinkedField",
|
||||||
|
"name": "organization",
|
||||||
|
"plural": false,
|
||||||
|
"selections": [
|
||||||
|
(v2/*: any*/),
|
||||||
|
(v3/*: any*/),
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "logoUrl",
|
||||||
|
"storageKey": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"filters": null,
|
||||||
|
"handle": "prependEdge",
|
||||||
|
"key": "",
|
||||||
|
"kind": "LinkedHandle",
|
||||||
|
"name": "membershipEdge",
|
||||||
|
"handleArgs": [
|
||||||
|
{
|
||||||
|
"kind": "Variable",
|
||||||
|
"name": "connections",
|
||||||
|
"variableName": "membershipConnections"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "592fad5ce23af0f457d7e0ccf5f7123f",
|
"cacheID": "15ed0089d35b0163252ef542a4b1b667",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "InvitationCardMutation",
|
"name": "InvitationCardMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation InvitationCardMutation(\n $input: AcceptInvitationInput!\n) {\n acceptInvitation(input: $input) {\n membershipEdge {\n node {\n id\n }\n }\n }\n}\n"
|
"text": "mutation InvitationCardMutation(\n $input: AcceptInvitationInput!\n) {\n acceptInvitation(input: $input) {\n invitation {\n id\n }\n membershipEdge {\n node {\n id\n ...MembershipCardFragment\n organization {\n name\n id\n }\n }\n }\n }\n}\n\nfragment MembershipCardFragment on Membership {\n lastSession {\n id\n expiresAt\n }\n organization {\n id\n name\n logoUrl\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "00a20b1db5dd8e98838c8c9659560bb9";
|
(node as any).hash = "587f3fc115f88830e5ee49759f3ab7b5";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<1be91c8373db8ffb1155cb6e52beda6c>>
|
* @generated SignedSource<<0f048726f7e7371223919d924fa15d54>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -23,6 +23,7 @@ export type MembershipCard_assumeMutation$data = {
|
|||||||
readonly membership: {
|
readonly membership: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly lastSession: {
|
readonly lastSession: {
|
||||||
|
readonly expiresAt: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
} | null | undefined;
|
} | null | undefined;
|
||||||
};
|
};
|
||||||
@@ -117,7 +118,14 @@ v3 = [
|
|||||||
"name": "lastSession",
|
"name": "lastSession",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/)
|
(v1/*: any*/),
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "expiresAt",
|
||||||
|
"storageKey": null
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
@@ -176,16 +184,16 @@ return {
|
|||||||
"selections": (v3/*: any*/)
|
"selections": (v3/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "100893dbb5b232a19f4b11bc51598bc8",
|
"cacheID": "d106c9d8a5a2c3256da2f1f83fb8fde7",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MembershipCard_assumeMutation",
|
"name": "MembershipCard_assumeMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MembershipCard_assumeMutation(\n $input: AssumeOrganizationSessionInput!\n) {\n assumeOrganizationSession(input: $input) {\n result {\n __typename\n ... on OrganizationSessionCreated {\n membership {\n id\n lastSession {\n id\n }\n }\n }\n ... on PasswordRequired {\n reason\n }\n ... on SAMLAuthenticationRequired {\n reason\n redirectUrl\n }\n }\n }\n}\n"
|
"text": "mutation MembershipCard_assumeMutation(\n $input: AssumeOrganizationSessionInput!\n) {\n assumeOrganizationSession(input: $input) {\n result {\n __typename\n ... on OrganizationSessionCreated {\n membership {\n id\n lastSession {\n id\n expiresAt\n }\n }\n }\n ... on PasswordRequired {\n reason\n }\n ... on SAMLAuthenticationRequired {\n reason\n redirectUrl\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "f44a07beefbecb0a564858272e3cd244";
|
(node as any).hash = "7acaa03357731962d7d29eb2c046660a";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<a3cc5c262b8a01f267eb2b549ab95a27>>
|
* @generated SignedSource<<4beff809268fb32711cc02699683b623>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -19,6 +19,15 @@ export type MembershipsDropdownMenuItem_assumeMutation$variables = {
|
|||||||
export type MembershipsDropdownMenuItem_assumeMutation$data = {
|
export type MembershipsDropdownMenuItem_assumeMutation$data = {
|
||||||
readonly assumeOrganizationSession: {
|
readonly assumeOrganizationSession: {
|
||||||
readonly result: {
|
readonly result: {
|
||||||
|
readonly __typename: "OrganizationSessionCreated";
|
||||||
|
readonly membership: {
|
||||||
|
readonly id: string;
|
||||||
|
readonly lastSession: {
|
||||||
|
readonly expiresAt: string;
|
||||||
|
readonly id: string;
|
||||||
|
} | null | undefined;
|
||||||
|
};
|
||||||
|
} | {
|
||||||
readonly __typename: "PasswordRequired";
|
readonly __typename: "PasswordRequired";
|
||||||
readonly reason: ReauthenticationReason;
|
readonly reason: ReauthenticationReason;
|
||||||
} | {
|
} | {
|
||||||
@@ -46,13 +55,20 @@ var v0 = [
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
v1 = {
|
v1 = {
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "id",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
v2 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "reason",
|
"name": "reason",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v2 = [
|
v3 = [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": [
|
"args": [
|
||||||
@@ -85,7 +101,45 @@ v2 = [
|
|||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/)
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"concreteType": "Membership",
|
||||||
|
"kind": "LinkedField",
|
||||||
|
"name": "membership",
|
||||||
|
"plural": false,
|
||||||
|
"selections": [
|
||||||
|
(v1/*: any*/),
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"concreteType": "Session",
|
||||||
|
"kind": "LinkedField",
|
||||||
|
"name": "lastSession",
|
||||||
|
"plural": false,
|
||||||
|
"selections": [
|
||||||
|
(v1/*: any*/),
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "expiresAt",
|
||||||
|
"storageKey": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "OrganizationSessionCreated",
|
||||||
|
"abstractKey": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "InlineFragment",
|
||||||
|
"selections": [
|
||||||
|
(v2/*: any*/)
|
||||||
],
|
],
|
||||||
"type": "PasswordRequired",
|
"type": "PasswordRequired",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -93,7 +147,7 @@ v2 = [
|
|||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -118,7 +172,7 @@ return {
|
|||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MembershipsDropdownMenuItem_assumeMutation",
|
"name": "MembershipsDropdownMenuItem_assumeMutation",
|
||||||
"selections": (v2/*: any*/),
|
"selections": (v3/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
},
|
},
|
||||||
@@ -127,19 +181,19 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MembershipsDropdownMenuItem_assumeMutation",
|
"name": "MembershipsDropdownMenuItem_assumeMutation",
|
||||||
"selections": (v2/*: any*/)
|
"selections": (v3/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "21ebf9c598bd39f2abcb0ace0d9c0c4b",
|
"cacheID": "96111606700d6d57e20584324fac44c3",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MembershipsDropdownMenuItem_assumeMutation",
|
"name": "MembershipsDropdownMenuItem_assumeMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MembershipsDropdownMenuItem_assumeMutation(\n $input: AssumeOrganizationSessionInput!\n) {\n assumeOrganizationSession(input: $input) {\n result {\n __typename\n ... on PasswordRequired {\n reason\n }\n ... on SAMLAuthenticationRequired {\n reason\n redirectUrl\n }\n }\n }\n}\n"
|
"text": "mutation MembershipsDropdownMenuItem_assumeMutation(\n $input: AssumeOrganizationSessionInput!\n) {\n assumeOrganizationSession(input: $input) {\n result {\n __typename\n ... on OrganizationSessionCreated {\n membership {\n id\n lastSession {\n id\n expiresAt\n }\n }\n }\n ... on PasswordRequired {\n reason\n }\n ... on SAMLAuthenticationRequired {\n reason\n redirectUrl\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "416f824d526d3f92797fec0eb9c2e590";
|
(node as any).hash = "706b7dd33f09edc34377a52682d85037";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<ab48c4d454e4f9fa4472a103b8144b7c>>
|
* @generated SignedSource<<1d247c2fede04c2292000421a9e49fa8>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -14,6 +14,7 @@ export type MembershipsPageQuery$variables = Record<PropertyKey, never>;
|
|||||||
export type MembershipsPageQuery$data = {
|
export type MembershipsPageQuery$data = {
|
||||||
readonly viewer: {
|
readonly viewer: {
|
||||||
readonly memberships: {
|
readonly memberships: {
|
||||||
|
readonly __id: string;
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@@ -25,6 +26,7 @@ export type MembershipsPageQuery$data = {
|
|||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
readonly pendingInvitations: {
|
readonly pendingInvitations: {
|
||||||
|
readonly __id: string;
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@@ -40,35 +42,93 @@ export type MembershipsPageQuery = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
var v0 = [
|
var v0 = {
|
||||||
{
|
|
||||||
"kind": "Literal",
|
|
||||||
"name": "first",
|
|
||||||
"value": 1000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "Literal",
|
"kind": "Literal",
|
||||||
"name": "orderBy",
|
"name": "orderBy",
|
||||||
"value": {
|
"value": {
|
||||||
"direction": "DESC",
|
"direction": "DESC",
|
||||||
"field": "CREATED_AT"
|
"field": "CREATED_AT"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
v1 = [
|
||||||
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
v1 = {
|
v2 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v2 = {
|
v3 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "name",
|
"name": "name",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
};
|
},
|
||||||
|
v4 = {
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "__typename",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
v5 = {
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "cursor",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
v6 = {
|
||||||
|
"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
|
||||||
|
},
|
||||||
|
v7 = {
|
||||||
|
"kind": "ClientExtension",
|
||||||
|
"selections": [
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "__id",
|
||||||
|
"storageKey": null
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
v8 = [
|
||||||
|
{
|
||||||
|
"kind": "Literal",
|
||||||
|
"name": "first",
|
||||||
|
"value": 1000
|
||||||
|
},
|
||||||
|
(v0/*: any*/)
|
||||||
|
],
|
||||||
|
v9 = [
|
||||||
|
"orderBy"
|
||||||
|
];
|
||||||
return {
|
return {
|
||||||
"fragment": {
|
"fragment": {
|
||||||
"argumentDefinitions": [],
|
"argumentDefinitions": [],
|
||||||
@@ -89,11 +149,11 @@ return {
|
|||||||
{
|
{
|
||||||
"kind": "RequiredField",
|
"kind": "RequiredField",
|
||||||
"field": {
|
"field": {
|
||||||
"alias": null,
|
"alias": "memberships",
|
||||||
"args": (v0/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": "MembershipConnection",
|
"concreteType": "MembershipConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "memberships",
|
"name": "__MembershipsPage_memberships_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -107,8 +167,6 @@ return {
|
|||||||
"plural": true,
|
"plural": true,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"kind": "RequiredField",
|
|
||||||
"field": {
|
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Membership",
|
"concreteType": "Membership",
|
||||||
@@ -116,7 +174,7 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
@@ -132,35 +190,37 @@ return {
|
|||||||
"name": "organization",
|
"name": "organization",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v2/*: any*/)
|
(v3/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
"action": "THROW"
|
"action": "THROW"
|
||||||
}
|
},
|
||||||
|
(v4/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v5/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
"action": "THROW"
|
"action": "THROW"
|
||||||
}
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
},
|
},
|
||||||
"action": "THROW"
|
(v6/*: any*/),
|
||||||
}
|
(v7/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": "memberships(first:1000,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
"storageKey": "__MembershipsPage_memberships_connection(orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
||||||
},
|
},
|
||||||
"action": "THROW"
|
"action": "THROW"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "RequiredField",
|
"kind": "RequiredField",
|
||||||
"field": {
|
"field": {
|
||||||
"alias": null,
|
"alias": "pendingInvitations",
|
||||||
"args": (v0/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": "InvitationConnection",
|
"concreteType": "InvitationConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "pendingInvitations",
|
"name": "__MembershipsPage_pendingInvitations_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -174,8 +234,6 @@ return {
|
|||||||
"plural": true,
|
"plural": true,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"kind": "RequiredField",
|
|
||||||
"field": {
|
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Invitation",
|
"concreteType": "Invitation",
|
||||||
@@ -183,24 +241,26 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "InvitationCardFragment"
|
"name": "InvitationCardFragment"
|
||||||
}
|
},
|
||||||
|
(v4/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v5/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
"action": "THROW"
|
"action": "THROW"
|
||||||
}
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
},
|
},
|
||||||
"action": "THROW"
|
(v6/*: any*/),
|
||||||
}
|
(v7/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": "pendingInvitations(first:1000,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
"storageKey": "__MembershipsPage_pendingInvitations_connection(orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
||||||
},
|
},
|
||||||
"action": "THROW"
|
"action": "THROW"
|
||||||
}
|
}
|
||||||
@@ -229,7 +289,7 @@ return {
|
|||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v0/*: any*/),
|
"args": (v8/*: any*/),
|
||||||
"concreteType": "MembershipConnection",
|
"concreteType": "MembershipConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "memberships",
|
"name": "memberships",
|
||||||
@@ -251,7 +311,7 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -260,7 +320,7 @@ return {
|
|||||||
"name": "lastSession",
|
"name": "lastSession",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -279,8 +339,8 @@ return {
|
|||||||
"name": "organization",
|
"name": "organization",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
|
||||||
(v2/*: any*/),
|
(v2/*: any*/),
|
||||||
|
(v3/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -290,19 +350,32 @@ return {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
},
|
||||||
|
(v4/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
},
|
||||||
|
(v5/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
},
|
||||||
|
(v6/*: any*/),
|
||||||
|
(v7/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": "memberships(first:1000,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
"storageKey": "memberships(first:1000,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v0/*: any*/),
|
"args": (v8/*: any*/),
|
||||||
|
"filters": (v9/*: any*/),
|
||||||
|
"handle": "connection",
|
||||||
|
"key": "MembershipsPage_memberships",
|
||||||
|
"kind": "LinkedHandle",
|
||||||
|
"name": "memberships"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": (v8/*: any*/),
|
||||||
"concreteType": "InvitationConnection",
|
"concreteType": "InvitationConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "pendingInvitations",
|
"name": "pendingInvitations",
|
||||||
@@ -324,7 +397,7 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -347,37 +420,71 @@ return {
|
|||||||
"name": "organization",
|
"name": "organization",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
(v2/*: any*/),
|
||||||
(v2/*: any*/)
|
(v3/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
},
|
||||||
|
(v4/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
},
|
||||||
|
(v5/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
},
|
||||||
|
(v6/*: any*/),
|
||||||
|
(v7/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": "pendingInvitations(first:1000,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
"storageKey": "pendingInvitations(first:1000,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
||||||
},
|
},
|
||||||
(v1/*: any*/)
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": (v8/*: any*/),
|
||||||
|
"filters": (v9/*: any*/),
|
||||||
|
"handle": "connection",
|
||||||
|
"key": "MembershipsPage_pendingInvitations",
|
||||||
|
"kind": "LinkedHandle",
|
||||||
|
"name": "pendingInvitations"
|
||||||
|
},
|
||||||
|
(v2/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "70ba2b8cec46ba8154cf7a6a51e03932",
|
"cacheID": "a3dc3f3e775fa02b7d181fa57ade06b9",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {
|
||||||
|
"connection": [
|
||||||
|
{
|
||||||
|
"count": null,
|
||||||
|
"cursor": null,
|
||||||
|
"direction": "forward",
|
||||||
|
"path": [
|
||||||
|
"viewer",
|
||||||
|
"memberships"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"count": null,
|
||||||
|
"cursor": null,
|
||||||
|
"direction": "forward",
|
||||||
|
"path": [
|
||||||
|
"viewer",
|
||||||
|
"pendingInvitations"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"name": "MembershipsPageQuery",
|
"name": "MembershipsPageQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query MembershipsPageQuery {\n viewer {\n memberships(first: 1000, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n ...MembershipCardFragment\n organization {\n name\n id\n }\n }\n }\n }\n pendingInvitations(first: 1000, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n ...InvitationCardFragment\n }\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 organization {\n id\n name\n logoUrl\n }\n}\n"
|
"text": "query MembershipsPageQuery {\n viewer {\n memberships(first: 1000, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n ...MembershipCardFragment\n organization {\n name\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 organization {\n id\n name\n logoUrl\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "4148521eb3eaba1670a2d181b6d2468f";
|
(node as any).hash = "b21b9cae0ab7a4afdf12fb6ae516b64e";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -17,9 +17,11 @@ export const membershipsPageQuery = graphql`
|
|||||||
query MembershipsPageQuery {
|
query MembershipsPageQuery {
|
||||||
viewer @required(action: THROW) {
|
viewer @required(action: THROW) {
|
||||||
memberships(first: 1000, orderBy: { direction: DESC, field: CREATED_AT })
|
memberships(first: 1000, orderBy: { direction: DESC, field: CREATED_AT })
|
||||||
|
@connection(key: "MembershipsPage_memberships")
|
||||||
@required(action: THROW) {
|
@required(action: THROW) {
|
||||||
|
__id
|
||||||
edges @required(action: THROW) {
|
edges @required(action: THROW) {
|
||||||
node @required(action: THROW) {
|
node {
|
||||||
id
|
id
|
||||||
...MembershipCardFragment
|
...MembershipCardFragment
|
||||||
organization @required(action: THROW) {
|
organization @required(action: THROW) {
|
||||||
@@ -31,9 +33,12 @@ export const membershipsPageQuery = graphql`
|
|||||||
pendingInvitations(
|
pendingInvitations(
|
||||||
first: 1000
|
first: 1000
|
||||||
orderBy: { direction: DESC, field: CREATED_AT }
|
orderBy: { direction: DESC, field: CREATED_AT }
|
||||||
) @required(action: THROW) {
|
)
|
||||||
|
@connection(key: "MembershipsPage_pendingInvitations")
|
||||||
|
@required(action: THROW) {
|
||||||
|
__id
|
||||||
edges @required(action: THROW) {
|
edges @required(action: THROW) {
|
||||||
node @required(action: THROW) {
|
node {
|
||||||
id
|
id
|
||||||
...InvitationCardFragment
|
...InvitationCardFragment
|
||||||
}
|
}
|
||||||
@@ -54,8 +59,11 @@ export function MembershipsPage(props: {
|
|||||||
const { queryRef } = props;
|
const { queryRef } = props;
|
||||||
const {
|
const {
|
||||||
viewer: {
|
viewer: {
|
||||||
memberships: { edges: initialMemberships },
|
memberships: { __id: membershipConnectionId, edges: initialMemberships },
|
||||||
pendingInvitations: { edges: invitations },
|
pendingInvitations: {
|
||||||
|
__id: pendingInvitationsConnectionId,
|
||||||
|
edges: invitations,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} = usePreloadedQuery<MembershipsPageQuery>(membershipsPageQuery, queryRef);
|
} = usePreloadedQuery<MembershipsPageQuery>(membershipsPageQuery, queryRef);
|
||||||
|
|
||||||
@@ -81,7 +89,14 @@ export function MembershipsPage(props: {
|
|||||||
{__("Pending invitations")}
|
{__("Pending invitations")}
|
||||||
</h2>
|
</h2>
|
||||||
{invitations.map(({ node }) => (
|
{invitations.map(({ node }) => (
|
||||||
<InvitationCard key={node.id} fKey={node} />
|
<InvitationCard
|
||||||
|
pendingInvitationsConnectionId={
|
||||||
|
pendingInvitationsConnectionId
|
||||||
|
}
|
||||||
|
membershipConnectionId={membershipConnectionId}
|
||||||
|
key={node.id}
|
||||||
|
fKey={node}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { formatDate, formatError } from "@probo/helpers";
|
import { formatDate, formatError } from "@probo/helpers";
|
||||||
import { useTranslate } from "@probo/i18n";
|
import { useTranslate } from "@probo/i18n";
|
||||||
import { Button, Card, useToast } from "@probo/ui";
|
import { Button, Card, useToast } from "@probo/ui";
|
||||||
import { graphql } from "relay-runtime";
|
import { graphql, type DataID } from "relay-runtime";
|
||||||
import { useFragment, useMutation } from "react-relay";
|
import { useFragment, useMutation } from "react-relay";
|
||||||
import type { InvitationCardFragment$key } from "/__generated__/iam/InvitationCardFragment.graphql";
|
import type { InvitationCardFragment$key } from "/__generated__/iam/InvitationCardFragment.graphql";
|
||||||
import { useNavigate } from "react-router";
|
import type { InvitationCardMutation } from "/__generated__/iam/InvitationCardMutation.graphql";
|
||||||
|
|
||||||
const fragment = graphql`
|
const fragment = graphql`
|
||||||
fragment InvitationCardFragment on Invitation {
|
fragment InvitationCardFragment on Invitation {
|
||||||
@@ -19,11 +19,22 @@ const fragment = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const acceptMutation = graphql`
|
const acceptMutation = graphql`
|
||||||
mutation InvitationCardMutation($input: AcceptInvitationInput!) {
|
mutation InvitationCardMutation(
|
||||||
|
$input: AcceptInvitationInput!
|
||||||
|
$membershipConnections: [ID!]!
|
||||||
|
$pendingInvitationConnections: [ID!]!
|
||||||
|
) {
|
||||||
acceptInvitation(input: $input) {
|
acceptInvitation(input: $input) {
|
||||||
membershipEdge {
|
invitation {
|
||||||
|
id @deleteEdge(connections: $pendingInvitationConnections)
|
||||||
|
}
|
||||||
|
membershipEdge @prependEdge(connections: $membershipConnections) {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
|
...MembershipCardFragment
|
||||||
|
organization {
|
||||||
|
name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,19 +42,22 @@ const acceptMutation = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
interface InvitationCardProps {
|
interface InvitationCardProps {
|
||||||
|
pendingInvitationsConnectionId: DataID;
|
||||||
|
membershipConnectionId: DataID;
|
||||||
fKey: InvitationCardFragment$key;
|
fKey: InvitationCardFragment$key;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function InvitationCard(props: InvitationCardProps) {
|
export function InvitationCard(props: InvitationCardProps) {
|
||||||
const { fKey } = props;
|
const { pendingInvitationsConnectionId, membershipConnectionId, fKey } =
|
||||||
|
props;
|
||||||
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
const invitation = useFragment<InvitationCardFragment$key>(fragment, fKey);
|
const invitation = useFragment<InvitationCardFragment$key>(fragment, fKey);
|
||||||
|
|
||||||
const [acceptInvitation, isAccepting] = useMutation(acceptMutation);
|
const [acceptInvitation, isAccepting] =
|
||||||
|
useMutation<InvitationCardMutation>(acceptMutation);
|
||||||
|
|
||||||
const handleAccept = () => {
|
const handleAccept = () => {
|
||||||
acceptInvitation({
|
acceptInvitation({
|
||||||
@@ -51,6 +65,8 @@ export function InvitationCard(props: InvitationCardProps) {
|
|||||||
input: {
|
input: {
|
||||||
invitationId: invitation.id,
|
invitationId: invitation.id,
|
||||||
},
|
},
|
||||||
|
pendingInvitationConnections: [pendingInvitationsConnectionId],
|
||||||
|
membershipConnections: [membershipConnectionId],
|
||||||
},
|
},
|
||||||
onCompleted: (_, e) => {
|
onCompleted: (_, e) => {
|
||||||
if (e) {
|
if (e) {
|
||||||
@@ -61,7 +77,6 @@ export function InvitationCard(props: InvitationCardProps) {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
navigate(`/organizations/${invitation.organization.id}`);
|
|
||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ const assumeOrganizationSessionMutation = graphql`
|
|||||||
id
|
id
|
||||||
lastSession {
|
lastSession {
|
||||||
id
|
id
|
||||||
|
expiresAt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,15 @@ const assumeOrganizationSessionMutation = graphql`
|
|||||||
assumeOrganizationSession(input: $input) {
|
assumeOrganizationSession(input: $input) {
|
||||||
result {
|
result {
|
||||||
__typename
|
__typename
|
||||||
|
... on OrganizationSessionCreated {
|
||||||
|
membership {
|
||||||
|
id
|
||||||
|
lastSession {
|
||||||
|
id
|
||||||
|
expiresAt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
... on PasswordRequired {
|
... on PasswordRequired {
|
||||||
reason
|
reason
|
||||||
}
|
}
|
||||||
@@ -67,6 +76,9 @@ export function MembershipsDropdownMenuItem(props: {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleAssumeOrganizationSession = useCallback(() => {
|
const handleAssumeOrganizationSession = useCallback(() => {
|
||||||
|
if (isAuthenticated) {
|
||||||
|
navigate(`/organizations/${organization.id}`);
|
||||||
|
} else {
|
||||||
assumeOrganizationSession({
|
assumeOrganizationSession({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
@@ -82,7 +94,7 @@ export function MembershipsDropdownMenuItem(props: {
|
|||||||
|
|
||||||
switch (result.__typename) {
|
switch (result.__typename) {
|
||||||
case "PasswordRequired":
|
case "PasswordRequired":
|
||||||
navigate("auth/login");
|
navigate("/auth/login");
|
||||||
break;
|
break;
|
||||||
case "SAMLAuthenticationRequired":
|
case "SAMLAuthenticationRequired":
|
||||||
window.location.href = result.redirectUrl;
|
window.location.href = result.redirectUrl;
|
||||||
@@ -92,7 +104,8 @@ export function MembershipsDropdownMenuItem(props: {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}, [assumeOrganizationSession, navigate, organization.id]);
|
}
|
||||||
|
}, [assumeOrganizationSession, navigate, organization.id, isAuthenticated]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownItem key={id} onClick={handleAssumeOrganizationSession}>
|
<DropdownItem key={id} onClick={handleAssumeOrganizationSession}>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export function ViewerMembershipDropdown(props: {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.location.reload();
|
window.location.href = "/auth/login";
|
||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ const badge = tv({
|
|||||||
|
|
||||||
export function Badge(props: Props) {
|
export function Badge(props: Props) {
|
||||||
const Component = props.asChild ? Slot : "div";
|
const Component = props.asChild ? Slot : "div";
|
||||||
const { size, variant, ...restProps } = props;
|
const { className, size, variant, ...restProps } = props;
|
||||||
return <Component {...restProps} className={badge({ size, variant })} />;
|
return (
|
||||||
|
<Component {...restProps} className={badge({ className, size, variant })} />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,17 +198,17 @@ func (s *AccountService) AcceptInvitation(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
identityID gid.GID,
|
identityID gid.GID,
|
||||||
invitationID gid.GID,
|
invitationID gid.GID,
|
||||||
) (*coredata.Membership, error) {
|
) (*coredata.Invitation, *coredata.Membership, error) {
|
||||||
var (
|
var (
|
||||||
now = time.Now()
|
now = time.Now()
|
||||||
membership = &coredata.Membership{}
|
membership = &coredata.Membership{}
|
||||||
|
invitation = &coredata.Invitation{}
|
||||||
)
|
)
|
||||||
|
|
||||||
err := s.pg.WithTx(
|
err := s.pg.WithTx(
|
||||||
ctx,
|
ctx,
|
||||||
func(tx pg.Conn) error {
|
func(tx pg.Conn) error {
|
||||||
identity := coredata.Identity{}
|
identity := coredata.Identity{}
|
||||||
invitation := coredata.Invitation{}
|
|
||||||
|
|
||||||
err := identity.LoadByID(ctx, tx, identityID)
|
err := identity.LoadByID(ctx, tx, identityID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -306,10 +306,10 @@ func (s *AccountService) AcceptInvitation(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return membership, nil
|
return invitation, membership, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *AccountService) ListPendingInvitations(
|
func (s *AccountService) ListPendingInvitations(
|
||||||
|
|||||||
@@ -829,6 +829,7 @@ type RemoveMemberPayload {
|
|||||||
|
|
||||||
type AcceptInvitationPayload {
|
type AcceptInvitationPayload {
|
||||||
membershipEdge: MembershipEdge!
|
membershipEdge: MembershipEdge!
|
||||||
|
invitation: Invitation!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteInvitationPayload {
|
type DeleteInvitationPayload {
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ type DirectiveRoot struct {
|
|||||||
|
|
||||||
type ComplexityRoot struct {
|
type ComplexityRoot struct {
|
||||||
AcceptInvitationPayload struct {
|
AcceptInvitationPayload struct {
|
||||||
|
Invitation func(childComplexity int) int
|
||||||
MembershipEdge func(childComplexity int) int
|
MembershipEdge func(childComplexity int) int
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -587,6 +588,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
|||||||
_ = ec
|
_ = ec
|
||||||
switch typeName + "." + field {
|
switch typeName + "." + field {
|
||||||
|
|
||||||
|
case "AcceptInvitationPayload.invitation":
|
||||||
|
if e.complexity.AcceptInvitationPayload.Invitation == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.AcceptInvitationPayload.Invitation(childComplexity), true
|
||||||
case "AcceptInvitationPayload.membershipEdge":
|
case "AcceptInvitationPayload.membershipEdge":
|
||||||
if e.complexity.AcceptInvitationPayload.MembershipEdge == nil {
|
if e.complexity.AcceptInvitationPayload.MembershipEdge == nil {
|
||||||
break
|
break
|
||||||
@@ -3096,6 +3103,7 @@ type RemoveMemberPayload {
|
|||||||
|
|
||||||
type AcceptInvitationPayload {
|
type AcceptInvitationPayload {
|
||||||
membershipEdge: MembershipEdge!
|
membershipEdge: MembershipEdge!
|
||||||
|
invitation: Invitation!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteInvitationPayload {
|
type DeleteInvitationPayload {
|
||||||
@@ -3930,6 +3938,57 @@ func (ec *executionContext) fieldContext_AcceptInvitationPayload_membershipEdge(
|
|||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _AcceptInvitationPayload_invitation(ctx context.Context, field graphql.CollectedField, obj *types.AcceptInvitationPayload) (ret graphql.Marshaler) {
|
||||||
|
return graphql.ResolveField(
|
||||||
|
ctx,
|
||||||
|
ec.OperationContext,
|
||||||
|
field,
|
||||||
|
ec.fieldContext_AcceptInvitationPayload_invitation,
|
||||||
|
func(ctx context.Context) (any, error) {
|
||||||
|
return obj.Invitation, nil
|
||||||
|
},
|
||||||
|
nil,
|
||||||
|
ec.marshalNInvitation2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconnectᚋv1ᚋtypesᚐInvitation,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) fieldContext_AcceptInvitationPayload_invitation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
|
fc = &graphql.FieldContext{
|
||||||
|
Object: "AcceptInvitationPayload",
|
||||||
|
Field: field,
|
||||||
|
IsMethod: false,
|
||||||
|
IsResolver: false,
|
||||||
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
|
switch field.Name {
|
||||||
|
case "id":
|
||||||
|
return ec.fieldContext_Invitation_id(ctx, field)
|
||||||
|
case "email":
|
||||||
|
return ec.fieldContext_Invitation_email(ctx, field)
|
||||||
|
case "fullName":
|
||||||
|
return ec.fieldContext_Invitation_fullName(ctx, field)
|
||||||
|
case "role":
|
||||||
|
return ec.fieldContext_Invitation_role(ctx, field)
|
||||||
|
case "expiresAt":
|
||||||
|
return ec.fieldContext_Invitation_expiresAt(ctx, field)
|
||||||
|
case "acceptedAt":
|
||||||
|
return ec.fieldContext_Invitation_acceptedAt(ctx, field)
|
||||||
|
case "createdAt":
|
||||||
|
return ec.fieldContext_Invitation_createdAt(ctx, field)
|
||||||
|
case "status":
|
||||||
|
return ec.fieldContext_Invitation_status(ctx, field)
|
||||||
|
case "organization":
|
||||||
|
return ec.fieldContext_Invitation_organization(ctx, field)
|
||||||
|
case "permission":
|
||||||
|
return ec.fieldContext_Invitation_permission(ctx, field)
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("no field named %q was found under type Invitation", field.Name)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _AssumeOrganizationSessionPayload_result(ctx context.Context, field graphql.CollectedField, obj *types.AssumeOrganizationSessionPayload) (ret graphql.Marshaler) {
|
func (ec *executionContext) _AssumeOrganizationSessionPayload_result(ctx context.Context, field graphql.CollectedField, obj *types.AssumeOrganizationSessionPayload) (ret graphql.Marshaler) {
|
||||||
return graphql.ResolveField(
|
return graphql.ResolveField(
|
||||||
ctx,
|
ctx,
|
||||||
@@ -7658,6 +7717,8 @@ func (ec *executionContext) fieldContext_Mutation_acceptInvitation(ctx context.C
|
|||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "membershipEdge":
|
case "membershipEdge":
|
||||||
return ec.fieldContext_AcceptInvitationPayload_membershipEdge(ctx, field)
|
return ec.fieldContext_AcceptInvitationPayload_membershipEdge(ctx, field)
|
||||||
|
case "invitation":
|
||||||
|
return ec.fieldContext_AcceptInvitationPayload_invitation(ctx, field)
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("no field named %q was found under type AcceptInvitationPayload", field.Name)
|
return nil, fmt.Errorf("no field named %q was found under type AcceptInvitationPayload", field.Name)
|
||||||
},
|
},
|
||||||
@@ -15154,6 +15215,11 @@ func (ec *executionContext) _AcceptInvitationPayload(ctx context.Context, sel as
|
|||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
out.Invalids++
|
out.Invalids++
|
||||||
}
|
}
|
||||||
|
case "invitation":
|
||||||
|
out.Values[i] = ec._AcceptInvitationPayload_invitation(ctx, field, obj)
|
||||||
|
if out.Values[i] == graphql.Null {
|
||||||
|
out.Invalids++
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
panic("unknown field " + strconv.Quote(field.Name))
|
panic("unknown field " + strconv.Quote(field.Name))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ type AcceptInvitationInput struct {
|
|||||||
|
|
||||||
type AcceptInvitationPayload struct {
|
type AcceptInvitationPayload struct {
|
||||||
MembershipEdge *MembershipEdge `json:"membershipEdge"`
|
MembershipEdge *MembershipEdge `json:"membershipEdge"`
|
||||||
|
Invitation *Invitation `json:"invitation"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AssumeOrganizationSessionInput struct {
|
type AssumeOrganizationSessionInput struct {
|
||||||
|
|||||||
@@ -1006,7 +1006,7 @@ func (r *mutationResolver) AcceptInvitation(ctx context.Context, input types.Acc
|
|||||||
|
|
||||||
identity := IdentityFromContext(ctx)
|
identity := IdentityFromContext(ctx)
|
||||||
|
|
||||||
membership, err := r.iam.AccountService.AcceptInvitation(ctx, identity.ID, input.InvitationID)
|
invitation, membership, err := r.iam.AccountService.AcceptInvitation(ctx, identity.ID, input.InvitationID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot accept invitation", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot accept invitation", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
@@ -1014,6 +1014,7 @@ func (r *mutationResolver) AcceptInvitation(ctx context.Context, input types.Acc
|
|||||||
|
|
||||||
return &types.AcceptInvitationPayload{
|
return &types.AcceptInvitationPayload{
|
||||||
MembershipEdge: types.NewMembershipEdge(membership, coredata.MembershipOrderFieldCreatedAt),
|
MembershipEdge: types.NewMembershipEdge(membership, coredata.MembershipOrderFieldCreatedAt),
|
||||||
|
Invitation: types.NewInvitation(invitation),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user