Page MenuHomePhabricator

Allow client-side scripts to fill in settings when using the defaults
Closed, DeclinedPublic2 Estimated Story Points

Description

User story

As a user of the global watchlist user script,
When I (eventually) begin to use the extension,
I want to be able to easily copy my settings from the user script to the extension

Acceptance criteria
  • On Special:GlobalWatchlistSettings, when the user has no settings saved, client-side scripts have a chance to fill in those settings rather than always using the defaults
Notes

Can use mw.hook to pass the settings object, client-side scripts can modify the objects
Ref: https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.hook

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
DannyS712 triaged this task as Lowest priority.Jul 24 2020, 7:28 AM
DannyS712 moved this task from Backlog to Later on the MediaWiki-extensions-GlobalWatchlist board.
DannyS712 set the point value for this task to 2.

Not an issue until the extension is deployed

Notes in case it is converted to an HTMLForm first:
To add more sites client-side:

var addMore = OO.ui.infuse( $('#mw-input-wpsites--create') )
addMore.$button.trigger('click')

and then set the field values accordingly

Thinking about this again, given that outside of a one-time migration at the start the need for this should be pretty rare, adding the functionality to the user script version to just set the options via the api directly might be a better idea

Notes in case it is converted to an HTMLForm first:
To add more sites client-side:

var addMore = OO.ui.infuse( $('#mw-input-wpsites--create') )
addMore.$button.trigger('click')

and then set the field values accordingly

It was indeed converted to an HTMLForm

Thinking about this again, given that outside of a one-time migration at the start the need for this should be pretty rare, adding the functionality to the user script version to just set the options via the api directly might be a better idea

But we no longer have a dedicated api


At the moment, given the differences between the user script version and the extension, and the fact that the script will still work, leaning towards declining this and just adding an alert to the script telling people that the extension is now available and that they may want to use that instead.

DannyS712 moved this task from Later to Done on the MediaWiki-extensions-GlobalWatchlist board.

This was intended for helping with the initial migration from the user script to the extension, but wasn't done in time - I went with an alert in the userscript saying the extension is available. I do not believe this is a need for this anymore