Commit graph

185 commits

Author SHA1 Message Date
Adam Wight bda6215309 Migrate to package files: ext.templateDataGenerator.data
Bug: T260343
Change-Id: Ifd171b40de704bff8c063da46b711a384238a0f5
2020-12-04 19:41:30 +01:00
Adam Wight 1010e6fb78 Migrate from jsduck to jsdoc
Bug: T138401
Change-Id: Iae74fdcae5e8c2541416d8cec8de8221cfc282ef
2020-11-30 21:56:30 +01:00
jenkins-bot 2a477094b9 Merge "Add progressive flags to various buttons" 2020-10-09 14:38:33 +00:00
jenkins-bot bb8e099e4a Merge "Remove unused "changesBooleanValue" property" 2020-10-07 17:04:52 +00:00
jenkins-bot 27e9916941 Merge "Use OutlineSelectWidget/OutlineOptionWidget for maps editing" 2020-10-07 10:06:55 +00:00
jenkins-bot 86a6865512 Merge "Fix parameter extraction from wikitext source" 2020-10-06 23:07:23 +00:00
jenkins-bot a0f98a1ea4 Merge "Also add padding to add parameter panel" 2020-10-06 23:02:38 +00:00
Marielle Volz 8a4e0ec984 Also add padding to add parameter panel
Follow up to Ica6bed595d8

Change-Id: I43d76ac256f18b69b556eadf5a53c20698cd860d
2020-10-06 09:37:09 +01:00
Ed Sanders c61049b8e3 Add progressive flags to various buttons
* Add '+' icon to "Add parameter" footer action
* Add "primary" action to button on add param page

Change-Id: Idc5f83afdbffb2336c6949fcd16a08a00e28a1a3
2020-10-06 08:26:43 +00:00
Ed Sanders 91214f0a6f Use OutlineSelectWidget/OutlineOptionWidget for maps editing
Change-Id: I90ab11c9a0941e8a487a7253d69f0a6cb1dc8dc5
2020-10-05 21:04:44 +00:00
Ed Sanders a990bcfc54 Move sub-page warning to dialog when opened
This is an important warning, and should not just be hidden.

Instead show it in the dialog as well in case the user ignored
it on the edit page.

Change-Id: If6f2d4b15157096a915186921d767a860edbc86a
2020-10-05 19:37:59 +01:00
Ed Sanders 39ba318938 Use MessageWidgets instead of LabelWidgets in Dialog
Change-Id: Ia9c34f446d4af7c2f56903ee83b6a57c4ef100dd
2020-10-05 19:37:59 +01:00
jenkins-bot e729bc7d84 Merge "Use a MessageWidget for the sub-page warning" 2020-10-05 14:48:20 +00:00
Ed Sanders d79e07f059 Remove default padding from panels, uses padded:true/false instead
Change-Id: Ica6bed595d8f1b2ac7cb6f30d3081536b7e8561b
2020-10-04 15:53:15 +01:00
Ed Sanders 2d55fa64b1 Use a MessageWidget for the sub-page warning
Change-Id: I8b2878a9a817d14d3a4542a083e98a9f70cfde8d
2020-10-04 14:05:26 +01:00
Thiemo Kreuz de434822b4 Fix all eslint warnings
Change-Id: I731ea4a54b001a8d30743ca32188edb1c039253e
2020-09-24 13:31:18 +01:00
Thiemo Kreuz f6de5d3493 Fix parameter extraction from wikitext source
This fixes a series of issues:
* The JS implementation had a trim() in one place that was
  missing in PHP.
* The actual parameter name in the paramNames/$params array was
  trimmed, but the "normalized" name (this is only for duplicate
  detection) was not trimmed.
* It was possible for an empty parameter to show up.

This resulted in very strange behavior, e.g. {{{ 1}}}{{{1 }}}
was detected as "1" and "10" (?), i.e. it would try to renumber
the duplicate in a strange way (string "1" plus a counter that
starts with 0).

Change-Id: I0a6371f3633b03b5b21809ecd06ea4c72d7d914d
2020-09-22 18:27:23 +02:00
Thiemo Kreuz 47e8249349 More canonical property order in mw.TemplateData.Model class
This does not have any effect on how this code behaves. It's
only relevant when a human reads the code. I tried to bring the
properties in an order that makes the most sense, grouping stuff
that clearly belongs together, as well as following how stuff is
ordered on
https://www.mediawiki.org/wiki/Extension:TemplateData

Change-Id: Ibbe1027023f8d87bbd0a70411882a25671918670
2020-09-01 09:10:34 +00:00
jenkins-bot c42a4afede Merge "Allow different maps to be edited separately" 2020-08-30 16:14:59 +00:00
Khatean 76cf63dad2 Allow different maps to be edited separately
Seperate different maps of maps-object into different panels that
contains text-area to edit the map, delete button to delete the map, and
can be navigated through using a side-bar, that also have "Add new map"
button at the top to add a new map.

Bug: T258820
Change-Id: Ib53a73203f6010b3fd8a5cd78c74c904be2340f2
2020-08-28 20:18:27 +02:00
Thiemo Kreuz 4853c2ae3a Remove unused "changesBooleanValue" property
Not used anywhere:
https://codesearch.wmcloud.org/search/?q=changesBooleanValue

Change-Id: I40f08f4d7164dbcb7bef58bb647607573f852f15
2020-08-25 14:18:54 +02:00
Thiemo Kreuz a5fe1bfbb9 Move "Unknown" type to the top of the dropdown
"Unknown" is the special, default value when nothing else is
specified. It feels wrong to find this in alphabetical order
between all the other values, as if "Unknown" is something I'm
expected to pick. While this is possible, it's almost never
necessary. "Unknown" is the default anyway. If I'm fine with
that, I never change it. But if I want to pick something else,
I typically expect the list to show the "nothing selected yet"
default first so I can easily avoid it.

Change-Id: I283a1b0545efba208af777a0b2056740263dfc32
2020-08-19 17:30:05 +02:00
Siddharth VP 512911b92e Make getRawParams() ignore parameters in comments and nowiki tags
This is used by the includeMissingTitles option of API action=templatedata.
Parameter syntax existing within nowiki tags or comments will not be valid
for the template.

Bug: T237195
Change-Id: Ibbfa3e21488f2a37fc494862e929baf50607d4c9
2020-08-17 00:33:06 +00:00
Ed Sanders 71b27ed1ba Set import button to display:block, fixing text overflow
Bug: T259348
Change-Id: Ibbe2ccef8062275a20200445279033e084ca12aa
2020-07-31 14:19:43 +01:00
adham-khatean c4ca729ed5 Make the maps object editable from the TemplateData dialog
- Enable multiline.
- Enable updating the model with user changes if user clicks "Done".
- Disable "Done" button if the user inserts invalid JSON to handle JSON errors the
user might cause, and "Done" is enabled again if the JSON is valid.
- Create "cancel" button/action which will be for maps panel only, to
discard all changes made by the user.

Bug: T257503
Change-Id: Icd495290bae0b1684f8cd53864904a35e60fffe7
2020-07-24 16:07:04 +02:00
jenkins-bot 821c3b5af2 Merge "Create initial UI for maps panel in TemplateData GUI" 2020-07-09 19:12:27 +00:00
adham-khatean e719555d30 Create initial UI for maps panel in TemplateData GUI
Adding maps object to TemplateData GUI. By adding mapPanelButton to the
main panel and creating the map panel which contains multiline input
widget to show and insert the map info.

Bug: T254478
Change-Id: Iacff86812cbc448fcdbae24e7eeffb0384781dd5
2020-07-09 19:13:29 +02:00
Ed Sanders bf67ec6d52 build: Update eslint-config-wikimedia to 0.16.2
Change-Id: Ib53aa55795f228768a6226eebfdb5734d8a976d1
2020-07-08 13:08:35 +01:00
Thalia 8361c80307 Disable TemplateData dialog 'apply' action until changes are made
Change-Id: I890de938654ea598d3f7af2ea7f69e11188bbab4
2020-03-30 23:39:26 +01:00
adham-khatean 1bf9e95bb6 Fix borders for alias pills in TemplateData editor
fixing the problem of top and bottom borders for the alias pills in the
TemplateData editor are cut off, by setting the padding of the
class "tdg-templateDataParamWidget-param-aliases" to 1px

Bug: T248486
Change-Id: Ic66cda0be840fb3be966c2efa89062b7b9f117a3
2020-03-30 15:53:08 +02:00
Timo Tijhof 53f4783ffd Organise resource files in directories after their module bundles
* I've moved the one remaining file in resources/ to modules/.
  The repo had both resources/ and modules/.

* Class files are named after their class.

* Files with init logic on a page are named init.js.

* Files that only export re-usable classes for another module,
  are named index.js.

Bug: T193826
Depends-On: If661c68bea069e99cfff35711efdde7805a12851
Change-Id: Ic8975d7ba349ba50f9039545d2eb8d912ccdce26
2020-03-15 15:21:39 +00:00
Bartosz Dziewoński 2a137a2377 Ensure cancel confirmation dialog is visible on top of main dialog
Bug: T241819
Change-Id: I7764ad13acd52779e4f4ae853c05c795a80dc870
2020-01-03 12:57:30 +01:00
Ed Sanders 2db15c75a1 build: Update linters
Change-Id: Ie5cd0d355017eb802d0b302a69248886409fcbf9
2019-12-18 11:43:42 +00:00
Bartosz Dziewoński 2b8e39a278 templateDataGenerator: Fix off-by-one error when inserting new tag
There should not be a `- 1` here. It was kept in the refactoring in
34924e0a0b, but it should have been removed.

Also simplify the entire expression to just `matches.index`, which is
equivalent and easier to understand. We already use `matches.index` above.

Bug: T239445
Change-Id: I9cbeaabd50fb595c0ff622b86ce3870285e5b7c8
2019-11-28 21:39:32 +01:00
Ed Sanders cc8b0b5e2f Set back/close flags on dialog
Change-Id: I4a687495327b37ba96809cc927f1d9020ef797e8
2019-07-11 14:46:30 +01:00
David Lynch f3566cece2 tdDialog: handle name/alias swaps
If you changed the name to one of its own aliases, then went into the
alias field to remove that alias, the "Done" button would remain
disabled for no obvious reason. As such, rerun the name change handler.

Also, the input error-highlight was too low specificity for current OOUI
CSS, and so we weren't showing which field had an issue.

Bug: T222543
Change-Id: I49ac0587c4b5e58ce1fc3c42e3dffeae8f986672
2019-05-08 11:25:36 -05:00
Ed Sanders 6671a09959 build: Update eslint-config-wikimedia to 0.11.0
Change-Id: Ia109737bc7a0828dfdad14e4e2163d2add0c651c
2019-03-13 16:33:25 -07:00
Ed Sanders 0111b68d18 Remove use of OOUI's deprecated this.$
Change-Id: I5fb530a98ceb98329ad65ad57d55e9c416d99d86
2019-02-15 19:23:19 +00:00
Ed Sanders 49d469b2d1 build: Update eslint-config-wikimedia to 0.10.1
Change-Id: Ia8baa12906d4f23fcdf07a0bb664b4a3435d18df
2019-02-10 22:14:11 +00:00
jenkins-bot 4221945fc9 Merge "Ignore bang magic word in table syntax when guessing parameters" 2018-12-10 23:55:08 +00:00
jenkins-bot d7145f1180 Merge "Update eslint-config-wikimedia to 0.9.0" 2018-11-30 21:28:32 +00:00
Ed Sanders 47c3c69baa Update eslint-config-wikimedia to 0.9.0
Also bump stylelint (no fixes required)

Change-Id: Ia6bd3a8c0392eafb939f9ff05827e1320f56b706
2018-11-29 14:19:33 +00:00
Ed Sanders e0cab02231 Use ve.deactivationComplete hook instead of ve.deactivate
We want to deprecate the latter.

Change-Id: Id1ae1049738220a86adb36cb3961592e3d8ca27c
2018-11-29 14:01:32 +00:00
Sam Wilson 75e54ae999 Ignore bang magic word in table syntax when guessing parameters
Three-braces-and-a-bang can be a table starting construct in templates.

This also fixes an overlooked bug in which the test wasn't checking
array element key names.

Bug: T157029
Change-Id: I69ed4fc9fe3bb126b7b39abea0f58ad56adf3885
2018-11-27 11:46:23 +08:00
Ed Sanders 822d0cd345 Rename module editPage→editTemplatePage, create minimal new editPage module
VisualEditorPluginModules loads whenever VE loads, so create a minimal
loader page to check if we are in the template namespace before loading
the rest of the TemplateData init code.

Bug: T208765
Change-Id: Id127eb4a2472a6ce9da7672f9237b182cf6be2eb
2018-11-24 00:14:03 +00:00
Ed Sanders 34924e0a0b Remove VETarget, use textSelection API
The textSelection API works with VE wikitext mode , so we
can use the same code for both editors.

Change-Id: I9032733b14d115bad8dcadefc50e791cf30eed7d
2018-11-14 14:53:42 +00:00
Bjornskjald 096d558272
Add stripping leading and trailing spaces from the "format" field
Bug: T177973
Change-Id: I5fc30479485da59b5ea097f97a2dfb7ec149918f
2018-11-01 22:55:40 +01:00
jenkins-bot 5ac1f53bde Merge "Replace deprecated 'advanced' by renamed to 'settings' icon" 2018-09-12 16:23:48 +00:00
Sam Wilson 79e5347d90 Prevent leading hash from starting param names when guessing
Parameter names can be constructed with parser functions, so
we should not include these as raw parameter names. There
might be more characters to add here.

Bug: T203605
Change-Id: If57a9ed7edf1e881cd121d9a1bcb2e7455c04ec9
2018-09-12 10:04:45 +08:00
Volker E 7da7b90b58 Replace deprecated 'advanced' by renamed to 'settings' icon
Bug: T190581
Change-Id: If509219d1b6404c66f2a3c942623e315f9b02e34
2018-09-07 20:05:46 -07:00