mozilla / fxa

Monorepo for Mozilla Accounts (formerly Firefox Accounts)
https://mozilla.github.io/ecosystem-platform/
Mozilla Public License 2.0
590 stars 212 forks source link

How are we going to "target views" without edits within the code? #5031

Closed data-sync-user closed 4 years ago

data-sync-user commented 4 years ago

┆Issue is synchronized with this Jira Task ┆Issue Number: FXA-1708

data-sync-user commented 4 years ago

➤ David Justice commented:

This will likely happen at the root level of the app by looking at the router / url

data-sync-user commented 4 years ago

➤ Les Orchard commented:

Random thought that occurred to me during sprint planning: Is there any overlap here with the way we handle deciding when to enroll a particular user in an experiment on fxa-content-server? Not entirely sure how we make that selection, but seems like it might be similar? I don't think that's entirely edit-free in the code, though

data-sync-user commented 4 years ago

➤ Barry Chen commented:

I don't think that's entirely edit-free in the code, though

Indeed, there's the rub.

data-sync-user commented 4 years ago

➤ David Justice commented:

We don't have to be entirely edit free of course, we just want to avoid having checks in every view if possible

data-sync-user commented 4 years ago

➤ Barry Chen commented:

[~djustice@mozilla.com] What should be the output of this issue? There's no code in master for deciding whether a user should see a survey or for rendering a survey yet.

data-sync-user commented 4 years ago

➤ Barry Chen commented:

[~djustice@mozilla.com] I've pushed up a couple small commits to demo the general approach: https://github.com/mozilla/fxa/compare/master...chenba:1708-survey-targeting

Content server: the code expects a module, when given the view path (and the user), to return either the survey content or nothing.

Payments: use react-router's useLocation.