Skip to content

Support templates in action target #25656

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

karwosts
Copy link
Contributor

Proposed change

Support templates in visual editor for action target field. We currently support it for all subfields of data, but not for target until now.

There is sometimes a bit of jankiness where messing with the selector will kick the user out of visual editor and back to yaml mode due to superstruct validation, but I didn't come up with a great solution that doesn't undesirably weaken the validation for other cases not involving templates.

E.g. in the example screenshot, if you add the key area_id: to the object selector you'll be temporarily kicked out of visual editor because the struct validator asserts that area_id cannot be null. We could add to the validator that area_id is allowed to be null, but I don't know if we want that. Or if you're editing the target template, and you remove the template identifier "{{", you'll be kicked out of visual mode because the superstruct asserts that if target is a string it must be a template.

I think that's not too bad of a tradeoff to support this though, it would be a fairly rare occurence to be making edits like that.

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@frenck frenck added the Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) label Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Templates in automations and scripts
2 participants