Commit graph

52 commits

Author SHA1 Message Date
Tim Starling 8fdb3aca5e Fix history tools performance
Thanks was causing history views to do 4 DB queries per row, due to the
RevisionStore::getPreviousRevision() call. The reason for doing it is
that it doesn't make sense to thank someone for a diff which includes
multiple authors. This does not apply to history pages -- even for
filtered history views, you can thank someone for a specific revision on
the basis of its edit summary.

So, distinguish between history tools and diff tools. Do the expensive
thing only for diff tools.

Bug: T284274
Change-Id: Ib631100b82958065a327dd18c927af4a78b8be15
2021-06-29 13:01:05 +10:00
STran 43dd004a62 Allow partially blocking giving thanks
- Add hook to enable blocking thanks
- Check if user is blocked from 'thanks' action
  and disable giving thanks from  API and UI if so

Bug: T242785
Change-Id: I290a7c39c6fcb22a8ab4a9ecbad76a239cb18ea0
2021-05-12 13:06:09 -07:00
Reedy 3749db7eba Namespace extension
Change-Id: Ic9e0b8d6b3cc6b9be4d6b026cb0a3b4a12aef38f
2021-03-20 18:22:17 -07:00
Reedy 4329060a7b $wgThanksLogTypeWhitelist has been replaced by $wgThanksAllowedLogTypes
Bug: T277963
Change-Id: I7ebc669b353bf6097cbcee3aca186d46419bb5c7
2021-03-20 04:43:48 +00:00
Reedy 6cbddccd6b Use updated CheckUser Hooks class
Depends-On: I3f66b660f9d59c0e88b182c9b06ee8cec994348e
Change-Id: I9ba257b9795d1860eff27a7a68a16524deaae6d9
2021-02-11 19:31:13 +00:00
Niklas Laxström 4f432261e9 Remove unused jquery.cookie dependency
Change-Id: Id9fca11c5f4129b757e6b16b868938766b9c57eb
2021-01-13 12:29:58 +01:00
jenkins-bot e379078b5b Merge "Enable thanks from pagelang and upload log" 2020-09-22 20:02:36 +00:00
DannyS712 317e0a6810 Hooks: Update to use DifferenceEngineViewHeader
Bug: T255769
Change-Id: I9b8f0359c3478fe1c028b47756d88062c2abcec8
2020-06-24 00:42:58 +00:00
DannyS712 1826d8984d Use new HistoryTools and DiffTools hooks
Extension requires 1.35+, so the hooks are available

Bug: T255494
Bug: T255495
Change-Id: I334928ebd081d53a7d95466e6c4b75715b941ec4
Depends-On: Ib2ab2e26a95affdd1dfa6b945f752157580ea2d3
2020-06-16 00:40:57 +00:00
Matěj Suchánek 850d8e29f3 Enable thanks from pagelang and upload log
"Page language change" is an occasional administrative
action, for which thanking should be possible.
And thanking for an upload is same as thanking
for creating a page.

Bug: T254992
Change-Id: Id4ecc6e11968e51b166e80f30e636da902857dd7
2020-06-10 10:21:43 +00:00
Gergő Tisza 3d17c58922 Use mw.cookie instead of $.cookie
Bug: T254024
Change-Id: If487ef4d14f308fd6da0d6b938e35dc68dca5b5e
2020-05-29 19:44:12 +00:00
jenkins-bot 3a74c5d2d5 Merge "Convert to manifest_version 2" 2020-05-12 16:09:19 +00:00
Reedy ba2603977b Convert to manifest_version 2
Bug: T252470
Change-Id: I677c41a5dddb03c8224e86bf738c0ac8d85b1647
2020-05-12 02:05:37 +01:00
James D. Forrester e8db596dfa extension.json: Fix name of QUnitTestModule
Change-Id: If54638bedb347e4b7b58d932d0c625acb44782b4
2020-05-11 14:42:48 -07:00
James D. Forrester 84448301ef Use QUnitTestModule instead of deprecated ResourceLoaderTestModules
CI already ensures that MobileFrontend is loaded alongside Thanks, so
the defensive check in the code isn't needed; ext.thanks.mobilediff is
defined statically, it's just injected into the page dynamically in the
onBeforeSpecialMobileDiffDisplay hook handler.

Bug: T232875
Change-Id: I5612a9be65f4d4adf4912645856540dbb04d2b34
2020-05-11 19:43:17 +00:00
James D. Forrester b1597235d8 extension.json: Alphasort hooks
Change-Id: If252a261e14613ac341e70ac572ad057e737143e
2020-05-11 12:37:38 -07:00
James D. Forrester fdc080873f extension.json: Simplify hook links as we only have one method per hook
Change-Id: Ie952f5c75acf862d1342f6178c8d49678f9cb471
2020-05-11 12:37:36 -07:00
Timo Tijhof a20b708ce7 Remove redundant dependency on 'mediawiki.notify'
Bug: T233676
Change-Id: I8373dc651df227fc3d2319d2ec6b8c4d47dacf1c
2020-04-22 18:34:06 +01:00
Reedy 7768edc7ec Update to use Flow\Notifications\FlowPresentationModel
Change-Id: I419af406f86c495d1448d2be07f8e891bdd7e47a
Depends-On: I25c65cbbc6d43dae7b2515a7b93f02b7180ba89f
2020-04-18 00:19:57 +00:00
jdlrobson 7a7f751b42 Create mobile thanks using the mobile library
The thanks icon had styling issues as it didn't use the mobile
icon and button fundamental components.

The icon should also be inside the button, the element should not
be both a button and an icon.

Bug: T229440
Change-Id: I0136466fe1452f904961b89ae7677fc1a511adab
2019-09-13 19:23:49 +00:00
Ammar eae0f237df Remove unneeded CSS for thanks toast link
Minerva now provides default styling for these links.
Also removing 'grunt-stylelint' package as there are no
CSS/LESS files in this extension any more.

Bug: T232102
Change-Id: I4e8b44d3159ab4a87103fa8471c7b1b145ac6016
2019-09-06 09:23:12 -07:00
Timo Tijhof bfa2bd3f72 Merge jquery.findWithParent.js into 'ext.thanks.flowthank'
Never loaded directly as entry point, and only used by one module
as dependency. Does not need to be its own module bundle.

Bug: T202154
Change-Id: I8bfcdc82f96fac6e3e269fcef351a822acd860bd
2019-08-05 16:09:10 +01:00
Thalia 810de9afbd Allow partially blocked users to use Thanks
Only prohibit users from using Thanks if they are blocked from the
associated page. This allows partially blocked users to use thanks
most of the time.

It also allows blocked users to thank on their own talk page, if
they are allowed to edit it, even if they are sitewide blocked.

Bug: T221371
Change-Id: Ic99ec38ea200e806963951b2dd67e56ecde63752
2019-05-22 22:05:33 +01:00
Matěj Suchánek 08f769b3b2 Enable thanks on Page creation log
Bug: T213660
Change-Id: I1edf7bc8d1d2d604034a07069f0f39fa30bf36ae
2019-02-25 08:03:44 +00:00
jdlrobson 4f276041f4 Add client side click to cancel on thank
When the thanks button is clicked a thanks will be
queued, that the user can cancel by clicking "cancel"
before the action is completed.

This should help the majority of users experiencing
accidental thanks.

Bug: T63737
Change-Id: I807f729c1b1a9e9b5952685bb18f540f81d70f47
2019-02-08 17:31:20 -05:00
Rafid Aslam b7cd517fb6 Move all apihelp translatable messages to separate files
Should be merged along with
Ie566f9b0b6ba267470c01f17c3f4ea74482e2d2d

Bug: T189982
Change-Id: Id3d44fe0e7884276f7c81253f6b765984f5c9945
2018-11-21 07:00:55 +07:00
jdlrobson 5927de143e Fix indentation in extension.json
Follow up to I82ae596330aff8387653c65a6bab5ff729641a80

Change-Id: I849599e57bb546d99c1435222bc183ab8e5971c0
2018-08-16 10:18:20 -07:00
jdlrobson a6fa3c4977 Do not use PNG for thanks button
Instead use mediawiki.ui and ResourceLoaderImageModule

Other changes:
* Add gender support to thanks-button-thanked

Depends-On: I0745e112d11026ed59d8daca990b313305cd094a
Bug: T198151
Change-Id: I82ae596330aff8387653c65a6bab5ff729641a80
2018-08-09 17:13:21 +00:00
C. Scott Ananian edd6818eb9 Replace uses of deprecated Language::truncate()
See I2291c69d9df17c1a9e4ab1b7d4cbc73bc51d3ebb for the anticipated
hard-deprecation of this method in core.

Bug: T197492
Change-Id: I5d4ec96afe82910ffd18377b5f5f94405f73e9eb
2018-06-15 20:24:32 -04:00
Kunal Mehta b8b892bb98 Hard depend upon Echo in extension.json
This extension is useless without Echo, and the API modules already
disable themselves if it's not installed. Just absolutely require Echo
to be installed.

Change-Id: I653eea78668bfe0875bc5a33e2d45607106d4ee5
2018-04-11 01:00:30 -07:00
Niharika Kohli 896ea17303 Allow thanking for flow-lock-topic and flow-restore-topic
Bug: T191482
Change-Id: I3f5bd11d0c02ee25b305c73a708f995cb59e4624
2018-04-09 17:40:38 -07:00
Sam Wilson 2059e3ff4b Add revision-thanking links to some log entries
Many log entries are associated to (exactly one) revision,
and for these (only, and only where the log type is
whitelisted) we add a thank-link that behaves exactly
as the thank-link on diff and history pages.

Bug: T189752
Change-Id: I5f4e84c65d4fe2d95b20cdb3c3f9522ad3e5f422
2018-03-22 11:57:55 +08:00
Reedy 2735468029 Revert "Add revision-thanking links to some log entries"
This reverts commit 9f393ef9dd.

Change-Id: Ie76fef8dc25b1134f1f60da50a87b00115154041
2018-03-14 21:49:25 +00:00
Sam Wilson 9f393ef9dd Add revision-thanking links to some log entries
Many log entries are associated to (exactly one) revision,
and for these (only, and only where the log type is
whitelisted) we add a thank-link that behaves exactly
as the thank-link on diff and history pages.

Bug: T186763
Change-Id: I2af380d5cb06f19ef9eb5b232d95ad87379b5d9b
2018-03-13 09:33:15 +08:00
Max Semenik ed087b044c Reintroduce the API to thank for log entries
Originally introduced in b84eedc74e, it was reverted for security concerns.
New changes:
* Instead of bundling the log summary with notification, load it on display
* If the log event has been suppressed after the thanks for it has been sent,
  silently delete the event to prevent the confusion of linking to something
  zapped.
* Keep the 'already sent' cache key compatible with old format
* Validate the log id in the API
* Change ApiCoreThank::getRevisionFromParams() to ApiCoreThank::getRevisionFromId()

Bug: T186855
Bug: T188791
Depends-On: Ic5e9db0def857d9dcecbd06bf081c8c83712c1ea
Change-Id: I03aea7d9f4dfa0fe49639c53968deabf89999d2d
2018-03-06 13:08:47 +08:00
MaxSem 3b2397fea9 Revert "Add support to the Thanks API for thanking log entries"
This reverts commit b84eedc74e.

Bug: T188791
Change-Id: If55ed6cbb5da34c0034da3cc564c6a8ff82448d2
2018-03-02 22:59:20 +00:00
Sam Wilson b84eedc74e Add support to the Thanks API for thanking log entries
Add a 'log' API parameter (for the log ID to thank), and add
a whitelist config variable for specifying which log types are
thankable.

Bug: T186855
Change-Id: I58ae90c9729c0066f952e90fca2cf99b029d0d9b
2018-03-01 14:57:57 -08:00
jenkins-bot 9c708f1ac2 Merge "Add jquery.cookie dependency" 2018-02-24 00:07:51 +00:00
Sam Wilson 78831d2b68 Rename files and classes in preparation for adding log-thanks
Bug: T186855
Change-Id: I20f5d200c33e395aca9489b73d0ed9b1d0ad5b8c
2018-02-21 12:49:21 +08:00
Sam Wilson 84834d5b41 Add jquery.cookie dependency
Bug: T187851
Change-Id: I6158f557cbafcfbca7e6c7d3e0c5960250133e46
2018-02-21 11:50:22 +08:00
Sam Wilson 2e7e5e0190 Move classes to includes/ and rename some to match class names
For conformance to coding standards. This removes an exclusion
from the phpcs config.

Change-Id: I1481a3e7e68a81daf310ea3c7bf9dc48cdaf140b
2018-01-30 10:32:03 +08:00
Roan Kattouw 6bb7939a79 revthank: Clarify confirmation message and change yes/no messages
Bug: T159302
Change-Id: I49ac7d644f207fe76a49efd650b727e33049b3af
2018-01-19 17:07:42 -08:00
Matthew Flaschen 545a7de5e2 Add missing jQueryMsg dependency for mobile diff view
Bug: T170917
Change-Id: Ibca76902e0d748b95bb57e871993a4dc2664d5cd
2017-07-18 15:27:41 -04:00
Fomafix 2d0c8bd0f8 Fix module dependencies
* Change dependencies for 'ext.thanks.mobilediff' from
  'mediawiki.notification' to 'mediawiki.notify' because
  ext.thanks.mobilediff.js uses mw.notify and not mw.notification.
* Add module 'mediawiki.api' to dependencies for 'ext.thanks' because
  ext.thanks.thank.js uses mw.Api.

Change-Id: Icae08555c5ec0297c390e5161f9269b9c84f1145
2017-06-27 15:28:12 +02:00
jdlrobson 35964a6c77 Remove MobileFrontend toast dependency
Rather than using mobile.startup, switch
to using mediawiki.notification which is more
lightweight and does same thing.

Bug: T155801
Change-Id: I23d75272602766e24e8b01410f4a88609eda6dee
2017-01-26 11:56:18 -08:00
Reedy b96f1a8b70 Remove 'UnitTestList' hook
No longer needed now that extension unittests are autodiscovered.

Bug: T142120
Bug: T142121
Change-Id: Ic856aa0d3d7af53f1405ceee43aff41bface3b58
2016-08-05 17:40:28 +01:00
Stephane Bisson 245190c451 Cleanup old notification config
* Remove unused formatters
* Remove old formatter config
* Remove unused messages

Bug: T121612
Change-Id: I4c49c12bcf1366cd7a786aadaab6dfed67a3428a
2016-07-20 11:25:05 -04:00
Prateek Saxena be2ed5f959 Use OO.ui.alert() instead of plain alert
Bug: T128891
Change-Id: Ib5d47bad48e8d42098de19a2c87dd863a38c2a2d
2016-07-15 20:55:21 +05:30
Stephane Bisson b52fd0ea6f Make thanks notifications expandable bundles
* edit-thank
* flow-thank

Bug: T120152
Depends-On: I1507cae360f45cc87f2d60e966b4d047abfa202d
Depends-On: I91abb2dded9ab7f124aaa798dd07c52576ee791b
Change-Id: I21e36d1874967495d9541f621481cfccf54b7f19
2016-06-27 10:02:59 -04:00
Michael Holloway a93a610abe Remove mobile.special.mobilediff.scripts dependency
The mobile.special.mobilediff.scripts module was removed from
MobileFrontend[1] but remains listed in its extension.json and as a
dependency here.  This removes the dependency so it can be removed
from MobileFrontend.

[1] See I40ac27e56fcc3ccc58870660d0ed7353c7a17748

Bug: T131757
Change-Id: I399ef6a0abaeaf3ca10461f4579a0a3fcdab9df3
2016-06-18 17:02:24 -04:00