Skip to content
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

Implement Redirect operation - Pre-UA and On-UA implementations #17

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

alexnj
Copy link
Member

@alexnj alexnj commented Oct 25, 2023

Implement Redirect operation - Pre-UA and On-UA implementations

@micahheineckoptimizely
Copy link
Collaborator

@alexnj
Added an Arguments column to the Explainer table, and fixed the markdown for rendering as code. Let me know what you think.

return [operation, `$=>{${args[0]}}`];
case Experimentation.Operations.Redirect:
// In case of a redirect, we use a CustomJs operation to rewrite location.
return [Experimentation.Operations.CustomJs, `$=>{window.location.href="${JSON.stringify(args[0])}"}`];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to validate our args eventually, for all of our operations, for both PRE and ON UA. I don't think that's necessary for this PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this ticket to resolve this: #20

Copy link
Collaborator

@micahheineckoptimizely micahheineckoptimizely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested it yet, it looks like it should accomplish the Redirect.

@alexnj alexnj merged commit ac1421e into main Jan 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants