From 43678dea570c5ebc91e2f4c659adbb8036ea2aac Mon Sep 17 00:00:00 2001 From: zlavergne Date: Mon, 9 Sep 2019 19:02:55 +0000 Subject: [PATCH 1/2] HOTFIX: bug fixes for project files and gpx loading in RapiD --- client/app/project/project.controller.js | 3 +-- server/services/mapping_service.py | 18 +++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/client/app/project/project.controller.js b/client/app/project/project.controller.js index f6d20266e2..7ececa1d7c 100644 --- a/client/app/project/project.controller.js +++ b/client/app/project/project.controller.js @@ -1404,7 +1404,6 @@ vm.isSelectedMappable = true; vm.lockedTaskData = data; vm.lockTime[taskId] = getLastLockedAction(vm.lockedTaskData).actionDate; - vm.isSelectedSplittable = isTaskSplittable(vm.taskVectorLayer.getSource().getFeatures(), data.taskId); formatHistoryComments(vm.selectedTaskData.taskHistory); }, function (error) { onLockError(projectId, error); @@ -1446,7 +1445,7 @@ }; /** - * Call api to lock currently selected task for validation. Will update view and map after unlock. + * Call api to lock currently selected task for validation. Will update view and map after unlock. */ vm.lockSelectedTaskValidation = function () { // if(vm.user.isEmailVerified){ diff --git a/server/services/mapping_service.py b/server/services/mapping_service.py index e45c668ceb..8b9f2d283f 100644 --- a/server/services/mapping_service.py +++ b/server/services/mapping_service.py @@ -198,8 +198,8 @@ def generate_gpx(project_id: int, task_ids_str: str, timestamp=None): ET.SubElement(trkseg, 'trkpt', attrib=dict(lon=str(point[0]), lat=str(point[1]))) # Append wpt elements to end of doc - # wpt = ET.Element('wpt', attrib=dict(lon=str(point[0]), lat=str(point[1]))) - # root.append(wpt) + wpt = ET.Element('wpt', attrib=dict(lon=str(point[0]), lat=str(point[1]))) + root.append(wpt) xml_gpx = ET.tostring(root, encoding='utf8') return xml_gpx @@ -298,7 +298,6 @@ def generate_project_file_osm_xml(project_id: int, file_id: int, task_ids_str: s os.makedirs(filedir) tasks_file = os.path.join(filedir, "{project_id}_tasks.geojson".format(project_id=str(project_id))) - current_app.logger.debug(tasks_file) with open(tasks_file, 'w') as t: t.write(str(tasks)) @@ -306,8 +305,7 @@ def generate_project_file_osm_xml(project_id: int, file_id: int, task_ids_str: s # Convert the geojson features into separate .poly files # to use with osmosis poly_cmd = './server/tools/ogr2poly.py {file} -p {filedir}/ -f taskId'.format(file=tasks_file, filedir=filedir) - current_app.logger.debug(poly_cmd) - subprocess.call(poly_cmd, shell=True) + subprocess.check_output(poly_cmd, shell=True) os.remove(tasks_file) osm_files = [] @@ -316,7 +314,13 @@ def generate_project_file_osm_xml(project_id: int, file_id: int, task_ids_str: s task_cmd = './server/tools/osmosis/bin/osmosis -q --rx file={xml} enableDateParsing=no --bp completeWays=yes file={task_poly} --wx file={task_xml}'.format( xml=os.path.join(dto.path, dto.file_name), task_poly=os.path.join(filedir, poly), - task_xml=os.path.join(filedir, "task_{task_id}_{file_name}.osm".format(task_id=os.path.splitext(poly)[0], file_name=os.path.splitext(dto.file_name)[0])) + task_xml=os.path.join( + filedir, + "task_{task_id}_{file_name}.osm".format( + task_id=os.path.splitext(poly)[0], + file_name=os.path.splitext(dto.file_name)[0] + ) + ) ) osm_files.append( os.path.join( @@ -326,7 +330,7 @@ def generate_project_file_osm_xml(project_id: int, file_id: int, task_ids_str: s file_name=os.path.splitext(dto.file_name)[0]) ) ) - subprocess.call(task_cmd, shell=True) + subprocess.check_output(task_cmd, shell=True) os.remove(os.path.join(filedir, poly)) # Merge the extracted files back together. Used if more than one task is sent in request. From 69530a5eaa17a2ab3e0120b2e6192693a8b17f9b Mon Sep 17 00:00:00 2001 From: Zack LaVergne Date: Mon, 9 Sep 2019 15:33:13 -0600 Subject: [PATCH 2/2] email content updates --- server/services/messaging/smtp_service.py | 4 ++-- .../services/messaging/templates/email_verification_en.html | 2 +- server/services/messaging/templates/email_verification_en.txt | 2 +- .../services/messaging/templates/level_upgrade_message_en.txt | 4 ++-- server/services/messaging/templates/message_alert_en.html | 4 ++-- server/services/messaging/templates/message_alert_en.txt | 4 ++-- server/services/messaging/templates/welcome_message_en.txt | 4 +--- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/server/services/messaging/smtp_service.py b/server/services/messaging/smtp_service.py index 1da1fd67de..1c91f9eca2 100644 --- a/server/services/messaging/smtp_service.py +++ b/server/services/messaging/smtp_service.py @@ -27,7 +27,7 @@ def send_verification_email(to_address: str, username: str): text_template = text_template.replace('[USERNAME]', username) text_template = text_template.replace('[VEFIFICATION_LINK]', verification_url) - subject = 'HOT Tasking Manager - Email Verification' + subject = 'Kaart Tasking Manager - Email Verification' SMTPService._send_mesage(to_address, subject, html_template, text_template) return True @@ -50,7 +50,7 @@ def send_email_alert(to_address: str, username: str): text_template = text_template.replace('[USERNAME]', username) text_template = text_template.replace('[PROFILE_LINK]', inbox_url) - subject = 'You have a new message on the HOT Tasking Manager' + subject = 'You have a new message on the Kaart Tasking Manager' SMTPService._send_mesage(to_address, subject, html_template, text_template) return True diff --git a/server/services/messaging/templates/email_verification_en.html b/server/services/messaging/templates/email_verification_en.html index 8237c9938e..61f5c34879 100644 --- a/server/services/messaging/templates/email_verification_en.html +++ b/server/services/messaging/templates/email_verification_en.html @@ -7,7 +7,7 @@ Click here to verify your email address

Please ignore this email if you have received it by mistake.

Many thanks
- HOT Mapping Team
+ Kaart

diff --git a/server/services/messaging/templates/email_verification_en.txt b/server/services/messaging/templates/email_verification_en.txt index 7474913022..707fc7eac5 100644 --- a/server/services/messaging/templates/email_verification_en.txt +++ b/server/services/messaging/templates/email_verification_en.txt @@ -7,4 +7,4 @@ Thank you for supply your email address, please click the link below to verify y Please ignore this email if you have received it by mistake. Many thanks -HOT Mapping Team +Kaart diff --git a/server/services/messaging/templates/level_upgrade_message_en.txt b/server/services/messaging/templates/level_upgrade_message_en.txt index 549ed22bf5..8cd6c717e5 100644 --- a/server/services/messaging/templates/level_upgrade_message_en.txt +++ b/server/services/messaging/templates/level_upgrade_message_en.txt @@ -1,9 +1,9 @@ Hi [USERNAME],

-Congratulations! Your'e now an [LEVEL] mapper.
+Congratulations! You're now an [LEVEL] mapper.
Thank you very much for mapping!
We encourage you to continue your contribution to HOT.
You can now begin validating tasks across projects.

Many thanks
-HOT Mapping Team \ No newline at end of file +Kaart \ No newline at end of file diff --git a/server/services/messaging/templates/message_alert_en.html b/server/services/messaging/templates/message_alert_en.html index 41348ab9a8..63bdd057de 100644 --- a/server/services/messaging/templates/message_alert_en.html +++ b/server/services/messaging/templates/message_alert_en.html @@ -3,10 +3,10 @@

Hi [USERNAME]

- You have a new message on the HOT Tasking Manager.

+ You have a new message on the Kaart Tasking Manager.

Click here to view it..

Many thanks,
- Humanitarian OpenStreetMap Team

+ Kaart

Please note: You can now opt-out of all automated validation
messages by visiting your User Profile and clicking "Edit-Add Contact Details."

diff --git a/server/services/messaging/templates/message_alert_en.txt b/server/services/messaging/templates/message_alert_en.txt index 6d4d18f836..35aae6313b 100644 --- a/server/services/messaging/templates/message_alert_en.txt +++ b/server/services/messaging/templates/message_alert_en.txt @@ -1,10 +1,10 @@ Hi [USERNAME] -You have a new message on the HOT Tasking Manager. Click the link below to view it. +You have a new message on the Kaart Tasking Manager. Click the link below to view it. [PROFILE_LINK] Please note: You can now opt-out of all automated validation messages by visiting your User Profile and clicking "Edit-Add Contact Details." Many thanks, -Humanitarian OpenStreetMap Team +Kaart diff --git a/server/services/messaging/templates/welcome_message_en.txt b/server/services/messaging/templates/welcome_message_en.txt index 81d74cc2d7..1cfd7ab3a4 100644 --- a/server/services/messaging/templates/welcome_message_en.txt +++ b/server/services/messaging/templates/welcome_message_en.txt @@ -1,6 +1,6 @@ Hi [USERNAME],

-Welcome to the HOT Tasking Manager, we hope you will enjoy being part of the community that is helping map the world.
+Welcome to the Kaart Tasking Manager, we hope you will enjoy being part of the community that is helping map the world.

In order to be notified on project updates and feedback on your mapping, you have to add your email address to your profile by clicking on the link below.

@@ -8,6 +8,4 @@ In order to be notified on project updates and feedback on your mapping, you hav
Thank you very much!

-On behalf of the Humanitarian OpenStreetMap Team volunteer and staff community we want to welcome you to humanitarian mapping and the wider OpenStreetMap community.
-
For a much more detailed welcome letter, please visit the OSM Wiki Tasking Manager Welcome page. It has links to great learning resources if you want to learn more right away!