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

Display accurate infoAlertText on foreign key columns with locked data types #3257

Conversation

ejenk0
Copy link
Contributor

@ejenk0 ejenk0 commented Oct 25, 2023

Fixes #3247

Technical details

  • Replace the infoAlertText string in ColumnType.svelte with an async function that checks if the referent column is a primary key and displays appropriate text.
  • As a result, if the data type of the column is not locked due to being a primary key (i.e. if this column is a foreign key), the InfoBox will not render until the query to the columns api is complete.

Screenshots
Example of InfoBox for a column referencing a unique column.
Screenshot 2023-10-25 at 11 35 53 pm

Example of InfoBox for a column referencing a primary key.
Screenshot 2023-10-25 at 11 36 13 pm

Example of InfoBox being unrendered due to the API call not yet being fulfilled.
Screenshot 2023-10-25 at 11 37 22 pm

/cc @seancolsen @mathemancer @kgodey to review text

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.

Make a call to the columns api to check if the referent column is a
primary key and show appropriate message in InfoBox based on that.
@ejenk0
Copy link
Contributor Author

ejenk0 commented Oct 25, 2023

This is my first time touching Svelte and my first time contributing to an open-source project, so feedback on my code or my git/github stuff is appreciated!

@seancolsen
Copy link
Contributor

Thanks for making this PR @ejenk0!

We had some discussion in the ticket in order to take this change in a different direction, thus I'm closing this PR. You're welcome to submit another PR which makes the change now described in the ticket.

@seancolsen seancolsen closed this Oct 25, 2023
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.

Inaccurate info for a foreign key column referencing a non-pk column
2 participants