Opened 4 years ago
Last modified 3 years 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 )
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 ANDdefault_template
is set, it should evaluatedefault_template
and set the result to thename
.
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?
- Have a preset using
value_template=""
- Create an object and tag it with preset
- After closing the preset, change the value of the tag with
value_template=""
- 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 by , 4 years ago
Cc: | added |
---|
comment:2 by , 4 years ago
Description: | modified (diff) |
---|
comment:3 by , 3 years ago
comment:4 by , 3 years ago
Description: | modified (diff) |
---|
comment:5 by , 3 years ago
Milestone: | → 21.07 |
---|
comment:6 by , 3 years ago
@skyper is the problem sill here after r18080? Didn't have the time to look at it in detail yet.
follow-up: 9 comment:7 by , 3 years ago
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 by , 3 years ago
Milestone: | 21.07 → 21.08 |
---|
comment:9 by , 3 years ago
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 by , 3 years ago
Milestone: | 21.08 |
---|
In 18080/josm: