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
Hide 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 {
}
}
<<<<<<<
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
()
{
const
hook
=
this
.
getCurrentHook
();
...
...
@@ -131,7 +114,6 @@ class FilteredSearchDropdown {
return
updated
;
});
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
FilteredSearchContainer
from
'
./container
'
;
<<<<<<<
HEAD
(()
=>
{
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
;
if
(
this
.
page
===
'
issues
'
||
this
.
page
===
'
boards
'
)
{
this
.
filteredSearchTokenKeys
=
gl
.
FilteredSearchTokenKeysWithWeights
;
}
this
.
setupMapping
();
this
.
cleanupWrapper
=
this
.
cleanup
.
bind
(
this
);
document
.
addEventListener
(
'
beforeunload
'
,
this
.
cleanupWrapper
);
=======
class
FilteredSearchDropdownManager
{
constructor
(
baseEndpoint
=
''
,
page
)
{
this
.
container
=
FilteredSearchContainer
.
container
;
...
...
@@ -30,6 +10,10 @@ class FilteredSearchDropdownManager {
this
.
filteredSearchInput
=
this
.
container
.
querySelector
(
'
.filtered-search
'
);
this
.
page
=
page
;
if
(
this
.
page
===
'
issues
'
||
this
.
page
===
'
boards
'
)
{
this
.
filteredSearchTokenKeys
=
gl
.
FilteredSearchTokenKeysWithWeights
;
}
this
.
setupMapping
();
this
.
cleanupWrapper
=
this
.
cleanup
.
bind
(
this
);
...
...
@@ -40,7 +24,6 @@ class FilteredSearchDropdownManager {
if
(
this
.
droplab
)
{
this
.
droplab
.
destroy
();
this
.
droplab
=
null
;
>>>>>>>
ce
/
master
}
this
.
setupMapping
();
...
...
@@ -78,48 +61,16 @@ class FilteredSearchDropdownManager {
element
:
this
.
container
.
querySelector
(
'
#js-dropdown-hint
'
),
},
};
}
<<<<<<<
HEAD
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
'
),
},
if
(
this
.
page
===
'
issues
'
||
this
.
page
===
'
boards
'
)
{
this
.
mapping
.
weight
=
{
reference
:
null
,
gl
:
'
DropdownNonUser
'
,
element
:
document
.
querySelector
(
'
#js-dropdown-weight
'
),
};
}
}
if
(
this
.
page
===
'
issues
'
||
this
.
page
===
'
boards
'
)
{
this
.
mapping
.
weight
=
{
reference
:
null
,
gl
:
'
DropdownNonUser
'
,
element
:
document
.
querySelector
(
'
#js-dropdown-weight
'
),
};
}
=======
static
addWordToInput
(
tokenName
,
tokenValue
=
''
,
clicked
=
false
)
{
const
input
=
FilteredSearchContainer
.
container
.
querySelector
(
'
.filtered-search
'
);
...
...
@@ -128,7 +79,6 @@ class FilteredSearchDropdownManager {
if
(
clicked
)
{
gl
.
FilteredSearchVisualTokens
.
moveInputToTheRight
();
>>>>>>>
ce
/
master
}
}
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
3c834a57
...
...
@@ -6,54 +6,6 @@ import RecentSearchesStore from './stores/recent_searches_store';
import
RecentSearchesService
from
'
./services/recent_searches_service
'
;
import
eventHub
from
'
./event_hub
'
;
<<<<<<<
HEAD
(()
=>
{
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
;
if
(
page
===
'
issues
'
||
page
===
'
boards
'
)
{
this
.
filteredSearchTokenKeys
=
gl
.
FilteredSearchTokenKeysWithWeights
;
}
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
),
);
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
;
...
...
@@ -63,6 +15,10 @@ class FilteredSearchManager {
this
.
tokensContainer
=
this
.
container
.
querySelector
(
'
.tokens-container
'
);
this
.
filteredSearchTokenKeys
=
gl
.
FilteredSearchTokenKeys
;
if
(
page
===
'
issues
'
||
page
===
'
boards
'
)
{
this
.
filteredSearchTokenKeys
=
gl
.
FilteredSearchTokenKeysWithWeights
;
}
this
.
recentSearchesStore
=
new
RecentSearchesStore
();
let
recentSearchesKey
=
'
issue-recent-searches
'
;
if
(
page
===
'
merge_requests
'
)
{
...
...
@@ -83,7 +39,6 @@ class FilteredSearchManager {
// 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
);
});
...
...
@@ -154,14 +109,6 @@ class FilteredSearchManager {
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
()
{
this
.
filteredSearchInputForm
.
removeEventListener
(
'
submit
'
,
this
.
handleFormSubmit
);
this
.
filteredSearchInput
.
removeEventListener
(
'
input
'
,
this
.
setDropdownWrapper
);
...
...
@@ -188,7 +135,6 @@ class FilteredSearchManager {
// 46 = Delete Key
if
(
e
.
keyCode
===
8
||
e
.
keyCode
===
46
)
{
const
{
lastVisualToken
}
=
gl
.
FilteredSearchVisualTokens
.
getLastVisualTokenBeforeInput
();
>>>>>>>
ce
/
master
if
(
this
.
filteredSearchInput
.
value
===
''
&&
lastVisualToken
)
{
this
.
filteredSearchInput
.
value
=
gl
.
FilteredSearchVisualTokens
.
getLastTokenPartial
();
...
...
@@ -276,18 +222,9 @@ class FilteredSearchManager {
editToken
(
e
)
{
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
)
{
gl
.
FilteredSearchVisualTokens
.
editToken
(
token
);
this
.
tokenChange
();
>>>>>>>
ce
/
master
}
}
...
...
@@ -335,21 +272,11 @@ class FilteredSearchManager {
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
)
=>
{
if
(
t
.
classList
.
contains
(
'
js-visual-token
'
))
{
removeElements
.
push
(
t
);
}
});
>>>>>>>
ce
/
master
removeElements
.
forEach
((
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