App: Allow interpolation string as the only value on input-code
interface
#22318
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Scope
When using Flows, there's cases that we just want to pass the response from previous operation to the next one.
For example, we might want to pass the payload of a Read Date operation to another flow using Trigger Flow operation.
For such cases we should be able to pass the following into the Payload option of Trigger Flow operation:
Although, the Code interface will complain because the Payload option is defined as JSON and this value is not a valid JSON so the linter will show an error.
Since this is a valid action to do (to pass
{{ $last }}
), in this PR we ignore the lint if the value is an interpolation, i.e., if the value starts with{{
and ends with}}
.What's changed:
Potential Risks / Drawbacks
{{
and ends with}}
, there will be no errorsReview Notes / Questions
For example, we could try add some validation into
OperationsService
but the App send the operation data within a flow which will be handled byFlowService
so no validation would be madeComparision
Screen.Recording.2024-04-25.at.19.07.03.mov
Screen.Recording.2024-04-25.at.19.06.03.mov
{{$last}}
the Code interface shows an error. Although the Flow works as expected. When I type"{{ $last }}"
the Flow throws an error.{{$last}}
does not show any error any more and Flow works as expected. Although when typing"{{ $last }}"
it will still throw an error as"
are not removed and Flow will have double quotes conflicting.Fixes #21263