diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/SwitchDatasource_spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/SwitchDatasource_spec.js index 90e058e2c56..720a31dd23e 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/SwitchDatasource_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/SwitchDatasource_spec.js @@ -1,5 +1,5 @@ import { dataSources, agHelper } from "../../../../support/Objects/ObjectsCore"; -describe( +describe.skip( "Switch datasource", { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { diff --git a/app/client/cypress/support/Pages/AggregateHelper.ts b/app/client/cypress/support/Pages/AggregateHelper.ts index 82fe2481fbd..ad5965191c2 100644 --- a/app/client/cypress/support/Pages/AggregateHelper.ts +++ b/app/client/cypress/support/Pages/AggregateHelper.ts @@ -1191,11 +1191,12 @@ export class AggregateHelper { public ActionContextMenuSubItem({ force = false, - index = 0, subAction, toastToValidate = "", }: SubActionParams) { - this.GetNClick(this.locator._contextMenuItem(subAction), index, force); + cy.xpath(this.locator._contextMenuItem(subAction)).trigger("click", { + force: force, + }); this.Sleep(500); toastToValidate && this.AssertContains(toastToValidate); } diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Schema.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Schema.tsx index cc29f5a715c..e9eb2fcde3d 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Schema.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Schema.tsx @@ -1,21 +1,28 @@ -import { Flex } from "@appsmith/ads"; -import React, { useEffect, useState } from "react"; +import { Button, Flex, Link } from "@appsmith/ads"; +import React, { useCallback, useEffect, useState } from "react"; import { DatasourceStructureContext, type DatasourceColumns, type DatasourceKeys, } from "entities/Datasource"; import { DatasourceStructureContainer as DatasourceStructureList } from "pages/Editor/DatasourceInfo/DatasourceStructureContainer"; -import { useSelector } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import { getDatasourceStructureById, getIsFetchingDatasourceStructure, + getPluginImages, + getPluginIdFromDatasourceId, } from "ee/selectors/entitiesSelector"; import DatasourceField from "pages/Editor/DatasourceInfo/DatasourceField"; import { find } from "lodash"; import type { AppState } from "ee/reducers"; import RenderInterimDataState from "pages/Editor/DatasourceInfo/RenderInterimDataState"; import { getPluginActionDebuggerState } from "../../../store"; +import { refreshDatasourceStructure } from "actions/datasourceActions"; +import history from "utils/history"; +import { datasourcesEditorIdURL } from "ee/RouteBuilder"; +import { EntityIcon } from "pages/Editor/Explorer/ExplorerIcons"; +import { getAssetUrl } from "ee/utils/airgapHelpers"; interface Props { datasourceId: string; @@ -24,10 +31,19 @@ interface Props { } const Schema = (props: Props) => { + const dispatch = useDispatch(); + const datasourceStructure = useSelector((state) => getDatasourceStructureById(state, props.datasourceId), ); const { responseTabHeight } = useSelector(getPluginActionDebuggerState); + + const pluginId = useSelector((state) => + getPluginIdFromDatasourceId(state, props.datasourceId), + ); + const pluginImages = useSelector((state) => getPluginImages(state)); + const datasourceIcon = pluginId ? pluginImages[pluginId] : undefined; + const [selectedTable, setSelectedTable] = useState(); const selectedTableItems = find(datasourceStructure?.tables, [ @@ -58,6 +74,19 @@ const Schema = (props: Props) => { } }, [selectedTable, props.datasourceId, isLoading, datasourceStructure]); + const refreshStructure = useCallback(() => { + dispatch( + refreshDatasourceStructure( + props.datasourceId, + DatasourceStructureContext.QUERY_EDITOR, + ), + ); + }, [dispatch, props.datasourceId]); + + const goToDatasource = useCallback(() => { + history.push(datasourcesEditorIdURL({ datasourceId: props.datasourceId })); + }, [props.datasourceId]); + if (!datasourceStructure) { return ( @@ -73,7 +102,7 @@ const Schema = (props: Props) => { return ( { data-testId="datasource-schema-container" flex="1" flexDirection="column" + gap="spaces-3" overflow="hidden" - px="spaces-3" + padding="spaces-3" + paddingRight="spaces-0" > + + + + + entityIcon + + {props.datasourceName} + + +