Skip to content
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

Handle failed API requests on schema page #3323

Conversation

nikhilhenry
Copy link
Contributor

@nikhilhenry nikhilhenry commented Nov 22, 2023

Fixes #2644

Adds UI elements to display API request errors when fetching tables and queries (explorations) on the schema page in accordance with the provided design reference.

Technical details

  • Refactor table store to use RequestStatus instead of previously deprecated State.
  • Add support to manually refetch tables and queries.
  • Add support to redirect to the database page.
  • Display errors using the ErrorBox component.

Screenshots
Screenshot 2023-11-22 at 11 58 15 PM

Note: This PR is heavily inspired by PR #2829. Thanks to authors for their work!

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@pavish pavish self-assigned this Nov 23, 2023
@pavish pavish added the pr-status: review A PR awaiting review label Nov 23, 2023
@pavish pavish added this to the Backlog milestone Nov 23, 2023
@pavish pavish self-requested a review November 23, 2023 06:06
Copy link
Member

@pavish pavish left a comment

Choose a reason for hiding this comment

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

@nikhilhenry Thanks for the PR! I have a few comments which need to be addressed before merging this in.

Additionally, I notice that this PR does not satisfy the linting rules. Please fix them before marking it as ready for review again.

mathesar_ui/src/pages/schema/SchemaOverview.svelte Outdated Show resolved Hide resolved
mathesar_ui/src/pages/schema/SchemaOverview.svelte Outdated Show resolved Hide resolved
mathesar_ui/src/pages/schema/SchemaOverview.svelte Outdated Show resolved Hide resolved
@pavish pavish assigned nikhilhenry and unassigned pavish Nov 27, 2023
@pavish pavish added pr-status: revision A PR awaiting follow-up work from its author after review and removed pr-status: review A PR awaiting review labels Nov 27, 2023
@pavish pavish assigned pavish and unassigned nikhilhenry Nov 28, 2023
@pavish pavish added pr-status: review A PR awaiting review and removed pr-status: revision A PR awaiting follow-up work from its author after review labels Nov 28, 2023
mathesar/api/db/viewsets/queries.py Outdated Show resolved Hide resolved
Copy link
Member

@pavish pavish left a comment

Choose a reason for hiding this comment

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

@nikhilhenry I'm still seeing some linting errors, and a number of test changes that seem to have made into this PR. Please fix them and double check before requesting review.

mathesar_ui/src/stores/queries.ts Outdated Show resolved Hide resolved
mathesar_ui/src/stores/queries.ts Outdated Show resolved Hide resolved
mathesar_ui/src/stores/tables.ts Outdated Show resolved Hide resolved
@pavish pavish assigned nikhilhenry and unassigned pavish Nov 28, 2023
@pavish pavish removed the pr-status: review A PR awaiting review label Nov 28, 2023
@pavish pavish assigned nikhilhenry and unassigned nikhilhenry Nov 28, 2023
@pavish pavish added the pr-status: revision A PR awaiting follow-up work from its author after review label Nov 28, 2023
@nikhilhenry
Copy link
Contributor Author

@pavish I've reverted the changes to the backend and changes to stores/tables.ts and stores/queries.ts using git revert.

Could you please let me know if this is the appropriate method to revert these changes or if it would be better for me to open a new PR?

Once again, really sorry for the confusion.

@pavish pavish assigned pavish and unassigned nikhilhenry Nov 28, 2023
@pavish pavish added pr-status: review A PR awaiting review and removed pr-status: revision A PR awaiting follow-up work from its author after review labels Nov 28, 2023
Copy link
Member

@pavish pavish left a comment

Choose a reason for hiding this comment

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

@nikhilhenry Looks good to me! Thanks for your work on this.

@pavish pavish added this pull request to the merge queue Dec 4, 2023
Merged via the queue into mathesar-foundation:develop with commit 093a21e Dec 4, 2023
21 checks passed
@seancolsen seancolsen mentioned this pull request Dec 8, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: review A PR awaiting review
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Handle tables and queries API errors on the schema page
2 participants