Skip to content

Conversation

@arunapa
Copy link
Contributor

@arunapa arunapa commented Dec 15, 2022

Added a dynamic form to fill up metadata context (refer to screenshots)

Validated: 1) form submit, 2) if context is empty, form cannot be submit, 3) JSON output displayed on the final step

Screen Shot 2022-12-15 at 8 51 47 PM

Screen Shot 2022-12-15 at 8 52 11 PM

@arunapa arunapa linked an issue Dec 15, 2022 that may be closed by this pull request
@arunapa arunapa marked this pull request as ready for review December 16, 2022 02:51
@arunapa arunapa requested a review from longshuicy as a code owner December 16, 2022 02:51
@arunapa arunapa requested review from lmarini and max-zilla December 16, 2022 02:54
@longshuicy
Copy link
Member

I got an edge case error:
image

when i try to delete the last character of context this page errored out.
image

If you watched console, it's complaining about autocomplete can't accept empty value and still cast it to lowercase. I'm suspecting the "freesolo" option need some condition.

@arunapa
Copy link
Contributor Author

arunapa commented Dec 16, 2022

I got an edge case error: image

when i try to delete the last character of context this page errored out. image

If you watched console, it's complaining about autocomplete can't accept empty value and still cast it to lowercase. I'm suspecting the "freesolo" option need some condition.

Thank you for catching this bug! I checked the documentation and after debugging, it looks like implementing both "onInputChange" and "onChange" was causing issues. When I tried reproducing the autocomplete input, onInputChange event registered the new value as "" while onChange modified it to null, which is likely what the error was reporting.

I doubled checked the MUI API documentation and I think implementing onInputChange alone is sufficient.

Copy link
Member

@longshuicy longshuicy left a comment

Choose a reason for hiding this comment

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

Good finding about that onInputChange. It's working now. Approving!

Copy link
Member

@lmarini lmarini left a comment

Choose a reason for hiding this comment

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

Can we rename to Metadata context name to Term and Context URL to IRI?

See get_current_username for more info.

Not on this PR, but in the future what if we moved the term mapping to each of the metadata entry. Currently I can create mappings in the context that don't match what is in the metadata definition. Ideally the Term will be the same used in the JSON for the metadata entry.

@arunapa
Copy link
Contributor Author

arunapa commented Dec 16, 2022

Can we rename to Metadata context name to Term and Context URL to IRI?

See get_current_username for more info.

Not on this PR, but in the future what if we moved the term mapping to each of the metadata entry. Currently I can create mappings in the context that don't match what is in the metadata definition. Ideally the Term will be the same used in the JSON for the metadata entry.

Gotcha. I've renamed the fields both in my code and in the UI.

Should we create an issue in the backlog for the future item?

Screen Shot 2022-12-16 at 11 23 01 AM

@lmarini
Copy link
Member

lmarini commented Dec 16, 2022 via email

"DateTimePicker": "Date Time Picker",
"Select": "Dropdown"
}

Copy link
Member

Choose a reason for hiding this comment

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

Created #255. Hope it's not a duplicate.

@lmarini lmarini merged commit f4abf05 into main Dec 19, 2022
@lmarini lmarini deleted the 153-metadata-ui-page-context-field-improvement branch December 19, 2022 20:39
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.

Metadata UI page "context" field improvement

4 participants