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

Integrate new UID reference widget #2295

Merged
merged 175 commits into from
May 30, 2023
Merged

Integrate new UID reference widget #2295

merged 175 commits into from
May 30, 2023

Conversation

ramonski
Copy link
Contributor

Description of the issue/feature this PR addresses

This PR integrates the new DX compatible UID reference widget for all AT reference fields

Current behavior before PR

Old widget is used for AT reference fields

Desired behavior after PR is merged

New widget is used for AT reference fields

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

Copy link
Member

@xispa xispa left a comment

Choose a reason for hiding this comment

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

Thanks for this astonishing work!. Plenty of things here. I've done functional testing and works as expected for reference fields and widgets from core.

@xispa , I've found a couple of fields/widgets of mine (e.g. UIDOtherReferenceField and UIDOtherReferenceWidget that require attention) before we can move custom add-ons forward with this change.

return filter(lambda uid: uid, value)
if api.is_string(value):
value = value.split("\r\n")
return list(filter(None, value))
Copy link
Member

Choose a reason for hiding this comment

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

I would do

return list(filter(api.is_uid, value))


# extract the assigned UIDs for multi-reference fields
if field.multiValued:
value = filter(None, value.split(","))
value = filter(None, fieldvalue.split("\r\n"))
Copy link
Member

Choose a reason for hiding this comment

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

value = filter(api.is_uid, fieldvalue.split("\r\n"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup 🧹 Code cleanup and refactoring Improvement 🔧
Development

Successfully merging this pull request may close these issues.

2 participants