Group managers (#8591)

* Added abiltiy to add group managers

* Added ability to remove managers

* Added ability for managers to add group tasks

* Allower managers to assign tasks

* Allowed managers to unassign tasks

* Allow managers to delete group tasks

* Allowed managers to approve

* Added initial ui

* Added approval view for managers

* Allowed managers to edit

* Fixed lint issues

* Added spacing to buttons

* Removed leader from selection of group managers

* Code review updates

* Ensured approvals are only done once

* Added ability for parties to add managers

* Add notifications to all managers when approval is requests

* Removed tasks need approval notifications from all managers when task is approve

* Fixed linting issues

* Hid add managers UI from groups that are not subscribed

* Removed let from front end

* Fixed issues with post task url params

* Fixed string locales

* Removed extra limited strings

* Added cannotedit tasks function

* Added limit fields and notification check by taskId

* Localized string and other minor issues

* Added manager and leader indicator

* Added group notifications refresh on sync

* Added close button for group notifications

* Removed group approval notifications when manager is removed

* Moved leader/manager indicators to after hp

* Added manager fields to groups

* Spelling and syntax fixes
This commit is contained in:
Keith Holliday
2017-04-25 08:28:56 -06:00
committed by GitHub
parent 369702884a
commit e2f4b0e3dc
25 changed files with 708 additions and 55 deletions

View File

@@ -89,14 +89,20 @@ habitrpg.controller('NotificationCtrl',
var notificationsToRead = [];
var scoreTaskNotification;
User.user.groupNotifications = []; // Flush group notifictions
after.forEach(function (notification) {
if (lastShownNotifications.indexOf(notification.id) !== -1) {
return;
}
lastShownNotifications.push(notification.id);
if (lastShownNotifications.length > 10) {
lastShownNotifications.splice(0, 9);
// Some notifications are not marked read here, so we need to fix this system
// to handle notifications differently
if (['GROUP_TASK_APPROVED', 'GROUP_TASK_APPROVAL'].indexOf(notification.type) === -1) {
lastShownNotifications.push(notification.id);
if (lastShownNotifications.length > 10) {
lastShownNotifications.splice(0, 9);
}
}
var markAsRead = true;