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
Boxiang Sun
gitlab-ce
Commits
3da6d769
Commit
3da6d769
authored
Jun 12, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-enable autocomplete for milestones, tags, releases, and wiki
Fix
https://gitlab.com/gitlab-org/gitlab-ce/issues/33598
parent
dbfafd44
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
147 additions
and
48 deletions
+147
-48
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+7
-7
spec/features/issues/form_spec.rb
spec/features/issues/form_spec.rb
+14
-0
spec/features/merge_requests/form_spec.rb
spec/features/merge_requests/form_spec.rb
+14
-0
spec/features/projects/milestones/new_spec.rb
spec/features/projects/milestones/new_spec.rb
+18
-0
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+16
-0
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
+11
-3
spec/features/tags/master_creates_tag_spec.rb
spec/features/tags/master_creates_tag_spec.rb
+56
-38
spec/features/tags/master_updates_tag_spec.rb
spec/features/tags/master_updates_tag_spec.rb
+11
-0
No files found.
app/assets/javascripts/dispatcher.js
View file @
3da6d769
...
@@ -176,7 +176,7 @@ import initSettingsPanels from './settings_panels';
...
@@ -176,7 +176,7 @@ import initSettingsPanels from './settings_panels';
case
'
groups:milestones:update
'
:
case
'
groups:milestones:update
'
:
new
ZenMode
();
new
ZenMode
();
new
gl
.
DueDateSelectors
();
new
gl
.
DueDateSelectors
();
new
gl
.
GLForm
(
$
(
'
.milestone-form
'
));
new
gl
.
GLForm
(
$
(
'
.milestone-form
'
)
,
true
);
break
;
break
;
case
'
projects:compare:show
'
:
case
'
projects:compare:show
'
:
new
gl
.
Diff
();
new
gl
.
Diff
();
...
@@ -188,7 +188,7 @@ import initSettingsPanels from './settings_panels';
...
@@ -188,7 +188,7 @@ import initSettingsPanels from './settings_panels';
case
'
projects:issues:new
'
:
case
'
projects:issues:new
'
:
case
'
projects:issues:edit
'
:
case
'
projects:issues:edit
'
:
shortcut_handler
=
new
ShortcutsNavigation
();
shortcut_handler
=
new
ShortcutsNavigation
();
new
gl
.
GLForm
(
$
(
'
.issue-form
'
));
new
gl
.
GLForm
(
$
(
'
.issue-form
'
)
,
true
);
new
IssuableForm
(
$
(
'
.issue-form
'
));
new
IssuableForm
(
$
(
'
.issue-form
'
));
new
LabelsSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
new
MilestoneSelect
();
...
@@ -199,7 +199,7 @@ import initSettingsPanels from './settings_panels';
...
@@ -199,7 +199,7 @@ import initSettingsPanels from './settings_panels';
case
'
projects:merge_requests:edit
'
:
case
'
projects:merge_requests:edit
'
:
new
gl
.
Diff
();
new
gl
.
Diff
();
shortcut_handler
=
new
ShortcutsNavigation
();
shortcut_handler
=
new
ShortcutsNavigation
();
new
gl
.
GLForm
(
$
(
'
.merge-request-form
'
));
new
gl
.
GLForm
(
$
(
'
.merge-request-form
'
)
,
true
);
new
IssuableForm
(
$
(
'
.merge-request-form
'
));
new
IssuableForm
(
$
(
'
.merge-request-form
'
));
new
LabelsSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
new
MilestoneSelect
();
...
@@ -208,7 +208,7 @@ import initSettingsPanels from './settings_panels';
...
@@ -208,7 +208,7 @@ import initSettingsPanels from './settings_panels';
break
;
break
;
case
'
projects:tags:new
'
:
case
'
projects:tags:new
'
:
new
ZenMode
();
new
ZenMode
();
new
gl
.
GLForm
(
$
(
'
.tag-form
'
));
new
gl
.
GLForm
(
$
(
'
.tag-form
'
)
,
true
);
new
RefSelectDropdown
(
$
(
'
.js-branch-select
'
),
window
.
gl
.
availableRefs
);
new
RefSelectDropdown
(
$
(
'
.js-branch-select
'
),
window
.
gl
.
availableRefs
);
break
;
break
;
case
'
projects:snippets:new
'
:
case
'
projects:snippets:new
'
:
...
@@ -219,11 +219,11 @@ import initSettingsPanels from './settings_panels';
...
@@ -219,11 +219,11 @@ import initSettingsPanels from './settings_panels';
case
'
snippets:edit
'
:
case
'
snippets:edit
'
:
case
'
snippets:create
'
:
case
'
snippets:create
'
:
case
'
snippets:update
'
:
case
'
snippets:update
'
:
new
gl
.
GLForm
(
$
(
'
.snippet-form
'
));
new
gl
.
GLForm
(
$
(
'
.snippet-form
'
)
,
false
);
break
;
break
;
case
'
projects:releases:edit
'
:
case
'
projects:releases:edit
'
:
new
ZenMode
();
new
ZenMode
();
new
gl
.
GLForm
(
$
(
'
.release-form
'
));
new
gl
.
GLForm
(
$
(
'
.release-form
'
)
,
true
);
break
;
break
;
case
'
projects:merge_requests:show
'
:
case
'
projects:merge_requests:show
'
:
new
gl
.
Diff
();
new
gl
.
Diff
();
...
@@ -471,7 +471,7 @@ import initSettingsPanels from './settings_panels';
...
@@ -471,7 +471,7 @@ import initSettingsPanels from './settings_panels';
new
gl
.
Wikis
();
new
gl
.
Wikis
();
shortcut_handler
=
new
ShortcutsWiki
();
shortcut_handler
=
new
ShortcutsWiki
();
new
ZenMode
();
new
ZenMode
();
new
gl
.
GLForm
(
$
(
'
.wiki-form
'
));
new
gl
.
GLForm
(
$
(
'
.wiki-form
'
)
,
true
);
break
;
break
;
case
'
snippets
'
:
case
'
snippets
'
:
shortcut_handler
=
new
ShortcutsNavigation
();
shortcut_handler
=
new
ShortcutsNavigation
();
...
...
spec/features/issues/form_spec.rb
View file @
3da6d769
...
@@ -210,6 +210,13 @@ describe 'New/edit issue', :feature, :js do
...
@@ -210,6 +210,13 @@ describe 'New/edit issue', :feature, :js do
expect
(
find
(
'.js-assignee-search'
)).
to
have_content
(
user2
.
name
)
expect
(
find
(
'.js-assignee-search'
)).
to
have_content
(
user2
.
name
)
end
end
it
'description has autocomplete'
do
find
(
'#issue_description'
).
native
.
send_keys
(
''
)
fill_in
'issue_description'
,
with:
'@'
expect
(
page
).
to
have_selector
(
'.atwho-view'
)
end
end
end
context
'edit issue'
do
context
'edit issue'
do
...
@@ -258,6 +265,13 @@ describe 'New/edit issue', :feature, :js do
...
@@ -258,6 +265,13 @@ describe 'New/edit issue', :feature, :js do
end
end
end
end
end
end
it
'description has autocomplete'
do
find
(
'#issue_description'
).
native
.
send_keys
(
''
)
fill_in
'issue_description'
,
with:
'@'
expect
(
page
).
to
have_selector
(
'.atwho-view'
)
end
end
end
describe
'sub-group project'
do
describe
'sub-group project'
do
...
...
spec/features/merge_requests/form_spec.rb
View file @
3da6d769
...
@@ -96,6 +96,13 @@ describe 'New/edit merge request', feature: true, js: true do
...
@@ -96,6 +96,13 @@ describe 'New/edit merge request', feature: true, js: true do
.
to
end_with
(
merge_request_path
(
merge_request
))
.
to
end_with
(
merge_request_path
(
merge_request
))
end
end
end
end
it
'description has autocomplete'
do
find
(
'#merge_request_description'
).
native
.
send_keys
(
''
)
fill_in
'merge_request_description'
,
with:
'@'
expect
(
page
).
to
have_selector
(
'.atwho-view'
)
end
end
end
context
'edit merge request'
do
context
'edit merge request'
do
...
@@ -157,6 +164,13 @@ describe 'New/edit merge request', feature: true, js: true do
...
@@ -157,6 +164,13 @@ describe 'New/edit merge request', feature: true, js: true do
end
end
end
end
end
end
it
'description has autocomplete'
do
find
(
'#merge_request_description'
).
native
.
send_keys
(
''
)
fill_in
'merge_request_description'
,
with:
'@'
expect
(
page
).
to
have_selector
(
'.atwho-view'
)
end
end
end
end
end
...
...
spec/features/projects/milestones/new_spec.rb
0 → 100644
View file @
3da6d769
require
'spec_helper'
feature
'Creating a new project milestone'
,
:feature
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
,
name:
'test'
,
namespace:
user
.
namespace
)
}
before
do
login_as
(
user
)
visit
new_namespace_project_milestone_path
(
project
.
namespace
,
project
)
end
it
'description has autocomplete'
do
find
(
'#milestone_description'
).
native
.
send_keys
(
''
)
fill_in
'milestone_description'
,
with:
'@'
expect
(
page
).
to
have_selector
(
'.atwho-view'
)
end
end
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
View file @
3da6d769
...
@@ -133,6 +133,22 @@ feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do
...
@@ -133,6 +133,22 @@ feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do
expect
(
page
).
to
have_content
(
'My awesome wiki!'
)
expect
(
page
).
to
have_content
(
'My awesome wiki!'
)
end
end
end
end
scenario
'content has autocomplete'
,
:js
do
click_link
'New page'
page
.
within
'#modal-new-wiki'
do
fill_in
:new_wiki_path
,
with:
'test-autocomplete'
click_button
'Create page'
end
page
.
within
'.wiki-form'
do
find
(
'#wiki_content'
).
native
.
send_keys
(
''
)
fill_in
:wiki_content
,
with:
'@'
end
expect
(
page
).
to
have_selector
(
'.atwho-view'
)
end
end
end
end
end
...
...
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
View file @
3da6d769
...
@@ -5,11 +5,10 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
...
@@ -5,11 +5,10 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
background
do
background
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
WikiPages
::
CreateService
.
new
(
project
,
user
,
title:
'home'
,
content:
'Home page'
).
execute
login_as
(
user
)
login_as
(
user
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
visit
namespace_project_wikis_path
(
project
.
namespace
,
project
)
WikiPages
::
CreateService
.
new
(
project
,
user
,
title:
'home'
,
content:
'Home page'
).
execute
click_link
'Wiki'
end
end
context
'in the user namespace'
do
context
'in the user namespace'
do
...
@@ -42,6 +41,15 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
...
@@ -42,6 +41,15 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
expect
(
page
).
to
have_content
(
'Content can\'t be blank'
)
expect
(
page
).
to
have_content
(
'Content can\'t be blank'
)
expect
(
find
(
'textarea#wiki_content'
).
value
).
to
eq
''
expect
(
find
(
'textarea#wiki_content'
).
value
).
to
eq
''
end
end
scenario
'content has autocomplete'
,
:js
do
click_link
'Edit'
find
(
'#wiki_content'
).
native
.
send_keys
(
''
)
fill_in
:wiki_content
,
with:
'@'
expect
(
page
).
to
have_selector
(
'.atwho-view'
)
end
end
end
end
end
...
...
spec/features/tags/master_creates_tag_spec.rb
View file @
3da6d769
...
@@ -7,61 +7,79 @@ feature 'Master creates tag', feature: true do
...
@@ -7,61 +7,79 @@ feature 'Master creates tag', feature: true do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
login_with
(
user
)
visit
namespace_project_tags_path
(
project
.
namespace
,
project
)
end
end
scenario
'with an invalid name displays an error'
do
context
'from tag list'
do
create_tag_in_form
(
tag:
'v 1.0'
,
ref:
'master'
)
before
do
visit
namespace_project_tags_path
(
project
.
namespace
,
project
)
end
expect
(
page
).
to
have_content
'Tag name invalid'
scenario
'with an invalid name displays an error'
do
end
create_tag_in_form
(
tag:
'v 1.0'
,
ref:
'master'
)
scenario
'with an invalid reference displays an error'
do
expect
(
page
).
to
have_content
'Tag name invalid'
create_tag_in_form
(
tag:
'v2.0'
,
ref:
'foo'
)
end
expect
(
page
).
to
have_content
'Target foo is invalid'
scenario
'with an invalid reference displays an error'
do
end
create_tag_in_form
(
tag:
'v2.0'
,
ref:
'foo'
)
scenario
'that already exists displays an error'
do
expect
(
page
).
to
have_content
'Target foo is invalid'
create_tag_in_form
(
tag:
'v1.1.0'
,
ref:
'master'
)
end
expect
(
page
).
to
have_content
'Tag v1.1.0 already exists'
scenario
'that already exists displays an error'
do
end
create_tag_in_form
(
tag:
'v1.1.0'
,
ref:
'master'
)
expect
(
page
).
to
have_content
'Tag v1.1.0 already exists'
end
scenario
'with multiline message displays the message in a <pre> block'
do
scenario
'with multiline message displays the message in a <pre> block'
do
create_tag_in_form
(
tag:
'v3.0'
,
ref:
'master'
,
message:
"Awesome tag message
\n\n
- hello
\n
- world"
)
create_tag_in_form
(
tag:
'v3.0'
,
ref:
'master'
,
message:
"Awesome tag message
\n\n
- hello
\n
- world"
)
expect
(
current_path
).
to
eq
(
expect
(
current_path
).
to
eq
(
namespace_project_tag_path
(
project
.
namespace
,
project
,
'v3.0'
))
namespace_project_tag_path
(
project
.
namespace
,
project
,
'v3.0'
))
expect
(
page
).
to
have_content
'v3.0'
expect
(
page
).
to
have_content
'v3.0'
page
.
within
'pre.wrap'
do
page
.
within
'pre.wrap'
do
expect
(
page
).
to
have_content
"Awesome tag message
\n\n
- hello
\n
- world"
expect
(
page
).
to
have_content
"Awesome tag message
\n\n
- hello
\n
- world"
end
end
end
end
scenario
'with multiline release notes parses the release note as Markdown'
do
scenario
'with multiline release notes parses the release note as Markdown'
do
create_tag_in_form
(
tag:
'v4.0'
,
ref:
'master'
,
desc:
"Awesome release notes
\n\n
- hello
\n
- world"
)
create_tag_in_form
(
tag:
'v4.0'
,
ref:
'master'
,
desc:
"Awesome release notes
\n\n
- hello
\n
- world"
)
expect
(
current_path
).
to
eq
(
expect
(
current_path
).
to
eq
(
namespace_project_tag_path
(
project
.
namespace
,
project
,
'v4.0'
))
namespace_project_tag_path
(
project
.
namespace
,
project
,
'v4.0'
))
expect
(
page
).
to
have_content
'v4.0'
expect
(
page
).
to
have_content
'v4.0'
page
.
within
'.description'
do
page
.
within
'.description'
do
expect
(
page
).
to
have_content
'Awesome release notes'
expect
(
page
).
to
have_content
'Awesome release notes'
expect
(
page
).
to
have_selector
(
'ul li'
,
count:
2
)
expect
(
page
).
to
have_selector
(
'ul li'
,
count:
2
)
end
end
scenario
'opens dropdown for ref'
,
js:
true
do
click_link
'New tag'
ref_row
=
find
(
'.form-group:nth-of-type(2) .col-sm-10'
)
page
.
within
ref_row
do
ref_input
=
find
(
'[name="ref"]'
,
visible:
false
)
expect
(
ref_input
.
value
).
to
eq
'master'
expect
(
find
(
'.dropdown-toggle-text'
)).
to
have_content
'master'
find
(
'.js-branch-select'
).
trigger
(
'click'
)
expect
(
find
(
'.dropdown-menu'
)).
to
have_content
'empty-branch'
end
end
end
end
end
scenario
'opens dropdown for ref'
,
js:
true
do
context
'from new tag page'
do
click_link
'New tag'
before
do
ref_row
=
find
(
'.form-group:nth-of-type(2) .col-sm-10'
)
visit
new_namespace_project_tag_path
(
project
.
namespace
,
project
)
page
.
within
ref_row
do
end
ref_input
=
find
(
'[name="ref"]'
,
visible:
false
)
expect
(
ref_input
.
value
).
to
eq
'master'
expect
(
find
(
'.dropdown-toggle-text'
)).
to
have_content
'master'
find
(
'.js-branch-select'
).
trigger
(
'click'
)
it
'description has autocomplete'
,
:js
do
find
(
'#release_description'
).
native
.
send_keys
(
''
)
fill_in
'release_description'
,
with:
'@'
expect
(
find
(
'.dropdown-menu'
)).
to
have_content
'empty-branch'
expect
(
page
).
to
have_selector
(
'.atwho-view'
)
end
end
end
end
...
...
spec/features/tags/master_updates_tag_spec.rb
View file @
3da6d769
...
@@ -24,6 +24,17 @@ feature 'Master updates tag', feature: true do
...
@@ -24,6 +24,17 @@ feature 'Master updates tag', feature: true do
expect
(
page
).
to
have_content
'v1.1.0'
expect
(
page
).
to
have_content
'v1.1.0'
expect
(
page
).
to
have_content
'Awesome release notes'
expect
(
page
).
to
have_content
'Awesome release notes'
end
end
scenario
'description has autocomplete'
,
:js
do
page
.
within
(
first
(
'.content-list .controls'
))
do
click_link
'Edit release notes'
end
find
(
'#release_description'
).
native
.
send_keys
(
''
)
fill_in
'release_description'
,
with:
'@'
expect
(
page
).
to
have_selector
(
'.atwho-view'
)
end
end
end
context
'from a specific tag page'
do
context
'from a specific tag page'
do
...
...
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