Skip to content

Commit

Permalink
Merge pull request #1827 from hotosm/hotfix/better-email-request
Browse files Browse the repository at this point in the history
Hotfix release 3.4.3
  • Loading branch information
pantierra authored Aug 14, 2019
2 parents c9fb32b + cd8e0a9 commit 5daa64c
Show file tree
Hide file tree
Showing 37 changed files with 6,157 additions and 3,882 deletions.
1 change: 0 additions & 1 deletion client/app/home/home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
var resultsPromise = statsService.getHomePageStats();
resultsPromise.then(function (data) {
vm.stats = data;
console.log(vm.stats);
vm.hasLoaded = true;
vm.mappersOnline = data.mappersOnline;
vm.tasksMapped = data.tasksMapped;
Expand Down
5 changes: 2 additions & 3 deletions client/app/project/project.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1376,8 +1376,7 @@
* Call api to lock currently selected task for mapping. Will update view and map after unlock.
*/
vm.lockSelectedTaskMapping = function () {
console.log(vm.user);
if(vm.user.isEmailVerified){
if(vm.user.emailAddress){
vm.lockingReason = 'MAPPING';
var projectId = vm.projectData.projectId;
var taskId = vm.selectedTaskData.taskId;
Expand Down Expand Up @@ -1447,7 +1446,7 @@
* Call api to lock currently selected task for validation. Will update view and map after unlock.
*/
vm.lockSelectedTaskValidation = function () {
if(vm.user.isEmailVerified){
if(vm.user.emailAddress){
vm.lockingReason = 'VALIDATION';
var projectId = vm.projectData.projectId;
var taskId = vm.selectedTaskData.taskId;
Expand Down
46 changes: 31 additions & 15 deletions client/app/project/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,15 @@ <h3 style="display: inline-block;">{{ 'Mapping' | translate }}</h3>
<!-- task action buttons -->
<div class="form__group form__group--section">
<div ng-show="!(projectCtrl.enforceRandomTaskSelection() && projectCtrl.randomTaskSelectionError)">
<div ng-show="projectCtrl.showWarning">
<p class="error"><a class="email-warning" href="/user/{{projectCtrl.user.username}}">{{ 'Add your email address' | translate }}</a>
{{ 'to continue mapping' | translate }}</p>
<div ng-hide="projectCtrl.user.emailAddress">
<p>
{{ 'When you contribute on the Tasking Manager, it is important that notifications around the tasks and projects you participated are reaching you. Thus we require your email address.' | translate }}
<a href="/user/{{ projectCtrl.user.username }}">{{ 'Please go to your profile and add your email address' | translate }}</a>.<br /><br />
{{ 'You can inform yourself on our website about' | translate }}
<a href="https://hotosm.org/privacy">{{ 'how we handle your data' | translate }}</a>.
</p>
</div>
<button ng-show="projectCtrl.isSelectedMappable && !projectCtrl.taskLockError && projectCtrl.userCanMap"
<button ng-show="projectCtrl.isSelectedMappable && !projectCtrl.taskLockError && projectCtrl.userCanMap && projectCtrl.user.emailAddress"
class="button button--large"
ng-click="projectCtrl.lockSelectedTaskMapping()">
{{ 'Start Mapping' | translate }}
Expand Down Expand Up @@ -594,9 +598,13 @@ <h3>{{ 'Validation' | translate }}</h3>
role="alert">
<p>{{ 'You cannot select tasks for validation on this project because you do not have the Validator role.' | translate }}</p>
</div>
<div ng-show="projectCtrl.showWarning">
<p class="error"><a class="email-warning" href="/user/{{projectCtrl.user.username}}">{{'Add your email address' | translate}}</a>
{{ 'to continue validation' | translate }}</p>
<div ng-hide="projectCtrl.user.emailAddress">
<p>
{{ 'When you contribute on the Tasking Manager, it is important that notifications around the tasks and projects you participated are reaching you. Thus we require your email address.' | translate }}
<a href="/user/{{ projectCtrl.user.username }}">{{ 'Please go to your profile and add your email address' | translate }}</a>.<br /><br />
{{ 'You can inform yourself on our website about' | translate }}
<a href="https://hotosm.org/privacy">{{ 'how we handle your data' | translate }}</a>.
</p>
</div>
<div ng-show="projectCtrl.userCanValidate && !project.showWarning">
<p class="description--block">{{ 'Find a task for validation through one of the options below.' | translate }}</p>
Expand Down Expand Up @@ -779,11 +787,15 @@ <h3 style="display: inline-block;">{{ 'Validation' | translate }}</h3>
<!-- task action buttons -->
<div class="form__group form__group--section">
<div>
<div ng-show="projectCtrl.showWarning">
<p class="error"><a class="email-warning" href="/user/{{projectCtrl.user.username}}">{{'Add your email address' | translate}}</a>
{{ 'to continue validation' | translate }}</p>
<div ng-hide="projectCtrl.user.emailAddress">
<p>
{{ 'When you contribute on the Tasking Manager, it is important that notifications around the tasks and projects you participated are reaching you. Thus we require your email address.' | translate }}
<a href="/user/{{ projectCtrl.user.username }}">{{ 'Please go to your profile and add your email address' | translate }}</a>.<br /><br />
{{ 'You can inform yourself on our website about' | translate }}
<a href="https://hotosm.org/privacy">{{ 'how we handle your data' | translate }}</a>.
</p>
</div>
<button ng-show="projectCtrl.isSelectedValidatable && !projectCtrl.taskLockError && projectCtrl.userCanValidate"
<button ng-show="projectCtrl.isSelectedValidatable && !projectCtrl.taskLockError && projectCtrl.userCanValidate && projectCtrl.user.emailAddress"
class="button button--large"
ng-click="projectCtrl.lockSelectedTaskValidation()">
{{ 'Start Validating' | translate }}
Expand Down Expand Up @@ -1000,13 +1012,17 @@ <h6>{{ 'Done editing? Leave a comment and select one of the options below that m
</div>
<div ng-show="projectCtrl.currentTab === 'chat'">
<h3>{{ 'Project Questions and Comments' | translate }}</h3>
<div ng-show="projectCtrl.user.isEmailVerified">
<div ng-show="projectCtrl.user.emailAddress">
<project-chat project-id="projectCtrl.id"
project-author="projectCtrl.projectData.author" role="projectCtrl.user.role"></project-chat>
</div>
<div class='error' ng-hide="projectCtrl.user.isEmailVerified">
<a class="email-warning" href="/user/{{ projectCtrl.user.username }}">{{ 'Add your email address' | translate }}</a>
{{ 'to continue' | translate }}
<div ng-hide="projectCtrl.user.emailAddress">
<p>
{{ 'When you contribute on the Tasking Manager, it is important that notifications around the tasks and projects you participated are reaching you. Thus we require your email address.' | translate }}
<a href="/user/{{ projectCtrl.user.username }}">{{ 'Please go to your profile and add your email address' | translate }}</a>.<br /><br />
{{ 'You can inform yourself on our website about' | translate }}
<a href="https://hotosm.org/privacy">{{ 'how we handle your data' | translate }}</a>.
</p>
</div>
</div>
<!-- advanced options UI -->
Expand Down
1 change: 0 additions & 1 deletion client/app/services/stats.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
* @returns {*|!jQuery.deferred|!jQuery.Promise|!jQuery.jqXHR}
*/
function getHomePageStats(){
console.log('In service');
return $http({
method: 'GET',
url: configService.tmAPI + '/stats/summary'
Expand Down
Loading

0 comments on commit 5daa64c

Please sign in to comment.