Commit graph

114 commits

Author SHA1 Message Date
Umherirrender c697355f04 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I230ada2f4ad95f86593759e8320d47acdf06a749
2024-10-20 13:21:21 +02:00
Kosta Harlan f2220b151e
Hooks#onLogEventsListLineEnding: Don't add link for temp users
Why:

* Temp accounts cannot thank other users, so do not add the "thank" link
  in log entries.

What:

* Change condition to check if a user is not named, rather than if they
  are anonymous
* Add an integration test to verify the behavior for anon, temp, and
  named users

Bug: T375209
Change-Id: Idb772a3072a6dc8a9d052cebb306b558f49caf31
2024-09-23 22:21:03 +02:00
jenkins-bot e6e7a6305f Merge "Remove usage of writeapi userright" 2024-08-01 21:06:46 +00:00
libraryupgrader 830bfffa5c build: Updating npm dependencies
* eslint-config-wikimedia: 0.27.0 → 0.28.0
* grunt-stylelint: 0.19.0 → 0.20.0
* stylelint-config-wikimedia: 0.16.1 → 0.17.1

Change-Id: I0f57a77c738f26a0cda10af9f3891d4beee447d9
2024-06-08 05:08:42 +00:00
Fomafix 41e2942d94 Use namespaced PHP classes
Change-Id: I98890c4a41c913b5e20c97c9ad1deaa4c2b4fe5b
2024-05-11 08:58:37 +00:00
Jon Robson b119a36f62 Special:MobileDIff no longer exists so remove associated code
Bug: T360389
Change-Id: I0cd7e1269beb707b8e98d37e824dc260c8e670ea
2024-04-25 12:10:28 -07:00
libraryupgrader 17b410c6ec build: Updating eslint-config-wikimedia to 0.27.0
The following rules are failing and were disabled:
* modules:
  * prefer-const

Change-Id: I318c62b99290c67f0d04d26aad12379c0da0b944
2024-04-20 01:18:40 +00:00
Fomafix 2d2840376f Use setGroupPermissions instead of mergeMwGlobalArrayValue
Change-Id: I8fd3b18f3d09cf9b4bc8de350896aaccbd0cb001
2024-03-21 19:28:01 +00:00
Umherirrender 0bcfca3d90 build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0
Change-Id: I79de198b0a5dedb191a96056ccf33eb3b11b3026
2024-03-12 20:52:59 +01:00
Fomafix ad6496d4fa Use overrideConfigValue instead of setMwGlobals
Change-Id: I22e77c4019cf06796c3a00191bbd7f2e3fd0b254
2024-03-06 20:23:12 +00:00
Reedy 76167abd5b Remove usage of writeapi userright
Bug: T294397
Depends-On: Ifad2edc782b36d21c8c67fecde7f011dce02c11b
Change-Id: Ifd3359d003467c2ca0743d05f5f123894d4b5987
2024-02-15 20:44:18 +00:00
Umherirrender f5db77c750 Use namespaced classes
This requires 1.42 for some new names

Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I1b433ab02231087e0f84a734092751ce2cf28b2c
2024-01-04 22:22:56 +01:00
Ed Sanders 4826b01af6 Update ESLint and fix config
Change-Id: I53da439c547b1931140a407a71284643aa7f5d49
2023-11-30 12:01:26 +00:00
Umherirrender 2609a7c0c9 tests: Remove fallback to deprecated MWIntegrationTestCase::$users
getTestUser is there since 1.28, extension requires 1.41

Change-Id: I88a48435f0a1ecd7093af68dd7a4c96274d24d7c
2023-11-26 12:01:03 +01:00
Martin Urbanec 9cef38e80f IP Masking: Do not allow temporary users to thank other users
It has been decided to not allow temporary users to thank
other users (see task). This is because the transition
between anonymous and temporary account is nearly invisible,
and it might be confusing why the thanking ability appears
and hides.

Bug: T345679
Change-Id: I62e67327c9a80b3da9e98a2dccdd4ec2051f3026
2023-10-03 22:23:02 +00:00
Daimona Eaytoy 933f5591e5 Make ApiCoreThankIntegrationTest more robust
Use methods provided by core to create (non)existing test pages and
editing them. Make sure that revId is not 1, or the test will fail due
to T344475. This is needed by core change Ie2f1809d.

Change-Id: Ib7ea8c566d330db27c8abfcb4a783ddbd31787e0
2023-08-18 00:37:20 +00:00
Daimona Eaytoy cae27c61f3 Add ApiCoreThankUnitTest to the Database group
The test needs the DB for various things related to user blocks.

Change-Id: I1076c347f02de7285e1fdc77feccb59ad60cd08a
2023-08-06 21:30:56 +02:00
bwang b6a7933544 Update Thanks extension to use IconButton.js from MobileFrontend
Bug: T340262
Change-Id: Id177ce9a11b2f5e82bd1099613fd7a9c4cde6dc5
2023-07-28 11:17:43 -07:00
Func b96b4e1fde ServiceWiring: Rename LogStore to ThanksLogStore
`LogStore` is too ambiguous, usually services from extension should
be prefixed with its name.

Change-Id: Ia8a8474ac44ee9990b22ca4650d3ae5311744d19
2023-05-26 21:08:54 +08:00
jenkins-bot cfb40caaa8 Merge "tests: Make PHPUnit data providers static" 2023-05-21 13:06:59 +00:00
Umherirrender fc84a35180 tests: Make PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: Id40d7df5f9d380aca50ce4c15bbf83897333ecc5
2023-05-20 19:12:59 +02:00
Marcin Kostrzewski e483b844c9 API: Refactor to match modern code standards
I've moved all API classes into a separate folder,
as I felt like grouping modules improves readability.
APIs themselves had storage logic which I extracted and put
in another folder. I was originally going with an interface
to the storage to allow for other storage methods than
log entries, but the code was too tightly coupled with it,
so I've left that for another day. Added dependency injection
for all services and used ServiceOptions for config vars.

Bug: T337002
Change-Id: Ie8a1f435d635e1d0e1286f673bfe96cc4fdfe4fe
2023-05-20 17:57:26 +03:00
Bartosz Dziewoński dc8f07d2af API tests: Assert error codes, not error messages
Depends-On: I752f82f29bf5f9405ea117ebf9e5cf70335464ad
Needed-By: Ie17987991d1e9a0d77da97e3a81fe0a21c6d7866
Change-Id: I353e34d81afaa06750f8725181c808fabcebea42
2023-04-26 17:55:21 +00:00
Umherirrender 2a9a2e08e1 build: Updating npm dependencies
* eslint-config-wikimedia: 0.22.1 → 0.24.0

Change-Id: I8802407ab40834168d48f19a7926f9254c17a59e
2023-03-24 20:48:23 +01:00
Thiemo Kreuz a9878ab2ab Some smaller general code cleanups
In detail:
* Use more compact syntax to avoid a bit of code duplication.
* Use createMock() shortcut in tests.
* Avoid hiding code in strings.
* Remove a comment that literally repeats what the code says.

Change-Id: Ibedef380489451268e2e87f0864164e8f9737913
2023-01-03 12:30:41 +01:00
AnaïsGueyte d287af1af1 Remove GlobalBlock calls from Thanks
Remove the usage of User::isBlockedGlobally and User::getGlobalBlock

Bug: T318891
Change-Id: I79450b34523d0ecb1a7a7b1e5a99b7650e02866e
2022-11-09 14:01:45 -05:00
Timo Tijhof 0fddc4a258 tests: Remove use of QUnit 1.x setup()/teardown()
No longer supported upstream. Was kept compatible via monkey-patch
in MW core testrunner.js. While at it, also:

* Convert one file from an ad-hoc closure to using the QUnit.module()
  scop, as per <https://api.qunitjs.com/QUnit/module/>.

* Use inline variable declarations per current code conventions.

* Remove needless duplication and description from hardcoded
  assertion message.

Bug: T250045
Change-Id: If556b338c6151108aeebd241b828ccb420c8b857
2022-05-04 10:46:10 +02:00
Ed Sanders aaaa5b63da JS: Update APIs to make more extensible
* Don't require a jQuery element with a specific attribute
  to record thanks. Instead pass in the thanked ID directly.
* In Flow, don't override the cookieName static property,
  instead pass it in as an argument.
  Change the static property (effectively a global) prevents
  us from having multiple types of thanks on the same page.

Change-Id: Ia569f8636f070f2af69f89d7da66c9a6f9821d24
2022-01-25 22:02:15 +00:00
Ed Sanders 1daf4bcf2d build: Update eslint config
Change-Id: If0871326eb35f8cb6ef026784cd04fca5754ab59
2022-01-25 22:01:31 +00:00
Alexander Vorwerk d7b1bfe6f3 Replace usages of deprecated wfWikiID()
The global function wfWikiID() is deprecated since 1.35 and it's usages
should be replaced with WikiMap::getCurrentWikiId().

Bug: T298059
Change-Id: I0cb8e96b7e988aa1d6dce0cb3cddf65fc627b214
2021-12-21 02:32:37 +01:00
Alexander Vorwerk c60c7f01f9 Avoid using WikiPage::factory()
WikiPage::factory() is deprecated since 1.36 and should be replaced
with WikiPageFactory::newFromTitle().

Bug: T297688
Change-Id: I8a141512c51b5f7901ce1af36062f9b1ae64ef7b
2021-12-14 22:49:30 +01:00
Alexander Vorwerk 559e3e04ce MediaWikiTestCase -> MediaWikiIntegrationTestCase
MediaWikiTestCase has been renamed to MediaWikiIntegrationTestCase in 1.34.

Bug: T293043
Change-Id: Ic6305e141941667fc52844ae45386ce69a60e8e4
2021-10-13 12:28:31 +02:00
libraryupgrader 56e6d0d365 build: Updating mediawiki/mediawiki-codesniffer to 37.0.0
Change-Id: Ic46650ca7e95698d6c2ee045a62a3f4115c14a2d
2021-07-24 06:11:02 +00:00
Roman Stolar 28501aa637 Update DatabaseBlock construct option 'by' to use User Identity only
Bug: T283641
Change-Id: I0b79f99f89d386288529cd17b8542b90cccf451a
2021-06-01 12:21:42 +03:00
Kunal Mehta 8055732ae0 Remove PHP 5.3 $this closure workaround
Change-Id: Ic1f8147e85ad751927153d5a8f6330d37800aacb
2021-05-14 10:25:15 -07: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
libraryupgrader 7662f6c61b build: Updating eslint-config-wikimedia to 0.20.0
Change-Id: I808cbd2471d4cec72df383d03f208ea4d92da106
2021-04-14 10:37:46 +00:00
Umherirrender 6a8776d1b1 Use ::class for class name
This works also for non-existing classes,
because it is resolved on compile time

Change-Id: Ib40f1aeea35e474530fea42c43d593f6c86f4487
2021-04-08 21:14:44 +02:00
jenkins-bot af5711bf3f Merge "Namespace extension" 2021-03-21 17:52:26 +00:00
Reedy ce439d6ba4 Remove use of whitelist in comment
Bug: T277963
Change-Id: I0355bd4fe912b161d0769eb47d03db5400ce5601
2021-03-21 05:08:01 +00: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
libraryupgrader 2c2b79f9b9 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 34.0.0 → 35.0.0
* mediawiki/minus-x: 1.1.0 → 1.1.1

npm:
* eslint-config-wikimedia: 0.17.0 → 0.18.1

Additional changes:
* Added the "composer phan" command to conveniently run phan.

Change-Id: I9f93be1e4480b38031295771aa2a8b540268b2db
2021-01-30 16:07:37 +00:00
Umherirrender 1ec0aed694 Inline class property in tests
Change-Id: Iaa52bd9faafee62ac524e19964bd1aa2feea129b
2021-01-17 20:15:26 +01:00
DannyS712 a1e577c9a5 Remove use of the Revision object returned in WikiPage::doEditContent
Bug: T254952
Change-Id: Ifbdfd9bad21209be186bc93a4a82c034a8c6a26c
2020-06-10 00:31:25 +00:00
jenkins-bot 27104dd11a Merge "Remove use of WikiPage::doEditContent" 2020-06-05 17:14:14 +00:00
jenkins-bot 850fb00009 Merge "Use mw.cookie instead of $.cookie" 2020-06-03 11:12:01 +00:00
libraryupgrader 081ad97a0c build: Updating mediawiki/mediawiki-codesniffer to 31.0.0
Additional changes:
* Replaced "jakub-onderka" packages with "php-parallel-lint".

Change-Id: I1f3e80ffbcdf2526a6533af6d7008d9f3456531c
2020-05-30 08:23:03 +00:00
Gergő Tisza 3d17c58922 Use mw.cookie instead of $.cookie
Bug: T254024
Change-Id: If487ef4d14f308fd6da0d6b938e35dc68dca5b5e
2020-05-29 19:44:12 +00:00
DannyS712 f1ec6e6542 Remove use of WikiPage::doEditContent
Extension now requires MW 1.35+, so remove outdated version checks

Bug: T250638
Change-Id: I54f9865a09e7dcc00fe74f9d5dd3d73affde331a
2020-05-23 08:16:56 +00:00