Commit graph

17788 commits

Author SHA1 Message Date
jenkins-bot ea0f1c2610 Merge "Minimize template dialog CSS a bit" 2021-08-11 13:19:20 +00:00
jenkins-bot 1f91b2e185 Merge "Rename and document definition of "empty" in ve.ui.MWParameterPage" 2021-08-11 07:44:33 +00:00
Thiemo Kreuz 97486b2b3d Rename and document definition of "empty" in ve.ui.MWParameterPage
I found this while working on T274551, which is all about the
definition of "empty".

In the old sidebar a parameter's name is dimmed (gray) as long as
the parameter's value is empty. This stops working entirely when
there is a default value.

My first impulse was "this is a bug". When there is a default
value, both the empty string and the default value (when the user
enters it exactly) typically trigger the same behavior: The
template uses the default value, just as if the user entered it.

But this code is correct because of the way it is used. Only
parameters that are "truly" empty should be visually marked as
such. The moment there is a default value it is either impossible
to change this back to an empty string – meaning the parameter
can never be truly empty – or the empty string is meaningful user
input.

Bug: T274551
Change-Id: I90657bfe83e56afd3942428c0dd8a47b444e39c9
2021-08-11 07:24:41 +00:00
Translation updater bot 01d0dd0682 Localisation updates from https://translatewiki.net.
Change-Id: Id7f6653898a023ff041975ab27b8d0880553f7f5
2021-08-11 08:19:45 +02:00
Thiemo Kreuz 993c64f9a2 Minimize template dialog CSS a bit
Bug: T272481
Change-Id: I156c8f2ea4a70d2e86a7bc4282738c51bebc3f2a
2021-08-11 08:09:40 +02:00
Bartosz Dziewoński 055c87240a Update VE core submodule to master (c61e33a59)
New changes:
c61e33a59 Style tweaks for empty toolbars

Bug: T284402
Change-Id: Ic31d2d076e17313636ede24ef08598d6a8677acc
2021-08-10 12:21:23 +02:00
Translation updater bot 4ea1823944 Localisation updates from https://translatewiki.net.
Change-Id: I4ea04acc730f77f6a884cba9ff96c5b968b8386c
2021-08-10 08:07:11 +02:00
jenkins-bot 84799aa36c Merge "Don't show toolbar in MWLanguageVariantInspector text targets" 2021-08-10 01:17:08 +00:00
David Chan b8e2bfe051 Don't show toolbar in MWLanguageVariantInspector text targets
Bug: T284402
Depends-On: Idc8d2ffdae3f1168813fcb89ce5ca20bd835f9ab
Change-Id: I9316d77218b81ed47f99293ed70fe02c32edb96e
2021-08-09 23:34:48 +00:00
jenkins-bot 7032300cc4 Merge "ApiVisualEditor: inject services" 2021-08-09 21:44:52 +00:00
Bartosz Dziewoński c211b8f197 Update VE core submodule to master (84148fbe4)
New changes:
d0de8230f build: Updating npm dependencies
3681a121f Localisation updates from https://translatewiki.net.
0dd5f6e3b Localisation updates from https://translatewiki.net.
8c631c24b Localisation updates from https://translatewiki.net.
3ce31ddd1 build: Upgrade qunit from 2.15 to 2.16
15929e8c7 Localisation updates from https://translatewiki.net.
84148fbe4 Localisation updates from https://translatewiki.net.

Change-Id: Ife6967d470087705e39b4dc73503ccafe35d9387
2021-08-09 19:13:57 +02:00
jenkins-bot 622a85a2eb Merge "Split long ve.ui.MWTransclusionOutlineTemplateWidget methods" 2021-08-09 12:50:43 +00:00
Alexander Vorwerk 72693ca46b ApiVisualEditor: inject services
This patch add dependency injection for the ApiVisualEditor api
module.

Change-Id: I46a249fc1a8cf96102ee9fd64bf046d3a3d33361
2021-08-09 11:14:34 +00:00
Thiemo Kreuz 2ce7bb0213 Split long ve.ui.MWTransclusionOutlineTemplateWidget methods
This direct follow-up is meant to resolve the change request
from I1b0480a.

Bug: T274551
Change-Id: Iee4bab0b9807e6d36435d31bf8ec879d13d9ad3b
2021-08-09 10:40:53 +00:00
Thiemo Kreuz 9e74e2f352 Ignore default values as not being valuable as well
This check makes sure the user doesn't loose work when clicking
the back button. I would like to argue that neither of these
values is valuable enough to block the user with a confirmation
dialog:
* Literally nothing is lost when the input is empty.
* The auto-value is only temporarily lost, but will
  automatically be restored when the user decides to add the
  template back. The input field is pre-filled with this value.
* The default value doesn't need to be manually entered. It will
  show up anyway when the parameter is missing.

There is a rare edge-case, but it is not really relevant in this
situation. Some templates allow to override a default value with
the empty string. This will be considered irrelevant by this
code. However, this was already happening before and doesn't
change with this patch.

The only edge-case where this patch makes a difference is if a
parameter is marked as required or suggested, is documented to
have a default value, _and_ the template allows to override it
with an empty string. But this combination is rather crazy, if
not bogus, and not worth considering here, I believe.

Bug: T274551
Change-Id: Ib176a82844335c3d4dd5b720d335ec28245e1637
2021-08-09 10:28:09 +00:00
jenkins-bot aa868059ee Merge "Better name for ambiguous "empty" concept in the model" 2021-08-09 09:40:40 +00:00
Translation updater bot 5b5cb414fe Localisation updates from https://translatewiki.net.
Change-Id: I9c10f33b2607a160a0fa816fde91aa83e86189a5
2021-08-09 08:25:33 +02:00
jenkins-bot d5b40aaab7 Merge "Fix off-by-1 error when deprecated parameters are hidden" 2021-08-06 13:28:45 +00:00
Thiemo Kreuz 35080a8646 Better name for ambiguous "empty" concept in the model
This is really only about the methods name, but doesn't change
any behavior.

I realized we work with several different definitions of what
"empty" means. There are at least two significant definitions:

1. When a parameter's value is the empty string or identical
to the default value, the behavior of the template is the same.
It will use the default value just as if the user entered it.

The auto-value is a meaningful value in this scenario and can't
be considered equal to the empty string.

2. The context here is when the user presses the back button.
This will destroy all user input. But an auto-value is not user
input. It will appear again when the user realizes they made a
mistake. Nothing is lost.

Personally, I would not use the word "empty" to describe this
concept. Things like "containsUserProvidedValue",
"isCustomValue", "isMeaningfulValue", … come to mind. These are
all still a big vague. A "user provided" value can be identical
to the default or auto-value. "Custom" how? I went for
"containsValuableData" for now.

Bug: T274551
Change-Id: I2912a35556795c867a6b2396cbad291e947f0ed6
2021-08-06 15:11:44 +02:00
jenkins-bot 004d37dc1d Merge "Hide old sidebar when the new one is enabled" 2021-08-06 13:10:04 +00:00
Thiemo Kreuz 6446cf950f Fix off-by-1 error when deprecated parameters are hidden
This is a direct follow-up to I6ebd020.

Steps to reproduce the bug:
* Make sure you have a template with a deprecated parameter.
  The position doesn't matter.
* Add the template. The deprecated parameter is hidden.
* Add an undocumented parameter, e.g. "b". This is added to the
  end, as it should.
* Add an undocumented parameter "a". This should appear before
  "b", but doesn't. The reason is because the invisible
  deprecated parameter is in the list that is used to calculate
  the index, shifting it by 1 (or more when there are more
  hidden parameters).

This patch includes a few closely related changes:
* We can loop the list of checkboxes directly instead of
  indirectly via the list of parameter names.
* I made it so that an active filter only resets if it would
  hide the new parameter. The original problem we had to solve
  was that the new parameter would always be visible, even if
  it doesn't match the filter. This awkward mismatch is still
  guaranteed to not happen.

Bug: T274551
Change-Id: I1b0480ae836cc19b77b159d3fb30ff32e8c59df4
2021-08-06 12:24:49 +00:00
jenkins-bot 1cb4a5a471 Merge "Remove redundant ve.dm.MWTemplatePlaceholderModel.isEmpty" 2021-08-06 10:56:00 +00:00
jenkins-bot 4e2f3befe9 Merge "Make the sidebar in the transclusion dialog responsive" 2021-08-06 10:40:44 +00:00
jenkins-bot 5dabf57f94 Merge "Filter right content side of the template dialog as well" 2021-08-06 10:26:55 +00:00
jenkins-bot c8e36f9e6e Merge "Cleanup feature flags in ve.ui.MWTransclusionDialog" 2021-08-06 09:07:28 +00:00
Translation updater bot 501b42d10f Localisation updates from https://translatewiki.net.
Change-Id: I5c04b02600c9e75f6eb446d4334a87338bc1ef14
2021-08-06 08:14:11 +02:00
Andrew Kostka 21e9f5f0c4 Make the sidebar in the transclusion dialog responsive
Bug: T274554
Change-Id: I51e988e6fb0e50c9d542400471152807626539ea
2021-08-05 17:23:22 +02:00
Andrew Kostka 2f1cfdd187 Cleanup feature flags in ve.ui.MWTransclusionDialog
Change-Id: I6f6326c981da998b547a2a1990e26185763093ca
2021-08-05 17:00:27 +02:00
Thiemo Kreuz 3e5a2d6c82 Filter right content side of the template dialog as well
I came up with a new event to do this. This event is triggered
individually for each parameter. An alternative is a single
event that gets a list of visible parameters. Is this better?
What do you think?

Bug: T288202
Change-Id: Ia44da16917c28171a01aef0f1c613dcd5d3266ba
2021-08-05 14:36:10 +02:00
jenkins-bot fce48b0958 Merge "Split MWTransclusionModel methods to do one thing only" 2021-08-05 10:32:18 +00:00
Thiemo Kreuz 0351537ba2 Hide old sidebar when the new one is enabled
This is – for now – intentionally done in a way that can be
undone. This will still be helpful for debugging for a while.
But we need to get rid of the duplication to be able to make
this new functionality visible on the beta cluster.

Actual removal will hapen the moment we actually remove the
old toolbar. There are already tickets for this.

Bug: T286765
Change-Id: I842c3c39a55a273af20643fa8a602d2e57fb6b8c
2021-08-05 09:14:40 +02:00
Thiemo Kreuz 5e2a898459 Don't offer deprecated parameters when they aren't used
This affects only the new sidebar. Deprecated parameters don't
get a checkbox, except they are used already. "Used" includes
parameters that are present, but empty.

Bug: T274551
Change-Id: I6ebd020d02650c19060345d13495373acab363df
2021-08-04 16:34:54 +02:00
Translation updater bot 0acf57904d Localisation updates from https://translatewiki.net.
Change-Id: I8967bc09f0c762dc22773d493b4124bd02fa3a6d
2021-08-04 08:15:28 +02:00
jenkins-bot 21d9f533c8 Merge "Avoid conflicts between 2017 wikitext editor and DiscussionTools new topic tool" 2021-08-03 16:14:18 +00:00
jenkins-bot cf17a1f191 Merge "Remove tooltip from template dialog title" 2021-08-03 15:29:10 +00:00
Thiemo Kreuz 920550560d Remove redundant ve.dm.MWTemplatePlaceholderModel.isEmpty
This method already exists in the ve.dm.MWTransclusionPartModel
base class where it does the exact same.

Bug: T274551
Change-Id: I19d5914ed9b4b435c83ea4d64019bc46ce1ce8fd
2021-08-03 14:40:50 +02:00
jenkins-bot 7ef4fdc0c2 Merge "Revert "Hide deprecated parameters if they don't have a value"" 2021-08-03 08:42:35 +00:00
Thiemo Kreuz (WMDE) 8d9b4526c6 Revert "Hide deprecated parameters if they don't have a value"
This reverts commit 0d4dee341b.

Reason for revert: This made it entirely impossible to add a
deprecated parameter, even if done intentionally. Needs more tests.

Bug: T274551
Change-Id: I7389bad0845cd1ce78f9d7ef71592cb1ce2a063e
2021-08-03 08:24:24 +00:00
Translation updater bot 553f5238e6 Localisation updates from https://translatewiki.net.
Change-Id: Iaebf94b3ea940cc0c265ee29bed5cf51b77e6826
2021-08-02 08:37:43 +02:00
Translation updater bot 80b3f6889c Localisation updates from https://translatewiki.net.
Change-Id: I98f464b5e69a045e7e6ecf4adf72d9e27b6cc69d
2021-07-30 08:28:11 +02:00
jenkins-bot e57daaad98 Merge "Minor JSDoc documentation fixes in template dialog code" 2021-07-29 12:13:17 +00:00
Translation updater bot d3a313b4fe Localisation updates from https://translatewiki.net.
Change-Id: Ife2264141ac16cabb04e6d9250577d633ff0097e
2021-07-29 08:45:27 +02:00
jenkins-bot c7274acf80 Merge "Remove skinning modules when showing preview" 2021-07-28 19:35:42 +00:00
jenkins-bot 8102c3cc36 Merge "Move abort event tracking from the start to the end of the teardown process" 2021-07-28 16:59:03 +00:00
Arlo Breault 2fd09aaba3 Remove skinning modules when showing preview
Bug: T185284
Change-Id: Ifec8809cd75cb76c79936a69351be0c7779de39e
2021-07-28 10:55:16 -04:00
Bartosz Dziewoński ec3341c9a1 Avoid conflicts between 2017 wikitext editor and DiscussionTools new topic tool
They both want to handle the same URLs. If we detect that
DiscussionTools new topic tool will open, then do not open 2017
wikitext editor.

Bug: T282204
Change-Id: Ic7dd677ea219938969f60bab91387c2e03ebdbe6
2021-07-28 16:10:22 +02:00
Translation updater bot 11f6f06f3e Localisation updates from https://translatewiki.net.
Change-Id: Icf8e71fd90981f3983757cf8aa175105a5c44d8c
2021-07-28 08:21:23 +02:00
jenkins-bot 98aeab538b Merge "MWInternalLinkAnnotationWidget: show disambiguation pages last" 2021-07-28 03:00:52 +00:00
MusikAnimal 4fbab29e22 MWInternalLinkAnnotationWidget: show disambiguation pages last
Disambiguation pages are rarely the page users intend to link to,
especially with newbies. By moving the disambig page(s) as the last
result, the user is more likely to pick the page they actually intended
to link to.

Bug: T285510
Depends-On: I2b8545f6dd4849629037f81f48a540748e60da83
Change-Id: Id55a19e7665d8f88559c471de36e5447fb2babb0
2021-07-27 18:36:50 -04:00
Bartosz Dziewoński 6dc9b55b21 Move abort event tracking from the start to the end of the teardown process
Bug: T237063
Change-Id: I66869f8a84692e6fbe00373460449714cc722084
2021-07-27 22:50:52 +02:00