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
Jérome Perrin
gitlab-ce
Commits
66d03aae
Commit
66d03aae
authored
Apr 06, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed error handling
parent
98f59fc2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
15 deletions
+23
-15
app/assets/javascripts/droplab/plugins/ajax.js
app/assets/javascripts/droplab/plugins/ajax.js
+1
-7
app/assets/javascripts/droplab/plugins/ajax_filter.js
app/assets/javascripts/droplab/plugins/ajax_filter.js
+1
-1
app/assets/javascripts/filtered_search/dropdown_non_user.js
app/assets/javascripts/filtered_search/dropdown_non_user.js
+7
-0
app/assets/javascripts/filtered_search/dropdown_user.js
app/assets/javascripts/filtered_search/dropdown_user.js
+7
-0
spec/features/issues/filtered_search/dropdown_milestone_spec.rb
...eatures/issues/filtered_search/dropdown_milestone_spec.rb
+7
-7
No files found.
app/assets/javascripts/droplab/plugins/ajax.js
View file @
66d03aae
/* eslint-disable */
function
droplabAjaxException
(
message
)
{
this
.
message
=
message
;
}
const
Ajax
=
{
_loadUrlData
:
function
_loadUrlData
(
url
)
{
var
self
=
this
;
...
...
@@ -58,9 +54,7 @@ const Ajax = {
this
.
_loadUrlData
(
config
.
endpoint
)
.
then
(
function
(
d
)
{
self
.
_loadData
(
d
,
config
,
self
);
},
config
.
onError
).
catch
(
function
(
e
)
{
throw
new
droplabAjaxException
(
e
.
message
||
e
);
});
},
config
.
onError
).
catch
(
config
.
onError
);
}
},
destroy
:
function
()
{
...
...
app/assets/javascripts/droplab/plugins/ajax_filter.js
View file @
66d03aae
...
...
@@ -68,7 +68,7 @@ const AjaxFilter = {
this
.
_loadUrlData
(
url
)
.
then
(
function
(
data
)
{
self
.
_loadData
(
data
,
config
,
self
);
},
config
.
onError
);
},
config
.
onError
)
.
catch
(
config
.
onError
)
;
}
},
...
...
app/assets/javascripts/filtered_search/dropdown_non_user.js
View file @
66d03aae
/* global Flash */
import
Ajax
from
'
~/droplab/plugins/ajax
'
;
import
Filter
from
'
~/droplab/plugins/filter
'
;
...
...
@@ -13,6 +15,11 @@ require('./filtered_search_dropdown');
endpoint
,
method
:
'
setData
'
,
loadingTemplate
:
this
.
loadingTemplate
,
onError
()
{
/* eslint-disable no-new */
new
Flash
(
'
An error occured fetching the dropdown data.
'
);
/* eslint-enable no-new */
},
},
Filter
:
{
filterFunction
:
gl
.
DropdownUtils
.
filterWithSymbol
.
bind
(
null
,
this
.
symbol
,
input
),
...
...
app/assets/javascripts/filtered_search/dropdown_user.js
View file @
66d03aae
/* global Flash */
import
AjaxFilter
from
'
~/droplab/plugins/ajax_filter
'
;
require
(
'
./filtered_search_dropdown
'
);
...
...
@@ -18,6 +20,11 @@ require('./filtered_search_dropdown');
},
searchValueFunction
:
this
.
getSearchInput
.
bind
(
this
),
loadingTemplate
:
this
.
loadingTemplate
,
onError
()
{
/* eslint-disable no-new */
new
Flash
(
'
An error occured fetching the dropdown data.
'
);
/* eslint-enable no-new */
},
},
};
}
...
...
spec/features/issues/filtered_search/dropdown_milestone_spec.rb
View file @
66d03aae
...
...
@@ -65,7 +65,7 @@ describe 'Dropdown milestone', :feature, :js do
it
'should load all the milestones when opened'
do
filtered_search
.
set
(
'milestone:'
)
expect
(
dropdown_milestone_size
).
to
be
>
0
expect
(
filter_dropdown
).
to
have_selector
(
'.filter-dropdown .filter-dropdown-item'
,
count:
6
)
end
end
...
...
@@ -84,37 +84,37 @@ describe 'Dropdown milestone', :feature, :js do
it
'filters by name'
do
filtered_search
.
send_keys
(
'v1'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
expect
(
filter_dropdown
).
to
have_selector
(
'.filter-dropdown .filter-dropdown-item'
,
count:
1
)
end
it
'filters by case insensitive name'
do
filtered_search
.
send_keys
(
'V1'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
expect
(
filter_dropdown
).
to
have_selector
(
'.filter-dropdown .filter-dropdown-item'
,
count:
1
)
end
it
'filters by name with symbol'
do
filtered_search
.
send_keys
(
'%v1'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
expect
(
filter_dropdown
).
to
have_selector
(
'.filter-dropdown .filter-dropdown-item'
,
count:
1
)
end
it
'filters by case insensitive name with symbol'
do
filtered_search
.
send_keys
(
'%V1'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
expect
(
filter_dropdown
).
to
have_selector
(
'.filter-dropdown .filter-dropdown-item'
,
count:
1
)
end
it
'filters by special characters'
do
filtered_search
.
send_keys
(
'(+'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
expect
(
filter_dropdown
).
to
have_selector
(
'.filter-dropdown .filter-dropdown-item'
,
count:
1
)
end
it
'filters by special characters with symbol'
do
filtered_search
.
send_keys
(
'%(+'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
expect
(
filter_dropdown
).
to
have_selector
(
'.filter-dropdown .filter-dropdown-item'
,
count:
1
)
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