Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Exclude featured experiment from home page list #3276

Conversation

meandavejustice
Copy link
Contributor

@meandavejustice meandavejustice force-pushed the 3244-featured-experiment-excluded-home-page branch from 1277864 to 43ac27b Compare January 23, 2018 19:46
@fzzzy
Copy link
Contributor

fzzzy commented Jan 24, 2018

I guess I didn't see this before opening my pr. Is there any reason to do it this way instead of just not featuring any experiment?

@meandavejustice
Copy link
Contributor Author

@fzzzy This is a different issue, this makes it so we don't duplicate the featured experiment in the experiment card list.

const { experiments, isAfterCompletedDate, featuredExperiments } = this.props;
const { isAfterCompletedDate, featuredExperiments } = this.props;

const experiments = this.props.experiments.filter(x => !x.is_featured);

Choose a reason for hiding this comment

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

This should be in a selector (see: reselect) to centralize this type of logic and prevent unnecessary recalculation and rendering of the DOM.

len(data['results']) - completed_experiments - 1)
else:
assert len(page.body.experiments) == int(
len(data['results']) - completed_experiments)

Choose a reason for hiding this comment

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

Can you add another assertion that the featured experiment specifically is not in the list of experiments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

filed #3295, I still can't get integration tests running on my machine, it looks to be because of tox-dev/tox#121. I can loop back around to get this test written when I'm back at my house and on my linux machine.

@meandavejustice
Copy link
Contributor Author

Moved filtering into selector, added unit test, and fixed exiting tests to work with change.

filed #3295 as a reminder to fix when I have access to my linux machine since tox-dev/tox#121 is causing failures on my windows laptop.

@meandavejustice meandavejustice force-pushed the 3244-featured-experiment-excluded-home-page branch from 900eea3 to b7c8536 Compare January 26, 2018 17:55
@SoftVision-PaulOiegas
Copy link

SoftVision-PaulOiegas commented Jan 29, 2018

@meandavejustice Hmm, cloned this branch locally and did a bit of testing on it. Not sure this is working as intended since I'm seeing also the "Cliqz" experiment while my browser is [en-US] localized. Maybe the change affected the localization restrictions?

@chuckharmston
Copy link

This generally looks good, but I'm sitting on approving until the issue Paul raised is addressed.

@meandavejustice
Copy link
Contributor Author

@chuckharmston I'll try and get to paul's changes tomorrow morning, I'll ping ya when they're in

@meandavejustice meandavejustice force-pushed the 3244-featured-experiment-excluded-home-page branch from b7c8536 to d9833bd Compare February 1, 2018 17:26
@meandavejustice meandavejustice force-pushed the 3244-featured-experiment-excluded-home-page branch from d9833bd to 7f93d4b Compare February 2, 2018 21:11
@meandavejustice meandavejustice force-pushed the 3244-featured-experiment-excluded-home-page branch from 7f93d4b to 042ba49 Compare February 2, 2018 21:57
@meandavejustice meandavejustice merged commit 1cb4603 into mozilla:master Feb 5, 2018
@meandavejustice meandavejustice deleted the 3244-featured-experiment-excluded-home-page branch February 5, 2018 20:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants