Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix-automatically-unlocking-tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Hulios committed Oct 10, 2018
2 parents d58027a + a491b7a commit d55e1e3
Show file tree
Hide file tree
Showing 43 changed files with 3,615 additions and 1,019 deletions.
5 changes: 5 additions & 0 deletions .tx/config
Expand Up @@ -9,8 +9,11 @@ trans.bn = client/locale/bn.json
trans.cs = client/locale/cs.json
trans.de = client/locale/de.json
trans.es = client/locale/es.json
trans.fi = client/locale/fi.json
trans.fa_IR = client/locale/fa_IR.json
trans.fr = client/locale/fr.json
trans.hu = client/locale/hu.json
trans.gl = client/locale/gl.json
trans.id = client/locale/id.json
trans.it = client/locale/it.json
trans.ja = client/locale/ja.json
Expand All @@ -22,6 +25,8 @@ 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.ta = client/locale/ta.json
trans.uk = client/locale/uk.json
trans.vi = client/locale/vi.json
trans.zh_TW = client/locale/zh_TW.json
type = KEYVALUEJSON
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -63,6 +63,7 @@ As the project is open source we have to keep secrets out of the repo. You will
* **TM_CONSUMER_KEY** - This is the OAUTH Consumer Key used for authenticating the Tasking Manager App in OSM
* **TM_CONSUMER_SECRET** - This is the OAUTH Consumer Secret used for authenticating the Tasking Manager App in OSM
* **TM_SMTP_HOST** - The hostname for the SMTP server that is used to send email alerts
* **TM_SMTP_PORT** - The port number for the SMTP server that is used to send email alerts
* **TM_SMTP_USER** - The user for the SMTP server that is used to send email alerts
* **TM_SMTP_PASSWORD** - The password for the SMTP server that is used to send email alerts

Expand All @@ -73,6 +74,7 @@ As the project is open source we have to keep secrets out of the repo. You will
* ```export TM_CONSUMER_KEY=oauth-consumer-key-goes-here```
* ```export TM_CONSUMER_SECRET=oauth-consumer-secret-key-goes-here```
* ```export TM_SMTP_HOST=smtp-server-host-here```
* ```export TM_SMTP_PORT=smtp-server-port-here```
* ```export TM_SMTP_USER=smtp-server-user-here```
* ```export TM_SMTP_PASSWORD=smtp-server-password-here```
* Windows:
Expand All @@ -81,6 +83,7 @@ As the project is open source we have to keep secrets out of the repo. You will
* ```setx TM_CONSUMER_KEY "oauth-consumer-key-goes-here"```
* ```setx TM_CONSUMER_SECRET "oauth-consumer-secret-key-goes-here"```
* ```setx TM_SMTP_HOST "smtp-server-host-here"```
* ```setx TM_SMTP_PORT "smtp-server-port-here"```
* ```setx TM_SMTP_USER "smtp-server-user-here"```
* ```setx TM_SMTP_PASSWORD "smtp-server-password-here"```

Expand Down
25 changes: 25 additions & 0 deletions client/.eslintrc.json
@@ -0,0 +1,25 @@
{
"env": {
"browser": true
},
"globals": {
"ol": true,
"require": true
},
"extends": [
"eslint:recommended",
"angular"
],
"rules": {
"semi": [
"error",
"always"
],
"no-console": "error",
"no-debugger": "error",
"angular/di": [
"error",
"$inject"
]
}
}
2 changes: 1 addition & 1 deletion client/app/components/project-chat/project-chat.html
Expand Up @@ -5,7 +5,7 @@
<strong>
<a href="./user/{{ message.username }}" target="_blank"/>{{ message.username }}</a>
</strong> <span class="metadata" am-time-ago="message.timestamp | amUtc | amLocal"></span></p>
<p ng-bind-html="message.message"></p>
<p markdown-to-html="message.message"></p>
</div>
<div ng-show="projectChatCtrl.messages.length < 1">
{{ 'No project discussion yet' | translate }}
Expand Down
14 changes: 14 additions & 0 deletions client/app/project/comment-box.html
@@ -0,0 +1,14 @@
<div>
<textarea class="form__control space-bottom--none" type="text" mentio
rows="4"
maxlength="{{ projectCtrl.maxlengthComment }}"
placeholder="{{ 'Leave a comment' | translate }}"
mentio-typed-text="typedTerm"
mentio-search="projectCtrl.searchUser(term)"
mentio-select="projectCtrl.formatUserTag(item)"
mentio-items="projectCtrl.suggestedUsers"
mentio-template-url="/app/project/user-suggestions-menu.html"
ng-model="projectCtrl.comment"></textarea>
<p>{{ projectCtrl.maxlengthComment - projectCtrl.comment.length }}
{{ 'characters remaining' | translate }}</p>
</div>
60 changes: 33 additions & 27 deletions client/app/project/project-dashboard.html
Expand Up @@ -21,33 +21,39 @@ <h1 class="section__title">
<div class="dashboard-container">
<div class="left">
<h2>{{ 'Last activity' | translate }}</h2>
<p ng-show="!projectDashboardCtrl.projectActivity.length > 0">{{ 'No activity (yet).' | translate }}</p>
<div ng-show="projectDashboardCtrl.projectActivity.length > 0">
<div class="content">
<div ng-repeat="item in projectDashboardCtrl.projectActivity">
<span ng-show="item.action === 'LOCKED_FOR_MAPPING'">{{ 'Task locked for mapping by' | translate }} <a
href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a></span>
<span ng-show="item.action === 'LOCKED_FOR_VALIDATION'">{{ 'Task locked for validation by' | translate }} <a
href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a></span>
<span ng-show="item.action === 'AUTO_UNLOCKED_FOR_MAPPING'">{{ 'Task automatically unlocked for mapping by' | translate }} <a
href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a></span>
<span ng-show="item.action === 'AUTO_UNLOCKED_FOR_VALIDATION'">{{ 'Task automatically unlocked for validation by' | translate }} <a
href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a></span>
<span ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'BADIMAGERY'">{{ 'Task marked as bad imagery by' | translate }} <a
href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a></span>
<span ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'MAPPED'">{{ 'Task mapped by' | translate }} <a
href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a></span>
<span ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'VALIDATED'">{{ 'Task validated by' | translate }} <a
href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a></span>
<span ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'INVALIDATED'">{{ 'Task invalidated by' | translate }} <a
href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a></span>
<span ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'READY'">{{ 'Task marked as ready by' | translate }} <a
href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a></span>
<p>
<em am-time-ago="item.actionDate | amUtc | amLocal"></em>
</p>
</div>
</div>
<div class="content">
<p ng-show="!projectDashboardCtrl.projectActivity.length > 0">{{ 'No activity (yet).' | translate }}</p>
<table ng-show="projectDashboardCtrl.projectActivity.length > 0" class="table table-dashboard-project-activity">
<thead>
<tr>
<th>{{ 'Action' | translate }}</th>
<th>{{ 'User' | translate }}</th>
<th>{{ 'When' | translate }}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in projectDashboardCtrl.projectActivity">
<td>
<span class="status-marker-locked-for-mapping" ng-show="item.action === 'LOCKED_FOR_MAPPING'">{{ 'Task locked for mapping' | translate }}</span>
<span class="status-marker-locked-for-validation" ng-show="item.action === 'LOCKED_FOR_VALIDATION'">{{ 'Task locked for validation' | translate }}</span>
<span class="status-marker-auto-unlocked-for-mapping" ng-show="item.action === 'AUTO_UNLOCKED_FOR_MAPPING'">{{ 'Task automatically unlocked for mapping' | translate }}</span>
<span class="status-marker-auto-unlocked-for-validation" ng-show="item.action === 'AUTO_UNLOCKED_FOR_VALIDATION'">{{ 'Task automatically unlocked for validation' | translate }}</span>
<span class="status-marker-badimagery" ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'BADIMAGERY'">{{ 'Task marked as bad imagery' | translate }}</span>
<span class="status-marker-mapped" ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'MAPPED'">{{ 'Task mapped' | translate }}</span>
<span class="status-marker-validated" ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'VALIDATED'">{{ 'Task validated' | translate }}</span>
<span class="status-marker-invalidated" ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'INVALIDATED'">{{ 'Task invalidated' | translate }}</span>
<span class="status-marker-split" ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'SPLIT'">{{ 'Task split' | translate }}</span>
<span class="status-marker-ready" ng-show="item.action === 'STATE_CHANGE' && item.actionText === 'READY'">{{ 'Task marked as ready' | translate }}</span>
</td>
<td>
<a href="/user/{{ item.actionBy }}">{{ item.actionBy }}</a>
</td>
<td>
<span am-time-ago="item.actionDate | amUtc | amLocal"></span>
</td>
</tr>
</tbody>
</table>
<button class="button button--achromic"
ng-class="!projectDashboardCtrl.projectActivityPagination.hasPrev ? 'disabled' : ''"
ng-click="projectDashboardCtrl.getLastActivity(projectDashboardCtrl.projectActivityPagination.prevNum)">
Expand Down
21 changes: 21 additions & 0 deletions client/app/project/project.controller.js
Expand Up @@ -38,6 +38,8 @@
vm.taskUnLockErrorMessage = '';
vm.taskSplitError = false;
vm.taskSplitCode == null;
vm.taskCommentError = false;
vm.taskCommentErrorMessage = '';
vm.wasAutoUnlocked = false;

//authorization
Expand Down Expand Up @@ -191,6 +193,8 @@
vm.taskSplitError = false;
vm.taskSplitCode == null;
vm.taskUndoError = false;
vm.taskCommentError = false;
vm.taskCommentErrorMessage = '';
vm.wasAutoUnlocked = false;
}

Expand Down Expand Up @@ -268,6 +272,23 @@
}
};

/**
* Add stand-alone comment, adding it to task history.
*/
vm.addStandaloneComment = function() {
var projectId = vm.projectData.projectId;
var taskId = vm.selectedTaskData.taskId;
var commentPromise = taskService.addTaskComment(projectId, taskId, vm.comment);
commentPromise.then(function (data) {
vm.comment = '';
vm.resetErrors();
setUpSelectedTask(data);
}, function (error) {
vm.taskCommentError = true;
vm.taskCommentErrorMessage = error.data.Error;
});
};

/**
* Add the interactions for selecting tasks
*/
Expand Down

0 comments on commit d55e1e3

Please sign in to comment.