diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/CurrentDataSource.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/CurrentDataSource.tsx index e2ed7ece141d..59ed5b49a27e 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/CurrentDataSource.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/CurrentDataSource.tsx @@ -1,32 +1,30 @@ import React from "react"; -import { Flex } from "@appsmith/ads"; +import { Flex, Icon } from "@appsmith/ads"; import { getAssetUrl } from "ee/utils/airgapHelpers"; import { EntityIcon } from "pages/Editor/Explorer/ExplorerIcons"; import { useSelector } from "react-redux"; -import { - getPluginIdFromDatasourceId, - getPluginImages, -} from "ee/selectors/entitiesSelector"; +import { getPluginImages } from "ee/selectors/entitiesSelector"; interface Props { - datasourceId: string; datasourceName: string; + pluginId: string; } -const CurrentDataSource = ({ datasourceId, datasourceName }: Props) => { - const { pluginId, pluginImages } = useSelector((state) => ({ - pluginId: getPluginIdFromDatasourceId(state, datasourceId), - pluginImages: getPluginImages(state), - })); +const CurrentDataSource = ({ datasourceName, pluginId }: Props) => { + const pluginImages = useSelector((state) => getPluginImages(state)); const datasourceIcon = pluginId ? pluginImages?.[pluginId] : undefined; return ( - entityIcon + {datasourceIcon ? ( + entityIcon + ) : ( + + )} - {datasourceName} + {datasourceName || "NA"} ); }; diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/CurrentDataSourceLink.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/CurrentDataSourceLink.tsx index 8ba3acdf1e1c..e23378a47455 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/CurrentDataSourceLink.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/CurrentDataSourceLink.tsx @@ -6,9 +6,11 @@ import { useGoToDatasource } from "PluginActionEditor/components/PluginActionRes const CurrentDataSourceLink = ({ datasourceId, datasourceName, + pluginId, }: { datasourceId: string; datasourceName: string; + pluginId: string; }) => { const { goToDatasource } = useGoToDatasource(); @@ -19,10 +21,7 @@ const CurrentDataSourceLink = ({ return ( - + ); }; diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceInfo.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceInfo.tsx index acfa33571870..6c4dac8e1c68 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceInfo.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceInfo.tsx @@ -55,7 +55,7 @@ const DatasourceInfo = ({ datasourceName={datasourceName} plugin={plugin} /> - {showEditButton && ( + {showEditButton && datasourceName && (