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 43 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
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"ng-page-title": "^1.1.1",
"restangular": "~1.5.1",
"material-shadows": "^3.0.1",
"mno-ui-elements": "maestrano/mno-ui-elements#master"
"mno-ui-elements": "maestrano/mno-ui-elements#feature/tasks"
},
"devDependencies": {
"angular-mocks": "~1.6.0"
Expand Down
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>
<a ng-if="isTasksEnabled" ui-sref="home.messages" ui-sref-active="active">{{ 'mno_enterprise.templates.dashboard.menu.messages' | translate }}</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ng-if="isTasksEnabled" should be on the li element

</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
21 changes: 21 additions & 0 deletions src/app/components/mnoe-api/notifications.svc.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Service for managing the users.
angular.module 'mnoEnterpriseAngular'
.service 'MnoeNotifications', (MnoeFullApiSvc, MnoeOrganizations) ->
_self = @

@get = (params = {})->
MnoeOrganizations.get().then(->
MnoeFullApiSvc
.one('organizations', MnoeOrganizations.getSelectedId())
.getList('notifications', params)
)

@notified = (params)->
MnoeOrganizations.get().then(->
MnoeFullApiSvc
.one('organizations', MnoeOrganizations.getSelectedId())
.one('notifications')
.post('/notified', params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right syntax:

MnoeFullApiSvc.one('organizations', MnoeOrganizations.getSelectedId())
    .all('notifications')
    .doPOST(params, '/notified')

)

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 @
236 changes: 236 additions & 0 deletions src/app/components/mnoe-tasks/mnoe-tasks.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
angular.module('mnoEnterpriseAngular').component('mnoeTasks', {
bindings: {
},
templateUrl: 'app/components/mnoe-tasks/mnoe-tasks.html',
controller: ($filter, $uibModal, $log, $translate, $timeout, $q, toastr, MnoeTasks, MnoeCurrentUser)->
ctrl = this
ctrl.$onInit = ->
ctrl.tasks = {
list: []
sort: 'send_at.desc'
nbItems: 10
offset: 0
page: 1
loading: false
pageChangedCb: (nbItems, page) ->
ctrl.tasks.nbItems = nbItems
ctrl.tasks.page = page
ctrl.tasks.offset = (page - 1) * nbItems
fetchTasks(limit: nbItems, offset: ctrl.tasks.offset)
}
ctrl.menus = [
{ label: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.menus.inbox'), name: 'inbox', selected: true }
{ label: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.menus.sent'), name: 'sent', query: { outbox: true } }
{ label: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.menus.draft'), name: 'draft', query: { 'where[status][]': 'draft', outbox: true } }
]
ctrl.tasksFilters = [
{ name: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks_filters.all_tasks_and_msgs') }
{ name: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks_filters.all_tasks'), query: { 'where[due_date.ne]': '' } }
{ name: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks_filters.all_messages'), query: { 'where[due_date.eq]': '' } }
{ name: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks_filters.due_tasks'), query: { 'where[due_date.lt]': moment().toISOString() } }
{ name: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks_filters.completed_tasks'), query: { 'where[completed_at.ne]': '' } }
]
ctrl.selectedTasksFilter = ctrl.tasksFilters[0]
ctrl.selectedMenu = _.find(ctrl.menus, (m)-> m.selected)
fetchTasks()

ctrl.onSelectFilter = ({filter})->
return if filter == ctrl.selectedTasksFilter
ctrl.selectedTasksFilter = filter
fetchTasks()

ctrl.onSelectMenu = ({menu})->
return if menu == ctrl.selectedMenu
ctrl.selectedMenu = menu
params = { order_by: 'updated_at.desc' } if menu.name == 'draft'
fetchTasks(params)

ctrl.onRefreshTasks = ->
fetchTasks()

ctrl.sortableTableRowOnClick = ({rowItem})->
if ctrl.selectedMenu.name == 'draft' then ctrl.openCreateTaskModal(rowItem) else ctrl.openShowTaskModal(rowItem)

ctrl.openCreateTaskModal = (task)->
$uibModal.open({
component: 'mnoCreateTaskModal'
resolve:
recipientFormater: () -> recipientFormater
draftTask: ->
angular.copy(task) if task
recipients: MnoeTasks.getRecipients()
createTaskCb: ->
(newTask) ->
createTask(newTask)
updateDraftCb: ->
(draftTask)->
updateTask(draftTask, draftTask).then(
->
fetchTasks()
)
})

ctrl.openShowTaskModal = (task)->
$uibModal.open({
component: 'mnoShowTaskModal'
resolve:
recipientFormater: () -> recipientFormater
task: -> angular.copy(task)
dueDateFormat: -> 'MMMM d'
# $uibModal resolve internally unwraps the promise, applying the result to currentUser.
currentUser: MnoeCurrentUser.get()
setReminderCb: ->
(reminderDate)->
updateTask(task, reminder_date: reminderDate)
onReadTaskCb: ->
(hasBeenRead)->
# Only mark inbox items that have no already been read as read.
return $q.resolve() if hasBeenRead || ctrl.selectedMenu.name != 'inbox'
updateTask(task, read_at: moment().toDate())
markAsDoneCb: ->
(isDone)->
updateTaskStatus(task, isDone)
sendReplyCb: ->
(reply, markAsDone)->
promise = if markAsDone then updateTaskStatus(task, markAsDone) else $q.resolve()
promise.then(
->
ctrl.sendReply(reply, task)
)
})

ctrl.sendReply = (reply, task) ->
angular.merge(reply, { title: "RE: #{task.title}", orga_relation_id: task.owner_id, status: 'sent' })
createTask(reply)

# Manage sorting for mnoSortableTable with angular-smart-table st-pipe.
ctrl.sortableTableServerPipe = (tableState)->
ctrl.tasks.sort = updateTableSort(tableState.sort)
fetchTasks(limit: ctrl.tasks.nbItems, offset: ctrl.tasks.offset, order_by: ctrl.tasks.sort)

# Private

recipientFormater = (orgaRel) ->
orgaRel.user.name + " " + orgaRel.user.surname


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove double empty line

# Update angular-smart-table sorting parameters
updateTableSort = (sortState = {}) ->
sort = ctrl.tasks.sort
if sortState.predicate
sort = sortState.predicate
if sortState.reverse
sort += ".desc"
else
sort += ".asc"
return sort

fetchTasks = (params = {})->
ctrl.tasks.loading = true
ctrl.mnoSortableTableFields = buildMnoSortableTable()
baseParams = { limit: ctrl.tasks.nbItems, offset: ctrl.tasks.offset, order_by: ctrl.tasks.sort }
params = angular.merge({}, baseParams, params, ctrl.selectedMenu.query, ctrl.selectedTasksFilter.query)
MnoeTasks.get(params).then(
(response)->
ctrl.tasks.list = response.data.plain()
ctrl.tasks.totalItems = response.headers('x-total-count')
ctrl.tasks.list
(errors)->
$log.error(errors)
toastr.error('mno_enterprise.templates.components.mnoe-tasks.toastr_error.get_tasks')
return
).finally(->
# Add delay to improve UI the rendering appearance while new data is bound.
$timeout(->
ctrl.tasks.loading = false
, 250)
)

createTask = (task)->
MnoeTasks.create(task).then(
->
fetchTasks()
(errors)->
$log.error(errors)
toastr.error('mno_enterprise.templates.components.mnoe-tasks.toastr_error.create_task')
return
)

updateTask = (task, params = {})->
MnoeTasks.update(task.id, params).then(
(updatedTask)->
angular.extend(task, updatedTask)
(errors)->
$log.error(errors)
toastr.error('mno_enterprise.templates.components.mnoe-tasks.toastr_error.update_task')
return
)

# Update Task status attribute & linked 'done' checkbox ngModel
updateTaskStatus = (task, isDone)->
task.markedDone = isDone
status = if isDone then 'done' else 'sent'
MnoeTasks.update(task.id, status: status).then(
(response)->
angular.extend(task, response)
(errors)->
$log.error(errors)
toastr.error('mno_enterprise.templates.components.mnoe-tasks.toastr_error.update_task')
# Revert to previous state, as unchecked or checked on update fail
task.markedDone = !task.markedDone
return
)

# Creates mnoSortableTable cmp config API, building the tasks table columns
buildMnoSortableTable = ->
toUserNameColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.user.name'), attr: 'task_recipients[0].user.name'}
toUserSurnameColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.user.surname'), attr: 'task_recipients[0].user.surname'}
fromUserNameColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.user.name'), attr: 'owner.user.name'}
fromUserSurnameColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.user.surname'), attr: 'owner.user.surname'}
titleColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.title'), attr: 'title', class: 'ellipsis' }
messageColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.message'), attr: 'message', class: 'ellipsis' }
receivedAtColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.received'), attr: 'send_at', filter: expandingDateFormat }
sentAtColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.sent'), attr: 'send_at', filter: expandingDateFormat }
readAtColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.read'), attr: 'task_recipients[0].read_at', filter: expandingDateFormat }
updatedAtColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.updated_at'), attr: 'updated_at', filter: expandingDateFormat }
dueDateAtColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.due_date'), attr: 'due_date', filter: simpleDateFormat }
doneColumn = { header: $translate.instant('mno_enterprise.templates.components.mnoe-tasks.tasks.column_label.done'), attr: 'status', render: taskDoneCustomField, stopPropagation: true }
switch ctrl.selectedMenu.name
when 'inbox'
[fromUserNameColumn, fromUserSurnameColumn, titleColumn, messageColumn, receivedAtColumn, dueDateAtColumn, doneColumn]
when 'sent'
[toUserNameColumn, toUserSurnameColumn, titleColumn, messageColumn, sentAtColumn, readAtColumn, dueDateAtColumn, doneColumn]
when 'draft'
[toUserNameColumn, toUserSurnameColumn, titleColumn, messageColumn, updatedAtColumn, dueDateAtColumn]

# Formats dates yesterday & beyond differently from today
expandingDateFormat = (value)->
dateFormat = if moment(value) < moment().startOf('day') then 'MMMM d' else 'h:mma'
$filter('date')(value, dateFormat)

# A format used across multiple tasks columns
simpleDateFormat = (value)->
$filter('date')(value, 'MMMM d')

# Callback for building a custom "done" checkbox field in the mnoSortableTable component.
taskDoneCustomField = (rowItem)->
# If a :completed_at timestamp exist, initialise frontend switch model for checkbox.
rowItem.markedDone = rowItem.completed_at?
switch ctrl.selectedMenu.name
when 'inbox'
htmlTemplate = """
<input type="checkbox" class="toggle-task-done" ng-if="rowItem.due_date" ng-model="rowItem.markedDone" ng-change="markDone(rowItem)">
<span ng-if="!rowItem.due_date">-</span>
"""
when 'sent'
label = if rowItem.markedDone then 'completed' else 'open'
htmlTemplate = "<span>#{label}</span>"
{
scope:
markDone: (task) ->
updateTaskStatus(task, task.markedDone)
template: htmlTemplate
}

ctrl
})
33 changes: 33 additions & 0 deletions src/app/components/mnoe-tasks/mnoe-tasks.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div class="topbar">
<div class="flex-row">
<button class="btn btn-primary compose" ng-click="$ctrl.openCreateTaskModal()">
<span translate>mno_enterprise.templates.components.mnoe-tasks.compose_button_text</span>
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
</button>
<mno-dropdown-filter-selector filters="$ctrl.tasksFilters" selected="$ctrl.selectedTasksFilter" on-select="$ctrl.onSelectFilter($event)"></mno-dropdown-filter-selector>
<div class="refresh-tasks" ng-click="$ctrl.onRefreshTasks()">
<i class="fa fa-refresh fa-2x fa-fw" aria-hidden="true"></i>
</div>
</div>
<div class="hidden-sm hidden-md hidden-lg">
<mno-tasks-menu menus="$ctrl.menus" on-select="$ctrl.onSelectMenu($event)"></mno-tasks-menu>
</div>
</div>
<div class="main">
<div class="sidebar hidden-xs">
<mno-tasks-menu menus="$ctrl.menus" on-select="$ctrl.onSelectMenu($event)"></mno-tasks-menu>
</div>
<div class="tasks">
<mno-sortable-table row-collection="$ctrl.tasks.list" pipe="$ctrl.sortableTableServerPipe" fields="$ctrl.mnoSortableTableFields" row-on-click="$ctrl.sortableTableRowOnClick($event)" is-loading="$ctrl.tasks.loading"></mno-sortable-table>

<div class="pagination">
<mno-pagination
page="$ctrl.tasks.page"
nb-items="$ctrl.tasks.nbItems"
total-items="$ctrl.tasks.totalItems"
on-change-cb="$ctrl.tasks.pageChangedCb(nbItems, page)"
is-loading="$ctrl.tasks.loading">
</mno-pagination>
</div>
</div>
</div>
Loading