Skip to content

Commit

Permalink
fix: Merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hetunandu committed Dec 31, 2024
1 parent 1d892fb commit 8d4ee76
Showing 1 changed file with 1 addition and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React from "react";
import { usePluginActionContext } from "PluginActionEditor/PluginActionContext";
import type { BottomTab } from "components/editorComponents/EntityBottomTabs";
import { getIDEViewMode } from "selectors/ideSelectors";
Expand Down Expand Up @@ -33,9 +33,6 @@ import {
} from "PluginActionEditor/hooks";
import useDebuggerTriggerClick from "components/editorComponents/Debugger/hooks/useDebuggerTriggerClick";
import { Response } from "PluginActionEditor/components/PluginActionResponse/components/Response";
import { getIsAnvilEnabledInCurrentApplication } from "layoutSystems/anvil/integrations/selectors";
import type { Datasource as DatasourceType } from "entities/Datasource";
import { RagDocuments } from "ee/components/formControls/RagDocuments";
import { StateInspector } from "components/editorComponents/Debugger/StateInspector";
import { useLocation } from "react-router";
import { getIDETypeByUrl } from "ee/entities/IDE/utils";
Expand All @@ -57,8 +54,6 @@ function usePluginActionResponseTabs() {
const onDebugClick = useDebuggerTriggerClick();
const isRunning = useSelector(isActionRunning(action.id));
const blockExecution = useBlockExecution();
const isAnvilEnabled = useSelector(getIsAnvilEnabledInCurrentApplication);
const [ragDocumentsCount, setRagDocumentsCount] = useState<number>();

const tabs: BottomTab[] = [];

Expand Down Expand Up @@ -153,54 +148,6 @@ function usePluginActionResponseTabs() {
});
}

if ([PluginType.AI].includes(plugin.type)) {
if (showSchema && !isAnvilEnabled) {
tabs.push({
key: DEBUGGER_TAB_KEYS.DATASOURCE_TAB,
title: "Datasource",
panelComponent: (
<DatasourceTab
currentActionId={action.id}
datasourceId={datasource?.id || action.datasource.id || ""}
datasourceName={datasource?.name || action.datasource.name || ""}
/>
),
});
}

if (isAnvilEnabled) {
tabs.push({
key: DEBUGGER_TAB_KEYS.DATA_TAB,
title: "Data",
count: ragDocumentsCount,
panelComponent: (
<RagDocuments
datasourceId={(datasource as DatasourceType)?.id}
isDeletedAvailable={false}
setCount={setRagDocumentsCount}
workspaceId={datasource?.workspaceId}
/>
),
});
}

tabs.push({
key: DEBUGGER_TAB_KEYS.RESPONSE_TAB,
title: createMessage(DEBUGGER_RESPONSE),
panelComponent: (
<Response
action={action}
actionResponse={actionResponse}
isRunDisabled={blockExecution}
isRunning={isRunning}
onRunClick={onRunClick}
responseTabHeight={responseTabHeight}
theme={EditorTheme.LIGHT}
/>
),
});
}

const location = useLocation();

const ideType = getIDETypeByUrl(location.pathname);
Expand Down

0 comments on commit 8d4ee76

Please sign in to comment.