Skip to content

Commit

Permalink
fix: datasource name not reflecting in schema pane (#37131)
Browse files Browse the repository at this point in the history
## Description

Renaming the datasource was not getting updated in schema tab. This is
caused because of the use of unpublished action object.


Fixes #37118

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11591002654>
> Commit: 2f3b111
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11591002654&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Wed, 30 Oct 2024 17:09:22 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a new selector for improved datasource retrieval in the
Query Debugger.
  
- **Improvements**
- Enhanced the way datasource information is accessed, streamlining the
process for the `Schema` component.
- Updated test configuration to include a mock structure for testing
datasource functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
albinAppsmith authored Oct 31, 2024
1 parent ff70e3a commit 38c9bc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const storeState = {
},
datasources: {
structure: {},
list: [],
},
},
ui: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type { SourceEntity } from "entities/AppsmithConsole";
import type { Action } from "entities/Action";
import QueryResponseTab from "PluginActionEditor/components/PluginActionResponse/components/QueryResponseTab";
import {
getDatasource,
getDatasourceStructureById,
getPluginDatasourceComponentFromId,
} from "ee/selectors/entitiesSelector";
Expand Down Expand Up @@ -97,6 +98,10 @@ function QueryDebuggerTabs({
),
);

const datasource = useSelector((state) =>
getDatasource(state, currentActionConfig?.datasource?.id ?? ""),
);

useEffect(() => {
if (
currentActionConfig?.datasource?.id &&
Expand Down Expand Up @@ -252,7 +257,7 @@ function QueryDebuggerTabs({
<Schema
currentActionId={currentActionConfig.id}
datasourceId={currentActionConfig.datasource.id || ""}
datasourceName={currentActionConfig.datasource.name || ""}
datasourceName={datasource?.name || ""}
/>
),
});
Expand Down

0 comments on commit 38c9bc0

Please sign in to comment.