Skip to content

GitLab

  • Menu
    • Projects Groups Snippets
      Help
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !6475

Merged
Created 11 years ago by Administrator@rootOwner

Add GFM autocompletion for MergeRequests

  • Overview 3
  • Commits 1
  • Changes 2

Created by: rspeicher

Requested here.

Correct me if I'm wrong, but I couldn't find anywhere this functionality was tested.

  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
Compare
  • master (base)

and
  • latest version
    1688a290
    1 commit, 5 years ago

2 files
+ 13
- 0

    Preferences

    File browser
    Compare changes

There are merge conflicts

The comparison view may be inaccurate due to merge conflicts.

Resolve these conflicts or ask someone with write access to this repository to merge it locally.

a‎pp‎
assets/ja‎vascripts‎
gfm_auto_comp‎lete.js.coffee‎ +12 -0
contr‎ollers‎
projects_co‎ntroller.rb‎ +1 -0
app/assets/javascripts/gfm_auto_complete.js.coffee
+ 12
- 0
  • View file @ 1688a290

  • Edit in single-file editor

  • Edit in Web IDE


Show all unchanged lines Show 20 lines
Members:
template: '<li data-value="${username}">${username} <small>${name}</small></li>'
# Issues and MergeRequests
Issues:
template: '<li data-value="${id}"><small>${id}</small> ${title} </li>'
Show 20 lines Show all unchanged lines Show 20 lines
before_save: (issues) ->
$.map issues, (i) -> id: i.iid, title: sanitize(i.title), search: "#{i.iid} #{i.title}"
input.atwho
at: '!'
alias: 'mergerequests'
search_key: 'search'
tpl: @Issues.template
callbacks:
before_save: (merges) ->
$.map merges, (m) -> id: m.iid, title: sanitize(m.title), search: "#{m.iid} #{m.title}"
input.one "focus", =>
$.getJSON(@dataSource).done (data) ->
# load members
input.atwho 'load', "@", data.members
# load issues
input.atwho 'load', "issues", data.issues
# load merge requests
input.atwho 'load', "mergerequests", data.mergerequests
# load emojis
input.atwho 'load', ":", data.emojis
app/controllers/projects_controller.rb
+ 1
- 0
  • View file @ 1688a290

  • Edit in single-file editor

  • Edit in Web IDE


Show all unchanged lines Show 20 lines
@suggestions = {
emojis: Emoji.names,
issues: @project.issues.select([:iid, :title, :description]),
mergerequests: @project.merge_requests.select([:iid, :title, :description]),
members: @project.team.members.sort_by(&:username).map { |user| { username: user.username, name: user.name } }
}
Show 20 lines Show all unchanged lines
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Milestone
No milestone
None
None
Time tracking
0
Labels
None
Assign labels
  • No matching results
  • Manage project labels
Lock merge request
Unlocked
participants
Reference:
Source branch: github/fork/rspeicher/merge-request-autocomplete

    0 pending comments

Menu

Projects Groups Snippets
Help