Skip to content

fix: dont show wrong msg while loading#13597

Open
ganganimaulik wants to merge 1 commit intoappsmithorg:releasefrom
ganganimaulik:fix-schema-not-available
Open

fix: dont show wrong msg while loading#13597
ganganimaulik wants to merge 1 commit intoappsmithorg:releasefrom
ganganimaulik:fix-schema-not-available

Conversation

@ganganimaulik
Copy link
Copy Markdown
Contributor

@ganganimaulik ganganimaulik commented May 5, 2022

Description

Fixes #13584

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • make sure no schema msg is not displayed when expanding datasource.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Improvements
    • Enhanced loading state management for the Datasource Structure component by transitioning from local to global state management using Redux, which may improve performance and consistency across the application.
    • Updated rendering logic to reflect the centralized loading state, potentially facilitating easier testing and debugging.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2022

@ganganimaulik is attempting to deploy a commit to the Appsmith Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions Bot added the Stale label May 12, 2022
@github-actions
Copy link
Copy Markdown

This PR has been closed because of inactivity.

@github-actions github-actions Bot closed this May 19, 2022
@hetunandu hetunandu self-requested a review November 18, 2022 05:41
@hetunandu hetunandu reopened this Nov 18, 2022
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview Nov 18, 2022 at 5:41AM (UTC)

@hetunandu
Copy link
Copy Markdown
Member

/ok-to-test

@hetunandu hetunandu added the Entity Explorer Issues related to navigation using the entity explorer label Nov 18, 2022
@github-actions
Copy link
Copy Markdown

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3494819335.
Workflow: Appsmith External Integration Test Workflow.
Commit: ``.
PR: 13597.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=13597&runId=3494819335_1

Copy link
Copy Markdown
Member

@hetunandu hetunandu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct approach. While it does help when the api is still loading but does not handle the error properly

@prapullc prapullc added the Test Plan Approved Manual/Cypress tests covers changes made on the PR. Else, add skip-testPlan label if not applicable label Jul 12, 2023
@Nikhil-Nandagopal Nikhil-Nandagopal added IDE Product Issues related to the IDE Product IDE Pod Issues that new developers face while exploring the IDE labels Aug 5, 2024
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 5, 2024

Walkthrough

The recent changes enhance the loading state management in the DatasourceStructureContainer component by transitioning from a local state approach to utilizing Redux for loading status. This improvement ensures a more consistent user experience by centralizing the fetching logic, ultimately displaying a Loading.. message appropriately while data is being retrieved.

Changes

File Change Summary
app/client/src/pages/Editor/Explorer/Datasources/DatasourceStructureContainer.tsx Modified loading state management from a custom hook to Redux using useSelector to enhance consistency and performance in the component's data fetching logic.

Assessment against linked issues

Objective Addressed Explanation
Display Loading.. message during data fetching (#[13584])

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a 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, codebase verification and nitpick comments (1)
app/client/src/pages/Editor/Explorer/Datasources/DatasourceStructureContainer.tsx (1)

22-22: Consider adding a "Loading..." message.

The updated condition correctly handles the loading state. However, consider adding a "Loading..." message to enhance user experience.

+  if (isFetchingDatasourceStructure) {
+    view = <EntityPlaceholder step={props.step + 1}>Loading...</EntityPlaceholder>;
+  } else {
     if (props.datasourceStructure?.tables?.length) {
       view = (
         <>
           {props.datasourceStructure.tables.map(
             (structure: DatasourceTable) => {
               return (
                 <DatasourceStructure
                   datasourceId={props.datasourceId}
                   dbStructure={structure}
                   key={`${props.datasourceId}${structure.name}`}
                   step={props.step + 1}
                 />
               );
             },
           )}
         </>
       );
     } else {
       view = (
         <EntityPlaceholder step={props.step + 1}>
           {props.datasourceStructure &&
           props.datasourceStructure.error &&
           props.datasourceStructure.error.message
             ? props.datasourceStructure.error.message
             : "No information available"}
         </EntityPlaceholder>
       );
     }
   }
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f0952b8 and a587261.

Files selected for processing (1)
  • app/client/src/pages/Editor/Explorer/Datasources/DatasourceStructureContainer.tsx (2 hunks)
Additional comments not posted (2)
app/client/src/pages/Editor/Explorer/Datasources/DatasourceStructureContainer.tsx (2)

6-7: LGTM! New imports are necessary and correctly used.

The new imports useSelector and getIsFetchingDatasourceStructure are necessary for the updated loading state management.


19-21: LGTM! Correct use of useSelector and getIsFetchingDatasourceStructure.

The useSelector hook is correctly used to retrieve the loading state from the Redux store using the getIsFetchingDatasourceStructure selector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Entity Explorer Issues related to navigation using the entity explorer IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Stale Test Plan Approved Manual/Cypress tests covers changes made on the PR. Else, add skip-testPlan label if not applicable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: shows schema not available until its loaded

4 participants