From 3de74c3d5d3ae4415908260365db89339c6fd4c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rijaniaina=20Elie=20Fid=C3=A8le?= <elierijaniaina@gmail.com> Date: Tue, 25 Feb 2025 15:35:05 +0300 Subject: [PATCH] feat: mention in kanban --- assets/js/aap/aap.js | 88 +++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/assets/js/aap/aap.js b/assets/js/aap/aap.js index e55daccb0..422e8de88 100755 --- a/assets/js/aap/aap.js +++ b/assets/js/aap/aap.js @@ -6098,59 +6098,53 @@ var aapObj = { status: created.header, parentId: projectId, parentType: 'projects', - component: 'kanban' + component: 'kanban', + mentions: created.contributors.map(c => c.alias), }; if (wsCO && wsCO.id) post.emiter = wsCO.id; coInterface.actions.request_create_action(post).then(function (response) { - if (response.success) { - // send create notification - var id_at_kanban = created.id; - created.id = response.data._id.$id; - created.actions = [{ - icon: 'fa fa-archive', - bstooltip: { text: trad.delete, position: 'top' }, - action: 'onCardArchiveClick', - bstooltip: { text: trad['Archive'], position: 'top' } - }, { icon: 'fa fa-commenting', badge: '0', action: 'onCardCommentClick' }, { - icon: 'fa fa-picture-o', - badge: '0', - action: 'onCardPictureClick', - hideCondition: { badge: '0' } - }, - { - icon: 'fa fa-file', - badge: '0', - action: 'onCardFileClick', - hideCondition: { badge: '0' } + // send create notification + var id_at_kanban = created.id; + created.id = response._id.$id; + created.actions = [{ + icon: 'fa fa-archive', + bstooltip: { text: trad.delete, position: 'top' }, + action: 'onCardArchiveClick', + bstooltip: { text: trad['Archive'], position: 'top' } + }, { icon: 'fa fa-commenting', badge: '0', action: 'onCardCommentClick' }, { + icon: 'fa fa-picture-o', + badge: '0', + action: 'onCardPictureClick', + hideCondition: { badge: '0' } + }, + { + icon: 'fa fa-file', + badge: '0', + action: 'onCardFileClick', + hideCondition: { badge: '0' } + }, + { + badge: '0/0', + className: 'kanban-no-task-action' + }, { + icon: 'fa fa-link', + bstooltip: { + text: coTranslate('Participate'), + position: 'top' }, - { - badge: '0/0', - className: 'kanban-no-task-action' - }, { - icon: 'fa fa-link', - bstooltip: { - text: coTranslate('Participate'), - position: 'top' - }, - action: 'onParticipate' - }]; - $(container).kanban('setData', { column: created.header, id: id_at_kanban, data: created }); - coInterface.actions.update_action_position({ - action: created.id, - group: created.header, - emiter: wsCO && wsCO.id ? wsCO.id : null, - component: 'kanban', - server_url: baseUrl - }).then(); - } - else - toastr.error(coTranslate(response.data)); + action: 'onParticipate' + }]; + $(container).kanban('setData', { column: created.header, id: id_at_kanban, data: created }); + coInterface.actions.update_action_position({ + action: created.id, + group: created.header, + emiter: wsCO && wsCO.id ? wsCO.id : null, + component: 'kanban', + server_url: baseUrl + }).then(); }).catch(function (error) { - if (error && error.data) - toastr.error(coTranslate(error.data)); - else - mylog.error(error); + mylog.error(error); }); }, onHeaderChange: function (changedHeader) { -- GitLab