Skip to content

Commit

Permalink
Merge pull request #45 from gtt-project/next
Browse files Browse the repository at this point in the history
Updates minor version
  • Loading branch information
dkastl authored Jun 13, 2024
2 parents fdddc06 + 548d3ab commit 994278f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/views/subscription_templates/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@
if (link) {
link.addEventListener('click', function(e) {
e.preventDefault();
var geom = JSON.parse(e.target.dataset.geom).geometry.coordinates[0].map(coord => [Number(coord[0].toFixed(5)), Number(coord[1].toFixed(5))]).join(';');
var geom = JSON.parse(e.target.dataset.geom).geometry.coordinates[0]
.map(coord => [Number(coord[1].toFixed(5)), Number(coord[0].toFixed(5))]) // Flip the coordinates
.join(';');
document.querySelector('input[name="subscription_template[expression_coords]"]').value = geom;
document.querySelector('select[name="subscription_template[expression_geometry]"]').value = 'polygon';
document.querySelector('input[name="subscription_template[expression_georel]"]').value = 'coveredBy';
});
}
});
</script>
</script>

<p>
<%= content_tag :label, l(:field_subscription_template_alteration_types) %>
Expand Down
39 changes: 39 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,42 @@ curl -sX GET "${BROKER_URL}/v2/subscriptions" -H "Accept: application/json" | jq
These cURL commands should help you interact with the FIWARE broker and test the
Redmine GTT FIWARE plugin effectively. If you encounter any issues or need
further assistance, please let us know!

#### CORS Issues

If you encounter CORS issues, for example when you use FIWARE-Big-Bang, you can extend
the Ngix configuration as follows:

```nginx
[snip]
server {
[snip]
# Add CORS Headers
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT, PATCH' always;
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' always;
add_header 'Access-Control-Expose-Headers' 'location, fiware-correlator' always;
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT, PATCH' always;
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' always;
add_header 'Access-Control-Expose-Headers' 'location, fiware-correlator' always;
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
[snip]
}
[snip]
}
```

In particular `location` and `fiware-service, fiware-servicepath` are important
for the FIWARE broker to work correctly.
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
author_url 'https://github.com/georepublic'
url 'https://github.com/gtt-project/redmine_gtt_fiware'
description 'Adds FIWARE integration capabilities for GTT projects'
version '1.0.2'
version '1.0.3'

# Specify the minimum required Redmine version
requires_redmine :version_or_higher => '5.0.0'
Expand Down

0 comments on commit 994278f

Please sign in to comment.