Skip to content

Conversation

@dstandish
Copy link
Contributor

After making it so we can omit the prefix in get_connection_form_widgets, we left get_ui_field_behaviour alone because, even though maybe it's unlikely and probably not a great idea, it's possible that a user would want to add an extra field that shares a name with an existing conn attr and want to provide a placeholder for that field.

But, after turning my attention back to this area, I think I arrived a at a reasonable way to solve this, which should make things easier for users when trying to implement extra fields for hooks.

What we do is, check the placeholders when processing the hook in the providers manager, and if there are any fields which are not conn attrs and are not prefixed already, we add the prefix. We don't need to worry about "hidden fields" or "relabeling" because these are only used with the built-in conn attrs.

After making it so we can omit the prefix in `get_connection_form_widgets`, we left `get_ui_field_behaviour` alone because, even though maybe it's unlikely and probably not a great idea, it's *possible* that a user would want to add an extra field that shares a name with an existing conn attr _and_ want to provide a placeholder for that field.

But, after turning my attention back to this area, I think I arrived a at a reasonable way to solve this, which should make things easier for users when trying to implement extra fields for hooks.

What we do is, check the placeholders when processing the hook in the providers manager, and if there are any fields which are not conn attrs and are not prefixed already, we add the prefix.  We don't need to worry about "hidden fields" or "relabeling" because these are only used with the built-in conn attrs.
@dstandish dstandish merged commit e58e424 into apache:main Oct 14, 2022
@dstandish dstandish deleted the add-extra-prefix-if-missing branch October 14, 2022 19:25
@ephraimbuddy ephraimbuddy added the type:improvement Changelog: Improvements label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants