-
Notifications
You must be signed in to change notification settings - Fork 0
add exit preview params #45
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
Conversation
| <% unless @task_preview_mode == 'true' %> | ||
| <a href="<%= edit_template_path(@template, @auth_token || session[:auth_token] ? { auth_token: @auth_token || session[:auth_token] } : {}) %>" class="base-button" data-turbo="false" style="flex-shrink: 0; padding: 0px 24px;"> | ||
| <% exit_params = {} %> | ||
| <% exit_params[:auth_token] = @auth_token || session[:auth_token] if @auth_token || session[:auth_token] %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super confusing to me, when would we ever NOT have an auth_token here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the conditional at the end
| <a href="<%= edit_template_path(@template, @auth_token || session[:auth_token] ? { auth_token: @auth_token || session[:auth_token] } : {}) %>" class="base-button" data-turbo="false" style="flex-shrink: 0; padding: 0px 24px;"> | ||
| <% exit_params = {} %> | ||
| <% exit_params[:auth_token] = @auth_token || session[:auth_token] if @auth_token || session[:auth_token] %> | ||
| <% exit_params[:external_account_id] = @external_account_id if @external_account_id.present? %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm reading this right, we need the following:
- An
auth_token(which should always be present, right?) - An
account_idor apartnership_idwhich would then determine where we redirect back to, either retain side or partner hub.
Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
spaulsandhu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest leveraging some kind of presenter object here, but I think a couple of conditionals in the view are fine for now.
Jira ticket: CP-12221
Description
The params were not being persisted when exiting preview mode.
Changes
Demo
https://www.loom.com/share/962ebfa883524f0c81d763df3226f1df