-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get iwd experiment data to evaluate whether redirect to the cha…
…llenge ty page or the regular
- Loading branch information
Christian Bedon
committed
Feb 9, 2024
1 parent
6c6af72
commit 32099ca
Showing
4 changed files
with
51 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import experimentVersionFragment from '@/graphql/fragments/experimentVersion.graphql'; | ||
import checkInjections from '@/util/injectionCheck'; | ||
|
||
const injections = ['apollo']; | ||
|
||
export default { | ||
methods: { | ||
isIwdExperimentEnabled() { | ||
checkInjections(this, injections); | ||
|
||
const iwdExperiment = this.apollo.readFragment({ | ||
id: 'Experiment:IWD2024', | ||
fragment: experimentVersionFragment, | ||
}) || {}; | ||
// Only show IWD content and track experiment if: 1) experiment enabled, and 2) "women" loan checked out | ||
const EXPERIMENT_ENABLED_VERSION = 'b'; | ||
const womenLoanIncluded = !!this.iwdLoan; | ||
|
||
return iwdExperiment.version === EXPERIMENT_ENABLED_VERSION && womenLoanIncluded; | ||
}, | ||
} | ||
}; |