Skip to content

Commit 994278f

Browse files
authored
Merge pull request #45 from gtt-project/next
Updates minor version
2 parents fdddc06 + 548d3ab commit 994278f

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

app/views/subscription_templates/_form.html.erb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@
6161
if (link) {
6262
link.addEventListener('click', function(e) {
6363
e.preventDefault();
64-
var geom = JSON.parse(e.target.dataset.geom).geometry.coordinates[0].map(coord => [Number(coord[0].toFixed(5)), Number(coord[1].toFixed(5))]).join(';');
64+
var geom = JSON.parse(e.target.dataset.geom).geometry.coordinates[0]
65+
.map(coord => [Number(coord[1].toFixed(5)), Number(coord[0].toFixed(5))]) // Flip the coordinates
66+
.join(';');
6567
document.querySelector('input[name="subscription_template[expression_coords]"]').value = geom;
6668
document.querySelector('select[name="subscription_template[expression_geometry]"]').value = 'polygon';
6769
document.querySelector('input[name="subscription_template[expression_georel]"]').value = 'coveredBy';
6870
});
6971
}
7072
});
71-
</script>
73+
</script>
7274

7375
<p>
7476
<%= content_tag :label, l(:field_subscription_template_alteration_types) %>

doc/index.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,42 @@ curl -sX GET "${BROKER_URL}/v2/subscriptions" -H "Accept: application/json" | jq
7272
These cURL commands should help you interact with the FIWARE broker and test the
7373
Redmine GTT FIWARE plugin effectively. If you encounter any issues or need
7474
further assistance, please let us know!
75+
76+
#### CORS Issues
77+
78+
If you encounter CORS issues, for example when you use FIWARE-Big-Bang, you can extend
79+
the Ngix configuration as follows:
80+
81+
```nginx
82+
[snip]
83+
84+
server {
85+
[snip]
86+
87+
# Add CORS Headers
88+
add_header 'Access-Control-Allow-Origin' '*' always;
89+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT, PATCH' always;
90+
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' always;
91+
add_header 'Access-Control-Expose-Headers' 'location, fiware-correlator' always;
92+
93+
location / {
94+
if ($request_method = 'OPTIONS') {
95+
add_header 'Access-Control-Allow-Origin' '*' always;
96+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT, PATCH' always;
97+
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' always;
98+
add_header 'Access-Control-Expose-Headers' 'location, fiware-correlator' always;
99+
add_header 'Access-Control-Max-Age' 1728000;
100+
add_header 'Content-Type' 'text/plain charset=UTF-8';
101+
add_header 'Content-Length' 0;
102+
return 204;
103+
}
104+
105+
[snip]
106+
}
107+
108+
[snip]
109+
}
110+
```
111+
112+
In particular `location` and `fiware-service, fiware-servicepath` are important
113+
for the FIWARE broker to work correctly.

init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
author_url 'https://github.com/georepublic'
1313
url 'https://github.com/gtt-project/redmine_gtt_fiware'
1414
description 'Adds FIWARE integration capabilities for GTT projects'
15-
version '1.0.2'
15+
version '1.0.3'
1616

1717
# Specify the minimum required Redmine version
1818
requires_redmine :version_or_higher => '5.0.0'

0 commit comments

Comments
 (0)