Commit graph

19 commits

Author SHA1 Message Date
WMDE-Fisch 39679be927 Use the default edit dialog to create a sub-ref
There's no need to open another dialog to set the additional
details when creating a sub-reference. We can just use the edit
panel that's already added to the ReferenceDialog.

In the edit panel I assume that whenever it is loaded with a
reference that uses the extends attribute and has no content
then the panel is used to create a sub-ref.

Note: SetExtendsContentDialog is still used for the Citoid flow.

Bug: T375156
Change-Id: I8cb3663f2f45a807b1d00f543ae13e8c5f53c6d8
2024-10-06 20:34:29 +02:00
Adam Wight 9d665a8521 Hide group selector when editing a subref
Since changing the group will break a subref, we'll hide the field
for now.

TODO: There's more that can be done here: the main ref group
selector could also be hidden, and changing group could be supported
if we change the group on all linked refs.

Bug: T375156
Change-Id: I220850edae58097e09616a4b100878513767deae
2024-10-02 12:17:53 +02:00
WMDE-Fisch d9399cb81b Consistently use ve.msg() where possible
Change-Id: I2813ec963b869ea97aaadeb2018475e8dbaabb3e
2024-09-27 22:28:08 +02:00
WMDE-Fisch 1ba89ae0b8 Fix c&p leftover in MWReferenceEditPanel
Change-Id: Ia3d1ad5eeb652dd3c3b26d40fca184f1a9d9b805
2024-09-19 11:47:03 +00:00
mareikeheuer bdcbcc08f8 VE include subref count in warning message
Include subref count in warning messages in VE editPanel dialog and contextItem

Bug: T373023
Change-Id: Ie7d162c4a2291db441846ec338159e8955c206c2
2024-09-09 09:21:06 +02:00
WMDE-Fisch 1507354f93 Streamlining the MWReferenceEditPanel QUnit test
I could add some simplifications to reduce the complexity of the
tests a bit. I also fixed the test for the change handler. Seems
it did not work that way before.

Also some minor random doc fixes.

Change-Id: If1530a815ea126c38c3a55f3d52e3ca482059840
2024-09-03 14:50:51 +02:00
Adam Wight 65a02eb97b Fixup types
Change-Id: I609f6b4dfb4ebc357b6190571b8779a167a66f4f
2024-09-03 12:46:47 +02:00
WMDE-Fisch 31dcf2528e [refactor] Replace InternalList with DocumentReferences in ReferenceEditPanel
Change-Id: Icdb7b80f5ca4284fe77c4905b7a9c98659f9c2b4
2024-08-29 23:43:03 +02:00
Adam Wight 633969300b [refactor] Update some usages to new refs interface
Change-Id: Idfffbe92ad1385e85b078bc4794a529c5f770eae
2024-08-29 13:21:48 +02:00
Adam Wight b69614fc82 [refactor] groupInput takes narrower parameters
Simple parameters hide knowledge and ease testing.

Change-Id: I9a8549199a1de07b437caf274c8d5e842183f570
2024-08-28 05:48:44 +00:00
Adam Wight ce16e4a4cb Show error message in ref edit dialog for orphaned subref
Bug: T372871
Change-Id: I2b5c99f699ac4113f90b0b22913f1b7119d1d8ce
2024-08-22 17:27:51 +02:00
WMDE-Fisch 70e1f91bc0 Set more methods private in EditPanel class
These are just for internal use.

Bug: T369005
Change-Id: Ia3c6338c79c3ec4144727c841c24ea5066060eed
2024-08-13 20:37:42 +02:00
WMDE-Fisch 3af9dfdb71 Move event handler to the EditPanel class
Making sure that change events form the fields are handled in the
panel and forwarded to the dialog with the information needed.

Also slighly moving some calls in the setup process that inits
the dialog and removing some duplication. Calling focus on the
edit panel only makes sense in the ready step. Not during setup.

Bug: T369005
Change-Id: I4f9a022a06ec6543b106620eae030235b8f6712b
2024-08-13 15:53:24 +02:00
jenkins-bot e163f354a5 Merge "Add method to get the updated ref from the edit panel" 2024-08-13 13:22:15 +00:00
WMDE-Fisch 48d0699f09 Add method to get the updated ref from the edit panel
That's another step to separate the editing form the dialog. The dialog should not know about internals of the edit panel.

And eventually the dialog can get rid of the referenceModel property.

Bug: T369005
Change-Id: I9cf3a68ef58bc5791497af362c0572734e4bcadd
2024-08-12 18:00:32 +00:00
WMDE-Fisch 3d0a88c384 Hide main ref warning on orphan refs
Also adding tests.

Bug: T369005
Change-Id: Icb3deaf0c8e14e34bd05455590bd9680a7a5adec
2024-08-02 15:33:44 +02:00
WMDE-Fisch cc6aec4c77 Don't use the edit form when reusing a reference
There's no need to populate and use the form fields when we're
reusing a reference. The group and content are already stored
in the model and we can insert more directly.

I found that it's also not needed to update the internal item
because we're not changing the content or group. The same is done
in Citoid when reusing a reference.

Bug: T369003
Change-Id: I57315aafb73b0cd68a0d397d2f79833ac54a7c7f
2024-08-01 18:09:07 +02:00
WMDE-Fisch 8b60ead109 Move more editing methods to the EditPanel
Mainly leaving out the event handling for the change detection to
still keep it simple.

Also the data flow back for editing the content is still somewhat
opaque because the relevant data is passed by reference. I might
change that in follow up patches so it's more clear.

Bug: T369005
Change-Id: I93b62791ef10bf318697905af8a0c5b5d438fdb5
2024-07-26 17:45:23 +00:00
WMDE-Fisch 36d9270c1c Introduce MWReferenceEditPanel to extract editing UI
First step to move the UI parts that are relevant for creating,
editing (and extending) a reference to it's own class.

There remains some duplication because of the sub-referencing in
Citoid currently depending on the static properties to build its
own editing interface.

More patches follow, I just wanted to keep it small for reviewers.

Bug: T369005
Change-Id: I8588cde1a54cd505a57a36ed97fc591653c9fb6f
2024-07-18 14:46:23 +02:00