Permalink
Browse files

Merge branch 'develop' into develop

  • Loading branch information...
dakotabenjamin committed Aug 17, 2018
2 parents b577cfb + 7e5c324 commit af00ddb75128c3cbd7d44b59171003224a734979
Showing with 2,655 additions and 429 deletions.
  1. +3 −1 .tx/config
  2. +2 −1 Dockerfile
  3. +30 −0 client/app/admin/edit-project/edit-project.controller.js
  4. +59 −3 client/app/admin/edit-project/edit-project.html
  5. +15 −14 client/app/contribute/contribute.html
  6. +5 −0 client/app/learn/learn.html
  7. +15 −1 client/app/profile/profile.controller.js
  8. +8 −1 client/app/profile/profile.html
  9. +4 −0 client/app/project/project-dashboard.html
  10. +65 −25 client/app/project/project.controller.js
  11. +26 −2 client/app/project/project.html
  12. +37 −31 client/app/services/editor.service.js
  13. +23 −0 client/app/services/project.service.js
  14. +25 −0 client/app/services/user.service.js
  15. +445 −0 client/locale/ar.json
  16. +2 −2 client/locale/es.json
  17. +10 −10 client/locale/id.json
  18. +2 −2 client/locale/it.json
  19. +2 −2 client/locale/ja.json
  20. +445 −0 client/locale/mg.json
  21. +159 −159 client/locale/nb.json
  22. +3 −3 client/locale/nl_NL.json
  23. +445 −0 client/locale/pl.json
  24. +445 −0 client/locale/pt.json
  25. +1 −1 client/locale/sl.json
  26. +6 −6 client/locale/uk.json
  27. +6 −6 client/locale/zh_TW.json
  28. +11 −0 devops/tm2-pg-migration/migrationscripts.sql
  29. +43 −0 migrations/versions/deec8123583d_.py
  30. +4 −2 server/__init__.py
  31. +43 −0 server/api/project_admin_api.py
  32. +36 −0 server/api/stats_api.py
  33. +2 −4 server/config.py
  34. +12 −1 server/models/dtos/project_dto.py
  35. +6 −0 server/models/dtos/user_dto.py
  36. +8 −4 server/models/postgis/project.py
  37. +6 −0 server/models/postgis/statuses.py
  38. +42 −20 server/models/postgis/task.py
  39. +1 −0 server/models/postgis/user.py
  40. +3 −1 server/services/grid/grid_service.py
  41. +21 −1 server/services/mapping_service.py
  42. +4 −2 server/services/messaging/templates/message_alert_en.html
  43. +4 −2 server/services/messaging/templates/message_alert_en.txt
  44. +3 −1 server/services/messaging/templates/validation_message_en.txt
  45. +2 −0 server/services/project_admin_service.py
  46. +15 −11 server/services/project_search_service.py
  47. +1 −1 server/services/stats_service.py
  48. +29 −1 server/services/users/user_service.py
  49. +1 −1 server/services/validator_service.py
  50. +5 −82 tests/server/helpers/test_files/tasks_from_aoi_features.json
  51. +36 −0 tests/server/helpers/test_files/test_arbitrary.json
  52. +21 −0 tests/server/integration/services/test_mapping_service.py
  53. +6 −23 tests/server/unit/models/postgis/test_task.py
  54. +2 −2 tests/server/unit/services/grid/test_grid_service.py
View
@@ -4,6 +4,7 @@ host = https://www.transifex.com
[tasking-manager-3.master]
source_file = client/locale/en.json
source_lang = en
trans.ar = client/locale/ar.json
trans.bn = client/locale/bn.json
trans.cs = client/locale/cs.json
trans.de = client/locale/de.json
@@ -16,10 +17,11 @@ trans.ja = client/locale/ja.json
trans.mg = client/locale/mg.json
trans.nb = client/locale/nb.json
trans.nl_NL = client/locale/nl_NL.json
trans.pl = client/locale/pl.json
trans.pt = client/locale/pt.json
trans.pt_BR = client/locale/pt_BR.json
trans.ru = client/locale/ru.json
trans.sl = client/locale/sl.json
trans.uk = client/locale/uk.json
trans.zh_TW = client/locale/zh_TW.json
type = KEYVALUEJSON
View
@@ -3,9 +3,10 @@ FROM python:3.6-jessie
# Install dependencies for shapely
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y libgeos-c1 libgeos-dev \
&& apt-get install -y libgeos-dev \
&& rm -rf /var/lib/apt/lists/*
# Uncomment and set with valid connection string for use locally
#ENV TM_DB=postgresql://user:pass@host/db
@@ -340,6 +340,36 @@
});
};
/**
* Set the map confirmation modal to visible/invisible
* @param showModal
*/
vm.showMapConfirmation = function(showModal){
vm.showMapConfirmationModal = showModal;
};
/**
* Map all tasks on a project
*/
vm.mapAllTasks = function(){
vm.mapInProgress = true;
vm.mapTasksFail = false;
vm.mapTasksSuccess = false;
var resultsPromise = projectService.mapAllTasks(vm.project.projectId);
resultsPromise.then(function(){
// Tasks mapped successfully
vm.mapTasksFail = false;
vm.mapTasksSuccess = true;
vm.mapInProgress = false;
}, function(){
// Tasks not mapped successfully
vm.mapTasksFail = true;
vm.mapTasksSuccess = false;
vm.mapInProgress = false;
})
};
/**
* Set the invalidate confirmation modal to visible/invisible
* @param showModal
@@ -243,9 +243,14 @@ <h1 class="section__aside-title">{{ 'In this area' | translate }}</h1>
ng-model="info.perTaskInstructions" rows="4">
</textarea>
<p><strong>{{ 'Tip' | translate }}:</strong> {{ 'You can use Markdown. (HTML is not allowed)' | translate }}</p>
<p>Put here anything that can be useful to users while taking a task. {x}, {y} and {z} will be replaced by the corresponding parameters for each task.
<p ng-if="editProjectCtrl.project.taskCreationMode == 'GRID' ">
Put here anything that can be useful to users while taking a task. {x}, {y} and {z} will be replaced by the corresponding parameters for each task.
{x}, {y} and {z} parameters can only be be used on tasks generated in the Tasking Manager and not on imported tasks.
For example: « This task involves loading extra data. Click [here](http://localhost:8111/import?new_layer=true&url=http://www.domain.com/data/{x}/{y}/{z}/routes_2009.osm) to load the data into JOSM ».</p>
<p ng-if="editProjectCtrl.project.taskCreationMode == 'ARBITRARY'">
Put here anything that can be useful to users while taking a task. If you have added extra properties within the GeoJSON of the task, they can be referenced by surrounding them in curly braces. For eg. if you have a property called "import_url" in your GeoJSON, you can reference it like:
<code>This task involves loading extra data. Click [here](http://localhost:8111/import?new_layer=true&url={import_url}) to load the data into JOSM</code>
</p>
<button class="button button--secondary button--small"
ng-click="editProjectCtrl.showPreviewPerTaskInstructions = !editProjectCtrl.showPreviewPerTaskInstructions">
{{ 'Preview' | translate }}
@@ -458,11 +463,15 @@ <h1 class="section__aside-title">{{ 'In this area' | translate }}</h1>
</div>
</div>
<div class="form__group form__group--section">
<label class="form__label">{{ 'Validation and Invalidation' | translate }}</label>
<p>{{ 'Use this if for some reason you need to validate or invalidate all tasks in this project in a single step.' | translate }}</p>
<label class="form__label">{{ 'Mapping, Validation and Invalidation' | translate }}</label>
<p>{{ 'Use this if for some reason you need to map, validate or invalidate all tasks in this project in a single step.' | translate }}</p>
<div class="alert alert--warning" role="alert">
<p><strong>{{ 'Warning' | translate }}:</strong> {{ 'This cannot be undone.' | translate }}</p>
</div>
<button class="button button--secondary" type="button"
ng-click="editProjectCtrl.showMapConfirmation(true)">
{{ 'Map all tasks' | translate }}
</button>
<button class="button button--secondary" type="button"
ng-click="editProjectCtrl.showInvalidateConfirmation(true)">
{{ 'Invalidate all tasks' | translate }}
@@ -579,6 +588,53 @@ <h1 class="modal__title">{{ 'Delete project' | translate }}</h1>
</section>
<!-- delete project confirmation modal -->
<!-- map tasks confirmation modal -->
<section class="modal modal-tm" ng-show="editProjectCtrl.showMapConfirmationModal">
<div class="modal__inner">
<header class="modal__header">
<div class="modal__headline">
<h1 class="modal__title">{{ 'Task mapping' | translate }}</h1>
</div>
</header>
<div class="modal__body">
<div ng-hide="editProjectCtrl.mapTasksSuccess">
<p>
{{ 'Are you sure you want to mark all tasks in this project as mapped? You cannot undo this.' | translate }}
</p>
<p>
{{ 'This will mark all tasks (except bad imagery tasks) as mapped. Please use this only if you are sure of what you are doing.' | translate }}
</p>
</div>
<p ng-show="editProjectCtrl.mapTasksSuccess">
{{ 'The tasks were mapped successfully.' | translate }}
</p>
<p ng-show="editProjectCtrl.mapTasksFail" class="error">
{{ 'Mapping all the tasks failed for an unknown reason.' | translate }}
</p>
</div>
<footer class="modal__footer">
<div ng-hide="editProjectCtrl.mapTasksSuccess">
<button class="button button--achromic" type="button"
ng-click="editProjectCtrl.showMapConfirmation(false)">{{ 'Cancel' | translate }}
</button>
<button class="button button--base" type="button"
ng-click="editProjectCtrl.mapAllTasks()">{{ 'Map all tasks' | translate }}
</button>
<span ng-show="editProjectCtrl.mapInProgress">{{ 'Mapping...' | translate }}</span>
</div>
<div ng-show="editProjectCtrl.mapTasksSuccess">
<button class="button button--base" type="button"
ng-click="editProjectCtrl.showMapConfirmation(false)">{{ 'Close message' | translate }}
</button>
</div>
</footer>
</div>
<button class="modal__button-dismiss" title="{{ 'Close' | translate }}" ng-click="editProjectCtrl.showMapConfirmation(false)">
{{ 'Dismiss' | translate }}
</button>
</section>
<!-- map tasks confirmation modal -->
<!-- invalidate tasks confirmation modal -->
<section class="modal modal-tm" ng-show="editProjectCtrl.showInvalidateConfirmationModal">
<div class="modal__inner">
@@ -49,20 +49,21 @@ <h6 class="withDescription">Search</h6>
<form class="form">
<fieldset class="form__fieldset">
<div class="search-options-container">
<div class="form__group search-option" ng-show="accountNavCtrl.account.role === 'PROJECT_MANAGER' || accountNavCtrl.account.role === 'ADMIN'">
<div class="form__group search-option">
<div>
<label class="form__option form__option--custom-checkbox">
<input type="checkbox" name="form-custom-checkbox"
ng-click="contributeCtrl.search()"
ng-model="contributeCtrl.searchDraft"/>
<span class="form__option__text">{{ 'Include draft projects' | translate }}</span>
ng-change="contributeCtrl.search()"
ng-model="contributeCtrl.searchArchived"/>
<span class="form__option__text">{{ 'Include archived projects' | translate }}</span>
<span class="form__option__ui"></span>
</label>
<label class="form__option form__option--custom-checkbox">
<label class="form__option form__option--custom-checkbox"
ng-show="accountNavCtrl.account.role === 'PROJECT_MANAGER' || accountNavCtrl.account.role === 'ADMIN'">
<input type="checkbox" name="form-custom-checkbox"
ng-click="contributeCtrl.search()"
ng-model="contributeCtrl.searchArchived"/>
<span class="form__option__text">{{ 'Include archived projects' | translate }}</span>
ng-change="contributeCtrl.search()"
ng-model="contributeCtrl.searchDraft"/>
<span class="form__option__text">{{ 'Include draft projects' | translate }}</span>
<span class="form__option__ui"></span>
</label>
</div>
@@ -103,35 +104,35 @@ <h6 class="withDescription">Search</h6>
<div>
<label class="form__option form__option--custom-checkbox">
<input type="checkbox" name="form-custom-checkbox"
ng-click="contributeCtrl.search()"
ng-change="contributeCtrl.search()"
ng-model="contributeCtrl.searchRoads"/>
<span class="form__option__text">{{ 'Roads' | translate }}</span>
<span class="form__option__ui"></span>
</label>
<label class="form__option form__option--custom-checkbox">
<input type="checkbox" name="form-custom-checkbox"
ng-click="contributeCtrl.search()"
ng-change="contributeCtrl.search()"
ng-model="contributeCtrl.searchBuildings"/>
<span class="form__option__text">{{ 'Buildings' | translate }}</span>
<span class="form__option__ui"></span>
</label>
<label class="form__option form__option--custom-checkbox">
<input type="checkbox" name="form-custom-checkbox"
ng-click="contributeCtrl.search()"
ng-change="contributeCtrl.search()"
ng-model="contributeCtrl.searchWaterways"/>
<span class="form__option__text">{{ 'Waterways' | translate }}</span>
<span class="form__option__ui"></span>
</label>
<label class="form__option form__option--custom-checkbox">
<input type="checkbox" name="form-custom-checkbox"
ng-click="contributeCtrl.search()"
ng-change="contributeCtrl.search()"
ng-model="contributeCtrl.searchLanduse"/>
<span class="form__option__text">{{ 'Land use' | translate }}</span>
<span class="form__option__ui"></span>
</label>
<label class="form__option form__option--custom-checkbox">
<input type="checkbox" name="form-custom-checkbox"
ng-click="contributeCtrl.search()"
ng-change="contributeCtrl.search()"
ng-model="contributeCtrl.searchOther"/>
<span class="form__option__text">{{ 'Other' | translate }}</span>
<span class="form__option__ui"></span>
@@ -153,7 +154,7 @@ <h6 class="withDescription">Search</h6>
<a href="/project/{{ project.projectId }}" class="project-result__card {{ project.status | lowercase }}"
ng-repeat="project in contributeCtrl.results track by $index">
<section class="panel project-result__content">
<span>{{ project.priority }}</span>
<span>{{ 'Priority' | translate }}: {{ project.priority }}</span>
<span class="pull-right" ng-if="project.status != 'PUBLISHED'">{{ project.status }}</span>
<h4>#{{ project.projectId }} {{ project.name }}</h4>
<p markdown-to-html="(project.shortDescription | limitTo: contributeCtrl.characterLimitShortDescription) +
@@ -9,6 +9,7 @@ <h1 class="section__title">
</header>
<div class="section-container">
<div class="section__body section__body--secondary">
<a name="signup"></a>
<div class="inner">
<div class="learn-container">
<div class="information">
@@ -23,6 +24,7 @@ <h2>{{ 'Sign Up for OpenStreetMap' | translate }}</h2>
</div>
</div>
</div>
<a name="tm"></a>
<div class="inner">
<div class="learn-container">
<div class="information">
@@ -37,6 +39,7 @@ <h2>{{ 'Learn How to Use the Tasking Manager' | translate }}</h2>
</div>
</div>
</div>
<a name="buildings"></a>
<div class="inner">
<div class="learn-container">
<div class="information">
@@ -50,6 +53,7 @@ <h2>{{ 'How to map Buildings' | translate }}</h2>
</div>
</div>
</div>
<a name="roads"></a>
<div class="inner">
<div class="learn-container">
<div class="information">
@@ -63,6 +67,7 @@ <h2>{{ 'How to map Roads' | translate }}</h2>
</div>
</div>
</div>
<a name="validate"></a>
<div class="inner">
<div class="learn-container">
<div class="information">
@@ -15,6 +15,7 @@
vm.username = '';
vm.currentlyLoggedInUser = null;
vm.userDetails = null;
vm.userStats = null;
vm.osmUserDetails = null;
vm.projects = [];
vm.map = null;
@@ -50,8 +51,9 @@
var hoverIdentify = true;
var clickIdentify = true;
projectMapService.addPopupOverlay(hoverIdentify, clickIdentify);
getUserProjects();
getLevelSettings();
getUserStats();
getUserProjects();
}
/**
@@ -205,5 +207,17 @@
vm.mapperLevelAdvanced = data.mapperLevelAdvanced;
});
}
/**
* Get stats about the user
*/
function getUserStats() {
var resultsPromise = userService.getUserStats(vm.username);
resultsPromise.then(function (data) {
// On success, set the detailed stats for this user
vm.userStats = data;
});
}
}
})();
Oops, something went wrong.

0 comments on commit af00ddb

Please sign in to comment.