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
5936ac3f
Commit
5936ac3f
authored
Feb 17, 2022
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up issue_boards_filtered_search feature flag
Review feedback
parent
416c0477
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
81 deletions
+0
-81
app/assets/javascripts/boards/filtered_search_boards.js
app/assets/javascripts/boards/filtered_search_boards.js
+0
-81
No files found.
app/assets/javascripts/boards/filtered_search_boards.js
deleted
100644 → 0
View file @
416c0477
import
{
transformBoardConfig
}
from
'
ee_else_ce/boards/boards_util
'
;
import
FilteredSearchManager
from
'
ee_else_ce/filtered_search/filtered_search_manager
'
;
import
IssuableFilteredSearchTokenKeys
from
'
ee_else_ce/filtered_search/issuable_filtered_search_token_keys
'
;
import
{
updateHistory
}
from
'
~/lib/utils/url_utility
'
;
import
FilteredSearchContainer
from
'
../filtered_search/container
'
;
import
vuexstore
from
'
./stores
'
;
export
default
class
FilteredSearchBoards
extends
FilteredSearchManager
{
constructor
(
store
,
updateUrl
=
false
,
cantEdit
=
[])
{
super
({
page
:
'
boards
'
,
isGroupDecendent
:
true
,
stateFiltersSelector
:
'
.issues-state-filters
'
,
isGroup
:
IS_EE
,
useDefaultState
:
false
,
filteredSearchTokenKeys
:
IssuableFilteredSearchTokenKeys
,
});
this
.
store
=
store
;
this
.
updateUrl
=
updateUrl
;
// Issue boards is slightly different, we handle all the requests async
// instead or reloading the page, we just re-fire the list ajax requests
this
.
isHandledAsync
=
true
;
this
.
cantEdit
=
cantEdit
.
filter
((
i
)
=>
typeof
i
===
'
string
'
);
this
.
cantEditWithValue
=
cantEdit
.
filter
((
i
)
=>
typeof
i
===
'
object
'
);
if
(
vuexstore
.
state
.
boardConfig
)
{
const
boardConfigPath
=
transformBoardConfig
(
vuexstore
.
state
.
boardConfig
);
// TODO Refactor: https://gitlab.com/gitlab-org/gitlab/-/issues/329274
// here we are using "window.location.search" as a temporary store
// only to unpack the params and do another validation inside
// 'performSearch' and 'setFilter' vuex actions.
if
(
boardConfigPath
!==
''
)
{
const
filterPath
=
window
.
location
.
search
?
`
${
window
.
location
.
search
}
&`
:
'
?
'
;
updateHistory
({
url
:
`
${
filterPath
}${
transformBoardConfig
(
vuexstore
.
state
.
boardConfig
)}
`
,
});
}
}
}
updateObject
(
path
)
{
const
groupByParam
=
new
URLSearchParams
(
window
.
location
.
search
).
get
(
'
group_by
'
);
this
.
store
.
path
=
`
${
path
.
substr
(
1
)}${
groupByParam
?
`&group_by=
${
groupByParam
}
`
:
''
}
`
;
updateHistory
({
url
:
`?
${
path
.
substr
(
1
)}${
groupByParam
?
`&group_by=
${
groupByParam
}
`
:
''
}
`
,
});
vuexstore
.
dispatch
(
'
performSearch
'
);
}
removeTokens
()
{
const
tokens
=
FilteredSearchContainer
.
container
.
querySelectorAll
(
'
.js-visual-token
'
);
// Remove all the tokens as they will be replaced by the search manager
[].
forEach
.
call
(
tokens
,
(
el
)
=>
{
el
.
parentNode
.
removeChild
(
el
);
});
this
.
filteredSearchInput
.
value
=
''
;
}
updateTokens
()
{
this
.
removeTokens
();
this
.
loadSearchParamsFromURL
();
// Get the placeholder back if search is empty
this
.
filteredSearchInput
.
dispatchEvent
(
new
Event
(
'
input
'
));
}
canEdit
(
tokenName
,
tokenValue
)
{
if
(
this
.
cantEdit
.
includes
(
tokenName
))
return
false
;
return
(
this
.
cantEditWithValue
.
findIndex
(
(
token
)
=>
token
.
name
===
tokenName
&&
token
.
value
===
tokenValue
,
)
===
-
1
);
}
}
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