Page MenuHomePhabricator

Wikidata Tours: Clicking final "end" tour" button should redirect to Tours page
Closed, ResolvedPublic

Description

Currently the user is left on the tour Wikidata item at the end of the tour. This confusing as they should not carry on editing the item.

Instead we they should always redirect to https://wikidata.org/wiki/Wikidata:Tours once thy click the final complete button.

At the moment, this can be done in relatively hacky way for any individual tour by adding the following for the final step in the JavaScript file for the tour:

{
    // Congratulations!
    onShow: function() {
        $('.guidedtour-end-button').off('click').on('click', function() {
            window.location = window.location.origin + '/wiki/Wikidata:tours';
        })
    }
}

However, there we should instead use the built in feature of the Tour library.

The only problem is that we don't seem to have any CSS for the {action: "wikiLink"} button type.

It also looks like the current version of Guidedtour-lib.js overrides the final button with an "end" button type so this would need to be adjusted so anything defined in the options overrides the default. Or we simply change the default to the link back to main tours page (which I personally think is good for all Wikidata tours)
Adding this to the step options does show a working button, but with no button text/image:

{ action: 'wikiLink', page: 'Wikidata:Tours' }