Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
a5035ed3
Commit
a5035ed3
authored
Sep 05, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly loads gfm autocomplete source on pages where it is required
parent
3531032e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
7 deletions
+27
-7
CHANGELOG
CHANGELOG
+2
-0
app/views/layouts/_init_auto_complete.html.haml
app/views/layouts/_init_auto_complete.html.haml
+0
-4
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+1
-0
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+0
-3
app/views/projects/_zen.html.haml
app/views/projects/_zen.html.haml
+1
-0
spec/features/projects/gfm_autocomplete_load_spec.rb
spec/features/projects/gfm_autocomplete_load_spec.rb
+23
-0
No files found.
CHANGELOG
View file @
a5035ed3
...
@@ -57,6 +57,8 @@ v 8.12.0 (unreleased)
...
@@ -57,6 +57,8 @@ v 8.12.0 (unreleased)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Remove Gitorious import
- Remove Gitorious import
- Loads GFM autocomplete source only when required
- Fix issue with slash commands not loading on new issue page
- Fix inconsistent background color for filter input field (ClemMakesApps)
- Fix inconsistent background color for filter input field (ClemMakesApps)
- Remove prefixes from transition CSS property (ClemMakesApps)
- Remove prefixes from transition CSS property (ClemMakesApps)
- Add Sentry logging to API calls
- Add Sentry logging to API calls
...
...
app/views/layouts/_init_auto_complete.html.haml
View file @
a5035ed3
-
project
=
@target_project
||
@project
-
project
=
@target_project
||
@project
-
noteable_type
=
@noteable
.
class
if
@noteable
.
present?
-
noteable_type
=
@noteable
.
class
if
@noteable
.
present?
-
if
noteable_type
:javascript
GitLab
.
GfmAutoComplete
.
dataLoading
=
false
;
:javascript
:javascript
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_namespace_project_path
(
project
.
namespace
,
project
,
type:
noteable_type
,
type_id:
params
[
:id
])
}
"
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_namespace_project_path
(
project
.
namespace
,
project
,
type:
noteable_type
,
type_id:
params
[
:id
])
}
"
GitLab
.
GfmAutoComplete
.
cachedData
=
undefined
;
GitLab
.
GfmAutoComplete
.
cachedData
=
undefined
;
...
...
app/views/layouts/application.html.haml
View file @
a5035ed3
...
@@ -10,4 +10,5 @@
...
@@ -10,4 +10,5 @@
=
render
"layouts/header/default"
,
title:
header_title
=
render
"layouts/header/default"
,
title:
header_title
=
render
'layouts/page'
,
sidebar:
sidebar
,
nav:
nav
=
render
'layouts/page'
,
sidebar:
sidebar
,
nav:
nav
=
render
"layouts/init_auto_complete"
if
current_user
&&
@load_gfm
=
yield
:scripts_body
=
yield
:scripts_body
app/views/layouts/project.html.haml
View file @
a5035ed3
...
@@ -14,9 +14,6 @@
...
@@ -14,9 +14,6 @@
window
.
project_uploads_path
=
"
#{
namespace_project_uploads_path
project
.
namespace
,
project
}
"
;
window
.
project_uploads_path
=
"
#{
namespace_project_uploads_path
project
.
namespace
,
project
}
"
;
window
.
preview_markdown_path
=
"
#{
preview_markdown_path
}
"
;
window
.
preview_markdown_path
=
"
#{
preview_markdown_path
}
"
;
-
content_for
:scripts_body
do
=
render
"layouts/init_auto_complete"
if
current_user
-
content_for
:header_content
do
-
content_for
:header_content
do
.js-dropdown-menu-projects
.js-dropdown-menu-projects
.dropdown-menu.dropdown-select.dropdown-menu-projects
.dropdown-menu.dropdown-select.dropdown-menu-projects
...
...
app/views/projects/_zen.html.haml
View file @
a5035ed3
-
@load_gfm
=
true
-
supports_slash_commands
=
local_assigns
.
fetch
(
:supports_slash_commands
,
false
)
-
supports_slash_commands
=
local_assigns
.
fetch
(
:supports_slash_commands
,
false
)
.zen-backdrop
.zen-backdrop
-
classes
<<
' js-gfm-input js-autosize markdown-area'
-
classes
<<
' js-gfm-input js-autosize markdown-area'
...
...
spec/features/projects/gfm_autocomplete_load_spec.rb
0 → 100644
View file @
a5035ed3
require
'spec_helper'
describe
'GFM autocomplete loading'
,
feature:
true
,
js:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
before
do
project
.
team
<<
[
user
,
:master
]
login_as
user
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
it
'does not load on project#show'
do
expect
(
evaluate_script
(
'GitLab.GfmAutoComplete.dataSource'
)).
to
eq
(
''
)
end
it
'loads on new issue page'
do
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
expect
(
evaluate_script
(
'GitLab.GfmAutoComplete.dataSource'
)).
not_to
eq
(
''
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment