Skip to content

Commit 2bb2d7a

Browse files
authored
Merge pull request #34 from gtt-project/next
Next
2 parents c8a9dd7 + ae20bbd commit 2bb2d7a

File tree

5 files changed

+199
-31
lines changed

5 files changed

+199
-31
lines changed

app/views/subscription_templates/_list.html.erb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@
4040
var detail = event.detail;
4141
var data = detail[0], status = detail[1], xhr = detail[2];
4242

43-
// Update the subscription templates list with the response data
44-
document.getElementById('subscriptionTemplateList').innerHTML = xhr.responseText;
43+
// Check if event.target has the class 'copy-command-link'
44+
if (!event.target.classList.contains('copy-command-link')) {
45+
// Update the subscription templates list with the response data
46+
document.getElementById('subscriptionTemplateList').innerHTML = xhr.responseText;
47+
}
48+
4549
showNotification(xhr.getResponseHeader('X-Redmine-Message'));
4650
});
4751

app/views/subscription_templates/copy.js.erb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// Build the cURL command with line breaks and formatted JSON
2+
var jsonPayload = JSON.parse('<%= @json_payload.html_safe %>');
3+
var prettifiedJson = JSON.stringify(jsonPayload, null, 2);
4+
25
var command = "curl -i -X POST '<%= @broker_url %>' \\\n" +
36
"-H 'Content-Type: application/json' \\\n" +
47
<% if @subscription_template&.fiware_service&.present? %>
@@ -7,7 +10,7 @@ var command = "curl -i -X POST '<%= @broker_url %>' \\\n" +
710
<% if @subscription_template&.fiware_servicepath&.present? %>
811
"-H 'Fiware-ServicePath: <%= @subscription_template.fiware_servicepath %>' \\\n" +
912
<% end %>
10-
"--data-binary '" + '<%= @json_payload.html_safe %>' + "'";
13+
"--data-binary '" + prettifiedJson + "'";
1114

1215
var authToken = document.getElementById('subscription_auth_token').value;
1316
if (authToken) {

config/locales/de.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,132 @@
11
de:
22
project_module_gtt_fiware: GTT FIWARE
3+
field_subscription_template_name: 'Name'
4+
gtt_fiware:
5+
tracker_not_found: 'Status nicht gefunden'
6+
version_not_found: 'Version nicht gefunden'
7+
relation_not_found: 'Verknüpfung nicht gefunden'
8+
error_plugin_not_enabled: 'GTT FIWARE Plugin ist für dieses Projekt nicht aktiviert'
9+
category_not_found: 'Kategorie nicht gefunden'
10+
detail_not_found: 'Detailangabe nicht gefunden'
11+
priority_not_found: 'Priorität nicht gefunden'
12+
journal_not_found: 'Aufzeichnung nicht gefunden'
13+
user_not_found: 'Benutzer nicht gefunden'
14+
issue_not_found: 'Ticket nicht gefunden'
15+
issue_deletion_error: 'Beim Versuch, das Ticket zu löschen, ist ein Fehler aufgetreten.'
16+
attachement_not_found: 'Anlage nicht gefunden'
17+
project_not_found: 'Projekt nicht gefunden'
18+
status_not_found: 'Tracker nicht gefunden'
19+
model:
20+
subscription_template:
21+
valid_geometry: '%{value} ist keine gültige Geometrie'
22+
valid_status: '%{value} ist kein gültiger Status'
23+
valid_standard: '%{value} ist kein gültiger Standard'
24+
attrs_must_be_array_of_strings: 'Attribute müssen ein Array aus Strings sein'
25+
name_uniqueness: 'Eine Subscription-Vorlage mit diesem Namen existiert bereits.'
26+
geo_query_fields_must_be_all_or_none: 'Alle Geoabfrage-Felder (Georel, Geometrie,
27+
Koordinaten) müssen angegeben werden oder keines von ihnen'
28+
valid_alteration_types: '%{value} ist kein gültiger Änderungstyp'
29+
must_be_valid_array_of_objects: 'muss ein gültiges Array von Objekten sein'
30+
field_subscription_template_fiware_servicepath: 'FIWARE Service Path'
31+
gtt_fiware_settings_broker: 'FIWARE Broker-Einstellungen'
32+
subscription_published: 'Die Subscription wurde an den Broker übermittelt'
33+
field_subscription_template_expression_geometry: 'Geometry'
34+
link_to_copy: 'Zwischenablage'
35+
field_subscription_template_subject: 'Betreff'
36+
field_subscription_template_notes: 'Ticket-Notiz'
37+
field_subscription_template_subscription_placeholder: 'Eindeutige Kennung der Subscription
38+
(vom Broker bereitgestellt)'
39+
command_copied: 'Befehl in die Zwischenablage kopiert'
40+
field_subscription_auth_token_placeholder: 'Bearer Token'
41+
project_geometry_not_defined: 'Die Projektgrenzen sind nicht definiert'
42+
field_subscription_template_expression_query_placeholder: 'temperature > 30'
43+
field_subscription_template_expression_query: 'Abfrage'
44+
label_subscription_template: 'Vorlage für Subscription'
45+
field_subscription_template_attrs_placeholder: '["temperature"]'
46+
project_geometry_not_supported_multipolygon: 'Die Projektgrenze ist ein Multipolygon,
47+
das für räumliche Suchanfragen nicht unterstützt wird'
48+
subscription_unpublished_warning: 'Es gab ein Problem beim Aufheben der Subscription
49+
im Broker'
50+
link_to_insert_project_geometry_hint: 'Die Projektgrenze wird dabei als räumliche
51+
Suchmaske für die Subscription verwendet'
52+
gtt_fiware_subscription_template_variable_hint: 'Attributwerte können als <code>${Variable}</code>
53+
eingebettet werden.'
54+
field_subscription_template_expression_coords: 'Koordinaten'
55+
field_subscription_template_standard: 'NGSI-Standard'
56+
field_subscription_template_attachments_string: 'Anlagen (Array)'
57+
field_subscription_template_fiware_servicepath_placeholder: '/environment'
58+
field_subscription_template_expression_coords_placeholder: '40.419,-3.691;40.429,-3.691;40.429,-3.701'
59+
field_subscription_template_fiware_service_placeholder: 'smartcity'
60+
field_subscription_template_attachments_placeholder: '[{"filename": "image.jpg",
61+
"url": "https://example.com/image.jpg"}]'
62+
field_ngsi_ld_format: 'Standard NGSI-LD-Format'
63+
field_subscription_template_threshold_create_hours_hint: 'Schwellenwert für die
64+
Erstellung eines neuen Tickets in Stunden.'
65+
field_fiware_broker_subscription_throttling: 'Drosslung von Subscriptions'
66+
field_subscription_template_comment_placeholder: 'Diese Anmerkung wird nur intern
67+
verwendet.'
68+
field_subscription_template_geometry_placeholder: '{"type": "Feature", "geometry":
69+
"${location}"}'
70+
subscription_unauthorized_error: 'Nicht berechtigt, diese Aktion durchzuführen'
71+
field_subscription_template_name_placeholder: 'Temperatur-Alarm'
72+
field_subscription_auth_token_hint: 'Der Autorisierungs-Token, der in den Header
73+
der Anfrage eingefügt wird. Wenn keine Autorisierung erforderlich ist, lassen
74+
Sie das Feld leer. Der Token wird nicht in der Datenbank gespeichert. Wenn die
75+
<code>PROXY</code>-Schaltfläche aktiviert ist (grün), wird die Anfrage über den
76+
Server abgewickelt.'
77+
field_subscription_template_expression_georel: 'Georel'
78+
link_to_publish_hint: 'Die Subscription an den Broker übermitteln'
79+
subscription_unpublished: 'Die Subscription beim Broker wurde aufgehoben'
80+
field_subscription_template_context_placeholder: 'https://smartdatamodels.org/context.jsonld'
81+
label_subscription_template_new: 'Neue Vorlage für Subscriptions'
82+
field_subscription_template_status: 'Subscription Status'
83+
field_subscription_template_alteration_types: 'Änderungsarten'
84+
field_subscription_auth_token: 'Autorisierungs-Token'
85+
gtt_fiware_subscription_template_geoquery: 'Geografische Abfrage'
86+
field_subscription_template_broker_url: 'Broker URL'
87+
field_subscription_template_expiration: 'Gültigkeitsdauer'
88+
field_subscription_template_entities_string: 'Entities (Array)'
89+
field_subscription_template_notify_on_metadata_change: 'Benachrichtigung bei Änderung
90+
der Metadaten'
91+
option_ngsi_ld_format_not_normalized: 'Nicht normalisiert'
92+
field_subscription_template_description_placeholder: "Der Sensor in Raum ${Room}
93+
hat eine Temperatur von ${temperature}°C festgestellt. \n* [ ] Fenster öffnen
94+
\n* [ ] Schalten Sie die Klimaanlage ein"
95+
field_subscription_template_threshold_create_hours: 'Schwellenwert (h)'
96+
link_to_copy_hint: 'Befehl in die Zwischenablage kopieren'
97+
field_subscription_template_description: 'Beschreibung'
98+
label_gtt_fiware: 'FIWARE'
99+
link_to_unpublish: 'Aufheben'
100+
field_subscription_template_comment: 'Anmerkung'
101+
subscription_published_error: 'Es gab ein Problem bei der Übertragung der Subscription
102+
an den Broker'
103+
gtt_fiware_subscription_template_notification: 'Ticket-Vorlage'
104+
field_subscription_template_expression_geometry_placeholder: 'Eine Geometrie auswählen'
105+
permission_manage_subscription_templates: 'Vorlagen für Subscriptions verwalten'
106+
field_subscription_template_broker_url_placeholder: 'https://broker.example.com/'
107+
field_subscription_template_context: 'NGSI-LD Context'
108+
field_subscription_template_attrs: 'Attributes (Array)'
109+
field_subscription_template_notification_user: 'Gesendet vom Nutzer'
110+
option_ngsi_ld_format_normalized: 'Normalisiert'
111+
label_subscription_template_plural: 'Vorlagen für Subscriptions'
112+
field_subscription_template_geometry_string: 'Ticket-Geometrie (GeoJSON)'
113+
field_subscription_template_fiware_service: 'FIWARE Service'
114+
link_to_unpublish_hint: 'Subscription vom Broker aufheben'
115+
field_subscription_template_subject_placeholder: 'Temperaturalarm in ${Room}'
116+
gtt_fiware_subscription_template_general: 'Allgemein'
117+
permission_view_gtt_fiware_ngsi: 'NGSI-LD-Kontextdateien ansehen'
118+
field_subscription_template_entities_string_placeholder: '[{"idPattern": ".*", "type":
119+
"Room"}]'
120+
gtt_fiware_settings_general: 'Allgemeine Einstellungen'
121+
field_subscription_template_expression_georel_placeholder: 'near;maxDistance:1000'
122+
label_gtt_fiware_plural: 'FIWARE'
123+
field_subscription_template_subscription: 'Subscription ID'
124+
link_to_publish: 'Veröffentlichen'
125+
link_to_insert_project_geometry: 'Projektgrenzen eintragen'
126+
field_subscription_template_notes_placeholder: 'Schreiben Sie eine Ticket-Notiz,
127+
anstatt ein neues Ticket zu erstellen, wenn ein Ticket innerhalb der festgelegten
128+
Zeitspanne erstellt worden ist.'
129+
gtt_fiware_subscription_template_subject: 'Einstellungen für Subscriptions'
130+
field_connect_via_proxy: Verbindung über internen Proxy
131+
button_connect_via_proxy_text: PROXY
132+
general_action_error: Beim Ausführen dieser Aktion ist ein Fehler aufgetreten

config/locales/en.yml

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ en:
3434
field_subscription_template_context_placeholder: "https://smartdatamodels.org/context.jsonld"
3535
field_subscription_template_expiration: "Expiration date"
3636
field_subscription_template_comment: "Comment"
37-
field_subscription_template_comment_placeholder: ""
37+
field_subscription_template_comment_placeholder: "This comment is only used internally."
3838

3939
gtt_fiware_subscription_template_subject: "Subscription Settings"
4040
field_subscription_template_subscription: "Subscription ID"
41-
field_subscription_template_subscription_placeholder: "Subscription unique identifier (provided by the broker)"
41+
field_subscription_template_subscription_placeholder: "Subscription unique identifier
42+
(provided by the broker)"
4243
field_subscription_template_entities_string: "Entities (array of)"
43-
field_subscription_template_entities_string_placeholder: "[{\"idPattern\": \".*\", \"type\": \"Room\"}]"
44+
field_subscription_template_entities_string_placeholder: "[{\"idPattern\": \".*\"\
45+
, \"type\": \"Room\"}]"
4446
field_subscription_template_attrs: "Attributes (array of)"
4547
field_subscription_template_attrs_placeholder: "[\"temperature\"]"
4648
field_subscription_template_expression_query: "Query"
@@ -57,29 +59,41 @@ en:
5759
field_subscription_template_notify_on_metadata_change: "Notify on metadata change"
5860

5961
gtt_fiware_subscription_template_notification: "Issue Template"
60-
gtt_fiware_subscription_template_variable_hint: "Attribute readings can be embedded as <code>${variable}</code>."
62+
gtt_fiware_subscription_template_variable_hint: "Attribute readings can be embedded
63+
as <code>${variable}</code>."
6164
field_subscription_template_subject: "Subject"
6265
field_subscription_template_subject_placeholder: "Temperature Alert in ${Room}"
6366
field_subscription_template_description: "Description"
64-
field_subscription_template_description_placeholder: "The sensor in room ${Room} recorded a temperature of ${temperature}°C. \n* [ ] Open window \n* [ ] Turn on the air conditioning"
67+
field_subscription_template_description_placeholder: "The sensor in room ${Room}
68+
recorded a temperature of ${temperature}°C. \n* [ ] Open window \n* [ ] Turn on
69+
the air conditioning"
6570
field_subscription_template_attachments_string: "Attachments (array of)"
66-
field_subscription_template_attachments_placeholder: "[{\"filename\": \"image.jpg\", \"url\": \"https://example.com/image.jpg\"}]"
71+
field_subscription_template_attachments_placeholder: "[{\"filename\": \"image.jpg\"\
72+
, \"url\": \"https://example.com/image.jpg\"}]"
6773
field_subscription_template_notification_user: "Sent from user"
6874
field_subscription_template_threshold_create_hours: "Threshold (h)"
69-
field_subscription_template_threshold_create_hours_hint: "Threshold to create new issue in hours."
75+
field_subscription_template_threshold_create_hours_hint: "Threshold to create new
76+
issue in hours."
7077
field_subscription_template_notes: "Issue notes"
71-
field_subscription_template_notes_placeholder: "Post an issue note instead of creating a new issue if an issue has been created within the threshold."
78+
field_subscription_template_notes_placeholder: "Post an issue note instead of creating
79+
a new issue if an issue has been created within the threshold."
7280
field_subscription_template_geometry_string: "Issue geometry (GeoJSON)"
73-
field_subscription_template_geometry_placeholder: "{\"type\": \"Feature\", \"geometry\": \"${location}\"}"
81+
field_subscription_template_geometry_placeholder: "{\"type\": \"Feature\", \"geometry\"\
82+
: \"${location}\"}"
7483

7584
link_to_insert_project_geometry: "Insert project boundary"
76-
link_to_insert_project_geometry_hint: "This will use the project boundary as the geospatial query for the subscription"
85+
link_to_insert_project_geometry_hint: "This will use the project boundary as the
86+
geospatial query for the subscription"
7787
project_geometry_not_defined: "Project boundary is not defined"
78-
project_geometry_not_supported_multipolygon: "Project boundary is a multipolygon, which is not supported for geospatial queries"
88+
project_geometry_not_supported_multipolygon: "Project boundary is a multipolygon,
89+
which is not supported for geospatial queries"
7990

8091
field_subscription_auth_token: "Authorization token"
8192
field_subscription_auth_token_placeholder: "Bearer token"
82-
field_subscription_auth_token_hint: "Authorization token to be included in the request headers. Leave empty for no authorization. The token is not stored in the database. When the <code>PROXY</code> button is enabled (green), the request will be proxied through the server."
93+
field_subscription_auth_token_hint: "Authorization token to be included in the request
94+
headers. Leave empty for no authorization. The token is not stored in the database.
95+
When the <code>PROXY</code> button is enabled (green), the request will be proxied
96+
through the server."
8397

8498
link_to_copy: "Clipboard"
8599
link_to_copy_hint: "Copy command to clipboard"
@@ -88,12 +102,14 @@ en:
88102
link_to_publish: "Publish"
89103
link_to_publish_hint: "Publish subscription to broker"
90104
subscription_published: "Subscription published to broker"
91-
subscription_published_error: "There was a problem publishing the subscription from the broker"
105+
subscription_published_error: "There was a problem publishing the subscription from
106+
the broker"
92107

93108
link_to_unpublish: "Unpublish"
94109
link_to_unpublish_hint: "Unpublish subscription to broker"
95110
subscription_unpublished: "Subscription unpublished from broker"
96-
subscription_unpublished_warning: "There was a problem unpublishing the subscription from the broker"
111+
subscription_unpublished_warning: "There was a problem unpublishing the subscription
112+
from the broker"
97113

98114
subscription_unauthorized_error: "Unauthorized to perform this action"
99115
general_action_error: "There was an error performing this action"
@@ -121,7 +137,8 @@ en:
121137
name_uniqueness: A subscription template with that name already exists.
122138
attrs_must_be_array_of_strings: "Attributes must be an array of strings"
123139
must_be_valid_array_of_objects: "must be a valid array of objects"
124-
geo_query_fields_must_be_all_or_none: "All geo query fields (Georel, Geometry, Coordinates) must be provided or none of them"
140+
geo_query_fields_must_be_all_or_none: "All geo query fields (Georel, Geometry,
141+
Coordinates) must be provided or none of them"
125142
valid_standard: "%{value} is not a valid standard"
126143
valid_status: "%{value} is not a valid status"
127144
valid_geometry: "%{value} is not a valid geometry"

0 commit comments

Comments
 (0)