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

Metadata forms: List of Attached Forms #1652

Open
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

SofiaSazonova
Copy link
Contributor

Feature or Bugfix

  • Feature

Detail

  • New Tab in MF View
  • NO ACCESS RESTRICTION: if entity has an attached form, it's visible in this tab

Relates

Security

Please answer the questions below briefly where applicable, or write N/A. Based on
OWASP 10.

  • Does this PR introduce or modify any input fields or queries - this includes
    fetching data from storage outside the application (e.g. a database, an S3 bucket)?
    • Is the input sanitized?
    • What precautions are you taking before deserializing the data you consume?
    • Is injection prevented by parametrizing queries?
    • Have you ensured no eval or similar functions are used?
  • Does this PR introduce any functionality or component that requires authorization?
    • How have you ensured it respects the existing AuthN/AuthZ mechanisms?
    • Are you logging failed auth attempts?
  • Are you using or adding any cryptographic features?
    • Do you use a standard proven implementations?
    • Are the used keys controlled by the customer? Where are they stored?
  • Are you introducing any new policies/roles/users?
    • Have you used the least-privilege principle? How?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@SofiaSazonova SofiaSazonova marked this pull request as ready for review October 29, 2024 12:45
@noah-paige
Copy link
Contributor

One bug I see - Env and Org Forms not showing to Attach to S3 Dataset Entity Anymore
- This is from earlier PR when changing entityType to S3-Dataset: At createAttachedMetadataForm API in RenderedMetadataForm UI View we use entityType Dataset not S3-Dataset
- The source is from DatasetView - Line: <MetadataAttachment entityType="Dataset" entityUri={params.uri} />

Just need to change to S3-Dataset

Copy link
Contributor

@noah-paige noah-paige left a comment

Choose a reason for hiding this comment

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

some minor comments

Is access restrictions to be reconsidered later - just curious to hear thoughts here, I think outside scope of this PR for now

@SofiaSazonova
Copy link
Contributor Author

All done

Copy link
Contributor

@noah-paige noah-paige left a comment

Choose a reason for hiding this comment

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

Minor Comment on Theme(s)

One Bug Found (described below)

Bug when updating an already attached metadata form with a boolean value...

  • If there already exists an attached MF with a boolean value and I have a new MF Form version still with the same boolean value

    • When I click edit - the fields get carried over to new version
    • These field values are from AttachedMetadataForm.fields property returned from listAttachedMetadataForms API and the values are returned as strings
    • Meaning a boolean value is returned as 'false'
  • If I keep the boolean value as is and try to save this new version of the attached form I get an error

(builtins.TypeError) Not a boolean value: 'false' [SQL: INSERT INTO boolean_attached_metadata_form_field ("attachedFormUri", "fieldUri", value) VALUES (%(attachedFormUri)s, %(fieldUri)s, %(value)s)] [parameters: [{'value': 'false', 'attachedFormUri': 'XXX', 'fieldUri': 'XXXX'}]]
- Believe something is going on with boolean returned as string ++`JSON.stringify(field.value)` used before running `createAttachedMetadataForm`
- Looking at Lambda event the value comes in as `"\"false\""` which then gets loaded as `'false'` after json.loads(xxx) and then this string throws the error because not bool type

Ultimately, I get left with an error and 2 attached metadata forms of 2 different versions because createAttachedMetadataForm is also not cleaning up the pre-existing one due the error

Screenshot 2024-11-20 at 5 42 08 PM

@SofiaSazonova
Copy link
Contributor Author

bugs with attachement and values resolved
themes & colors fixed

@SofiaSazonova SofiaSazonova requested a review from dlpzx December 2, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants