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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3c834a57
Commit
3c834a57
authored
Apr 20, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conflicts in filtered search
parent
15483879
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
156 deletions
+15
-156
app/assets/javascripts/filtered_search/filtered_search_dropdown.js
...s/javascripts/filtered_search/filtered_search_dropdown.js
+0
-18
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
...ripts/filtered_search/filtered_search_dropdown_manager.js
+11
-61
app/assets/javascripts/filtered_search/filtered_search_manager.js
...ts/javascripts/filtered_search/filtered_search_manager.js
+4
-77
No files found.
app/assets/javascripts/filtered_search/filtered_search_dropdown.js
View file @
3c834a57
...
@@ -103,23 +103,6 @@ class FilteredSearchDropdown {
...
@@ -103,23 +103,6 @@ class FilteredSearchDropdown {
}
}
}
}
<<<<<<<
HEAD
resetFilters
()
{
const
hook
=
this
.
getCurrentHook
();
if
(
hook
)
{
const
data
=
hook
.
list
.
data
||
[];
if
(
!
data
)
return
;
const
results
=
data
.
map
((
o
)
=>
{
const
updated
=
o
;
updated
.
droplab_hidden
=
false
;
return
updated
;
});
hook
.
list
.
render
(
results
);
}
=======
resetFilters
()
{
resetFilters
()
{
const
hook
=
this
.
getCurrentHook
();
const
hook
=
this
.
getCurrentHook
();
...
@@ -131,7 +114,6 @@ class FilteredSearchDropdown {
...
@@ -131,7 +114,6 @@ class FilteredSearchDropdown {
return
updated
;
return
updated
;
});
});
hook
.
list
.
render
(
results
);
hook
.
list
.
render
(
results
);
>>>>>>>
ce
/
master
}
}
}
}
}
}
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
View file @
3c834a57
import
DropLab
from
'
~/droplab/drop_lab
'
;
import
DropLab
from
'
~/droplab/drop_lab
'
;
import
FilteredSearchContainer
from
'
./container
'
;
import
FilteredSearchContainer
from
'
./container
'
;
<<<<<<<
HEAD
class
FilteredSearchDropdownManager
{
(()
=>
{
class
FilteredSearchDropdownManager
{
constructor
(
baseEndpoint
=
''
,
page
)
{
constructor
(
baseEndpoint
=
''
,
page
)
{
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
baseEndpoint
=
baseEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
baseEndpoint
=
baseEndpoint
.
replace
(
/
\/
$/
,
''
);
...
@@ -18,20 +16,6 @@ import FilteredSearchContainer from './container';
...
@@ -18,20 +16,6 @@ import FilteredSearchContainer from './container';
this
.
setupMapping
();
this
.
setupMapping
();
this
.
cleanupWrapper
=
this
.
cleanup
.
bind
(
this
);
document
.
addEventListener
(
'
beforeunload
'
,
this
.
cleanupWrapper
);
=======
class
FilteredSearchDropdownManager
{
constructor
(
baseEndpoint
=
''
,
page
)
{
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
baseEndpoint
=
baseEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
tokenizer
=
gl
.
FilteredSearchTokenizer
;
this
.
filteredSearchTokenKeys
=
gl
.
FilteredSearchTokenKeys
;
this
.
filteredSearchInput
=
this
.
container
.
querySelector
(
'
.filtered-search
'
);
this
.
page
=
page
;
this
.
setupMapping
();
this
.
cleanupWrapper
=
this
.
cleanup
.
bind
(
this
);
this
.
cleanupWrapper
=
this
.
cleanup
.
bind
(
this
);
document
.
addEventListener
(
'
beforeunload
'
,
this
.
cleanupWrapper
);
document
.
addEventListener
(
'
beforeunload
'
,
this
.
cleanupWrapper
);
}
}
...
@@ -40,7 +24,6 @@ class FilteredSearchDropdownManager {
...
@@ -40,7 +24,6 @@ class FilteredSearchDropdownManager {
if
(
this
.
droplab
)
{
if
(
this
.
droplab
)
{
this
.
droplab
.
destroy
();
this
.
droplab
.
destroy
();
this
.
droplab
=
null
;
this
.
droplab
=
null
;
>>>>>>>
ce
/
master
}
}
this
.
setupMapping
();
this
.
setupMapping
();
...
@@ -48,39 +31,6 @@ class FilteredSearchDropdownManager {
...
@@ -48,39 +31,6 @@ class FilteredSearchDropdownManager {
document
.
removeEventListener
(
'
beforeunload
'
,
this
.
cleanupWrapper
);
document
.
removeEventListener
(
'
beforeunload
'
,
this
.
cleanupWrapper
);
}
}
setupMapping
()
{
this
.
mapping
=
{
author
:
{
reference
:
null
,
gl
:
'
DropdownUser
'
,
element
:
this
.
container
.
querySelector
(
'
#js-dropdown-author
'
),
},
assignee
:
{
reference
:
null
,
gl
:
'
DropdownUser
'
,
element
:
this
.
container
.
querySelector
(
'
#js-dropdown-assignee
'
),
},
milestone
:
{
reference
:
null
,
gl
:
'
DropdownNonUser
'
,
extraArguments
:
[
`
${
this
.
baseEndpoint
}
/milestones.json`
,
'
%
'
],
element
:
this
.
container
.
querySelector
(
'
#js-dropdown-milestone
'
),
},
label
:
{
reference
:
null
,
gl
:
'
DropdownNonUser
'
,
extraArguments
:
[
`
${
this
.
baseEndpoint
}
/labels.json`
,
'
~
'
],
element
:
this
.
container
.
querySelector
(
'
#js-dropdown-label
'
),
},
hint
:
{
reference
:
null
,
gl
:
'
DropdownHint
'
,
element
:
this
.
container
.
querySelector
(
'
#js-dropdown-hint
'
),
},
};
}
<<<<<<<
HEAD
setupMapping
()
{
setupMapping
()
{
this
.
mapping
=
{
this
.
mapping
=
{
author
:
{
author
:
{
...
@@ -119,7 +69,8 @@ class FilteredSearchDropdownManager {
...
@@ -119,7 +69,8 @@ class FilteredSearchDropdownManager {
element
:
document
.
querySelector
(
'
#js-dropdown-weight
'
),
element
:
document
.
querySelector
(
'
#js-dropdown-weight
'
),
};
};
}
}
=======
}
static
addWordToInput
(
tokenName
,
tokenValue
=
''
,
clicked
=
false
)
{
static
addWordToInput
(
tokenName
,
tokenValue
=
''
,
clicked
=
false
)
{
const
input
=
FilteredSearchContainer
.
container
.
querySelector
(
'
.filtered-search
'
);
const
input
=
FilteredSearchContainer
.
container
.
querySelector
(
'
.filtered-search
'
);
...
@@ -128,7 +79,6 @@ class FilteredSearchDropdownManager {
...
@@ -128,7 +79,6 @@ class FilteredSearchDropdownManager {
if
(
clicked
)
{
if
(
clicked
)
{
gl
.
FilteredSearchVisualTokens
.
moveInputToTheRight
();
gl
.
FilteredSearchVisualTokens
.
moveInputToTheRight
();
>>>>>>>
ce
/
master
}
}
}
}
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
3c834a57
...
@@ -6,9 +6,7 @@ import RecentSearchesStore from './stores/recent_searches_store';
...
@@ -6,9 +6,7 @@ import RecentSearchesStore from './stores/recent_searches_store';
import
RecentSearchesService
from
'
./services/recent_searches_service
'
;
import
RecentSearchesService
from
'
./services/recent_searches_service
'
;
import
eventHub
from
'
./event_hub
'
;
import
eventHub
from
'
./event_hub
'
;
<<<<<<<
HEAD
class
FilteredSearchManager
{
(()
=>
{
class
FilteredSearchManager
{
constructor
(
page
)
{
constructor
(
page
)
{
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
filteredSearchInput
=
this
.
container
.
querySelector
(
'
.filtered-search
'
);
this
.
filteredSearchInput
=
this
.
container
.
querySelector
(
'
.filtered-search
'
);
...
@@ -45,49 +43,6 @@ import eventHub from './event_hub';
...
@@ -45,49 +43,6 @@ import eventHub from './event_hub';
this
.
recentSearchesService
.
save
(
resultantSearches
);
this
.
recentSearchesService
.
save
(
resultantSearches
);
});
});
if
(
this
.
filteredSearchInput
)
{
this
.
tokenizer
=
gl
.
FilteredSearchTokenizer
;
this
.
dropdownManager
=
new
gl
.
FilteredSearchDropdownManager
(
this
.
filteredSearchInput
.
getAttribute
(
'
data-base-endpoint
'
)
||
''
,
page
);
this
.
recentSearchesRoot
=
new
RecentSearchesRoot
(
this
.
recentSearchesStore
,
this
.
recentSearchesService
,
document
.
querySelector
(
'
.js-filtered-search-history-dropdown
'
),
=======
class
FilteredSearchManager
{
constructor
(
page
)
{
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
filteredSearchInput
=
this
.
container
.
querySelector
(
'
.filtered-search
'
);
this
.
filteredSearchInputForm
=
this
.
filteredSearchInput
.
form
;
this
.
clearSearchButton
=
this
.
container
.
querySelector
(
'
.clear-search
'
);
this
.
tokensContainer
=
this
.
container
.
querySelector
(
'
.tokens-container
'
);
this
.
filteredSearchTokenKeys
=
gl
.
FilteredSearchTokenKeys
;
this
.
recentSearchesStore
=
new
RecentSearchesStore
();
let
recentSearchesKey
=
'
issue-recent-searches
'
;
if
(
page
===
'
merge_requests
'
)
{
recentSearchesKey
=
'
merge-request-recent-searches
'
;
}
this
.
recentSearchesService
=
new
RecentSearchesService
(
recentSearchesKey
);
// Fetch recent searches from localStorage
this
.
fetchingRecentSearchesPromise
=
this
.
recentSearchesService
.
fetch
()
.
catch
(()
=>
{
// eslint-disable-next-line no-new
new
Flash
(
'
An error occured while parsing recent searches
'
);
// Gracefully fail to empty array
return
[];
})
.
then
((
searches
)
=>
{
// Put any searches that may have come in before
// we fetched the saved searches ahead of the already saved ones
const
resultantSearches
=
this
.
recentSearchesStore
.
setRecentSearches
(
this
.
recentSearchesStore
.
state
.
recentSearches
.
concat
(
searches
),
>>>>>>>
ce
/
master
);
this
.
recentSearchesService
.
save
(
resultantSearches
);
});
if
(
this
.
filteredSearchInput
)
{
if
(
this
.
filteredSearchInput
)
{
this
.
tokenizer
=
gl
.
FilteredSearchTokenizer
;
this
.
tokenizer
=
gl
.
FilteredSearchTokenizer
;
this
.
dropdownManager
=
new
gl
.
FilteredSearchDropdownManager
(
this
.
filteredSearchInput
.
getAttribute
(
'
data-base-endpoint
'
)
||
''
,
page
);
this
.
dropdownManager
=
new
gl
.
FilteredSearchDropdownManager
(
this
.
filteredSearchInput
.
getAttribute
(
'
data-base-endpoint
'
)
||
''
,
page
);
...
@@ -154,14 +109,6 @@ class FilteredSearchManager {
...
@@ -154,14 +109,6 @@ class FilteredSearchManager {
eventHub
.
$on
(
'
recentSearchesItemSelected
'
,
this
.
onrecentSearchesItemSelectedWrapper
);
eventHub
.
$on
(
'
recentSearchesItemSelected
'
,
this
.
onrecentSearchesItemSelectedWrapper
);
}
}
<<<<<<<
HEAD
if
(
this
.
filteredSearchInput
.
value
===
''
&&
lastVisualToken
)
{
if
(
this
.
canEdit
&&
!
this
.
canEdit
(
lastVisualToken
))
return
;
this
.
filteredSearchInput
.
value
=
gl
.
FilteredSearchVisualTokens
.
getLastTokenPartial
();
gl
.
FilteredSearchVisualTokens
.
removeLastTokenPartial
();
}
=======
unbindEvents
()
{
unbindEvents
()
{
this
.
filteredSearchInputForm
.
removeEventListener
(
'
submit
'
,
this
.
handleFormSubmit
);
this
.
filteredSearchInputForm
.
removeEventListener
(
'
submit
'
,
this
.
handleFormSubmit
);
this
.
filteredSearchInput
.
removeEventListener
(
'
input
'
,
this
.
setDropdownWrapper
);
this
.
filteredSearchInput
.
removeEventListener
(
'
input
'
,
this
.
setDropdownWrapper
);
...
@@ -188,7 +135,6 @@ class FilteredSearchManager {
...
@@ -188,7 +135,6 @@ class FilteredSearchManager {
// 46 = Delete Key
// 46 = Delete Key
if
(
e
.
keyCode
===
8
||
e
.
keyCode
===
46
)
{
if
(
e
.
keyCode
===
8
||
e
.
keyCode
===
46
)
{
const
{
lastVisualToken
}
=
gl
.
FilteredSearchVisualTokens
.
getLastVisualTokenBeforeInput
();
const
{
lastVisualToken
}
=
gl
.
FilteredSearchVisualTokens
.
getLastVisualTokenBeforeInput
();
>>>>>>>
ce
/
master
if
(
this
.
filteredSearchInput
.
value
===
''
&&
lastVisualToken
)
{
if
(
this
.
filteredSearchInput
.
value
===
''
&&
lastVisualToken
)
{
this
.
filteredSearchInput
.
value
=
gl
.
FilteredSearchVisualTokens
.
getLastTokenPartial
();
this
.
filteredSearchInput
.
value
=
gl
.
FilteredSearchVisualTokens
.
getLastTokenPartial
();
...
@@ -276,18 +222,9 @@ class FilteredSearchManager {
...
@@ -276,18 +222,9 @@ class FilteredSearchManager {
editToken
(
e
)
{
editToken
(
e
)
{
const
token
=
e
.
target
.
closest
(
'
.js-visual-token
'
);
const
token
=
e
.
target
.
closest
(
'
.js-visual-token
'
);
<<<<<<<
HEAD
if
(
this
.
canEdit
&&
!
this
.
canEdit
(
token
))
return
;
if
(
token
)
{
gl
.
FilteredSearchVisualTokens
.
editToken
(
token
);
this
.
tokenChange
();
}
=======
if
(
token
)
{
if
(
token
)
{
gl
.
FilteredSearchVisualTokens
.
editToken
(
token
);
gl
.
FilteredSearchVisualTokens
.
editToken
(
token
);
this
.
tokenChange
();
this
.
tokenChange
();
>>>>>>>
ce
/
master
}
}
}
}
...
@@ -335,21 +272,11 @@ class FilteredSearchManager {
...
@@ -335,21 +272,11 @@ class FilteredSearchManager {
const
removeElements
=
[];
const
removeElements
=
[];
<<<<<<<
HEAD
[].
forEach
.
call
(
this
.
tokensContainer
.
children
,
(
t
)
=>
{
if
(
t
.
classList
.
contains
(
'
js-visual-token
'
))
{
if
(
this
.
canEdit
&&
!
this
.
canEdit
(
t
))
return
;
removeElements
.
push
(
t
);
}
});
=======
[].
forEach
.
call
(
this
.
tokensContainer
.
children
,
(
t
)
=>
{
[].
forEach
.
call
(
this
.
tokensContainer
.
children
,
(
t
)
=>
{
if
(
t
.
classList
.
contains
(
'
js-visual-token
'
))
{
if
(
t
.
classList
.
contains
(
'
js-visual-token
'
))
{
removeElements
.
push
(
t
);
removeElements
.
push
(
t
);
}
}
});
});
>>>>>>>
ce
/
master
removeElements
.
forEach
((
el
)
=>
{
removeElements
.
forEach
((
el
)
=>
{
el
.
parentElement
.
removeChild
(
el
);
el
.
parentElement
.
removeChild
(
el
);
...
...
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