Commit graph

2740 commits

Author SHA1 Message Date
WMDE-Fisch e8bb4b5010 Make sure links in notices open in new tabs
Bug: T276574
Change-Id: I458afab8a34d97619f858c49eea0cef3ad1b83fa
2021-09-02 14:12:01 +02:00
jenkins-bot 52fe00975e Merge "Add notes and warning for missing parameter documentation" 2021-09-02 11:49:59 +00:00
jenkins-bot 52ed6367f9 Merge "Mark link to non-existing template page red" 2021-09-02 10:25:54 +00:00
jenkins-bot 7c304dc444 Merge "Highlight first template parameter when using tab to navigate" 2021-09-02 10:18:22 +00:00
jenkins-bot abdbf57f84 Merge "Fix click/enter on template parameters not focusing the input" 2021-09-02 10:11:49 +00:00
jenkins-bot c8e00fb98a Merge "Highlight corresponding template parameter in new sidebar" 2021-09-02 10:10:13 +00:00
Thiemo Kreuz a395e76653 Mark link to non-existing template page red
Bug: T272487
Change-Id: I15b377feda3a4e3b4570986668dfaa066afd70e9
2021-09-02 10:02:57 +00:00
WMDE-Fisch 1673f9f8bf Add notes and warning for missing parameter documentation
Bug: T276574
Change-Id: Iba0dd661ccdfd6cbb13aef7e8ace25995ecf0cf8
2021-09-01 17:29:25 +02:00
Thiemo Kreuz fc0b419540 Highlight first template parameter when using tab to navigate
I tried to memorize the cursor position in the list of
parameters. This way you could leave the list with tab, and
return to the original position with shift+tab. Unfortunately
this is not how the SelectWidget works. The moment the
highlight is gone it's gone. There is nothing that remembers
a position. We could introduce code to do this. But I feel
like this is a lot of effort for not much benefit. Also not
listed as a requirement anywhere, at the moment.

Bug: T285323
Change-Id: I8d44ba4539ec4b5535bc031accfeacd87e1886eb
2021-09-01 14:05:01 +00:00
Thiemo Kreuz 7a8ad64cbd Fix click/enter on template parameters not focusing the input
This got lost in patch I20dbd2b.

Both events come from the same sidebar class. The difference
between the two is:
* selectPart is when the button representing a top-level part
  is clicked.
* focusPart is when a parameter name is clicked while the
  parameter is already checked.

Yes, this is confusing at the moment. Following patches will
rename, merge and split a lot of these events to be much more
self-explaining.

Bug: T285323
Change-Id: I0c6b53c93c712ff5e47c1beb5199d590cba7ab1a
2021-09-01 16:01:17 +02:00
Thiemo Kreuz b7efea5559 Remove unused event listener from …ParameterSelectWidget
We forgot to remove this in I319896a. The individual
…TransclusionOutlineParameterWidgets don't fire this event any
more. Instead this is done by the …SelectWidget.

Bug: T285323
Change-Id: I2c29e45127464785ffdc32d73b52188fcbefb7bf
2021-09-01 11:58:36 +00:00
Thiemo Kreuz b0ddcb0010 Highlight corresponding template parameter in new sidebar
Note there are currently two different code paths utilizing two
different events. The existing event handler actually changes
the selection of the top-level part in the sidebar (the
corresponding template name turns blue). The new event handler
highlights a parameter (it turns gray). This is currently
intentional (partly because of a bug in OOUI). I will try to
merge these code paths, if possible.

Please test, and if it works fine from the user's perspective,
please merge it as it is for now.

Bug: T285323
Bug: T289043
Change-Id: I8fafee68b8b7ff225c7b3c327f483f3426d8129c
2021-09-01 11:15:37 +02:00
jenkins-bot f7265428e8 Merge "Try to use margin/padding instead of flex for template dialog" 2021-09-01 08:53:01 +00:00
jenkins-bot 3b5064318c Merge "Connect focus event from BookletLayout to new sidebar" 2021-09-01 08:47:07 +00:00
Thiemo Kreuz a4dac831d9 Try to use margin/padding instead of flex for template dialog
Proof of concept: while flex is – well – flexible, it feels like
this should be possible with some good old block containers and
margins. It's pixel-perfect in my test.

Bug: T288465
Change-Id: I1458900fff197e08ce318398524a3cf2b6b9ee2a
2021-09-01 10:35:52 +02:00
jenkins-bot fd4084efb9 Merge "Use ve.targetLinksToNewWindow in MWDismissibleMessageWidget" 2021-08-31 14:21:40 +00:00
jenkins-bot bc1af53609 Merge "Text improvements for unkown parameter input" 2021-08-31 14:10:46 +00:00
WMDE-Fisch 099d6bad87 Use ve.targetLinksToNewWindow in MWDismissibleMessageWidget
Change-Id: I71a2c933e4af0dac4a083ce34820fa2994fc388d
2021-08-31 15:06:20 +02:00
WMDE-Fisch 14d3e8144c Text improvements for unkown parameter input
- Change description text according to ticket
- Make sure link to template page opens in new tab
- Add missing placeholder text

Bug: T272487
Change-Id: Ie8189e9cb9db5908e8fc5fc8bf7ff20df5595094
2021-08-31 14:57:24 +02:00
jenkins-bot 9d0c480529 Merge "Narrow selector for links when adding _blank" 2021-08-31 12:42:36 +00:00
jenkins-bot a6c01e946a Merge "Rename …OutlineItem CSS class to match widget class name" 2021-08-31 11:35:18 +00:00
WMDE-Fisch 99cee2be11 Narrow selector for links when adding _blank
Change-Id: Ia05117759c81fff6f35256931d0894c0b8051fe6
2021-08-31 13:08:25 +02:00
jenkins-bot ef486588ce Merge "Add tests for new ve.ui.MWAddParameterPage" 2021-08-31 10:55:16 +00:00
Thiemo Kreuz b84251080a Rename …OutlineItem CSS class to match widget class name
Bug: T285323
Change-Id: Ib307a23adb4712f253610b5029483ea8c049b7ce
2021-08-31 12:16:10 +02:00
jenkins-bot 7f8b6202ac Merge "Correct focus handling when adding undocumented parameters" 2021-08-30 15:43:35 +00:00
Thiemo Kreuz fcd555ba68 Correct focus handling when adding undocumented parameters
When I press the button to expand the input field for
undocumented parameters, it needs to be focused. Otherwise I
have to click it manually all the time.

We probably forgot to list this as an acceptance criteria when
working on Ic5dcd36.

This also replaced a bit of JavaScript with CSS. I do this
mainly because I found the mixture before (one piece was
hidden via JavaScript, another via CSS) a bit confusing.

Bug: T272487
Change-Id: I0cbee63c65a37f2f1860bde007c1e5c8408ba006
2021-08-30 17:03:30 +02:00
Thiemo Kreuz 99558f9076 Connect focus event from BookletLayout to new sidebar
This makes sure the corresponding top-leve part is selected in
the list on the left when navigating the main area on the
right.

Bug: T289043
Change-Id: Id1b398e1786c4099d5b14fe88dd21a106269096b
2021-08-30 17:00:52 +02:00
Thiemo Kreuz e9bd350f68 Add tests for new ve.ui.MWAddParameterPage
The class was added via Ic5dcd36 just a few days ago.

Bug: T289560
Change-Id: I3f729fb6c5d7c28a221d88294d5547809f10a17d
2021-08-30 13:02:52 +00:00
Thiemo Kreuz 0ba7480901 More complete top-level part selection support in new sidebar
This comes with a few significant changes:
* A whole bunch of places in the code that focus and highlight
  an element in the old sidebar consider the new sidebar now.
* Same when e.g. the toolbar at the bottom needs to know which
  part is selected. This is read from the new sidebar now.
* To make this possible I had to merge the small helper class
  we introduced in I7bc73cc back into the dialog.

It's helpful to understand how the event flow works:
* You click a template name. This does nothing (does not select
  the element). It only triggers an event.
* The event is catched by the outer container that manages
  all parts. From there all elements are unselected, and one
  selected. This call is internal and should not trigger
  another event.

Bug: T285323
Bug: T288827
Bug: T289043
Change-Id: I4a2d2b83cf2691423d4b0e6f4487228fa3c7b56d
2021-08-27 19:16:00 +02:00
Thiemo Kreuz 544bd5688c Allow selecting top-level parts in the new sidebar
This is mostly, if not exclusively visual, at the moment. The
actual state is still managed by the old sidebar.

I made the element OptionWidgets for convenience. This gives us
all the functionality we need (primarily setSelected and
isSelected), without to much clutter. However, I didn't made
the container a SelectWidget. This comes with to much stuff we
don't need at this level, e.g. cursor key navigation.

Bug: T285323
Bug: T289043
Change-Id: I20dbd2ba23ceaa9125947b25e037c0bb3c91a471
2021-08-27 18:22:37 +02:00
jenkins-bot c1ce1e3d4b Merge "Move small code snippets into …OutlineParameterSelectWidget" 2021-08-27 11:36:53 +00:00
jenkins-bot c5ea00c03d Merge "Remove wikitext buttons from the content view" 2021-08-27 10:33:02 +00:00
jenkins-bot 86f9acf616 Merge "Cleanup feature flags in ve.ui.MWParameterPage" 2021-08-27 10:32:10 +00:00
jenkins-bot f2b94e10b6 Merge "More test cases for MWTransclusionOutlineContainerWidget" 2021-08-27 10:00:04 +00:00
Andrew Kostka d94fb21b1e Remove wikitext buttons from the content view
Bug: T285669
Change-Id: I875a41e54e7a33cb9f67383d887a732a31649bbb
2021-08-26 17:47:14 +02:00
Thiemo Kreuz 7aeff4bfd3 Move small code snippets into …OutlineParameterSelectWidget
Most notably:
* Move some code snippets from the outer …TemplateWidget to
  the inner …SelectWidget, without introducing new
  dependencies.
* Move all knowledge about the item class
  …OutlineParameterWidget class into …SelectWidget.
* Some more self-documenting method names for event handlers.
* Avoid the somewhat ambiguous variable name "checkbox" in
  favor of "item". That's how it's named in the upstream OOUI
  …SelectWidget.

This is extracted from the following patch Ibd94c39. The
difference is that the following patch adds a new dependency:
The …SelectWidget gets to know the template model. This patch
here contains all changes that are possible without this new
dependency.

Bug: T288827
Change-Id: I187f313c84424b28005d9276cb1356029f9ebb75
2021-08-26 17:30:03 +02:00
Andrew Kostka afe8e8f721 Cleanup feature flags in ve.ui.MWParameterPage
Change-Id: Id1be6512f763d9ddb98665005d378947fdd3e6bb
2021-08-26 17:25:09 +02:00
jenkins-bot a5718f01c5 Merge "Remove unnecessary title parsing from template related code" 2021-08-26 15:08:13 +00:00
jenkins-bot 765b1da5b1 Merge "Use spec label for template link generation" 2021-08-26 14:13:22 +00:00
Thiemo Kreuz c8536f1a71 Remove unnecessary title parsing from template related code
There are 2 situations:

1. Either the template name is used in a [[…]] link. In this case
we must provide the namespace. MWTemplateModel.getTitle() does
this. However, it's not a mw.Title object and therefor not really
guaranteed to be a valid title. This is fine. The worst thing
that can happen is that the link points to an error message.
But this should be entirely unreachable anyway.

2. Some messages want to display the name of the template.
Ideally without the namespace. That's what
MWTemplateSpecModel.getLabel() is for. Again this is not
guaranteed to be a valid mw.Title. But it doesn't need to. It's
only used as a label.

Change-Id: I03d0481201620a2f5c444ee32b656bcaade98aac
2021-08-26 15:58:15 +02:00
jenkins-bot 34992ba3ac Merge "Basic cursor key support in new template dialog sidebar" 2021-08-26 13:46:40 +00:00
WMDE-Fisch 3913f635d4 Use spec label for template link generation
We should only need that label for the link. The other mechanic
would fail when editing wikitext like this:

{{{{echo|<}}|param=foo}}

Bug: T272487
Change-Id: If8d228b40bf1589181e83e8f68f3c33b4c7759c7
2021-08-26 15:09:48 +02:00
Thiemo Kreuz 0bd9e587b3 Basic cursor key support in new template dialog sidebar
Bug: T285323
Depends-On: I47effe05427cfabfcf534920edee79521eaa033f
Change-Id: I319896a20a71b18655ebb93663d47e656a1a67a6
2021-08-26 12:48:49 +00:00
jenkins-bot 6c33cc4a35 Merge "Add message on multipart content" 2021-08-26 07:34:15 +00:00
jenkins-bot 5be007ee9a Merge "Minor cleanups to new add parameter input widget" 2021-08-26 07:26:53 +00:00
jenkins-bot 4741abe803 Merge "Added new input page for undocumented parameters" 2021-08-26 07:26:41 +00:00
WMDE-Fisch 67988452ab Add message on multipart content
Bug: T276574
Change-Id: Iff5c2fd4071dd03ca62c395cce4041dacb1c7ea6
2021-08-25 10:47:16 +02:00
Thiemo Kreuz 9392282bf2 More test cases for MWTransclusionOutlineContainerWidget
This also fixes a mistake in the class where we forgot to
disconnect event handlers when an element is removed from
the list. This doesn't have much of a consequence, as the
event flow is only in one direction, from the destroyed
element up. This is not possible any more.

Bug: T289560
Change-Id: I0bcc1d68c50b8cbdb033ef6692b34e2fc94e8d85
2021-08-24 15:46:46 +00:00
Thiemo Kreuz 3bca0f30c9 Minor cleanups to new add parameter input widget
Most of what I did in patchset 1 is now squashed into the
original patch Ic5dcd36.

Bug: T272487
Change-Id: I5cfd500da4c496a31ec5a28fedee4a079acc6123
2021-08-24 10:22:55 +02:00
Svantje Lilienthal 5c9fbca085 Added new input page for undocumented parameters
Bug: T272487
Change-Id: Ic5dcd36c9f647f9b52b98e5a520a1df1960a5b48
2021-08-24 10:18:43 +02:00