facebook / Rapid

The OpenStreetMap editor driven by open data, AI, and supercharged features
https://rapideditor.org
ISC License
487 stars 92 forks source link

[MapRoulette Integration] Curly braces in instructions aren't replaced #1419

Closed atiannicelli closed 1 week ago

atiannicelli commented 2 months ago

Description

I'm not sure this is something you can even fix, but I noticed that the {{curly braces}} parameters in the instructions don't get replaced with the correct values. The way that Maproulette allows people to write instructions it will replace {{idendifier}} with the value of identifier in the task. See Screen shots.

For more detail from MapRoulette: https://learn.maproulette.org/en-us/documentation/mustache-tag-replacement/#content

Screenshots

Here is what I see on Rapid Screenshot 2024-05-09 at 3 56 02 PM And here is what That task looks like on MapRoulette Screenshot 2024-05-09 at 3 57 35 PM Here is where the "osmIdentifier" comes from When you do a curl -X 'GET' 'https://maproulette.org/api/v2/task/227267509' -H 'accept: application/json' you will see "properties". These can be referenced in the instructions by using {{}} and they are supposed to be replaced. For this specific task the properties look like this:

        "properties": {
          "oneway": "yes",
          "highway": "cycleway",
          "crossing": "unmarked",
          "cycleway": "crossing",
          "priority": 0,
          "identifier": "w1204730293@1",
          "instructions": "None",
          "osmIdentifier": "way/1204730293",
          "crossing:markings": "no"

Version

2.3.0

What browser are you seeing the problem on? What version are you running?

Chrome v124.0

The OS you're using

mac

Steps to reproduce

Go to https://rapideditor.org/edit#map=21.97/37.77652/-122.40743&background=Bing&datasets=fbRoads,msBuildings&disable_features=boundaries and enable the MapRoulette Tasks. Click on the one in the middle of your screen and scroll down to the instructions and look at the first sentence.

The browser URL at the time you encountered the bug

https://rapideditor.org/edit#map=21.97/37.77652/-122.40745&background=Bing&datasets=fbRoads,msBuildings&disable_features=boundaries

The auto-detected useragent string for your browser (leave blank if you're manually filling this form out)

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

atiannicelli commented 2 months ago

Oh Crap.... I completed the tasks that I just told you to go look at!!! I'll give you another one.... Hold please...

https://rapideditor.org/edit#map=21.29/37.76174/-122.44786&background=Bing&datasets=fbRoads,msBuildings&disable_features=boundaries

there you go.

tordans commented 2 months ago

+1 for this. My use case: I create the task description as part of the script that creates the MR tasks as property and my task description only shows {markdownDescription} which gets fetches the markdown text from the property. This way I can add custom instructions per Task like custom Mapillary links and such.

tordans commented 2 months ago

I wonder, if this should be something that is handeled by the MapRoulette Server? The response by the maproulette server could include the resolved mustache template tags and not just the raw information, right?

atiannicelli commented 2 months ago

I believe that is the solution that they are looking into.