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.
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
[NASAA-203/204] - Create AmpExperiment component, add top stories experiment to PS articles #12048
[NASAA-203/204] - Create AmpExperiment component, add top stories experiment to PS articles #12048
Changes from 21 commits
9a2290e
cdd54dd
bdd3edd
a215780
a4b4188
b11f47a
739314b
db2b3ff
8f709d0
bcc34e5
6aae312
3be6ae5
cfe5254
3e46a76
1725aa5
1c4c59a
4689617
cf7a1f1
68d5932
1674d2e
43f903c
92a84f8
5bacd6f
a031332
31fbb08
42ad63a
bf3c63e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm a bit confused on what's happening here. Does this always add in the experiment?
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 think it might be. This was flagged by a TS error I get on line 102
Right operand of ?? is unreachable because the left operand is never nullish.
If I add something in like the below on line 205 then the unit tests pass
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 think the function now returns either the blocks unchanged or the experimentally changes to the blocks. This should probably be made more clear by updating the name of the function to de-couple it from experimentation. i.e
getExperimentTopStoriesBlocks
should really begetTopStoriesBlocks
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.
Sorry that was just me being careless. You're right about the fix, I moved around a few things in the last refactor and completely left the check out. Re-added, should make sense now. Also missed some more renaming, but should be good now!
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.
@iainrj I've kept the name
getExperimentTopStoriesBlocks
since it doesn't get the data for the originalTopStoriesSection
in the secondary column and because the top stories blocks in the article blocks array havetype: experimentTopStories
.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.
Nice one, thanks :)
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.
Impressive I like that