Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNOE-551][MNOE-553] Release Task Feature to 1.1 #281

Open
wants to merge 80 commits into
base: 1.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d3e6a0a
[MNOE-551] add messages view
xaun Jul 28, 2017
21f95a2
[MNOE-551] Sidebar and Tasks w/ sortable table UI
xaun Jul 28, 2017
7dab375
[MNOE-551] Add pagination element to tasks (stubbed)
xaun Jul 31, 2017
4ba452a
[MNOE-551] Use @link-color for active menus etc
xaun Jul 31, 2017
8ab3b6e
[MNOE-551] Add create task modal with autocomplete recipients
xaun Jul 31, 2017
078ce82
[MNOE-551] Move create-task-modal to mno-ui-elements
xaun Aug 1, 2017
8598ddf
[MNOE-551] Add show tasks modal
xaun Aug 1, 2017
e634301
[MNOE-551] Adjustments for changes to mnoSortableTable
xaun Aug 1, 2017
05df34c
[MNOE-551] Create topbar for compose & filter elements
xaun Aug 1, 2017
8ed4db5
[MNOE-551] Refactor menu buttons & improve for mobile
xaun Aug 1, 2017
958ff9e
[MNOE-551] Use md-primary for Compose button
xaun Aug 1, 2017
0187ed7
[MNOE-551] Add filter selector component
xaun Aug 2, 2017
f0dc824
[MNOE-551] mnoe-tasks ctrl fixes & refactors
xaun Aug 2, 2017
ef09daa
[MNOE-551] Move tasks menu to ui-elements cmp
xaun Aug 2, 2017
3069856
[MNOE-551] get tasks from api, apply filter queries & i18n
xaun Aug 3, 2017
6f5ec07
[MNOE-551] Fix table header spacing, & improve date format
xaun Aug 3, 2017
0b77362
[MNOE-551] Connect pagination to backend
xaun Aug 3, 2017
20eaac2
[MNOE-551] Add loading for tasks
xaun Aug 4, 2017
e8249c7
[MNOE-551] Connect create tasks to backend
xaun Aug 4, 2017
d2019c5
[MNOE-551] connect reply & reply and mark done to backend
xaun Aug 4, 2017
9c63555
[MNOE-551] Configure mnoShowTaskModal with a date format
xaun Aug 4, 2017
0440f4e
[MNOE-551] Add delay to fetchTasks loader finish
xaun Aug 4, 2017
20f208b
[MNOE-551] Fix date filter format string
xaun Aug 4, 2017
94ccf9d
[MNOE-551] Config mnoSortableTable with a st-pipe callback
xaun Aug 4, 2017
573ff68
[MNOE-551] Build tasks table columns based on selected menu
xaun Aug 7, 2017
88d38b5
[MNOE-551] improve tasks date formatting
xaun Aug 7, 2017
49d2b34
[MNOE-551] Add refresh tasks
xaun Aug 7, 2017
8c58258
[MNOE-551] configure show-task-modal for setting reminders
xaun Aug 7, 2017
18d8263
[MNOE-551] Fix promises to reject errors for chaining
xaun Aug 7, 2017
d8b8c18
[MNOE-551] Add sent & read columns for outbox
xaun Aug 7, 2017
2c6d8a4
[MNOE-551] Update Task as read on show modal
xaun Aug 7, 2017
cc5ebbf
[MNOE-551] Enable/disable task via mnoe feature flag
xaun Aug 7, 2017
a283ee0
[MNOE-551] Use callback for modal actions
xaun Aug 8, 2017
539c073
[MNOE-551] Sort draft tasks by updated_at
xaun Aug 8, 2017
722f13a
[MNOE-551] Only allow inbox items to be marked as read
xaun Aug 8, 2017
73859f7
[MNOE-551] Open create modal on draft task click
xaun Aug 8, 2017
a08ea43
[MNOE-551] Remove mno-tasks-menu less variables
xaun Aug 8, 2017
6531257
[MNOE-551] Uncheck done on failed update & callback refactors
xaun Aug 8, 2017
58f82d1
Merge pull request #278 from xaun/feature/551-tasks
x4d3 Aug 8, 2017
4c0c288
Implement Notifications
x4d3 Aug 9, 2017
b687cfa
Merge pull request #280 from x4d3/feature/tasks
x4d3 Aug 9, 2017
aaff79b
Improve columns
x4d3 Aug 10, 2017
a218b4d
Merge pull request #283 from x4d3/feature/tasks
x4d3 Aug 10, 2017
ca115fa
Fix drafts appearing in outbox
xaun Aug 15, 2017
8552624
Fix mnoe-tasks component for utc
xaun Aug 15, 2017
a9229f6
Merge pull request #285 from xaun/feature/tasks
x4d3 Aug 16, 2017
5a74207
Use master branch for mno-ui-elements
x4d3 Aug 16, 2017
ee084ee
Move notification.svn to mno-ui-elements
x4d3 Aug 16, 2017
f5d67a3
Add Notification Feature flag
x4d3 Aug 16, 2017
4a4f97d
Merge pull request #287 from x4d3/feature/tasks
x4d3 Aug 16, 2017
73f3310
Apply code review comments
x4d3 Aug 18, 2017
fa62ac1
Merge pull request #289 from x4d3/feature/tasks
x4d3 Aug 18, 2017
8baf784
Fix issue with done message not shown in Sent
x4d3 Aug 21, 2017
723d66f
Merge pull request #290 from x4d3/feature/tasks
x4d3 Aug 21, 2017
3837c9d
Fix due tasks filter to exclude done tasks
xaun Aug 27, 2017
fe77074
Merge pull request #295 from xaun/feature/tasks
manu-da Aug 30, 2017
166c491
Use asyncronous translations to fix locale loading problems
xaun Aug 30, 2017
5d9362a
Fix to & from field display on task show modal
xaun Aug 30, 2017
5e1c46d
Merge pull request #300 from xaun/feature/tasks
alexnoox Aug 31, 2017
584bf15
Merge remote-tracking branch 'central/1.1' into feature/tasks
cesar-tonnoir Aug 31, 2017
2b3835a
Use new version of notification
x4d3 Sep 12, 2017
8a195c2
Merge pull request #314 from x4d3/feature/tasks
x4d3 Sep 13, 2017
548932b
Fix Task without due-date should not have status
x4d3 Sep 13, 2017
978906f
Merge pull request #317 from x4d3/feature/tasks
cesar-tonnoir Sep 14, 2017
8138989
Add missing task_title
x4d3 Sep 14, 2017
fb10504
Merge pull request #319 from x4d3/feature/tasks
x4d3 Sep 14, 2017
e28b8dd
Fix issue of modal being opened twice - Rotate refreh icon while loading
x4d3 Sep 14, 2017
522b185
Apply code review comments
x4d3 Sep 14, 2017
ac669ef
Merge pull request #321 from x4d3/feature/tasks
cesar-tonnoir Sep 15, 2017
3af75a6
Merge remote-tracking branch 'origin/1.1' into merge/1.1
Sep 27, 2017
5fe199f
Merge pull request #345 from fgourichon/merge/1.1
alexnoox Sep 27, 2017
057894f
Fix: Notifications shown only if browser is refreshed in the right orga
x4d3 Sep 27, 2017
2a19b81
Merge pull request #346 from x4d3/feature/tasks
Sep 28, 2017
50f2766
Fix: Task is due "Today" is not appearing
x4d3 Oct 9, 2017
f5ae4aa
Merge pull request #354 from x4d3/feature/tasks
x4d3 Oct 12, 2017
9ecbdc4
Refresh messages when changing organizations
adamaziz15 Nov 17, 2017
65850fa
Reorder controller dependencies
adamaziz15 Nov 20, 2017
df4694d
Merge pull request #383 from adamaziz15/bug/795-messages-page-refresh
alexnoox Dec 11, 2017
ef0d514
Update styling on messages section and fix ng-animate bug
adamaziz15 Dec 13, 2017
530d675
Merge pull request #399 from adamaziz15/feature/57-inbox-tab
ouranos Dec 21, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ angular.module 'mnoEnterpriseAngular'
restrict: 'EA'
templateUrl: 'app/components/dashboard-menu/dashboard-menu.html',

controller: ($scope, MnoeCurrentUser, MnoeOrganizations, DOCK_CONFIG, ORGANIZATION_MANAGEMENT, MARKETPLACE_CONFIG) ->
controller: ($scope, MnoeCurrentUser, MnoeOrganizations, DOCK_CONFIG, ORGANIZATION_MANAGEMENT, MARKETPLACE_CONFIG, TASKS_CONFIG) ->
$scope.isDockEnabled = DOCK_CONFIG.enabled
$scope.isOrganizationManagementEnabled = ORGANIZATION_MANAGEMENT.enabled
$scope.isMarketplaceEnabled = MARKETPLACE_CONFIG.enabled
$scope.isTasksEnabled = TASKS_CONFIG.enabled

$scope.$watch(MnoeOrganizations.getSelectedId, (newValue) ->
# Impac! is displayed only to admin and super admin
Expand Down
9 changes: 9 additions & 0 deletions src/app/components/dashboard-menu/dashboard-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
<a ui-sref="home.account" ui-sref-active="active">{{ 'mno_enterprise.templates.dashboard.menu.my_account' | translate }}</a>
</li>

<li ng-if="isTasksEnabled">
<a ui-sref="home.messages" ui-sref-active="active">{{ 'mno_enterprise.templates.dashboard.menu.messages' | translate }}</a>
</li>

<li ng-if="isOrganizationManagementEnabled">
<a ui-sref="home.company" ui-sref-active="active">{{ 'mno_enterprise.templates.dashboard.menu.company' | translate }}</a>
</li>
Expand Down Expand Up @@ -81,6 +85,11 @@
<i class="dhb-icon-account"></i>
</a>

<a ng-if="isTasksEnabled" ui-sref="home.messages" class="dashboard-button top-buffer-1" ui-sref-active="active">
<div class='content'>{{ 'mno_enterprise.templates.dashboard.menu.messages' | translate }}</div>
<i class="fa fa-tasks fa-2x" aria-hidden="true" style="padding: 5px 2px;"></i>
</a>

<a ng-if="isOrganizationManagementEnabled" ui-sref="home.company" class="dashboard-button top-buffer-1" ui-sref-active="active">
<div class='content'>{{ 'mno_enterprise.templates.dashboard.menu.company' | translate }}</div>
<i class="dhb-icon-company"></i>
Expand Down
135 changes: 135 additions & 0 deletions src/app/components/mnoe-api/notifications.svc.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Service for managing the users.
angular.module 'mnoEnterpriseAngular'
.service 'MnoeNotifications', ($q, $translate, MnoeFullApiSvc, MnoeOrganizations) ->

@get = (organizationId)->
deferred = $q.defer()
MnoeFullApiSvc
.one('organizations', organizationId)
.getList('notifications').then((response) ->
promises = _.map(response.data.plain(), (notification)->
NotificationFormatter[notification.notification_type](notification)
)
$q.all(promises).then(deferred.resolve)
)
deferred.promise

@notified = (params)->
MnoeOrganizations.get().then(->
MnoeFullApiSvc
.one('organizations', MnoeOrganizations.getSelectedId())
.all('notifications')
.doPOST(params, '/notified')
)

formatDate = (date)->
moment(date).format('LL')

isToday = (date)->
moment(date).isSame(moment(), 'd')

NotificationFormatter = {}

NotificationFormatter.reminder = (notification) ->
task = notification.task
deferred = $q.defer()
$translate([
'mno_enterprise.templates.components.notifications.reminder.title',
'mno_enterprise.templates.components.notifications.reminder.message.title',
'mno_enterprise.templates.components.notifications.reminder.message.from',
'mno_enterprise.templates.components.notifications.reminder.message.due',
'mno_enterprise.templates.components.notifications.reminder.message.details'
],
{
user_name: task.owner.user.name
user_surname: task.owner.user.surname,
due_date: formatDate(task.due_date),
task_title: task.title
}
).then((tls) ->
message = [
tls['mno_enterprise.templates.components.notifications.reminder.message.title'],
tls['mno_enterprise.templates.components.notifications.reminder.message.from'],
tls['mno_enterprise.templates.components.notifications.reminder.message.due'],
tls['mno_enterprise.templates.components.notifications.reminder.message.details']
].join('</br>')
deferred.resolve({
object_id: notification.object_id,
object_type: notification.object_type,
notification_type: notification.notification_type,
method: 'info',
title: tls['mno_enterprise.templates.components.notifications.reminder.title'],
message: message,
})
)
deferred.promise

NotificationFormatter.due = (notification) ->
task = notification.task
deferred = $q.defer()
$translate([
'mno_enterprise.templates.components.notifications.due.title',
'mno_enterprise.templates.components.notifications.due.title_today',
'mno_enterprise.templates.components.notifications.due.message.title',
'mno_enterprise.templates.components.notifications.due.message.from',
'mno_enterprise.templates.components.notifications.due.message.details'
],
{
user_name: task.owner.user.name
user_surname: task.owner.user.surname,
due_date: formatDate(task.due_date),
task_title: task.title
}
).then((tls) ->
message = [
tls['mno_enterprise.templates.components.notifications.due.message.title'],
tls['mno_enterprise.templates.components.notifications.due.message.from'],
tls['mno_enterprise.templates.components.notifications.due.message.details']
].join('</br>')
title = if isToday(task.due_date)
tls['mno_enterprise.templates.components.notifications.due.title_today']
else
tls['mno_enterprise.templates.components.notifications.due.title']
deferred.resolve({
object_id: notification.object_id,
object_type: notification.object_type,
notification_type: notification.notification_type,
method: 'warning',
title: title,
message: message,
})
)
deferred.promise

NotificationFormatter.completed = (notification) ->
task = notification.task
recipient = task.task_recipients[0]
deferred = $q.defer()
$translate([
'mno_enterprise.templates.components.notifications.completed.title',
'mno_enterprise.templates.components.notifications.completed.message.has_completed',
'mno_enterprise.templates.components.notifications.completed.message.details'
],
{
user_name: recipient.user.name
user_surname: recipient.user.surname,
task_title: task.title
}
).then((tls) ->
message = [
tls['mno_enterprise.templates.components.notifications.completed.message.has_completed'],
tls['mno_enterprise.templates.components.notifications.completed.message.details']
].join('</br>')

deferred.resolve({
object_id: notification.object_id,
object_type: notification.object_type,
notification_type: notification.notification_type,
method: 'info',
title: tls['mno_enterprise.templates.components.notifications.completed.title'],
message: message,
})
)
deferred.promise

return @
41 changes: 41 additions & 0 deletions src/app/components/mnoe-api/tasks.svc.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Service for managing the users.
angular.module 'mnoEnterpriseAngular'
.service 'MnoeTasks', (MnoeFullApiSvc, MnoeOrganizations) ->
@get = (params = {})->
MnoeOrganizations.get().then(->
MnoeFullApiSvc
.one('organizations', MnoeOrganizations.getSelectedId())
.getList('tasks', params)
)

@getRecipients = ->
MnoeFullApiSvc
.all('orga_relations')
.getList()
.then(
(response)-> response.data.plain()
)

@update = (id, params = {})->
MnoeOrganizations.get().then(->
MnoeFullApiSvc
.one('organizations', MnoeOrganizations.getSelectedId())
.one('tasks', id)
.patch(params)
.then(
(response)-> response.data.plain().task
)
)

@create = (params = {})->
MnoeOrganizations.get().then(->
MnoeFullApiSvc
.one('organizations', MnoeOrganizations.getSelectedId())
.all('tasks')
.post(params)
.then(
(response)-> response.data.plain()
)
)

return @
8 changes: 7 additions & 1 deletion src/app/components/mnoe-config/mnoe-config.svc.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module 'mnoEnterpriseAngular'
.factory 'MnoeConfig', ($log, AUDIT_LOG, ORGANIZATION_MANAGEMENT) ->
.factory 'MnoeConfig', ($log, AUDIT_LOG, ORGANIZATION_MANAGEMENT, NOTIFICATIONS_CONFIG) ->
_self = @

@isAuditLogEnabled = () ->
Expand All @@ -14,4 +14,10 @@ angular.module 'mnoEnterpriseAngular'
else
true

@isNotificationsEnabled = () ->
if NOTIFICATIONS_CONFIG
NOTIFICATIONS_CONFIG.enabled
else
false

return @
Loading