Show iid in event feed and uatocomplete as default id for issues, mr
This commit is contained in:
parent
608f328653
commit
20397091f1
4 changed files with 7 additions and 3 deletions
|
@ -44,7 +44,7 @@ GitLab.GfmAutoComplete =
|
||||||
tpl: @Issues.template
|
tpl: @Issues.template
|
||||||
callbacks:
|
callbacks:
|
||||||
before_save: (issues) ->
|
before_save: (issues) ->
|
||||||
$.map issues, (i) -> id: i.id, title: sanitize(i.title), search: "#{i.id} #{i.title}"
|
$.map issues, (i) -> id: i.iid, title: sanitize(i.title), search: "#{i.iid} #{i.title}"
|
||||||
|
|
||||||
input.one "focus", =>
|
input.one "focus", =>
|
||||||
$.getJSON(@dataSource).done (data) ->
|
$.getJSON(@dataSource).done (data) ->
|
||||||
|
|
|
@ -256,6 +256,10 @@ class Event < ActiveRecord::Base
|
||||||
target.commit_id
|
target.commit_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def target_iid
|
||||||
|
target.respond_to?(:iid) ? target.iid : target_id
|
||||||
|
end
|
||||||
|
|
||||||
def note_short_commit_id
|
def note_short_commit_id
|
||||||
note_commit_id[0..8]
|
note_commit_id[0..8]
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
%span.author_name= link_to_author event
|
%span.author_name= link_to_author event
|
||||||
%span.event_label{class: event.action_name}= event_action_name(event)
|
%span.event_label{class: event.action_name}= event_action_name(event)
|
||||||
- if event.target
|
- if event.target
|
||||||
%strong= link_to "##{event.target_id}", [event.project, event.target]
|
%strong= link_to "##{event.target_iid}", [event.project, event.target]
|
||||||
- else
|
- else
|
||||||
%strong= gfm event.target_title
|
%strong= gfm event.target_title
|
||||||
at
|
at
|
||||||
|
|
|
@ -281,7 +281,7 @@ Gitlab::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :issues, except: [:destroy] do
|
resources :issues, constraints: {id: /\d+/}, except: [:destroy] do
|
||||||
collection do
|
collection do
|
||||||
post :bulk_update
|
post :bulk_update
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue