Commit graph

17878 commits

Author SHA1 Message Date
libraryupgrader 3c0cf07510 build: Updating npm dependencies
* path-parse: 1.0.6 → 1.0.7
  * https://npmjs.com/advisories/1773 (CVE-2021-23343)
* jszip: 3.5.0 → 3.7.1
  * https://npmjs.com/advisories/1774 (CVE-2021-23413)

Change-Id: I38344cc565811c948d9d30aa82ba248427d2aa9f
2021-08-25 11:20:46 +00:00
jenkins-bot 0184aa7b14 Merge "Add a first trivial PHPUnit test" 2021-08-25 09:43:00 +00:00
jenkins-bot 0829e55b05 Merge "ApiVisualEditorEdit: data-{plugin} is not multi" 2021-08-25 09:19:17 +00:00
Kosta Harlan f9ce087e67 ApiVisualEditorEdit: data-{plugin} is not multi
Specifying it as such creates a 0 based index for what is a single value
property. This wasn't noticed before because I6b81ea318f52e accessed the
request object directly instead of using $params. See also
I3baa1ebb66559 for how this bug manifested in GrowthExperiments.

Bug: T289652
Change-Id: Ife8350d1cea79fc1dd6f3cb040a7801b9fe6db91
2021-08-25 10:47:13 +02:00
Thiemo Kreuz e56b4e82f5 Add test for ve.ui.MWParameterCheckboxInputWidget
This is not a file we created recently, but one we care about.
This is also a nice start to get in the mood to write tests.

Bug: T289560
Change-Id: I6475b00508cfa9188ab0d78c2bfd31bab8aed6ed
2021-08-24 15:44:43 +00:00
jenkins-bot 46bccb570a Merge "Replace Content::preloadTransform call to ContentTransformer::preloadTransform" 2021-08-23 16:09:16 +00:00
jenkins-bot e803c20007 Merge "Rename …ParameterCheckboxLayout now that it's an actual Widget" 2021-08-23 14:46:09 +00:00
jenkins-bot f1c9012916 Merge "Remove dependency from new sidebar to the BookletLayout" 2021-08-23 14:40:02 +00:00
jenkins-bot 6cdd1f6ebf Merge "Clean up toggleSidebar by splitting out 'auto'" 2021-08-23 14:31:39 +00:00
Thiemo Kreuz 3b5bc1b0b2 Fix non-existing property name .isNewSidebar
This is obviously a rebase mistake. We renamed the property in
I78a5129.

Change-Id: I43247ebf6c8910d12c90aa2dd1f9111f4ed69a07
2021-08-23 15:44:28 +02:00
Adam Wight b1a376a6e1 Clean up toggleSidebar by splitting out 'auto'
This naturally fits into a new function.

Bug: T274554
Change-Id: Icda432dc1a13243efddc9949f41a00162053970d
2021-08-23 14:38:24 +02:00
Translation updater bot d37304abce Localisation updates from https://translatewiki.net.
Change-Id: I7c59aa591a706da2e4bd3f56fba066edde31c2fa
2021-08-23 09:04:36 +02:00
Thiemo Kreuz d78af2c0e9 Add a first trivial PHPUnit test
This is more a proof of concept. The PHP code in this codebase
is rather small, but not trivial, and worth being covered by
tests.

Change-Id: I20c713c3c3be5d289947a343cd4fbf5256234a4a
2021-08-20 15:20:35 +00:00
WMDE-Fisch fc8ce9d7e3 Fix typos in doc
Change-Id: I5895207ca2d9de91bb92e6ab3566fbf2880bf393
2021-08-20 14:56:32 +02:00
jenkins-bot d6316145b5 Merge "Better method names in MWTransclusionModel class" 2021-08-20 11:29:49 +00:00
jenkins-bot 112bd2e5cb Merge "Call focusPart() only once in MWTemplateDialog.onReplacePart()" 2021-08-20 09:56:52 +00:00
jenkins-bot cdf7d907a9 Merge "Fix null error in ve.ui.MWTemplateDialog" 2021-08-20 09:48:27 +00:00
jenkins-bot 928b33ce69 Merge "Re-add adding undocumented paramters in some cases" 2021-08-20 09:33:18 +00:00
Thiemo Kreuz 8fbdd4258f Fix null error in ve.ui.MWTemplateDialog
Introduced via Ifd52369 just a few minutes ago.

Bug: T288827
Change-Id: I859f606c0608f9725bb64ff56a501a7a2c85c1df
2021-08-20 09:24:56 +00:00
jenkins-bot 6f052b928d Merge "Use page ID string instead of object reference" 2021-08-20 08:37:48 +00:00
jenkins-bot d3e8fe001c Merge "Streamline and harden template paramter search widget behavior" 2021-08-20 08:35:45 +00:00
WMDE-Fisch c3e5ea2fe1 Re-add adding undocumented paramters in some cases
Bug: T272487
Change-Id: I862c2802da1340d302a2a95e8e9d17bd6fd35877
2021-08-20 10:13:20 +02:00
Thiemo Kreuz 5fcc862eb1 Remove dependency from new sidebar to the BookletLayout
This replaces I8cf9ecd.

Significant changes:
* The …OutlineContainerWidget doesn't need to know the
  BookletLayout any more. The only remaining resason to have
  this dependency was some focus management. This is now done
  via an event.
* Renamed an existing event to match the new one. The two
  really mean and do the exact same, even if they are
  triggered from two different places.
* Simplified some existing code.
* Updated documentation.

Bug: T288827
Change-Id: Ifcf2cadabf7fa4b8ecb72e3937003fab3b00d9bb
2021-08-20 10:07:03 +02:00
Thiemo Kreuz 7045371a4d Better method names in MWTransclusionModel class
Names like "fetch" or "resolve" are heavily ambiguous and
continue to confuse me. I hope these new names reflect better
what's going on.

Bug: T288827
Depends-On: I587a203a9370e4742f87586b4f1867b37459c375
Change-Id: I8fa47ed313e7d7b2c114a5638a67c4f3c8b830f1
2021-08-20 10:00:10 +02:00
Thiemo Kreuz 4f9426d61a Rename …ParameterCheckboxLayout now that it's an actual Widget
This is a direct follow-up for Idc5e048.

Bug: T285323
Change-Id: Ia03d594386a9a59a4819bf78c7d2edcd465dfd52
2021-08-20 09:56:40 +02:00
Thiemo Kreuz 301c84bda4 Call focusPart() only once in MWTemplateDialog.onReplacePart()
This merges all code-paths that re-select a part (i.e. an input
widget on the right side of the template dialog).

Note there is an edge-case that actually changes with this
patch. When a page is removed, and creating a new page fails,
there is an `if ( page )` check. Before, the behavior was that
nothing gets selected in this case. After this change the
behavior is the same as if a page was removed: the closest one
gets selected. Not only does this make more sense. The `if` is
only a fail-safe anyway and should not result in different
behavior.

Bug: T288827
Change-Id: Ibb0260587588fb51a876658b16a81c5a73371dc4
2021-08-20 09:49:30 +02:00
Thiemo Kreuz 47bed4e1c8 Use page ID string instead of object reference
You will see where I'm going with this in the following patches.

Bug: T288827
Change-Id: Ifd52369d19c01499fb9cc801c3deec46c26810fd
2021-08-20 09:47:57 +02:00
Thiemo Kreuz 45096d1e2f Streamline and harden template paramter search widget behavior
What this changes:
* The moment the user selects anything in the parameter search
  widget, the input is cleared, no matter what happens next.
  Even in case of an error. We know the input was bad in this
  case. Let's get rid of it.
* The method makes sure it does not even try to add a
  duplicate parameter. This should be unreachable, but better
  be safe than sorry.

This is split from I5eeb973. I run into this while playing
around with different approaches related to hiding deprecated
parameters. Typically there should be no way the parameter
search widget offers a duplicate. Still I believe it's a good
idea to have this extra safety-net.

Bug: T272487
Bug: T288827
Change-Id: I04e76d73b4a3f6467d0ccf3ccff5d2f6b4114bd9
2021-08-20 07:46:26 +00:00
Translation updater bot c24b91ce5c Localisation updates from https://translatewiki.net.
Change-Id: Idb2f71dea2a96b8a27a01a5a253365aab898802f
2021-08-20 08:24:42 +02:00
jenkins-bot 1cad3e6eaa Merge "Introduce VisualEditorApiVisualEditorPreSaveHook" 2021-08-20 04:17:24 +00:00
Bartosz Dziewoński d6cac864b4 Update VE core submodule to master (4c2a0ea13)
New changes:
eaf2a3f59 build: Updating path-parse to 1.0.7
b4fa54166 Localisation updates from https://translatewiki.net.
aa8609dcf Localisation updates from https://translatewiki.net.
2d8502c6c Update OOUI to v0.42.0
4c2a0ea13 Revert "Comment out broken test after Chrome upgrade"

Change-Id: Ia871387678d7aad25471b372c15e27f00ae67300
2021-08-19 23:28:18 +02:00
jenkins-bot eaeaf7240a Merge "Rename custom outline widget events to not conflict" 2021-08-19 13:49:29 +00:00
jenkins-bot 834d7fee77 Merge "Rename conflicting .setSelected() method in outline widget" 2021-08-19 13:46:24 +00:00
jenkins-bot 2326468533 Merge "Remove unused code from ve.ui.MWTransclusionOutlinePartWidget" 2021-08-19 13:43:26 +00:00
jenkins-bot b7f572bd06 Merge "Reduce deep nesting in ve.dm.MWTransclusionModel" 2021-08-19 13:40:55 +00:00
jenkins-bot fdde92f820 Merge "Refactor onReplacePart in TemplateDialog" 2021-08-19 13:40:52 +00:00
jenkins-bot 0bf5c8493b Merge "Remove parameter adding on new sidebar code" 2021-08-19 13:40:16 +00:00
Thiemo Kreuz 095c891040 Remove unused code from ve.ui.MWTransclusionOutlinePartWidget
* getPartId() is unused.
* Use this.data instead of a custom this.partId.
* No need to store this.header as a property.
* Rename the event to "headerClick". That's enough when the
  event comes from a widget that does have the word "part" in
  it's name.

Bug: T274544
Bug: T288827
Change-Id: I8c70425403c6cd6a19e3a1cacb2b085e5c8b2e46
2021-08-19 11:03:44 +00:00
Thiemo Kreuz 3365c0fd66 Rename custom outline widget events to not conflict
The base widgets we are going to use (notably OO.ui.OptionWidget
and OO.ui.SelectWidget) also have events, and some of them use
the same names. Such conflicts are really hard to track down.

This is meant to be temporary. The goal is to use the events
from the base classes and get rid of the custom ones, if
possible.

Bug: T285323
Change-Id: I0f103a5bbb8fb800e57009e3bf709f00a651fdda
2021-08-19 09:55:11 +00:00
Thiemo Kreuz 68712e979b Rename conflicting .setSelected() method in outline widget
The problem here is that the OO.ui.OptionWidget base class
(changed in the previous patch) also contains a .setSelected()
method, but with slightly different behavior. This results
in crazy behavior when I try to make the outer widget an
OO.ui.SelectWidget.

Renaming the method to be a custom, private helper method
avoids this problem.

The plan is to actually use the default setSelected()
behavior and get rid of the helper method. This will be done
in later patches.

Bug: T285323
Change-Id: I84e752f20a4d07007fd4e61989f9b34983410950
2021-08-19 09:54:55 +00:00
WMDE-Fisch eeda931f59 Refactor onReplacePart in TemplateDialog
As preparation to introduce then new UI to add unknown parameters.
This is a few things:
- Merge the code paths when adding a MWTemplateModel
- Put code adding parameters to the dialog next to each other so
  that preventing reselection happens around that block
- Reduce duplicated code when re-focusing after addition
- Move adding the placeholder page to the end
- Add and clean up inline documentation

Bug: T272487
Change-Id: Ic700edd42027a928a236ed11f2c257fffe994257
2021-08-19 08:19:01 +00:00
WMDE-Fisch d41714f3a1 Remove parameter adding on new sidebar code
This removes the paramter placeholder page from all places where it's
not usefull anymore under the new sidebar.

The new UI will be re-added in follow up patches.

Bug: T272487
Change-Id: Ifc6f6f64fed1a1b23c92282e2a1bb40a7d401d72
2021-08-19 08:18:55 +00:00
Thiemo Kreuz 0af0978db4 Use same .useNewSidebar property name everywhere
This makes it easier to find stuff.

Change-Id: I78a51290767db4fe06ba0d4d2d251e8df07368b4
2021-08-19 10:13:16 +02:00
jenkins-bot ef43ae2950 Merge "Add getters for un-/documented parameters" 2021-08-19 07:19:05 +00:00
WMDE-Fisch 9aaeac3318 Add getters for un-/documented parameters
Will be needed to figure out when the new UI to add parameters should
be visible.

Bug: T272487
Change-Id: I97d2429b7845905784ef18e9d41cd5e6f85bbd01
2021-08-19 07:00:30 +00:00
Translation updater bot 8e21ecb83f Localisation updates from https://translatewiki.net.
Change-Id: I2462d03013068d9d14cedf14cfe60c98861656ac
2021-08-19 08:14:04 +02:00
jenkins-bot 5102ed2ab5 Merge "ve.ui.MWMediaDialog: mediaUploadBooklet may be undefined" 2021-08-18 16:50:07 +00:00
jenkins-bot f2e0388dc1 Merge "ve.ui.MWBackTool: Avoid using global ve.init.target" 2021-08-18 16:50:04 +00:00
jenkins-bot 68cfd5da16 Merge "Remove addParameter button from new sidebar" 2021-08-18 09:34:26 +00:00
jenkins-bot b05b165981 Merge "Make template parameter checkbox widget an OptionWidget" 2021-08-18 09:31:52 +00:00