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

Fix Datalink inputs #11376

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Conversation

somebody1234
Copy link
Contributor

Pull Request Description

Important Notes

None

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • ~~If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.~~

@somebody1234 somebody1234 added CI: No changelog needed Do not require a changelog entry for this PR. --bug Type: bug g-dashboard labels Oct 22, 2024
@somebody1234 somebody1234 added the CI: Ready to merge This PR is eligible for automatic merge label Oct 22, 2024
@PabloBuchu
Copy link
Contributor

  1. If I type datalink name that already exists the modal is successfully submited but request ends with 400
  2. Looks like for Postgres connectors all is now optional. I can create one with missing hostname, database name. Only port is required (similar to snowflake)
  3. Can we make the red border around required attribute bit stronger? Is there enough space to also include something like "You need to provide URI" also we should change the validation text for name (will provide that with James)
Screenshot 2024-10-22 at 09 59 28

@somebody1234 somebody1234 removed the CI: Ready to merge This PR is eligible for automatic merge label Oct 22, 2024
@somebody1234
Copy link
Contributor Author

somebody1234 commented Oct 22, 2024

If I type datalink name that already exists the modal is successfully submited but request ends with 400

i think this is out of scope unfortunately. the way the event handler currently works, we cannot await it to see if it succeeded. it's possible to fix but will require larger logic refactors

@radeusgd
Copy link
Member

2. Looks like for Postgres connectors all is now optional. I can create one with missing hostname, database name. Only port is required (similar to snowflake)

+1 to that - it seems that I can create a data link without hostname or database name - but these 2 fields are required. Such datalink gets created but then when I .read it in Enso it of course fails to open as its invalid.

@@ -186,7 +200,7 @@ export default function JSONSchemaInput(props: JSONSchemaInputProps) {
>
{propertyDefinitions.map((definition) => {
const { key, schema: childSchema } = definition
const isOptional = !requiredProperties.includes(key)
const isOptional = !requiredProperties.includes(key) || isAbsent
Copy link
Member

Choose a reason for hiding this comment

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

I think this may be too simple for the fix we need.

Fields that are themselves required, should still be marked red and not accepted if they are absent.

Only required sub-fields whose parent field is optional, do not have to be required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i guess this is a bit of a misnomer - isAbsent means that the parent field is optional

Copy link
Contributor Author

@somebody1234 somebody1234 Oct 22, 2024

Choose a reason for hiding this comment

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

Foo (object field, optional, currently absent, isAbsent = false)
  Bar (isAbsent = true, not optional)
  Baz (isAbsent = true, not optional)

Copy link
Member

Choose a reason for hiding this comment

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

i guess this is a bit of a misnomer - isAbsent means that the parent field is optional

Oh... Yeah so that name is a bit misleading indeed

@radeusgd
Copy link
Member

Hmm, I see. It may be that the Postgres always allowed empty string for hostname/database name. So the fields are not actually missing, they are just "".

I guess we may want to change the schema to require at least host to be non-empty. Not sure if empty database string makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug CI: No changelog needed Do not require a changelog entry for this PR. g-dashboard
Projects
None yet
4 participants