diff --git a/frontend/app/src/components/conversations/thread.tsx b/frontend/app/src/components/conversations/thread.tsx index 5b1a09d68a..56a07c7fde 100644 --- a/frontend/app/src/components/conversations/thread.tsx +++ b/frontend/app/src/components/conversations/thread.tsx @@ -3,13 +3,7 @@ import { Checkbox } from "@/components/inputs/checkbox"; import ModalConfirm from "@/components/modals/modal-confirm"; import { ALERT_TYPES, Alert } from "@/components/ui/alert"; import { Tooltip } from "@/components/ui/tooltip"; -import { - DIFF_TABS, - PROPOSED_CHANGES_ARTIFACT_THREAD_OBJECT, - PROPOSED_CHANGES_CHANGE_THREAD_OBJECT, - PROPOSED_CHANGES_OBJECT_THREAD_OBJECT, - PROPOSED_CHANGES_THREAD_COMMENT_OBJECT, -} from "@/config/constants"; +import { PROPOSED_CHANGES_THREAD_COMMENT_OBJECT } from "@/config/constants"; import graphqlClient from "@/graphql/graphqlClientApollo"; import { createObject } from "@/graphql/mutations/objects/createObject"; import { updateObjectWithId } from "@/graphql/mutations/objects/updateObjectWithId"; @@ -27,8 +21,6 @@ import { useState } from "react"; import { toast } from "react-toastify"; import { AddComment } from "./add-comment"; import { Comment } from "./comment"; -import { StringParam, useQueryParam } from "use-query-params"; -import { QSP } from "@/config/qsp"; import { Card } from "@/components/ui/card"; type tThread = { @@ -49,7 +41,6 @@ export const Thread = (props: tThread) => { const auth = useAuth(); - const [qspTab] = useQueryParam(QSP.PROPOSED_CHANGES_TAB, StringParam); const branch = useAtomValue(currentBranchAtom); const date = useAtomValue(datetimeAtom); const [isLoading, setIsLoading] = useState(false); @@ -111,21 +102,6 @@ export const Thread = (props: tThread) => { } }; - const getMutation = () => { - // for artifacts view - if (qspTab === DIFF_TABS.ARTIFACTS) { - return PROPOSED_CHANGES_ARTIFACT_THREAD_OBJECT; - } - - // for conversations view - if (displayContext) { - return PROPOSED_CHANGES_CHANGE_THREAD_OBJECT; - } - - // for object views - return PROPOSED_CHANGES_OBJECT_THREAD_OBJECT; - }; - const handleResolve = async () => { if (!thread.id) { return; @@ -139,7 +115,7 @@ export const Thread = (props: tThread) => { } const mutationString = updateObjectWithId({ - kind: getMutation(), + kind: thread.__typename, data: stringifyWithoutQuotes({ id: thread.id, resolved: { diff --git a/frontend/app/src/config/constants.tsx b/frontend/app/src/config/constants.tsx index 47db553400..ccfe68dec8 100644 --- a/frontend/app/src/config/constants.tsx +++ b/frontend/app/src/config/constants.tsx @@ -38,8 +38,6 @@ export const PROPOSED_CHANGES_ARTIFACT_THREAD_OBJECT = "CoreArtifactThread"; export const ARTIFACT_OBJECT = "CoreArtifact"; -export const INFRAHUB_TASK = "InfrahubTask"; - export const GRAPHQL_QUERY_OBJECT = "CoreGraphQLQuery"; export const PROPOSED_CHANGES_THREAD_COMMENT_OBJECT = "CoreThreadComment"; @@ -54,8 +52,6 @@ export const SCHEMA_ENUM_ADD = "SchemaEnumAdd"; export const SCHEMA_ENUM_REMOVE = "SchemaEnumRemove"; -export const GROUP_OBJECT = "CoreGroup"; - export const NUMBER_POOL_OBJECT = "CoreNumberPool"; export const TASK_OBJECT = "InfrahubTask";