-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Adding the logic to fetch datasource structure for schema tab, if empty #37256
Conversation
WalkthroughThe changes in this pull request enhance the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
app/client/src/PluginActionEditor/components/PluginActionResponse/components/Schema.tsx (2)
73-75
: Consider adding type annotation for better type safetyThe selector usage looks good, but consider adding an explicit type annotation for
pluginDatasourceForm
.- const pluginDatasourceForm = useSelector((state) => + const pluginDatasourceForm: DatasourceComponentTypes = useSelector((state) => getPluginDatasourceComponentFromId(state, pluginId || ""), );
81-95
: Consider adding error handling for fetch operationThe fetch operation should include error handling to improve user experience when the fetch fails.
useEffect(() => { if ( props.datasourceId && datasourceStructure === undefined && pluginDatasourceForm !== DatasourceComponentTypes.RestAPIDatasourceForm ) { dispatch( fetchDatasourceStructure( props.datasourceId, true, DatasourceStructureContext.QUERY_EDITOR, + // Consider handling the promise rejection + ).catch((error) => { + // Handle error appropriately + console.error('Failed to fetch datasource structure:', error); ), ); } }, [props.datasourceId, datasourceStructure, dispatch, pluginDatasourceForm]);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/client/src/PluginActionEditor/components/PluginActionResponse/components/Schema.tsx
(2 hunks)
🔇 Additional comments (2)
app/client/src/PluginActionEditor/components/PluginActionResponse/components/Schema.tsx (2)
15-15
: LGTM: Import changes are well-organized
The new imports are properly grouped and align with the feature requirements.
Also applies to: 22-25
81-95
: LGTM: Conditional fetching logic is well-implemented
The useEffect hook correctly implements the requirement to fetch datasource structure when empty, with proper conditions and dependency tracking.
… if empty (appsmithorg#37256) ## Description Adding the logic to fetch datasource structure for schema tab, if empty Fixes [appsmithorg#37247](appsmithorg#37247) ## Automation /ok-to-test tags="@tag.Sanity, @tag.IDE" ### 🔍 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/11702661925> > Commit: 7045b99 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11702661925&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity, @tag.IDE` > Spec: > <hr>Wed, 06 Nov 2024 12:13:19 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced data-fetching logic for plugin datasource components. - Introduced a new selector to retrieve plugin datasource components by ID. - **Improvements** - Refined conditions for fetching datasource structure, improving performance and reliability. - Maintained consistent user interface while updating backend logic. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Ankita Kinger <ankitakinger@Ankitas-MacBook-Pro.local>
Description
Adding the logic to fetch datasource structure for schema tab, if empty
Fixes #37247
Automation
/ok-to-test tags="@tag.Sanity, @tag.IDE"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11702661925
Commit: 7045b99
Cypress dashboard.
Tags:
@tag.Sanity, @tag.IDE
Spec:
Wed, 06 Nov 2024 12:13:19 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit