Add assigned people to a task

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-13 10:08:31 +01:00
parent 376edd927d
commit 8cbe08d136
15 changed files with 1881 additions and 61 deletions

View File

@@ -31,6 +31,9 @@ import {
FileText,
Image,
X,
UserPlus,
UserMinus,
User,
} from "lucide-react";
import { Card, CardContent } from "@/components/ui/card";
import { useToast } from "@/hooks/use-toast";
@@ -46,6 +49,11 @@ import {
DialogTrigger,
} from "@/components/ui/dialog";
import { Label } from "@/components/ui/label";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
import { Helmet } from "react-helmet-async";
import type { ControlOverviewPageQuery as ControlOverviewPageQueryType } from "./__generated__/ControlOverviewPageQuery.graphql";
@@ -54,6 +62,9 @@ import type { ControlOverviewPageCreateTaskMutation as ControlOverviewPageCreate
import type { ControlOverviewPageDeleteTaskMutation as ControlOverviewPageDeleteTaskMutationType } from "./__generated__/ControlOverviewPageDeleteTaskMutation.graphql";
import type { ControlOverviewPageUploadEvidenceMutation as ControlOverviewPageUploadEvidenceMutationType } from "./__generated__/ControlOverviewPageUploadEvidenceMutation.graphql";
import type { ControlOverviewPageDeleteEvidenceMutation as ControlOverviewPageDeleteEvidenceMutationType } from "./__generated__/ControlOverviewPageDeleteEvidenceMutation.graphql";
import type { ControlOverviewPageAssignTaskMutation as ControlOverviewPageAssignTaskMutationType } from "./__generated__/ControlOverviewPageAssignTaskMutation.graphql";
import type { ControlOverviewPageUnassignTaskMutation as ControlOverviewPageUnassignTaskMutationType } from "./__generated__/ControlOverviewPageUnassignTaskMutation.graphql";
import type { ControlOverviewPageOrganizationQuery$data } from "./__generated__/ControlOverviewPageOrganizationQuery.graphql";
import { Textarea } from "@/components/ui/textarea";
// Function to format ISO8601 duration to human-readable format
@@ -113,6 +124,11 @@ const controlOverviewPageQuery = graphql`
state
timeEstimate
version
assignedTo {
id
fullName
primaryEmailAddress
}
evidences(first: 50)
@connection(key: "ControlOverviewPage_evidences") {
__id
@@ -162,6 +178,11 @@ const createTaskMutation = graphql`
description
timeEstimate
state
assignedTo {
id
fullName
primaryEmailAddress
}
}
}
}
@@ -222,6 +243,57 @@ const getEvidenceFileUrlQuery = graphql`
}
`;
const assignTaskMutation = graphql`
mutation ControlOverviewPageAssignTaskMutation($input: AssignTaskInput!) {
assignTask(input: $input) {
task {
id
version
assignedTo {
id
fullName
primaryEmailAddress
}
}
}
}
`;
const unassignTaskMutation = graphql`
mutation ControlOverviewPageUnassignTaskMutation($input: UnassignTaskInput!) {
unassignTask(input: $input) {
task {
id
version
assignedTo {
id
fullName
primaryEmailAddress
}
}
}
}
`;
const organizationQuery = graphql`
query ControlOverviewPageOrganizationQuery($organizationId: ID!) {
organization: node(id: $organizationId) {
id
... on Organization {
peoples(first: 100) @connection(key: "ControlOverviewPage_peoples") {
edges {
node {
id
fullName
primaryEmailAddress
}
}
}
}
}
}
`;
function ControlOverviewPageContent({
queryRef,
}: {
@@ -236,6 +308,32 @@ function ControlOverviewPageContent({
const navigate = useNavigate();
const environment = useRelayEnvironment();
// Load organization data for people selector
const [organizationData, setOrganizationData] =
useState<ControlOverviewPageOrganizationQuery$data | null>(null);
useEffect(() => {
if (organizationId) {
fetchQuery(environment, organizationQuery, {
organizationId,
})
.toPromise()
.then((response) => {
setOrganizationData(
response as ControlOverviewPageOrganizationQuery$data
);
})
.catch((error) => {
console.error("Error fetching organization data:", error);
toast({
title: "Error",
description: "Failed to load people data",
variant: "destructive",
});
});
}
}, [organizationId, environment, toast]);
const formatImportance = (importance: string | undefined): string => {
if (!importance) return "";
@@ -304,6 +402,12 @@ function ControlOverviewPageContent({
useMutation<ControlOverviewPageDeleteEvidenceMutationType>(
deleteEvidenceMutation
);
const [assignTask] =
useMutation<ControlOverviewPageAssignTaskMutationType>(assignTaskMutation);
const [unassignTask] =
useMutation<ControlOverviewPageUnassignTaskMutationType>(
unassignTaskMutation
);
const [isCreateTaskOpen, setIsCreateTaskOpen] = useState(false);
const [newTaskName, setNewTaskName] = useState("");
@@ -354,6 +458,16 @@ function ControlOverviewPageContent({
taskId: string;
} | null>(null);
// Add state for people selector
const [peoplePopoverOpen, setPeoplePopoverOpen] = useState<{
[key: string]: boolean;
}>({});
// Add state for people search
const [peopleSearch, setPeopleSearch] = useState<{
[key: string]: string;
}>({});
const tasks = data.control.tasks?.edges.map((edge) => edge.node) || [];
const getEvidenceConnectionId = useCallback(
@@ -796,6 +910,57 @@ function ControlOverviewPageContent({
});
};
// Function to handle assigning a person to a task
const handleAssignPerson = (taskId: string, personId: string) => {
assignTask({
variables: {
input: {
taskId,
assignedToId: personId,
},
},
onCompleted: () => {
toast({
title: "Task assigned",
description: "Task has been assigned successfully.",
});
// Close the popover
setPeoplePopoverOpen((prev) => ({ ...prev, [taskId]: false }));
},
onError: (error) => {
toast({
title: "Error assigning task",
description: error.message,
variant: "destructive",
});
},
});
};
// Function to handle unassigning a person from a task
const handleUnassignPerson = (taskId: string) => {
unassignTask({
variables: {
input: {
taskId,
},
},
onCompleted: () => {
toast({
title: "Task unassigned",
description: "Task has been unassigned successfully.",
});
},
onError: (error) => {
toast({
title: "Error unassigning task",
description: error.message,
variant: "destructive",
});
},
});
};
return (
<>
<Helmet>
@@ -1015,25 +1180,21 @@ function ControlOverviewPageContent({
? "border-gray-400 bg-gray-100"
: "border-gray-300"
} ${isDraggingFile ? "opacity-50" : ""}`}
onClick={() =>
task?.id &&
task?.state &&
handleTaskClick(task.id, task.state, task.version)
}
onClick={(e) => {
e.stopPropagation();
if (task?.id && task?.state) {
handleTaskClick(task.id, task.state, task.version);
}
}}
>
{task?.state === "DONE" && (
<CheckCircle2 className="w-4 h-4 text-gray-500" />
)}
</div>
<div
className={`flex-1 flex items-center justify-between cursor-pointer ${
className={`flex-1 flex items-center justify-between ${
isDraggingFile ? "opacity-50" : ""
}`}
onClick={() =>
task?.id &&
task?.state &&
handleTaskClick(task.id, task.state, task.version)
}
>
<div>
<h3
@@ -1057,9 +1218,182 @@ function ControlOverviewPageContent({
<span>{formatDuration(task.timeEstimate)}</span>
</p>
)}
{task?.assignedTo && (
<p className="text-xs mt-1 flex items-center text-gray-600">
<User className="w-3 h-3 mr-1" />
<span>{task.assignedTo.fullName}</span>
</p>
)}
</div>
<div className="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
{/* People Selector */}
<Popover
open={peoplePopoverOpen[task?.id || ""]}
onOpenChange={(open: boolean) => {
if (task?.id) {
setPeoplePopoverOpen((prev) => ({
...prev,
[task.id]: open,
}));
}
}}
>
<PopoverTrigger asChild>
<button
type="button"
className="text-gray-400 hover:text-blue-600"
onClick={(e) => {
e.stopPropagation();
if (task?.id) {
setPeoplePopoverOpen((prev) => ({
...prev,
[task.id]: !prev[task.id],
}));
}
}}
>
{task?.assignedTo ? (
<UserMinus className="w-4 h-4" />
) : (
<UserPlus className="w-4 h-4" />
)}
</button>
</PopoverTrigger>
<PopoverContent className="w-[250px] p-0" align="end">
{task?.assignedTo ? (
<div className="p-4 space-y-4">
<div className="flex items-center gap-2">
<User className="w-4 h-4 text-gray-500" />
<div className="text-sm">
<p className="font-medium">
{task.assignedTo.fullName}
</p>
<p className="text-xs text-gray-500">
{task.assignedTo.primaryEmailAddress}
</p>
</div>
</div>
<Button
type="button"
variant="destructive"
size="sm"
className="w-full"
onClick={(e) => {
e.stopPropagation();
if (task?.id) {
handleUnassignPerson(task.id);
}
}}
>
<UserMinus className="w-4 h-4 mr-2" />
Unassign
</Button>
</div>
) : (
<div className="max-h-[300px] overflow-y-auto">
<div className="p-2 border-b">
<input
type="text"
placeholder="Search people to assign..."
className="w-full px-3 py-2 text-sm border rounded focus:outline-none focus:ring-2 focus:ring-blue-500"
value={peopleSearch[task?.id || ""] || ""}
onChange={(e) => {
if (task?.id) {
setPeopleSearch((prev) => ({
...prev,
[task.id]: e.target.value,
}));
}
}}
/>
</div>
<div className="px-3 py-2 text-xs text-gray-500">
Click on a person to assign them to this task
</div>
<div className="py-1">
{!organizationData?.organization?.peoples?.edges?.some(
(edge) => {
if (!edge?.node) return false;
const searchTerm = (
peopleSearch[task?.id || ""] || ""
).toLowerCase();
return (
!searchTerm ||
edge.node.fullName
.toLowerCase()
.includes(searchTerm) ||
edge.node.primaryEmailAddress
.toLowerCase()
.includes(searchTerm)
);
}
) && (
<div className="py-6 text-center text-sm">
No people found.
</div>
)}
{organizationData?.organization?.peoples?.edges?.map(
(edge) => {
if (!edge?.node) return null;
const searchTerm = (
peopleSearch[task?.id || ""] || ""
).toLowerCase();
if (
searchTerm &&
!edge.node.fullName
.toLowerCase()
.includes(searchTerm) &&
!edge.node.primaryEmailAddress
.toLowerCase()
.includes(searchTerm)
) {
return null;
}
return (
<div
key={edge.node.id}
className="px-2 py-1 hover:bg-blue-50 cursor-pointer"
>
<button
type="button"
className="flex items-center w-full text-left"
onClick={() => {
if (task?.id) {
handleAssignPerson(
task.id,
edge.node.id
);
setPeoplePopoverOpen((prev) => ({
...prev,
[task.id]: false,
}));
}
}}
>
<User className="mr-2 h-4 w-4 text-blue-500 flex-shrink-0" />
<div>
<p className="font-medium">
{edge.node.fullName}
</p>
<p className="text-xs text-gray-500">
{edge.node.primaryEmailAddress}
</p>
</div>
</button>
</div>
);
}
)}
</div>
</div>
)}
</PopoverContent>
</Popover>
<button
type="button"
className="text-gray-400 hover:text-blue-600"
onClick={(e) => {
e.stopPropagation();
@@ -1071,6 +1405,7 @@ function ControlOverviewPageContent({
<Upload className="w-4 h-4" />
</button>
<button
type="button"
className="text-gray-400 hover:text-red-600"
onClick={(e) => {
e.stopPropagation();

View File

@@ -99,6 +99,10 @@ function CreatePeoplePageContent() {
organizationId!,
"PeopleSelector_organization_peoples"
),
ConnectionHandler.getConnectionID(
organizationId!,
"ControlOverviewPage_peoples"
),
],
input: {
organizationId: organizationId!,

View File

@@ -0,0 +1,146 @@
/**
* @generated SignedSource<<bd1f2132960c1cdd84906d7de58765e9>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type AssignTaskInput = {
assignedToId: string;
taskId: string;
};
export type ControlOverviewPageAssignTaskMutation$variables = {
input: AssignTaskInput;
};
export type ControlOverviewPageAssignTaskMutation$data = {
readonly assignTask: {
readonly task: {
readonly assignedTo: {
readonly fullName: string;
readonly id: string;
readonly primaryEmailAddress: string;
} | null | undefined;
readonly id: string;
readonly version: number;
};
};
};
export type ControlOverviewPageAssignTaskMutation = {
response: ControlOverviewPageAssignTaskMutation$data;
variables: ControlOverviewPageAssignTaskMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v2 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "AssignTaskPayload",
"kind": "LinkedField",
"name": "assignTask",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Task",
"kind": "LinkedField",
"name": "task",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "version",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "People",
"kind": "LinkedField",
"name": "assignedTo",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "primaryEmailAddress",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ControlOverviewPageAssignTaskMutation",
"selections": (v2/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ControlOverviewPageAssignTaskMutation",
"selections": (v2/*: any*/)
},
"params": {
"cacheID": "2a75b40af9d9853b851d153595dc1317",
"id": null,
"metadata": {},
"name": "ControlOverviewPageAssignTaskMutation",
"operationKind": "mutation",
"text": "mutation ControlOverviewPageAssignTaskMutation(\n $input: AssignTaskInput!\n) {\n assignTask(input: $input) {\n task {\n id\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "02f3b1fb21bc39cea7fde9cc3945adc6";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<502600204c0e5180095f00fe3372ea5a>>
* @generated SignedSource<<1b8a07c3040e6ae6265d0b4eabc394ad>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,6 +11,7 @@
import { ConcreteRequest } from 'relay-runtime';
export type TaskState = "DONE" | "TODO";
export type CreateTaskInput = {
assignedToId?: string | null | undefined;
controlId: string;
description: string;
name: string;
@@ -24,6 +25,11 @@ export type ControlOverviewPageCreateTaskMutation$data = {
readonly createTask: {
readonly taskEdge: {
readonly node: {
readonly assignedTo: {
readonly fullName: string;
readonly id: string;
readonly primaryEmailAddress: string;
} | null | undefined;
readonly description: string;
readonly id: string;
readonly name: string;
@@ -57,6 +63,13 @@ v2 = [
}
],
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v4 = {
"alias": null,
"args": null,
"concreteType": "TaskEdge",
@@ -72,13 +85,7 @@ v3 = {
"name": "node",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
(v3/*: any*/),
{
"alias": null,
"args": null,
@@ -106,6 +113,32 @@ v3 = {
"kind": "ScalarField",
"name": "state",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "People",
"kind": "LinkedField",
"name": "assignedTo",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "primaryEmailAddress",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
@@ -131,7 +164,7 @@ return {
"name": "createTask",
"plural": false,
"selections": [
(v3/*: any*/)
(v4/*: any*/)
],
"storageKey": null
}
@@ -156,7 +189,7 @@ return {
"name": "createTask",
"plural": false,
"selections": [
(v3/*: any*/),
(v4/*: any*/),
{
"alias": null,
"args": null,
@@ -179,16 +212,16 @@ return {
]
},
"params": {
"cacheID": "ed1842681cbb14392603c1b73e82b6f9",
"cacheID": "7e8741b4f438fecdf0d991843d0e206a",
"id": null,
"metadata": {},
"name": "ControlOverviewPageCreateTaskMutation",
"operationKind": "mutation",
"text": "mutation ControlOverviewPageCreateTaskMutation(\n $input: CreateTaskInput!\n) {\n createTask(input: $input) {\n taskEdge {\n node {\n id\n name\n description\n timeEstimate\n state\n }\n }\n }\n}\n"
"text": "mutation ControlOverviewPageCreateTaskMutation(\n $input: CreateTaskInput!\n) {\n createTask(input: $input) {\n taskEdge {\n node {\n id\n name\n description\n timeEstimate\n state\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "d2e06ccdb00312c0862187a18f374d23";
(node as any).hash = "1622754b77775d1662f4cb6af68ca775";
export default node;

View File

@@ -0,0 +1,254 @@
/**
* @generated SignedSource<<50244c085e737eefef310f74fe8808a3>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type ControlOverviewPageOrganizationQuery$variables = {
organizationId: string;
};
export type ControlOverviewPageOrganizationQuery$data = {
readonly organization: {
readonly id: string;
readonly peoples?: {
readonly edges: ReadonlyArray<{
readonly node: {
readonly fullName: string;
readonly id: string;
readonly primaryEmailAddress: string;
};
}>;
};
};
};
export type ControlOverviewPageOrganizationQuery = {
response: ControlOverviewPageOrganizationQuery$data;
variables: ControlOverviewPageOrganizationQuery$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "organizationId"
}
],
v1 = [
{
"kind": "Variable",
"name": "id",
"variableName": "organizationId"
}
],
v2 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v4 = [
{
"alias": null,
"args": null,
"concreteType": "PeopleEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "People",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "primaryEmailAddress",
"storageKey": null
},
(v3/*: 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
}
],
"storageKey": null
}
],
v5 = [
{
"kind": "Literal",
"name": "first",
"value": 100
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ControlOverviewPageOrganizationQuery",
"selections": [
{
"alias": "organization",
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{
"alias": "peoples",
"args": null,
"concreteType": "PeopleConnection",
"kind": "LinkedField",
"name": "__ControlOverviewPage_peoples_connection",
"plural": false,
"selections": (v4/*: any*/),
"storageKey": null
}
],
"type": "Organization",
"abstractKey": null
}
],
"storageKey": null
}
],
"type": "Query",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ControlOverviewPageOrganizationQuery",
"selections": [
{
"alias": "organization",
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
(v2/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{
"alias": null,
"args": (v5/*: any*/),
"concreteType": "PeopleConnection",
"kind": "LinkedField",
"name": "peoples",
"plural": false,
"selections": (v4/*: any*/),
"storageKey": "peoples(first:100)"
},
{
"alias": null,
"args": (v5/*: any*/),
"filters": null,
"handle": "connection",
"key": "ControlOverviewPage_peoples",
"kind": "LinkedHandle",
"name": "peoples"
}
],
"type": "Organization",
"abstractKey": null
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "2a407ffb628c6c0465efe741ba990440",
"id": null,
"metadata": {
"connection": [
{
"count": null,
"cursor": null,
"direction": "forward",
"path": [
"organization",
"peoples"
]
}
]
},
"name": "ControlOverviewPageOrganizationQuery",
"operationKind": "query",
"text": "query ControlOverviewPageOrganizationQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n peoples(first: 100) {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "ba314af121e5a3d44f9001a7ada7a89a";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<1a0065809cf4bdeff6f4bb7ff087cdf7>>
* @generated SignedSource<<8f9fcd90d577e5e9f1b7ac31bbc1a14c>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -28,6 +28,11 @@ export type ControlOverviewPageQuery$data = {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly assignedTo: {
readonly fullName: string;
readonly id: string;
readonly primaryEmailAddress: string;
} | null | undefined;
readonly description: string;
readonly evidences: {
readonly __id: string;
@@ -131,18 +136,44 @@ v9 = {
v10 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"concreteType": "People",
"kind": "LinkedField",
"name": "assignedTo",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "primaryEmailAddress",
"storageKey": null
}
],
"storageKey": null
},
v11 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"name": "__typename",
"storageKey": null
},
v12 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
},
v13 = {
"alias": null,
"args": null,
"concreteType": "PageInfo",
@@ -167,7 +198,7 @@ v12 = {
],
"storageKey": null
},
v13 = {
v14 = {
"kind": "ClientExtension",
"selections": [
{
@@ -179,7 +210,7 @@ v13 = {
}
]
},
v14 = [
v15 = [
{
"alias": null,
"args": null,
@@ -226,25 +257,25 @@ v14 = [
"name": "createdAt",
"storageKey": null
},
(v10/*: any*/)
(v11/*: any*/)
],
"storageKey": null
},
(v11/*: any*/)
(v12/*: any*/)
],
"storageKey": null
},
(v12/*: any*/),
(v13/*: any*/)
(v13/*: any*/),
(v14/*: any*/)
],
v15 = [
v16 = [
{
"kind": "Literal",
"name": "first",
"value": 100
}
],
v16 = [
v17 = [
{
"kind": "Literal",
"name": "first",
@@ -305,6 +336,7 @@ return {
(v5/*: any*/),
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
{
"alias": "evidences",
"args": null,
@@ -312,19 +344,19 @@ return {
"kind": "LinkedField",
"name": "__ControlOverviewPage_evidences_connection",
"plural": false,
"selections": (v14/*: any*/),
"selections": (v15/*: any*/),
"storageKey": null
},
(v10/*: any*/)
(v11/*: any*/)
],
"storageKey": null
},
(v11/*: any*/)
(v12/*: any*/)
],
"storageKey": null
},
(v12/*: any*/),
(v13/*: any*/)
(v13/*: any*/),
(v14/*: any*/)
],
"storageKey": null
}
@@ -353,7 +385,7 @@ return {
"name": "node",
"plural": false,
"selections": [
(v10/*: any*/),
(v11/*: any*/),
(v2/*: any*/),
{
"kind": "InlineFragment",
@@ -365,7 +397,7 @@ return {
(v7/*: any*/),
{
"alias": null,
"args": (v15/*: any*/),
"args": (v16/*: any*/),
"concreteType": "TaskConnection",
"kind": "LinkedField",
"name": "tasks",
@@ -393,41 +425,42 @@ return {
(v5/*: any*/),
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
{
"alias": null,
"args": (v16/*: any*/),
"args": (v17/*: any*/),
"concreteType": "EvidenceConnection",
"kind": "LinkedField",
"name": "evidences",
"plural": false,
"selections": (v14/*: any*/),
"selections": (v15/*: any*/),
"storageKey": "evidences(first:50)"
},
{
"alias": null,
"args": (v16/*: any*/),
"args": (v17/*: any*/),
"filters": null,
"handle": "connection",
"key": "ControlOverviewPage_evidences",
"kind": "LinkedHandle",
"name": "evidences"
},
(v10/*: any*/)
(v11/*: any*/)
],
"storageKey": null
},
(v11/*: any*/)
(v12/*: any*/)
],
"storageKey": null
},
(v12/*: any*/),
(v13/*: any*/)
(v13/*: any*/),
(v14/*: any*/)
],
"storageKey": "tasks(first:100)"
},
{
"alias": null,
"args": (v15/*: any*/),
"args": (v16/*: any*/),
"filters": null,
"handle": "connection",
"key": "ControlOverviewPage_tasks",
@@ -444,7 +477,7 @@ return {
]
},
"params": {
"cacheID": "bd9679f5980ac0eed07f28e4f0cf4f27",
"cacheID": "1d26d59ea2232a213d01636e8d388919",
"id": null,
"metadata": {
"connection": [
@@ -467,11 +500,11 @@ return {
},
"name": "ControlOverviewPageQuery",
"operationKind": "query",
"text": "query ControlOverviewPageQuery(\n $controlId: ID!\n) {\n control: node(id: $controlId) {\n __typename\n id\n ... on Control {\n name\n description\n state\n importance\n category\n tasks(first: 100) {\n edges {\n node {\n id\n name\n description\n state\n timeEstimate\n version\n evidences(first: 50) {\n edges {\n node {\n id\n mimeType\n filename\n size\n state\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
"text": "query ControlOverviewPageQuery(\n $controlId: ID!\n) {\n control: node(id: $controlId) {\n __typename\n id\n ... on Control {\n name\n description\n state\n importance\n category\n tasks(first: 100) {\n edges {\n node {\n id\n name\n description\n state\n timeEstimate\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n evidences(first: 50) {\n edges {\n node {\n id\n mimeType\n filename\n size\n state\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "81d519cc3ea015284326fa7d5052b25f";
(node as any).hash = "e48b75fde2fcff42e868a0e68abd5809";
export default node;

View File

@@ -0,0 +1,145 @@
/**
* @generated SignedSource<<ec9f52c0ab13cd30148d7b2a97f59b63>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type UnassignTaskInput = {
taskId: string;
};
export type ControlOverviewPageUnassignTaskMutation$variables = {
input: UnassignTaskInput;
};
export type ControlOverviewPageUnassignTaskMutation$data = {
readonly unassignTask: {
readonly task: {
readonly assignedTo: {
readonly fullName: string;
readonly id: string;
readonly primaryEmailAddress: string;
} | null | undefined;
readonly id: string;
readonly version: number;
};
};
};
export type ControlOverviewPageUnassignTaskMutation = {
response: ControlOverviewPageUnassignTaskMutation$data;
variables: ControlOverviewPageUnassignTaskMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v2 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "UnassignTaskPayload",
"kind": "LinkedField",
"name": "unassignTask",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Task",
"kind": "LinkedField",
"name": "task",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "version",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "People",
"kind": "LinkedField",
"name": "assignedTo",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "primaryEmailAddress",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ControlOverviewPageUnassignTaskMutation",
"selections": (v2/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ControlOverviewPageUnassignTaskMutation",
"selections": (v2/*: any*/)
},
"params": {
"cacheID": "dc570710d28f3208dbaff23593819f4d",
"id": null,
"metadata": {},
"name": "ControlOverviewPageUnassignTaskMutation",
"operationKind": "mutation",
"text": "mutation ControlOverviewPageUnassignTaskMutation(\n $input: UnassignTaskInput!\n) {\n unassignTask(input: $input) {\n task {\n id\n version\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "4c809cd810a4178ab4f7a6d020338187";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<c6eaf570ef3d4e5a289ab266f6662546>>
* @generated SignedSource<<2e946185d02bd4e3d510d81c68cb9863>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,6 +16,7 @@ export type UpdateTaskInput = {
name?: string | null | undefined;
state?: TaskState | null | undefined;
taskId: string;
timeEstimate?: any | null | undefined;
};
export type ControlOverviewPageUpdateTaskStateMutation$variables = {
input: UpdateTaskInput;