Commit graph

3105 commits

Author SHA1 Message Date
Thiemo Kreuz a6f784c095 Fix hiding unused template parameters sometimes not working
We ended mixing two concepts in a single method:

* We need a method that allows us to create the parameter list widget
when it's needed, even if it's empty. This is relevant when a template
is entirely empty, and the first parameter is added. This wasn't
working. Instead the parameter list was created with all parameters.

* On initialization we either want all parameters to be shown, or only
used ones. But this code is only needed once, on initialization. I
ended inlining this code in this patch.

Bug: T300640
Bug: T304046
Change-Id: I6620a870e4420dcb8fecf522b3274458eeec891d
2022-03-22 15:41:55 +01:00
jenkins-bot ce9809d113 Merge "Fix resize of MWAceEditorWidget when setting up" 2022-03-22 01:03:48 +00:00
jenkins-bot 43a06844f9 Merge "Fix review button shown when review panel is already active" 2022-03-21 17:12:37 +00:00
Thiemo Kreuz 6eaf0ef55b Fix review button shown when review panel is already active
These two lines forcefully enabled the review/preview buttons, even
when the review/preview panel is already active.

Bug: T300448
Change-Id: I6dbe6ee88728a65233a455b768f17bff668fe3a8
2022-03-21 11:37:58 +01:00
Adam Wight b079440068 Fix template dialog parameter padding on mobile
In the mobile view, parameters don't have left padding so some styles
should only be applied to the desktop stylesheet.

Bug: T304167
Change-Id: I1846512c21aae36f212fe142b7d96ac91e46854b
2022-03-21 09:53:22 +01:00
Ed Sanders f6ea2e3457 Fix resize of MWAceEditorWidget when setting up
Bug: T303964
Change-Id: Ic8efbd7df74213fddaec987aff60e733f9550db2
2022-03-18 22:30:54 +00:00
Adam Wight bf7f022686 Fix right padding on inline descriptions without the new sidebar
This fixes a styling issue with inline descriptions, for the scenario
when the inline description feature is enabled but the new sidebar is
disabled.

Bug: T304167
Change-Id: Ida4da4605da5143de2a27725d87d5876aea7065c
2022-03-18 17:16:48 +01:00
jenkins-bot 401da7ee13 Merge "Remove MWDismissibleMessageWidget and use MessageWidget's showClose option instead" 2022-03-17 11:43:33 +00:00
jenkins-bot cada5a3ab8 Merge "Extract template scrollToTop method" 2022-03-15 12:17:50 +00:00
WMDE-Fisch 96dc96da8d Extract template scrollToTop method
Also putting the findFirstSelected to where it belongs.

Bug: T302965
Change-Id: Ibc56abfdf84a0b5eade5b6a44903d769f424206d
2022-03-11 12:30:51 +01:00
WMDE-Fisch 824648b32a Streamline hide unused handling
Extracted the state change so we do not need the `internal` var.

Change-Id: I0ce1afab35abf3e0e656ad1a3601513d55406537
2022-03-11 12:02:32 +01:00
jenkins-bot 4a8ca84ecc Merge "Scroll template outline into view when hiding unused" 2022-03-11 10:22:37 +00:00
WMDE-Fisch 037e7ad0b2 Scroll template outline into view when hiding unused
Due to the stickyness we need to scroll the header and the first
visible item from the parameter list to have the best result in all
cases.

We also only want to scroll when the user triggered hiding the
fields. Not when the template outline view is initialized.

Bug: T302965
Change-Id: I84d293888a7dbf13ec655c293c0fc3a79edca698
2022-03-09 19:45:07 +01:00
WMDE-Fisch e5277dd838 Fix missing padding on inline descriptions
Bug: T303386
Change-Id: Id0567102d9c8d7f0f3740085027713a2574141ef
2022-03-09 13:08:52 +01:00
Thiemo Kreuz eb25116734 Block Ctrl+Del/Backspace when Remove button is inaccessible
* I can't guarantee this fixes T301914. But I suspect the bug can not
be triggered any more with this plus If9b6050 in place.

* I wasn't able to reproduce the issue locally. But I learned that
  1. it's related to the hotkey, and
  2. it's because the dialog looses focus, and the focus ends on the
     VE surface in te background. Pressing Esc there closes VE. That's
     intended behavior.

* I tried to use .trigger( 'click' ), but it doesn't make much of a
difference. The only magic check is if the button is disabled. But no
visibility checks are done.

Bug: T301914
Change-Id: I2f66fc2411144c60cd08baae58452d336b4e9802
2022-03-02 11:56:29 +00:00
Thiemo Kreuz 836d36bc16 Skip initial creation of unused parameter widget
In a test case with 200 templates where all but a few parameters are
unused the loading time is cut in half.

Bug: T300974
Change-Id: Ice850cb9e5e95b9e3a19ff511b3a4f32117c7199
2022-03-02 10:19:46 +00:00
Ed Sanders 1b5550f485 Move var declarations inline
Mostly ve-mw/ui and a few left overs.

Change-Id: Idea0c94d974e661c49af8ad4545cd8fd98179ca8
2022-03-01 17:50:24 +00:00
jenkins-bot 976272fa41 Merge "Fix spacing between sticky find bar and field list" 2022-03-01 14:42:32 +00:00
jenkins-bot 46cfbc74bd Merge "Added check for hotkey action on input or textareas" 2022-03-01 12:00:20 +00:00
Svantje Lilienthal fb95572429 Added check for hotkey action on input or textareas
Bug: T301913
Change-Id: If9b6050c378836157fa1df5b9782ba4632890f1a
2022-03-01 10:14:52 +00:00
jenkins-bot a6d771dd00 Merge "MobileSaveDialog: Also add 'content' class to preview panel" 2022-02-28 23:45:18 +00:00
Thiemo Kreuz 5a92880da5 Fix bad visualization of empty suggested value
Bug: T299430
Change-Id: I9a0d26c7fc88e1a0c2c68152b3e15a9ba7662991
2022-02-28 08:49:08 +01:00
Ed Sanders 3f1eb8992f Fix spacing between sticky find bar and field list
Bug: T300899
Change-Id: Ieac47d58eb1037edcd82e0d7ee5c98e125c4e78c
2022-02-24 10:40:37 +00:00
Thiemo Kreuz 0d989b6fee Never collapse newly added templates in transclusion dialog
Bug: T300640
Change-Id: Id400951cf98f1eda780700d726fc10afbc1eaa90
2022-02-22 11:37:21 +01:00
Ed Sanders b4f3ecbc5c MobileSaveDialog: Also add 'content' class to preview panel
This isn't used yet as NWE is not enabled.

Change-Id: I2ea4697c2a5ba57f537e646e3d0fb7d89fd04c7b
2022-02-22 00:23:35 +00:00
jenkins-bot 839a62829d Merge "Add and fix default values in parameter documentation" 2022-02-21 13:41:51 +00:00
jenkins-bot 8c1ad11a7d Merge "MWEditSummaryWidget: Handle multi-line comments" 2022-02-21 13:39:01 +00:00
Thiemo Kreuz bc0a34b0ed Add and fix default values in parameter documentation
Same random finds while working on something else. I carefully
checked and made sure these methods are actually called without the
optional parameter.

Change-Id: Iab36fd130258322985b5d6e7f8e1f7b4ee235ba2
2022-02-21 13:19:21 +00:00
jenkins-bot 2a72f4e290 Merge "Remove not needed self = this indirections" 2022-02-21 12:57:41 +00:00
Thiemo Kreuz 3c042049bf Use .bind() syntax where it makes code more readable
This focuses on a few trivial cases where the syntax helps making
the code more readable. One level of indirection is gone with this.

Change-Id: Ibf25d7eaa06952e69b36bd5a78a48d04ac62890c
2022-02-21 10:34:03 +00:00
Thiemo Kreuz 58e27f56d6 Remove not needed self = this indirections
These are only needed when we need to access a specific `this` from
within another `function () {}` context. This is not the case in the
situations here.

This is split from Ibf25d7e to make it smaller and easier to argue
about.

Change-Id: Ide1476de91fc343aa992ad92a1321d3a38b06dd0
2022-02-21 10:52:24 +01:00
Lucas Werkmeister 957036fa19 MWEditSummaryWidget: Handle multi-line comments
The `.` character class matches any character *except* line terminators,
but edit summaries can contain those. Use [^] to match truly everything
in the comment part. (In the section part, I assume `.` is okay.)

Bug: T302103
Change-Id: I29fcdd7489d118674bab5cfe5c0a15b8e4efac64
2022-02-18 19:54:03 +01:00
jenkins-bot 962d95a51f Merge "Add ctrl/cmd backspace hotkey to delete part" 2022-02-09 12:04:25 +00:00
WMDE-Fisch ce230afa09 Disable hide unused widget when all are selected
I bit more logic was needed to make sure, the state of the widget
resets when all unused fields are added during search.

Bug: T299811
Change-Id: I3006c233fda5490e323bc3a3e631bf0c1199bda3
2022-02-09 09:23:14 +00:00
WMDE-Fisch 4b2931276c Add ctrl/cmd backspace hotkey to delete part
Bug: T300971
Change-Id: Ie8752d632fba6a15cbf45176b71b3c77a7171360
2022-02-08 16:17:12 +00:00
jenkins-bot 7d297a20e9 Merge "Wire move/delete hotkeys to button functionallity" 2022-02-08 16:09:22 +00:00
jenkins-bot 5634e5e378 Merge "Hide unused paramters by default on multipart" 2022-02-08 15:58:16 +00:00
WMDE-Fisch b35ea59de5 Hide unused paramters by default on multipart
Covers the base functionality to hide the parameters. Performance
optimizations could be done in a follow up.

Bug: T300640
Change-Id: Ia99b5da392273f1445e475a0720a656460612dcf
2022-02-08 15:56:40 +01:00
WMDE-Fisch ef87088198 Wire move/delete hotkeys to button functionallity
The behavior is now consistant with what would happen when the
buttons are triggered.

Instead of emitting a button click I directly wired the methods
that will by triggerd by the click. This might make it easier to
remove the old sidbar later.

To avoid movement when the buttons should be disabled, an
additional check was added to the onMove method. It's not identical
to the more complex check in the outlineControlsWidget, but should
be enough for our use case. The onDelete method already just does
nothing if nothing is selected.

Bug: T300971
Change-Id: I8a278c9657c91fd648944b5a8c1204c9fff75b7e
2022-02-08 15:41:01 +01:00
jenkins-bot 098791f6c7 Merge "Add vector-body class to diff/previews" 2022-02-07 23:38:15 +00:00
Ed Sanders 5739da585a Add vector-body class to diff/previews
Bug: T287733
Change-Id: I6a4befb2a29489c767df5896a86ef6a607938685
2022-02-05 22:51:05 +00:00
Ed Sanders b0e32c22fa Remove MWDismissibleMessageWidget and use MessageWidget's showClose option instead
This option was added in 0.43.0. Now that the close button is handled,
the remaining functionality (store a flag in local storage, and fixing
link targets) doesn't really justify a separate class, especially as
it's currently only used once.

Change-Id: I0fd81cadccc077dbf957302f9f41409c5a1f4f20
2022-02-03 16:37:52 +00:00
jenkins-bot 440620ae73 Merge "Show a keyboard shortcut when hovering over a toolbar button" 2022-02-01 12:33:39 +00:00
Thiemo Kreuz 7298834211 Follow naming convention for static methods
Change-Id: Ie2d7fb061fcb46765ba8796911425d58218736d1
2022-01-27 09:12:23 +01:00
Adam Wight 7e7ad97bf6 Don't wrap unknown actions with confirmation
For example, the "apply changes" button was producing a confirmation
dialog.

Bug: T300095
Change-Id: I77e53cc0cf62ff7c0aca052568384e20490ce7ec
2022-01-26 14:40:58 +01:00
jenkins-bot 1f8e56a333 Merge "Move copyright warning message parsing from RL module to API" 2022-01-26 11:07:03 +00:00
jenkins-bot 4e41b70758 Merge "ve.ui.MWLinkInspectorTool: Parse "education popup" text as wikitext" 2022-01-25 18:41:56 +00:00
jenkins-bot 219e25fb8f Merge "ve.ui.MWEducationPopupWidget: Allow formatting in the popup text" 2022-01-25 18:39:28 +00:00
Bartosz Dziewoński 8080bd2f5d Move copyright warning message parsing from RL module to API
Parsing it in the RL module caused the module cache key to depend
on the parse, which is slow and makes ResourceLoader sad. The usual
approach for solving this (I206bb05d28) can't be used, because of
how EditPage generates this message.

Bonus #1:
Generate the message for the correct page title. MediaWiki allows
customizing it per-namespace or even per-title, which we haven't
supported before.

Bonus #2:
Pass the context for message localisation (depends on I5f7c77970d).
EditPage::getCopyrightWarning() was parsing messages without the
interface flag, causing some needless processing elsewhere.

Depends-On: I5f7c77970d0525c0ff394f8bd72c69dcb5d00623
Bug: T298822
Change-Id: Iaa626f0e6379a5a370f9c465cea8528bb5bde7f7
2022-01-24 22:19:04 +00:00
WMDE-Fisch 5b4e53148d Confirm before close when all parameter values are deleted
Do show a confirmation when editing templates without parameters,
but don't show the confirmation when you're only on the template search
page.

Bug: T299394
Change-Id: I8205bb6a0f92b7b535a80f7f6a43674f1aa5b51b
2022-01-24 11:43:27 +01:00