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
852ea20a
Commit
852ea20a
authored
Sep 06, 2017
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Standardize filtered_search file.
parent
72772929
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
app/assets/javascripts/service_desk_issues/filtered_search.js
...assets/javascripts/service_desk_issues/filtered_search.js
+7
-8
app/assets/javascripts/service_desk_issues/index.js
app/assets/javascripts/service_desk_issues/index.js
+5
-1
ee/app/views/projects/issues/service_desk.html.haml
ee/app/views/projects/issues/service_desk.html.haml
+1
-1
No files found.
app/assets/javascripts/service_desk_issues/filtered_search.js
View file @
852ea20a
/* eslint-disable class-methods-use-this */
const
AUTHOR_PARAM_KEY
=
'
author_username
'
;
export
default
class
FilteredSearchServiceDesk
extends
gl
.
FilteredSearchManager
{
constructor
()
{
constructor
(
supportBotData
)
{
super
(
'
service_desk
'
);
this
.
supportBotAttrs
=
JSON
.
parse
(
document
.
querySelector
(
'
.service-desk-issues
'
).
dataset
.
supportBot
,
);
this
.
supportBotData
=
supportBotData
;
}
customRemovalValidator
(
token
)
{
const
tokenValue
=
token
.
querySelector
(
'
.value-container
'
);
return
tokenValue
?
tokenValue
.
getAttribute
(
'
data-original-value
'
)
!==
`@
${
this
.
supportBot
Attrs
.
username
}
`
:
true
;
tokenValue
.
getAttribute
(
'
data-original-value
'
)
!==
`@
${
this
.
supportBot
Data
.
username
}
`
:
true
;
}
canEdit
(
tokenName
)
{
...
...
@@ -21,9 +21,8 @@ export default class FilteredSearchServiceDesk extends gl.FilteredSearchManager
}
modifyUrlParams
(
paramsArray
)
{
const
authorParamKey
=
'
author_username
'
;
const
supportBotParamPair
=
`
${
authorParamKey
}
=
${
this
.
supportBotAttrs
.
username
}
`
;
const
onlyValidParams
=
paramsArray
.
filter
(
param
=>
param
.
indexOf
(
authorParamKey
)
===
-
1
);
const
supportBotParamPair
=
`
${
AUTHOR_PARAM_KEY
}
=
${
this
.
supportBotData
.
username
}
`
;
const
onlyValidParams
=
paramsArray
.
filter
(
param
=>
param
.
indexOf
(
AUTHOR_PARAM_KEY
)
===
-
1
);
// unshift ensures author param is always first token element
onlyValidParams
.
unshift
(
supportBotParamPair
);
...
...
app/assets/javascripts/service_desk_issues/index.js
View file @
852ea20a
import
FilteredSearchServiceDesk
from
'
./filtered_search
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
this
.
filteredSearchManager
=
new
FilteredSearchServiceDesk
();
const
supportBotData
=
JSON
.
parse
(
document
.
querySelector
(
'
.js-service-desk-issues
'
).
dataset
.
supportBot
,
);
this
.
filteredSearchManager
=
new
FilteredSearchServiceDesk
(
supportBotData
);
this
.
filteredSearchManager
.
setup
();
});
ee/app/views/projects/issues/service_desk.html.haml
View file @
852ea20a
...
...
@@ -16,7 +16,7 @@
-
support_bot_attrs
=
User
.
support_bot
.
to_json
(
only:
[
:id
,
:name
,
:username
,
:avatar_url
])
%div
{
class:
"#{container_class} service-desk-issues"
,
data:
{
support_bot:
support_bot_attrs
}
}
%div
{
class:
"#{container_class}
js-service-desk-issues
service-desk-issues"
,
data:
{
support_bot:
support_bot_attrs
}
}
.top-area
=
render
'shared/issuable/nav'
,
type: :issues
.nav-controls
{
class:
(
"visible-xs"
if
show_new_nav?
)
}
...
...
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