BetterDynAdmin icon indicating copy to clipboard operation
BetterDynAdmin copied to clipboard

Repository view - Add button - Add element anywhere

Open sixdouglas opened this issue 8 years ago • 2 comments

On a Repository, when I click on the Add button above the query text zone, would it be possible to add the element either at the end, at the begining or even better near the current cursor position but outside the XML element? For example, let say we have this in the query text zone:

<add-item item-descriptor="store" id="0070075800758">
  <set-property name="parentDeliveryZone"><![CDATA[dz24_shanghai_shi]]></set-property>
</add-item>
<query-items item-descriptor="store" id-only="false">
  parentDeliveryZone = "dz24_shanghai_shi"
</query-items>

And I want to add this:

<print-item id="0070075800758" item-descriptor="store" />

It would be nice to add it:

---- HERE
<add-item item-descriptor="store" id="0070075800758">
  <set-property name="parentDeliveryZone"><![CDATA[dz24_shanghai_shi]]></set-property>
</add-item>
---- HERE
<query-items item-descriptor="store" id-only="false">
  parentDeliveryZone = "dz24_shanghai_shi"
</query-items>
---- HERE

but not:

<add-item item-descriptor="store" id="0070075800758">
  ---- NOT HERE
  <set-property name="parentDeliveryZone"><![CDATA[dz24_shanghai_shi]]></set-property>
  ---- NOT HERE
</add-item>
<query-items item-descriptor="store" id-only="false">
  ---- NOT HERE
  parentDeliveryZone = "dz24_shanghai_shi"
  ---- NOT HERE
</query-items>

sixdouglas avatar Jun 14 '16 07:06 sixdouglas

A quick win would be to always insert at the end, instead of at the cursor position. Inserting outside the current tag would be a bit tricky and not that usefull I think. Or maybe have both "insert before" and "insert after" buttons, but in that case would would wait the UX enhancement i think.

troussej avatar Jun 15 '16 07:06 troussej

After retesting a bit, the insert is done nearest cursor position; it won't insert inside a tag, but between.

like:

<a>
<new>
</b>
<new>

but not <a <new>>

So placing the cursor better should solve the issue, do you agree?

troussej avatar Nov 15 '17 14:11 troussej