Merge "Remove broken remains of &campaign=leftNavSignup handling"

This commit is contained in:
jenkins-bot 2018-09-25 08:49:46 +00:00 committed by Gerrit Code Review
commit b2f2152fb0
2 changed files with 4 additions and 30 deletions

View file

@ -696,8 +696,6 @@ class SkinMinerva extends SkinTemplate {
[ 'data-event-name' => 'logout' ]
);
} else {
// note welcome=yes in returnto allows us to detect accounts created from the left nav
$returntoquery[ 'welcome' ] = 'yes';
// unset campaign on login link so as not to interfere with A/B tests
unset( $returntoquery['campaign'] );
$query[ 'returntoquery' ] = wfArrayToCgi( $returntoquery );
@ -1309,7 +1307,6 @@ class SkinMinerva extends SkinTemplate {
$user = $this->getUser();
$req = $this->getRequest();
$action = $req->getVal( 'article_action' );
$campaign = $req->getVal( 'campaign' );
$title = $this->getTitle();
if ( !$title->isSpecialPage() ) {
@ -1328,7 +1325,7 @@ class SkinMinerva extends SkinTemplate {
}
if ( $this->isCurrentPageEditableByUser() ) {
if ( $action === 'signup-edit' || $campaign === 'leftNavSignup' ) {
if ( $action === 'signup-edit' ) {
$modules[] = 'skins.minerva.newusers';
}
}

View file

@ -1,13 +1,8 @@
/* This code currently handles two different editing tutorials/CTAs:
/* This code handles the editing tutorial/CTA:
EditTutorial - When an editor registers via the edit page action, upon returning to the
page, show a blue guider prompting them to continue editing. You can replicate this by
appending article_action=signup-edit to the URL of an editable page whilst logged in.
LeftNavEditTutorial - When an editor registers via the left navigation menu, upon
returning to the page, show a blue tutorial in 50% of cases prompting them to try
editing. You can replicate this by appending campaign=leftNavSignup to the URL of an
editable page whilst logged in, although you must be in test group A to see the CTA.
*/
( function ( M, $ ) {
var PointerOverlay = M.require( 'skins.minerva.newusers/PointerOverlay' ),
@ -17,17 +12,7 @@ editable page whilst logged in, although you must be in test group A to see the
escapeHash = util.escapeHash,
inEditor = window.location.hash.indexOf( '#editor/' ) > -1,
hash = window.location.hash,
editOverlay, target, $target, href;
/**
* Whether or not the user should see the leftNav guider
* @ignore
* @return {boolean}
*/
function shouldShowLeftNavEditTutorial() {
return mw.util.getParamValue( 'campaign' ) === 'leftNavSignup' &&
mw.config.get( 'wgNamespaceNumber' ) === 0 && !inEditor;
}
editOverlay, target;
/**
* If the user came from an edit button signup, show guider.
@ -36,7 +21,7 @@ editable page whilst logged in, although you must be in test group A to see the
*/
function shouldShowTutorial() {
var shouldShowEditTutorial = mw.util.getParamValue( 'article_action' ) === 'signup-edit' && !inEditor;
return shouldShowEditTutorial || shouldShowLeftNavEditTutorial();
return shouldShowEditTutorial;
}
if ( hash && hash.indexOf( '/' ) === -1 ) {
@ -47,14 +32,6 @@ editable page whilst logged in, although you must be in test group A to see the
// Note the element might have a new ID if the wikitext was changed so check it exists
if ( $( target ).length > 0 && shouldShowTutorial() ) {
if ( shouldShowLeftNavEditTutorial() ) {
// Append the funnel name to the edit link's url
$target = $( target );
href = $target.attr( 'href' );
$target.attr( 'href', href + '/leftNavSignup' );
}
editOverlay = new PointerOverlay( {
target: target,
skin: skin,