Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation on task description not helpful when using Mustache Tag Replacement #2342

Open
tordans opened this issue May 16, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@tordans
Copy link
Contributor

tordans commented May 16, 2024

For https://maproulette.org/challenge/45242/task/227680961 I am using Mustache Tag Replacement to provide the description of the task from my GeoJSON (Example).

Each Feature in my geojson has a task_markdown property which I generate to have custom information per task (Code).

The min-char validations prevents me from saving the description with just the Mustache Tag {{task_markdown}}. I have to add some characters to the description just to get around the validation.

Possible solution:

  • Make the validation a warning only, but don't prevent saving the challenge
  • Remove the validation once mustache tag replacements are present in the text
  • …?
@mvexel
Copy link
Member

mvexel commented May 20, 2024

Only the Mapillary links are different in your example -- could you just reduce the redundancy by making the rest of the text static?

@tordans
Copy link
Contributor Author

tordans commented May 22, 2024

could you just reduce the redundancy by making the rest of the text static?

In this specific case yes. I would consider that a workaround. But I can also work around the issue by adding blank text to the text field.

I have other campaigns where the whole descriptions changes based on context data that I have available in the application where I create the Challenge-Dataset. For example, I can add/remove suggested solutions for an issue based on other OSM data I have.

My general goal is to have a workflow where I can craft and control the whole dataset in our application so we don't need to switch tools too much.

@mvexel
Copy link
Member

mvexel commented Jun 12, 2024

Since mustache tags are an uncommon use case, perhaps we can disable the string length requirement for instructions that contain them?

Alternatively we don't make it a hard requirement but we encourage the user to keep writing, like displaying a warning if the instructions are very short like JOSM does

image image

Thoughts?

@tordans
Copy link
Contributor Author

tordans commented Jun 14, 2024

Thoughts?

From a user point of view both solutions work well.

Another (much) more hacky workaround would be to count white spaces towards the required characters but strip them before returning the data from the API / before displaying the comment. That would allow to document a workaround for those using this kind of setup without polluting the UI with non helpful characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants