<h3 dir="auto">Description</h3>

<p dir="auto">PR adds support for note tags as described in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2621730431" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5294" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/5294/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/5294">#5294</a> Following changes are made:</p>
<ol dir="auto">
<li>Created <code class="notranslate">note_tags</code> table, connected it with note table (using foreign key and associations), created <code class="notranslate">NoteTag</code> model file and <code class="notranslate">NoteTagTest</code> class with basic tests (PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2659032643" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5323" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/5323/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/5323">#5323</a> does this)</li>
<li>Added preparing and rendering of note tags in left sidebar using <code class="notranslate">browse/tag_details</code> partial, also, created test with multiple tags added rendering and checking if rendered HTML contains tags</li>
<li>Updated (j)builder files to write note tags in XML, JSON, GPX, RSS and feed files and updated test to check existence of tags in each of above files (creation of tag is performed using ActiveLayer)</li>
<li>Added support for creating tags at note creation time using POST HTTP request and improved tests to check existence of tags in each of generated files (creation of tag is performed using POST HTTP request). Also, added creating tag <code class="notranslate">created_by, OpenStreetMaps-Website</code> for notes created using OSM website.</li>
</ol>
<p dir="auto">Displayed resolved note:<br>
<a href="https://github.com/user-attachments/assets/782fb6de-fd52-4fa1-94fc-369baa29b341">image.png (view on web)</a></p>
<p dir="auto">Displayed opened note:<br>
<a href="https://github.com/user-attachments/assets/92b7bc2e-d35e-41a6-b283-f3f3f0d0582f">image.png (view on web)</a></p>
<p dir="auto">XML output for "opened note":<br>
<a href="https://github.com/user-attachments/assets/696ae767-28be-4e0e-b036-e004d7db8a98">image.png (view on web)</a></p>
<p dir="auto">Displayed note without tags (all current):<br>
<a href="https://github.com/user-attachments/assets/8410c963-31a5-4e9c-870b-1a47d2eaae19">image.png (view on web)</a></p>
<p dir="auto"><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #5294.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2621730431" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5294" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/5294/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/5294">#5294</a></p>
<h3 dir="auto">How has this been tested?</h3>

<p dir="auto">Run tests from workflows, tested creating and displaying notes manually as administrator / moderator / regular user, tested displaying already existing notes (they will be displayed as earlier - without tags)</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5344'>https://github.com/openstreetmap/openstreetmap-website/pull/5344</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/commits/6c3ddc40ccea33d213179dc63b0af8f605242ed3" class="commit-link">6c3ddc4</a>  Added NoteTag model and note_tags table</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/commits/fd295c83cfed57a96dabfc838d31ffc58c8c579b" class="commit-link">fd295c8</a>  Added displaying tags on Notes sidebar</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/commits/9138256e2078aec6106dbf70bd8ed2677c9443d0" class="commit-link">9138256</a>  Updated (j)builder files with note tags</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/commits/67b4aaa8046df9b7036f27c5e6d45f83e2339366" class="commit-link">67b4aaa</a>  Added support for tags in note creation API</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/commits/3c78b681b0c34339c9baeaa06576ee6a40e5b781" class="commit-link">3c78b68</a>  Added note_tag factory and NoteTag model test-case</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/commits/7f5df4db9b47e9a6efb33f5c557832c2439286ba" class="commit-link">7f5df4d</a>  Added unit test for notes with tags</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/commits/52177a0f0a57faf50e018fdabcabf215ccb9f2a3" class="commit-link">52177a0</a>  Test note/tag output created at ActiveRecord level</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/commits/0841bfcd8d86b7abb0f3c19acfc8a522a2686a5f" class="commit-link">0841bfc</a>  Test note/tag output created at POST/HTML level</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files">16 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-08fd2f80528286cf96375b12d81cac98954dee8e6a6899f5f261a127861fdd49">app/assets/javascripts/index/new_note.js</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-6e9fe051c0ef757618e376ffe731dfca8d4960ef0838b7d6a05609b46ba0fad1">app/controllers/api/notes_controller.rb</a>
    (20)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-08ddccf408b18937e98b422e555eaf851c2a02c3ba815c5aeb8bc00efe65ecab">app/models/note.rb</a>
    (12)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-81be17ec98bec3c251b17903545e5895fe358d39325ab06eb5c343a00e7dd56a">app/models/note_tag.rb</a>
    (20)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-8e70c530a3e7f6eb777b75ec26204721dd896dedf08d20582adb5da76aba544c">app/views/api/notes/_note.gpx.builder</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-a14835243072d71830ba15ff480de24e3146811fabdf73b7e35670af209fbf05">app/views/api/notes/_note.json.jbuilder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-9b8b3e6d46a2a808a27e4c2f8d88c5470d39ee77146f8bb530124c0cacc35dbe">app/views/api/notes/_note.rss.builder</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-143dab9bcdf18ed43c02d5c815e4fb922faf69c55a45c4c8af8c7cb07af310e9">app/views/api/notes/_note.xml.builder</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-d8f30ea1257d77c6a54152eb01b0b95a06f343a2f49f05b51447ef9d89ee8c89">app/views/api/notes/feed.rss.builder</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-84d04c9c37a8be927ab1870e6b3c1940f670585b77b8e88c32d6ded35cf87dc7">app/views/notes/show.html.erb</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-91e633b8a2cb0093761aafc0eae1adf636649c69196d6a7d600994f6ed9ecd57">db/migrate/20241030122707_create_note_tags.rb</a>
    (13)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-1dd5a8f580b9615769ddc19a64a98f455d9d20eb149c443f41d9d3c797d39b12">db/structure.sql</a>
    (35)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-b4cc80ae5a4279eef2a7494cb8c489220ce03acaf36932b2042247df9d316908">test/controllers/api/notes_controller_test.rb</a>
    (42)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-b41a560e061b578bbf13158bf175036a9489241ab69f59137c44d57df9682fa7">test/controllers/notes_controller_test.rb</a>
    (21)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-9bda23e9b0c9dbd54b3d4f4e846031f867317f30b673a60c72e6a9b06621b960">test/factories/note_tags.rb</a>
    (8)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344/files#diff-35e08b22421302c54865eb32008165be551c0c934e972f08cb69f2c1d488eaab">test/models/note_tag_test.rb</a>
    (49)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5344.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5344.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5344.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5344.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5344">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMNZZHCC7JUICNKHWL2BNBOLAVCNFSM6AAAAABSCG2KCWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY3TEMZRG4YDKNQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLL4M6QZ25AF5AC3NDT2BNBOLA5CNFSM6AAAAABSCG2KCWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHJ6SCSQA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5344</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5344",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5344",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>