improve code climate

pull/6929/head
Wieland Lindenthal 6 years ago
parent 202baafa7f
commit c2819c466d
  1. 4
      app/controllers/search_controller.rb
  2. 2
      frontend/src/app/modules/global_search/global-search-work-packages.component.ts
  3. 2
      frontend/src/app/modules/global_search/global-search.service.ts
  4. 2
      lib/open_project/global_search.rb

@ -111,12 +111,12 @@ class SearchController < ApplicationController
gon.global_search = {
search_term: @question,
project_scope: search_params[:scope].to_s,
available_search_types: @available_search_types.map { |search_type|
available_search_types: @available_search_types.map do |search_type|
{
id: search_type,
name: OpenProject::GlobalSearch.tab_name(search_type)
}
},
end,
current_tab: @available_search_types.select { |search_type| search_params[search_type] }.first || 'all'
}

@ -103,7 +103,7 @@ export class GlobalSearchWorkPackagesComponent extends WorkPackageEmbeddedTableC
this.configuration.inlineCreateEnabled = false;
this.configuration.withFilters = true;
this.configuration.showFilterButton = true;
this.configuration.filterButtonText = I18n.t('js.button_advanced_filter')
this.configuration.filterButtonText = I18n.t('js.button_advanced_filter');
this.searchTermSub = this.globalSearchService
.searchTerm$

@ -88,7 +88,7 @@ export class GlobalSearchService {
}
public submitSearch():void {
window.location.href = this.searchPath();;
window.location.href = this.searchPath();
}
public searchPath() {

@ -3,7 +3,7 @@ module OpenProject
def self.tab_name(tab)
I18n.t("global_search.overwritten_tabs.#{tab}",
default: I18n.t("label_#{tab.singularize}_plural",
default: tab.to_s.humanize))
default: tab.to_s.humanize))
end
end
end

Loading…
Cancel
Save