Page MenuHomePhabricator

QuickSurveys should provide an API for applications (including special pages) to insert surveys into the page.
Closed, ResolvedPublic

Description

Background

We'd like to run surveys inside special pages and inside workflows (e.g. within the editor) or after certain events (e.g. completing an edit). By providing an API along with configuration options T393436: Improve QuickSurveys placement algorithm for non-Wikipedia support and T360996: Enable QuickSurveys to target users on different namespaces we will empower developers to setup and embed surveys in their pages.

User story

As a product owner of a special page I want to target users with surveys relating to the feature.

Requirements

  • There is an API that special pages can use to insert surveys
  • It is possible to set up a survey that will not be automatically added to the page.

BDD

  • For QA engineer to fill out

Test Steps

  • For QA engineer to fill out

Design

  • Add mockups and design requirements

Acceptance criteria

  • The ext.quicksurveys.lib module should be undeprecated and annotated with the @stable keyword to ensure that developers are aware it is stable to use.
  • The module ext.quicksurveys.lib exports a function showSurvey. showSurvey takes an additional parameter - the embed ID of the survey
  • showSurvey will add no survey to page if the ID of the survey doesn’t exist.
  • When force is set to false, and the ID matches an active survey, but the survey is not applicable to the page (e.g. the user does not match the current audience or platforms or coverage), showSurvey will not insert a survey into the page.
  • When force is set to true, sampling does not run. If the Id matches a survey a DOMElement will be returned which relates to the rendered server.
  • The showSurvey function is documented on wiki as stable.

Communication criteria - does this need an announcement or discussion?

  • Add communication criteria

Rollback plan

  • What is the rollback plan in production for this task if something goes wrong?

This task was created by Version 1.2.0 of the Web team task template using phabulous

Event Timeline

Change #1187518 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/QuickSurveys@master] Make showSurvey a stable API and allow programmatic insertion

https://gerrit.wikimedia.org/r/1187518

Change #1187518 merged by jenkins-bot:

[mediawiki/extensions/QuickSurveys@master] Make showSurvey a stable API and allow programmatic insertion

https://gerrit.wikimedia.org/r/1187518

Change #1194301 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[operations/mediawiki-config@master] Reconfigure labs survey to test embedElementId

https://gerrit.wikimedia.org/r/1194301

Change #1194301 merged by jenkins-bot:

[operations/mediawiki-config@master] Reconfigure labs survey to test embedElementId

https://gerrit.wikimedia.org/r/1194301

Change #1194303 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[operations/mediawiki-config@master] [beta] Allow displaying surveys on special pages

https://gerrit.wikimedia.org/r/1194303

Change #1194303 merged by jenkins-bot:

[operations/mediawiki-config@master] [beta] Allow displaying surveys on special pages

https://gerrit.wikimedia.org/r/1194303

Change #1194304 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[operations/mediawiki-config@master] [labs] Move namespaces to audience definition

https://gerrit.wikimedia.org/r/1194304

Change #1194311 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/QuickSurveys@master] showSurvey should always render the requested survey

https://gerrit.wikimedia.org/r/1194311

Change #1194311 merged by jenkins-bot:

[mediawiki/extensions/QuickSurveys@master] Follow up adjustments to showSurvey API

https://gerrit.wikimedia.org/r/1194311

Change #1194304 merged by jenkins-bot:

[operations/mediawiki-config@master] [labs] Move namespaces to audience definition

https://gerrit.wikimedia.org/r/1194304