Fix collaborative_editor_url incorrectly mapping trigger/edge s param to job#4593
Open
m4cd4r4 wants to merge 2 commits intoOpenFn:mainfrom
Open
Fix collaborative_editor_url incorrectly mapping trigger/edge s param to job#4593m4cd4r4 wants to merge 2 commits intoOpenFn:mainfrom
m4cd4r4 wants to merge 2 commits intoOpenFn:mainfrom
Conversation
…signs When switching from legacy to collaborative editor, the s (selection) param was always mapped to job= regardless of whether the selected item was a trigger or edge. This happened because determine_selection_type/2 needs atom-keyed socket assigns, but collaborative_editor_url/2 was passing the string-keyed URL params map instead. Adds an optional third assigns argument to collaborative_editor_url/3 and passes socket.assigns from the handle_event caller in edit.ex. Fixes OpenFn#4375
Author
|
The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #4375
When a user switches from the legacy editor to the collaborative editor,
the
squery param (selected node) is converted to the appropriate collabparam (
job=,trigger=, oredge=). The conversion depends ondetermine_selection_type/2, which pattern-matches on atom-keyed socketassigns (
selected_trigger,selected_job,selected_edge).The bug:
collaborative_editor_url/2was passing the URL params map(string-keyed) as the 4th argument to
convert_param, not socket assigns.Since the URL params never contain
:selected_triggeretc., the cond alwaysfell through to the default
"job"case - so triggers and edges were alwaysmapped to
job=instead oftrigger=oredge=.Changes
collaborative_editor_url/3now takes an optionalassignsarg (defaultsto
%{}for backward compat) and passes it toconvert_paraminstead ofthe URL params map
edit.exnow passessocket.assignswhen callingcollaborative_editor_urlfrom the
switch_to_collab_editorevent handlerChecklist