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 deleting table constraints #760

Merged
merged 17 commits into from
Nov 8, 2021
Merged

Conversation

seancolsen
Copy link
Contributor

@seancolsen seancolsen commented Oct 26, 2021

Fixes #328

Before

  • No way to delete table constraints

After

User can delete table constraints through the "Table Constraints" modal.

Peek 2021-10-26 21-26

(The slow frame rate of the gif doesn't really do justice to the CSS transitions, which I think look really nice in the browser.)

Notes

  • After dropping the constraint, the constraints store is re-fetched.

  • I added a couple new UI components:

    • Spinner, so that we can write <Spinner /> instead of <Icon data={faSpinner} spin={true}/>. (One fewer import!)

    • Seesaw (open to suggestions for a better name here) which switches between a "left" and "right" content using a slide transition.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the master 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.

@seancolsen seancolsen requested review from a team, mathemancer and pavish October 26, 2021 20:39
@seancolsen seancolsen marked this pull request as draft October 26, 2021 20:40
@seancolsen seancolsen force-pushed the 328_table_constraint_delete branch from 2c971b1 to 538c1a4 Compare October 26, 2021 21:05
@seancolsen seancolsen marked this pull request as ready for review October 27, 2021 11:25
@pavish pavish self-assigned this Oct 27, 2021
@pavish pavish added the pr-status: review A PR awaiting review label Oct 28, 2021
@mr-gabe49

This comment has been minimized.

@seancolsen

This comment has been minimized.

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.

@seancolsen I love the subtle animation and the simplicity of the confirmation view.

I do have a few comments which I'd like to be addressed before we merge this PR.

mathesar_ui/src/components/spinner/Spinner.svelte Outdated Show resolved Hide resolved
mathesar_ui/src/stores/table-data/constraints.ts Outdated Show resolved Hide resolved
mathesar_ui/src/stores/table-data/constraints.ts Outdated Show resolved Hide resolved
@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 5, 2021
@pavish
Copy link
Member

pavish commented Nov 5, 2021

An additional minor comment: When all constraints are deleted, only an empty modal with a title is shown. It would be better if we showed additional text mentioning that there are no constraints available.

@seancolsen
Copy link
Contributor Author

When all constraints are deleted, only an empty modal with a title is shown.

  • Good call. In d384c4a changed the modal to display as follows:

    image

- Use `api` property within `ConstraintsDataStore` to hold api methods.
- Show loading spinner only when constaints data is empty and loading.
@seancolsen
Copy link
Contributor Author

@pavish Ready for re-review

@seancolsen seancolsen 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 7, 2021
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.

@seancolsen The changes look good to me!

@pavish pavish merged commit 238320a into master Nov 8, 2021
@pavish pavish deleted the 328_table_constraint_delete branch November 8, 2021 05:36
@kgodey
Copy link
Contributor

kgodey commented Nov 8, 2021

Nice work on this @seancolsen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Frontend work for viewing and deleting table constraints
4 participants