Commit graph

18095 commits

Author SHA1 Message Date
Translation updater bot ecf3b9b388 Localisation updates from https://translatewiki.net.
Change-Id: Ieb257e045e7d996f595b9ff9b808fabdd7e754e0
2021-09-20 08:19:50 +02:00
jenkins-bot 4f34e9b049 Merge "Regression: Update selection in new sidebar relative to content" 2021-09-17 16:53:29 +00:00
Thiemo Kreuz 48b9a58737 Regression: Update selection in new sidebar relative to content
We broke something with the change I166b971. When we renamed that
method it started to override (and therefor disable) the method
with the same name from the base class.

I decided to move all code in the subclass for the moment. It might
be misplaced there (note how almost all code related to the new
sidebar is in the base class). But this is cleanup work for later.

Bug: T289043
Bug: T291151
Change-Id: Id255585e78967eee0f72c27727cd23211674923c
2021-09-17 16:45:24 +02:00
Thiemo Kreuz 9f783d962a Regression: Fix selection of first transclusion element
We removed this line of code in a recent patch, but it turns out
it's still necessary in at least one situation:
* Make sure you have a multi-part template where the first part is
  a wikitext snippet.
* Edit the template.
* Click the very first item in the sidebar.

Nothing happens. But the text cursor should be in the wikitext
field.

Another situation:
* Put the text cursor in the first wikitext field.
* Press shift + tab. Now a button in the bottom toolbar should have
  the focus.
* Click the 1st element in the sidebar. Again, nothing happens.

The extra .focus() call is redundant in many situations. But it also
doesn't hurt to repeat it. It will just re-focus the element that's
already focused.

Bug: T289043
Change-Id: Iccbe376b98a1b1e5469cd17e1c95d5d8869442d3
2021-09-17 14:46:06 +02:00
jenkins-bot b5388fec52 Merge "Regression: Fix broken click on top-level template elements" 2021-09-17 11:49:08 +00:00
Translation updater bot 3b917f0c16 Localisation updates from https://translatewiki.net.
Change-Id: I174d9ae52da1a7c4d6c5cc9a1a052dc57db9e6f2
2021-09-17 08:45:59 +02:00
jenkins-bot 4478eb15d8 Merge "Update and fix all @param config and @cfg documentation" 2021-09-16 20:09:15 +00:00
jenkins-bot c24e6a85d9 Merge "Rename weird .onBookletLayoutSet() event handler" 2021-09-16 12:39:55 +00:00
jenkins-bot 3486d9ea58 Merge "Rename showSidebar to expandSidebar for consistency" 2021-09-16 12:36:09 +00:00
Thiemo Kreuz 0fcfa5c4aa Rename weird .onBookletLayoutSet() event handler
It was called like this because the event is literally called "set".
But it doesn't explain _what_ is set.

The new name .onBookletLayoutSetPage() already appears somewhere
else in the codebase.

Change-Id: I166b971c08f5d0fae97fc9d6244117a680f84b7c
2021-09-16 14:18:57 +02:00
Thiemo Kreuz 482f4152cc Regression: Fix broken click on top-level template elements
The previous patch Id314ee8 was incomplete. The event changed.
The id in the event is not guaranteed to be a top-level partId any
more, but can be a template parameter's id.

Note: "Parameter id" and "pageName" is the same. The fact that
these ids match is how the left and the right side of the dialog
communicate.

Bug: T289043
Bug: T291151
Change-Id: I391f0f8edb96398fd33a2e0b01003013c52776da
2021-09-16 10:48:09 +02:00
Thiemo Kreuz cf14790450 Utilize native .isRemovable() in template dialog sidebar
The OO.ui.OutlineOptionWidget class does have an .isRemovable()
state. This is how OO.ui.OutlineControlsWidget decides if the
remove button can be used.

It appears like ve.ui.MWParameterPage forgot to mark required
parameters as not removable.

This makes some oddly specific code in ve.ui.MWTransclusionDialog
obsolete. Note how this class does not contain any other code
about "required" or other flags specific to parameters.

Note that one aspect of this patch will be visible in the old
sidebar: The trashcan will be visible on required parameters, but
disabled. It was hidden before. However, this actually improves
the UX. Hiding the trashcan made the up/down buttons jump around.
This makes it unnecessary hard to hit them. It also causes visual
distraction when navigating the list of parameters.

Let's stick to the upstream OOUI behavior.

The remove button still disappears when the only element in the
dialog is the template search widget. This is clearly an
entirely different state. (Don't ask why the up/down buttons are
not hidden. It was like this before.)

Bug: T289039
Change-Id: If78881e503f19f497f1993da4e5b9b09ee538307
2021-09-16 10:03:09 +02:00
Translation updater bot 6416dd275f Localisation updates from https://translatewiki.net.
Change-Id: I8f61526fb6c0c119e6bedbcb9c958065d421e0fd
2021-09-16 08:12:04 +02:00
Thiemo Kreuz dc2ce8ff59 Use OO.ui.PageLayout.setupOutlineItem instead of setOutlineItem
The separate setup method was introduced in 2014 via I7c3c133.
It appears like most of the code here was written before this
method existed. Let's update it.

* this.outlineItem is guaranteed to be set. No need for the `if`.
* The parent method is effectively abstract. There is no point in
  calling it, I would argue.
* The return value is never used. I.e. this method is never
  chained, and probably shouldn't.

Change-Id: Ida26ebdf09be74958936c3950ebdf6def9a69bc0
2021-09-15 12:18:13 +02:00
jenkins-bot fe6c46bbdc Merge "Merge "templateParameterClick" and "choose" events" 2021-09-15 10:11:12 +00:00
jenkins-bot 5c688148e8 Merge "Force delete button to be disabled on template parameters" 2021-09-15 09:30:32 +00:00
jenkins-bot 3b78f40e7a Merge "Optimize .selectPartById() to fire less events" 2021-09-15 09:07:18 +00:00
jenkins-bot 8ca4f2cc36 Merge "Change confusing property name in AddParameterPage" 2021-09-15 08:22:27 +00:00
jenkins-bot 345e1b6e09 Merge "Update AddParameterPage validation when the template changes" 2021-09-15 08:22:24 +00:00
jenkins-bot 478c95f77d Merge "Hide "required" indicator in new sidebar" 2021-09-15 07:44:58 +00:00
Translation updater bot 6f24dbcc59 Localisation updates from https://translatewiki.net.
Change-Id: Ic2aafe4e21fbd6e16d2944e464e55ed3e91c663f
2021-09-15 08:15:00 +02:00
Bartosz Dziewoński 4117126ed2 Update VE core submodule to master (ec9e8022e)
New changes:
40bf00bfc Make default source mode font easier to override
ec9e8022e Update and fix all `@param config` and `@cfg` documentation

Bug: T290176
Change-Id: I20ddb21c23ac817c500f7f854bd2bb5d88bf779c
2021-09-14 23:59:07 +02:00
jenkins-bot 51eb60a81e Merge "Override default source mode font in placeholders too" 2021-09-14 21:21:47 +00:00
Thiemo Kreuz cb685d1216 Fix enter sometimes focusing the wrong template part
The behavior of the enter key in the new template dialog sidebar
is somewhat inconsistent. When pressing enter on the name of a
template it sometimes just doesn't work, but focuses something
else.

I realized this is because the message "The … template doesn't
yet exist." does not have a link. There is nothing to focus in
this element. The code just gives up and the selection returns
to whatever was selected before.

It works when there is a link in the template header. But this
is not even that useful.

Let's try to always focus the first parameter instead. The user
can still press Shift + Tab to focus the link to the template
page.

Bug: T289043
Change-Id: Id314ee8ebf47d387df08c7fb432094b6d8f7a3d2
2021-09-14 18:14:05 +02:00
Thiemo Kreuz 0f309f5b90 Hide "required" indicator in new sidebar
The previous patch I15aa2c0 (approved by UX) was incomplete. The
required indicator was still shown, depending on the skin.

This patch also reduces the amount of generated HTML when it
doesn't have an effect anyway. At the moment an empty <span></span>
is generated for _every_ parameter in the dialog. That's potentially
hundreds. But the element is only needed for deprecated and
(in the old UI) required parameters.

A missing space is added while we touch this code anyway. The
missing whitespace between label and indicator icon is confirmed to
be a bug by UX.

Styles that are the same on all skins are moved to the .css file
that's loaded for all skins. Missing word-wrapping for overly long
template parameter names (on the right side of the dialog) is added.
The position of the indicator icon was broken on Minerva the moment
a parameter name is a bit longer. Fixed by replacing `inline-block`
with `inline`.

Bug: T290492
Change-Id: Ie346d88969cec2effaf90d328d08567ab7b7bf75
2021-09-14 18:05:11 +02:00
Thiemo Kreuz 074a295a03 Change confusing property name in AddParameterPage
This kept confusing me. This is not an "input field", but a
layout container.

Change-Id: I77d8ddd4635c21512a5800f64e13e76fe08c3091
2021-09-14 17:15:55 +02:00
Thiemo Kreuz 51ad403117 Update AddParameterPage validation when the template changes
This applies in several situations. A trivial one is a parameter
that's already in use, but you uncheck it while the relevant
error message is shown. Vice versa.

Bug: T290977
Change-Id: Ia4114194a2efe34a7d51e633c776ce892cc9cb18
2021-09-14 17:13:02 +02:00
jenkins-bot 7bbdca3fb9 Merge "Avoid referencing methods via strings, take 2" 2021-09-14 14:09:35 +00:00
Thiemo Kreuz c33536112d Avoid referencing methods via strings, take 2
The first approach in patch I024ac1e doesn't work.

Change-Id: I4c9f8ef65c9e423a3e34f48483142a97ec6cef1e
2021-09-14 12:40:59 +00:00
Svantje Lilienthal 7f2821da78 Align more/less button
Bug: T290492
Change-Id: Iee160704d0875a1305ece5a4e075706e3ddb4957
2021-09-14 14:00:45 +02:00
Translation updater bot b583b7eac7 Localisation updates from https://translatewiki.net.
Change-Id: If68a82a32ad555486f66557263dd92772123f471
2021-09-14 08:33:27 +02:00
jenkins-bot 787bc0db17 Merge "Revert "Avoid referencing methods via strings"" 2021-09-13 18:55:22 +00:00
Bartosz Dziewoński a667045383 Revert "Avoid referencing methods via strings"
This reverts commit 48283d5f19.

Change-Id: Ifc2b7fb9e9fb7deaecb6c0475db0f9253e81869f
2021-09-13 18:36:07 +00:00
Thiemo Kreuz 5351217cc4 Add test for MWTemplateModel.getOriginalParameterName()
Bug: T285869
Change-Id: I4318af044037b5c7b3d661c5da54754ca883967b
2021-09-13 18:22:16 +00:00
James D. Forrester f69a68716d Update VE core submodule to master (f89945db3)
New changes:
2bb06f597 Localisation updates from https://translatewiki.net.
f89945db3 styles: Remove obsolete vendor prefixed properties

Bug: T278670
Change-Id: I7c93d8e5df427714708bc07f4a48ee5fa8aca690
2021-09-13 09:25:59 -07:00
Andrew Kostka a38338259d Improve input validation for the add parameter page
This patch improves the error handling for when a user tries to add
a parameter which is either an alias of a existing parameter, the
primary name of a existing aliased parameter, or a name/alias of an
existing parameter which is shown with an override label.

The error message was modified to always refer to the conflicting
parameter using the same name that is has in the sidebar.

Example: A parameter named "Parameter B" is already present in the
sidebar under its alias "B". When a user tries to add "Parameter B",
the new error message will inform the user that the parameter they
are trying to add already exists as "B".

Bug: T285869
Change-Id: I762b72b6cf14eb8ff5fcef63b4dcb70e297050de
2021-09-13 16:58:11 +02:00
Thiemo Kreuz 6680f5f141 Force delete button to be disabled on template parameters
It's impossible to use the delete button from the
OO.ui.OutlineControlsWidget to delete a parameter when the new
sidebar is active.

This partly fixes one of the issues mentioned in I97d77f4. The
delete button might stil become active for a moment (not fixed
yet), but doesn't stay active forever any more with this fix
in place.

Apparently this also makes another workaround obsolete.

Change-Id: I0bca310772c26149170af23ff8e5505c3ce4adf4
2021-09-13 16:01:25 +02:00
jenkins-bot 1666db730b Merge "Avoid expensive/unnecessary .getItems() call in a test" 2021-09-13 13:41:58 +00:00
jenkins-bot 26b3f5abf0 Merge "Consistent use of .forEach() in QUnit tests" 2021-09-13 13:41:28 +00:00
jenkins-bot 97a76b115e Merge "Comment & compact targetLinksToNewWindow related syntax" 2021-09-13 13:35:47 +00:00
jenkins-bot a52cb05804 Merge "Avoid referencing methods via strings" 2021-09-13 13:28:19 +00:00
jenkins-bot 401319cb67 Merge "Split focus handling from add/remove parameter events" 2021-09-13 13:28:16 +00:00
jenkins-bot b4ac8c45ce Merge "Make "templateParameterClick" event similar to "choose"" 2021-09-13 13:24:37 +00:00
Thiemo Kreuz 48283d5f19 Avoid referencing methods via strings
Should be a bit more obvious, I hope.

Change-Id: I024ac1e2d68bfe4c5af733c48967af4c51f336c1
2021-09-13 14:26:16 +02:00
jenkins-bot 45659e2c60 Merge "Fix "add parameter" widget not being focused on click" 2021-09-13 12:25:50 +00:00
jenkins-bot ad27a6d7bc Merge "More assertions for ve.ui.MWTransclusionOutlineParameterWidget" 2021-09-13 12:24:33 +00:00
jenkins-bot 0cfd298d18 Merge "Fix and test page name splitting code in template dialog" 2021-09-13 12:23:17 +00:00
jenkins-bot 1e4ef48393 Merge "Use OOUI 'classes' property instead of .addClass()" 2021-09-13 11:46:19 +00:00
jenkins-bot bb22a6e4bb Merge "Add tests for ve.ui.MWParameterPage class" 2021-09-13 11:45:00 +00:00
Thiemo Kreuz e62b3fecbb Optimize .selectPartById() to fire less events
There is no point in firing this event when noting changed.
This should reduce flickering and some of the issues described
in I97d77f4.

Change-Id: I7c387889a4a33dac5053cec11a0641d358020b56
2021-09-13 13:42:20 +02:00