Commit graph

75 commits

Author SHA1 Message Date
Thiemo Kreuz 5077780216 Remove all BookletLayout OutlineItem code
No longer need to manage the connection between outline items and
content pane pages.

Bug: T310866
Change-Id: I8dae7efa18e97ce5e1c84d963f1a32f09dd7e7cb
2022-06-30 05:29:46 +00:00
Thiemo Kreuz 76f563c929 Move .addPromptedParameters() calls to more canonical places
This was done in 3 rather "random" places:
1. Whenever a template is manually added. But rather late, after the
   template was added, in an event handler that is about focus
   behavior. It should not continue to manipulate the template that
   was just added.
2. When the dialog opens with a template preloaded by name, as it is
   done from the citation menu.
3. When the dialog is about to finish loading.

This patch fixes 2 issues:
* Get rid of a duplicate call (number 2 and 3) when using the
  citation menu.
* Move number 1 to a place where it's executed much earlier, and
  only when the user clicks "add template" in a template placeholder.
  There is no other way to add a template to an existing transclusion,
  but it's still a more appropriate place I feel.

Bug: T311069
Change-Id: I8a65ad703b95ba2092e9ef73493e9903e96b0dd6
2022-06-28 08:40:24 +02:00
jenkins-bot 9d3ebeba60 Merge "Remove invisible stuff from BookletLayout OutlineItems" 2022-06-20 10:09:10 +00:00
Thiemo Kreuz d5857c20f5 Remove invisible stuff from BookletLayout OutlineItems
Technically the old BookletLayout sidebar is still there. But it's
never visible, effectively dead, and meant to be removed. This patch
just empties the OutlineItems of all template dialog related pages
without actually disabling the old sidebar.

Note this partly reverts Ie57f462.

Bug: T310859
Bug: T310866
Change-Id: Ic0b7d703f369045ed342426563f8eeb3e47046db
2022-06-20 09:31:53 +00:00
WMDE-Fisch 6396b030d5 Remove dead code in MWTemplatePlaceholderPage
Bug: T310859
Change-Id: I04de9c4bd3828e8769136d5776037e927ba7b4ab
2022-06-20 10:30:31 +02:00
Adam Wight e1ea921f76 Remove $wgVisualEditorTemplateSearchImprovements feature flag
The feature is always enabled now.

Bug: T307188
Change-Id: I34a3db44355d93413f611b99cd80b876d8737413
2022-06-14 10:48:19 +02:00
WMDE-Fisch 13f5637290 Clean-up users storage after search message removal
I'm more in favor of leaving no garbage behind. The TODO with a date
is a good way of making sure this gets removed eventually.

This could have been part of Ie6eea76. The new code is added to the
same spot where the code removed in Ie6eea76 originally was.

Bug: T296471
Depends-On: Ie6eea76dacdc614ecb910c48e7e1f519b8c69322
Change-Id: Idec63201ff4aa52a0c53c6d007577a93c94e0ec0
2022-06-14 06:59:46 +00:00
Svantje Lilienthal 58fd0531d9 Remove updated feature message about search
Bug: T296471
Change-Id: Ie6eea76dacdc614ecb910c48e7e1f519b8c69322
2022-06-10 13:13:51 +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
Thiemo Kreuz 29ef00fa29 Rework all code using template type related conditions
This is a more radical change, compared to the previous patch.
I will post more detailled explanations as comments on Gerrit.

Change-Id: I6909b3f0b2c153b7ee9995441e995ffa793eab40
2021-10-22 10:42:16 +00:00
Thiemo Kreuz 1904698105 Move some logic into the TransclusionModel class
I moved some code around and found that quite a lot of code wants to
know:
* Is the length of this transclusion exactly 1?
* I need that 1st part.

There is more that can potentially moved from the dialog to the model.
But I don't want to make this patch to big.

Bug: T292371
Change-Id: Ia94ed0450d04dd97c4c41f5bf7c266f9a534e821
2021-10-06 16:00:18 +00:00
Thiemo Kreuz f68c1e3794 Add @private tags to template dialog related methods
… obviously only to methods that are meant to be private, i.e.
only called from within the class (and possibly tests).

Change-Id: I581558078dc7210abac5f5724f71316ac45745e6
2021-09-26 11:51:36 +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
Thiemo Kreuz 3ee7a1f1ed Do not pass Message object to …DismissibleMessageWidget
I wanted to change this for quite a while now. It was discussed
again in Iff1d2c0.

Change-Id: Iaaac9bf91d9b11557ab068d2c719084c46b3ecb2
2021-09-03 15:21:36 +00:00
Andrew Kostka 01d8a8c7a4 Remove trash icons from the content view
Bug: T275761
Change-Id: I8d2c1b8ebdc2e20779d0207b1a2ebe6ce36c54e7
2021-07-15 12:20:45 +02:00
Thiemo Kreuz 4367235dcc Inline many var declarations in the code below
This makes the code more readable and easier to reason about.
The ESLint rule responsible for this code style was removed
just recently.

Notes:
* I focus on classes that are relevant for what the WMDE team
  does right now.
* I merge multiple `var` keywords only when the variables are
  strongly connected.
* Caching the length in a for loop makes the code hard to
  read, but not really faster when it's a trivial property
  access anyway.

Bug: T284895
Change-Id: I621fed61d894a83dc95f58129bbe679d82b0f5f5
2021-06-23 09:02:24 +00:00
Thiemo Kreuz feb902aba0 Small code cleanups for the MWDismissibleMessageWidget
* Re-focus the input field after closing the message.
* Store only the message key. That's all that's needed.
* Avoid a class property that's not needed.
* Use the config object instead of calling .setLabel() manually.

Bug: T284742
Change-Id: If8e8bb6460fa5aea8ddd46c2e27b5f08b7772896
2021-06-16 10:32:08 +02:00
Andrew Kostka 13d1c4d2ac Dismissible feedback message for the template search
Bug: T284742
Change-Id: I5dc32521b899c3c9d35d1bf77d346384e4cc87e6
2021-06-16 10:03:04 +02:00
Andrew Kostka 0c310d03d3 Use a new tab when linking to the project page for feedback
Bug: T284560
Change-Id: I13e7461299ccd1a584e0f661a5506e7b52b8fe4b
2021-06-10 13:06:35 +02:00
Svantje Lilienthal 1a707e2aad Add message linking to project page for feedback
Bug: T284560
Change-Id: I8ac45db4844c8ccb65595e8bfe3fb68be9bb02ee
2021-06-10 11:28:42 +02:00
WMDE-Fisch 42b557ff80 Use add template when adding a new transclusion part
We have two cases now that we want to cover here:
- Either we're inserting a new template and start a "fresh"
  transclusion, then we want to use "search" in the headlines
- Or we're adding a new template to an exsisting
  transclusion, then we want to use "add" in the headlines

Bug: T277028
Change-Id: I9fa294cf732598d58f848c75b353d2e1742eb4e8
2021-05-11 13:13:44 +02:00
Svantje Lilienthal 2665734b10 Renaming temporary config variable and splitting it from cirrus search lookup
This allows using the config variable independendly from the cirrus search extension.
This way it can be used for all subtickets of T271802.

Bug: T277028
Change-Id: I1b3bdda5fa6fbfe5c531c3b51c2c8e2a28ed1faf
2021-05-10 14:47:31 +02:00
Adam Wight f89301bedf Optional verbose template search
Renames "Add a template" to "Template Search" in most cases and
provides inline help for the workflow.

Bug: T277028
Change-Id: I3fee87cb89b5044e785596e71ef3f1a18f2694ce
2021-05-10 12:45:12 +00:00
Adam Wight 9a1072a960 Add edit count bucket to VisualEditorTemplateDialogUse events
Bug: T269986
Change-Id: I68cc15d58a23149a6edc71cac229f6b29d33fd92
2021-01-21 13:17:03 +01:00
WMDE-Fisch 2ce9934ab9 Add tracking of template usage
The names in the schema are roughly following what's
done in Schema:TemplateWizard. The information if
templates have TemplateData will be logged seperatly.

Bug: T259705
Change-Id: Iafa7256f675dbfd6a5a6de794061901780e3c55d
2020-12-16 12:56:45 +01:00
Akinwale Alagbe 229a249cca Adding accessibility label to template and field name edit textbox
Change-Id: Ieeb29de8534300751956eb76477b38578478b4a2
2020-04-02 21:02:55 -07:00
James D. Forrester 2c77e88d2c doc: Bump copyright year for 2020
Change-Id: I30539877543dc2a57bd1428a00d10ac46d8fc294
2020-01-08 09:13:24 -08:00
Ed Sanders b6704010fa Automatically add a template when chosen from the autocomplete list
This behaves in the same way as the link inspector.

Change-Id: I8901c636cd5c74023f4c6c562b410f55afe91124
2019-05-17 13:15:07 +02:00
James D. Forrester 3c293ea00c doc: Bump copyright year for 2019
Change-Id: I8991b97c980d4149f53eb5601036220ef3c0c440
2019-01-01 13:24:23 +00:00
Ed Sanders 23ec1973d8 Match width of template lookupMenu to input
Bug: T196117
Change-Id: I58909b2f0138b512df03a8990d3c19cb0b184cad
2018-08-24 14:22:00 +01:00
Bartosz Dziewoński 5827b17ad0 ve.ui.MWTemplatePlaceholderPage: Avoid Firefox rendering issue
There is something about ActionFieldLayouts with `align: 'left'` (the
default) and no label that causes Firefox to render them differently
than we expect. I am not sure if the bug is in OOUI or Firefox, but it
is easily avoided by just using `align: 'top'` instead (it looks the
same, since there is no label, and it avoids the issue).

Bug: T198274
Change-Id: Ic6077e576b504e7a0cd761c8bac24d4079ae6702
2018-07-03 20:13:28 +02:00
Ed Sanders 478b0bcbb9 Create getters for localised APIs (getContentApi/getLocalApi)
Pass through the current document when available, otherwise
assume the current surface's document.

Also add a getter for getPageName, so that can vary based
on the target document.

Bug: T193856
Change-Id: Ifdc951fdc6a43b924d102e3fcd7e59e52023757b
2018-05-05 14:32:55 +01:00
Bartosz Dziewoński 0cf02e0155 ve.ui.MWParameterPage: Pass $overlay to PopupButtonWidget
Also, pass $overlay to all PageLayout subclasses used in ve.ui.MWMetaDialog
and ve.ui.MWTemplateDialog/ve.ui.MWTransclusionDialog, for consistency.

Bug: T191395
Change-Id: Ib7ed2e2c04ff7930be1161bd2b981180ee59557a
2018-04-04 22:45:13 +02:00
David Lynch a52dc16244 Update TitleInput's getTitle to getMWTitle
cb92c72c63274b332dc81edf473b1b3979ab4bdf in MW core changed this.

Bug: T185231
Change-Id: I9084a11bd40e46bddbcd1922ff549703bc90f60f
2018-01-18 11:39:23 -06:00
Ed Sanders 0169701257 getSelectedItem() -> findSelectedItem()
Change-Id: Idf90335d06800b690063c7b2a781e822f0ee7ba9
2018-01-17 13:39:13 +00:00
James D. Forrester 0a7a845a42 doc: Bump copyright year
Change-Id: I0b299c840ede1a1b8552cecfc70c5760ab036181
2018-01-03 17:45:07 +00:00
James D. Forrester 2c70792c4f Replace constructive with progressive UI flag
Change-Id: Iae36e978978ed6642f44606a934c540cf5f8537f
2017-09-26 15:14:32 -04:00
James D. Forrester 528942c2e1 Drop local 'template' icon, use 'puzzle' from upstream
Now that our template icon has been upstreamed thereto.

Bug: T111041
Change-Id: If101018de284dcc1be086d92427de0d88adb0e02
2017-07-06 09:52:56 -07:00
James D. Forrester 756079d477 Replace uses of the removed 'remove' icon with the 'trash' one
Bug: T166730
Change-Id: I528dcdb390a4488ffac89fc823ff35bc1eda4f24
2017-05-31 16:30:17 -07:00
David Lynch efc469f2f4 TemplatePlaceholderPage: abort pending template search after adding template
With precise timing, the lookup menu could appear after the add template
button had been pressed and the user had moved on to the next page.

Bug: T162707
Change-Id: I36941dc7288c6031a0fb189c0946aa6d8f8697e8
2017-04-12 11:34:42 -05:00
David Lynch 1f1be831c0 Add template: don't try to add invalid templates when enter is pressed
Bug: T161715
Change-Id: I12eabe3588fbcbed0fa18b94de7de7239ba490c2
2017-03-29 10:53:17 -05:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
Ed Sanders 62bdaac13b Use super property to call parent methods
Change-Id: I76982b844cf2871d7583463def4393e5bdc33aa2
2016-08-23 11:56:47 -07:00
James D. Forrester ada58df361 build: Bump file copyright notices for 2016
Change-Id: I3c618c196e504a80ca297a4132a17f1977a24fb7
2016-01-03 14:57:25 -08:00
Alex Monk 2d46e57709 Template placeholder: Don't show delete button if we're the only transclusion part
Bug: T95252
Change-Id: I62ebe56a2c5d5a0a39a5d806b2fcb348e25f6a17
2015-09-17 00:31:18 +00:00
James D. Forrester 57f8fc5368 build: Drop last jscs over-ride and make pass
Change-Id: I4ff60af79cfc6e09e284d51f9b7ac2afa900f0f5
2015-07-22 15:13:09 -07:00
Ed Sanders 52cb066dc7 Use new MediaWiki core TitleInputWidget
All link input/title input functionality has been moved to core, so
we can replace the link widget, redirect widget and template search
widget with it.

Depends on Ib463e60cad96 in MediaWiki core.

Change-Id: I452f3b86ead403307072cf904f0553c9771f4300
2015-06-24 17:06:00 -07:00
Ed Sanders 1962234efd Remove this.$ remnants
Change-Id: Ia32eebd4f6da156209fc0e9cc858e99ea454c262
2015-05-09 11:48:30 +01:00
Moriel Schottlender a669a4fc52 Show template description in the template search
For each template result, ask for the templatedata description. If
that description exists, show it under the template result.

Bug: T53436
Change-Id: If28d1eb082edca6f50c6c15c933a0b7d014eaeaf
2015-04-16 12:30:55 -07:00
Roan Kattouw 95bffa22a0 Stop using this.$
Has been a backwards-compatibility alias since OOjs UI 0.7.0.

Change-Id: I17d7c03e9d1b9fa991d88444d22abfd403269ee0
2015-04-14 02:54:01 +01:00