Commit d9d138da authored by Bryce Johnson's avatar Bryce Johnson

Fixup nav and load support bot info from data attr.

parent ba89aff8
......@@ -578,7 +578,6 @@ class FilteredSearchManager {
getUsernameParams() {
const usernamesById = {};
try {
const attribute = this.filteredSearchInput.getAttribute('data-username-params');
JSON.parse(attribute).forEach((user) => {
......
......@@ -3,6 +3,7 @@
export default class FilteredSearchServiceDesk extends gl.FilteredSearchManager {
constructor() {
super('service_desk');
this.supportBotAttrs = JSON.parse(document.querySelector('.service-desk-issues').dataset.supportBot);
}
customRemovalValidator(token) {
......@@ -16,7 +17,7 @@ export default class FilteredSearchServiceDesk extends gl.FilteredSearchManager
modifyUrlParams(paramsArray) {
const authorParamKey = 'author_username';
// FIXME: Need to grab the value from a data attribute
const supportBotParamPair = `${authorParamKey}=support-bot`;
const supportBotParamPair = `${authorParamKey}=${this.supportBotAttrs.username}`;
const onlyValidParams = paramsArray.filter(param => param.indexOf(authorParamKey) === -1);
......
import FilteredSearchServiceDesk from './filtered_search';
this.filteredSearchManager = new FilteredSearchServiceDesk();
document.addEventListener('DOMContentLoaded', () => {
this.filteredSearchManager = new FilteredSearchServiceDesk();
this.filteredSearchManager.setup();
this.filteredSearchManager.setup();
});
......@@ -134,7 +134,7 @@
Labels
- if EE::Gitlab::ServiceDesk.enabled?(project: @project)
= nav_link(controller: [ :issues, :service_desk ]) do
= nav_link(controller: :issues, action: :service_desk ) do
= link_to service_desk_project_issues_url(@project), title: 'Service Desk' do
%span Service Desk
......
......@@ -27,6 +27,11 @@
%span
Labels
- if EE::Gitlab::ServiceDesk.enabled?(project: @project)
= nav_link(controller: :issues, action: :service_desk ) do
= link_to service_desk_project_issues_url(@project), title: 'Service Desk' do
%span Service Desk
- if project_nav_tab? :milestones
= nav_link(controller: :milestones) do
= link_to project_milestones_path(@project), title: 'Milestones' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment