Modify

Opened 5 months ago

Last modified 4 weeks ago

#20861 new defect

Tagging preset: "value_template" always overwrites value without strong indication and without option to disable.

Reported by: skyper Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: template_report tagging preset value_template Cc: simon04

Description (last modified by skyper)

This is a follow-up of #18949 and #20851

On #18949, KorneySan wrote in comment 6:

On preset dialog closing by OK button the engine should check the name value and if it is empty AND default_template is set, it should evaluate default_template and set the result to the name.

In #20851s description skyper wrote:

One more question: Is it wise to change an existing value, automatically, without user's interaction??
Think we need at least a preference option to enable/disable this feature of overwriting values.

What steps will reproduce the problem?

  1. Have a preset using value_template=""
  2. Create an object and tag it with preset
  3. After closing the preset, change the value of the tag with value_template=""
  4. Open the preset again with the object still selected

What is the expected result?

  • A strong indication about the automatically change of the value (fixed in r18080)
  • An option to reset the value
  • An option to disable this automatism completely

What happens instead?

  • no strong indication (fixed in r18080)
  • the value is always changed, despite having set it manually in advance and there is no quick way to reset
  • no preference option to disable value_template

Please provide any additional information below. Attach a screenshot if possible.

  • At least some stronger indication of the automatic value change like an prominent icon is needed.
  • How about touching the value only if the value is empty. User could still delete the value in the preset to reactivate the template but values are not overwritten automatically.
  • I did not check on name_template="" but I would say, the use of templates should be in user control with preferences options to generally enable/disable the use of each of both templates.

Thanks a lot for your work, I really appreciate it.

    <group name="Public Transport" icon="presets/transport/bus.svg">
        <item name="Public Transport Route (Rail)" icon="presets/misc/route.svg" type="relation" preset_name_label="true">
            <link wiki="Public_transport#Service_routes" />
            <space />
            <key key="type" value="route" />
            <combo key="route" text="Route type" values="train,subway,monorail,tram,light_rail" values_searchable="true" match="keyvalue!" />
            <key key="public_transport:version" value="2" /> <!-- only validate marked relations in order to avoid false positives -->
            <text key="name" text="Name" value_template="?{route=train 'Train'|route=subway 'Subway'|route=monorail 'Monorail'|route=tram 'Tram'|route=light_rail 'Light_rail'|''} {ref}?{': {from} - {via} - {to}'|': {from} - {to}'|''}" />
            <text key="ref" text="Reference" />
            <text key="from" text="from" />
            <text key="to" text="to" />
            <text key="via" text="Via" />
        </item> <!-- Public Transport Route (Rail) -->
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-05-06 22:44:54 +0200 (Thu, 06 May 2021)
Revision:17878
Build-Date:2021-05-07 01:31:01
URL:https://josm.openstreetmap.de/svn/trunk
Plugins:
+ tagging-preset-tester (35640)

Tagging presets:
+ ${HOME}/JOSM/new/resources/data/defaultpresets_17833_route_17661_18662.xml

Attachments (0)

Change History (10)

comment:1 Changed 5 months ago by skyper

Cc: simon04 added

comment:2 Changed 5 months ago by skyper

Description: modified (diff)

comment:3 Changed 2 months ago by Don-vip

In 18080/josm:

fix #21156 - fix #20851 - see #20861 - disable value_template for multiple selection (patch by marcello)

comment:4 Changed 2 months ago by skyper

Description: modified (diff)

comment:5 Changed 8 weeks ago by Don-vip

Milestone: 21.07

comment:6 Changed 8 weeks ago by Don-vip

@skyper is the problem sill here after r18080? Didn't have the time to look at it in detail yet.

comment:7 Changed 8 weeks ago by skyper

Description: modified (diff)

There is some stronger indication using a different color for the value but the rest was not handled.
Without an option to disable value_template completely and without the option to preserve existing values and only add if empty (deleted), I fear, this is not acceptable within defaultpresets as nevertheless it needs to be users choice to decide on the proper value.

By the way, I just found a situation where my regex needs adjustments as it does not handle multiple values in ref=* properly.

comment:8 Changed 8 weeks ago by Don-vip

Milestone: 21.0721.08

comment:9 in reply to:  7 Changed 8 weeks ago by skyper

Replying to skyper:

By the way, I just found a situation where my regex needs adjustments as it does not handle multiple values in ref=* properly.

I do not find any description how to manipulate the value from {tag}? Is it possible, atm? I need to replace ; with /.

comment:10 Changed 4 weeks ago by Don-vip

Milestone: 21.08

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to skyper
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.