Fixed issue #2813 - Useless display of delete icon below note.
This commit is contained in:
parent
3d00f4d25b
commit
7225899cf9
2 changed files with 22 additions and 9 deletions
|
@ -2,14 +2,27 @@ class Delete
|
||||||
@action: (actions, ticket, article, ui) ->
|
@action: (actions, ticket, article, ui) ->
|
||||||
return actions if ui.permissionCheck('ticket.customer')
|
return actions if ui.permissionCheck('ticket.customer')
|
||||||
|
|
||||||
if article.type.name is 'note'
|
return actions if article.type.name isnt 'note'
|
||||||
if App.User.current()?.id == article.created_by_id && ui.permissionCheck('ticket.agent')
|
|
||||||
actions.push {
|
return actions if App.User.current()?.id != article.created_by_id
|
||||||
name: 'delete'
|
|
||||||
type: 'delete'
|
return actions if !ui.permissionCheck('ticket.agent')
|
||||||
icon: 'trash'
|
|
||||||
href: '#'
|
# return if article is older then 10 minutes
|
||||||
}
|
created_at = Date.parse(article.created_at)
|
||||||
|
time_to_show = 600000 - (Date.parse(new Date()) - created_at)
|
||||||
|
|
||||||
|
return actions if time_to_show <= 0
|
||||||
|
|
||||||
|
actions.push {
|
||||||
|
name: 'delete'
|
||||||
|
type: 'delete'
|
||||||
|
icon: 'trash'
|
||||||
|
href: '#'
|
||||||
|
}
|
||||||
|
|
||||||
|
# rerender ations in 10 minutes again to hide delete action of article
|
||||||
|
ui.delay(ui.render, time_to_show, 'actions-rerender')
|
||||||
|
|
||||||
actions
|
actions
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ class App.TicketZoomArticleActions extends App.Controller
|
||||||
super
|
super
|
||||||
@render()
|
@render()
|
||||||
|
|
||||||
render: ->
|
render: =>
|
||||||
actions = @actionRow(@ticket, @article)
|
actions = @actionRow(@ticket, @article)
|
||||||
|
|
||||||
if actions
|
if actions
|
||||||
|
|
Loading…
Reference in a new issue