Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Code climate fixes

Aleix Suau56e9f1d086a6
diff --git a/config/middleware.rb b/config/middleware.rb
index 050edcafe91..e96062df337 100644
--- a/config/middleware.rb
+++ b/config/middleware.rb
@@ -2,4 +2,4 @@ require 'request_headers'
if %w(test).include?(Rails.env)
Rails.application.config.middleware.insert_before Rack::Lock, "RequestHeaders", CustomHeadersHelper
-end
\ No newline at end of file
+end
diff --git a/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.ts b/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.ts
index c0927484238..ba234a270bc 100644
--- a/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.ts
+++ b/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.ts
@@ -26,11 +26,11 @@ import {pluck, distinctUntilChanged, filter} from "rxjs/operators";
],
changeDetection: ChangeDetectionStrategy.OnPush
})
-export class BcfListContainerComponent extends WorkPackageListViewComponent implements OnInit {
+export class BcfListContainerComponent extends WorkPackageListViewComponent implements OnInit {
@InjectField() bimView:BimViewService;
@InjectField() ifcModelsService:IfcModelsDataService;
@InjectField() wpTableColumns:WorkPackageViewColumnsService;
- @InjectField() uIRouterGlobals:UIRouterGlobals
+ @InjectField() uIRouterGlobals:UIRouterGlobals;
public wpTableConfiguration = {
dragAndDropEnabled: false
@@ -43,9 +43,7 @@ export class BcfListContainerComponent extends WorkPackageListViewComponent impl
// until we can load the initial query
this.wpTableColumns
.onReady()
- .then(() => {
- this.wpTableColumns.addColumn('bcfThumbnail', 2);
- });
+ .then(() => this.wpTableColumns.addColumn('bcfThumbnail', 2));
this.uIRouterGlobals
.params$!
@@ -64,7 +62,7 @@ export class BcfListContainerComponent extends WorkPackageListViewComponent impl
this.cdRef.detectChanges();
});
}
-
+
protected updateViewRepresentation(query:QueryResource) {
if (this.wpDisplayRepresentation.current === null) {
this.wpDisplayRepresentation.setDisplayRepresentation(wpDisplayCardRepresentation);
diff --git a/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts b/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts
index fe352a6c0d4..b6a89f35cf8 100644
--- a/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts
+++ b/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts
@@ -101,7 +101,7 @@ export class BimViewToggleDropdownDirective extends OpContextMenuTrigger {
// Under the hood it is done by modifying the params of actual route.
// Because of that, it is not possible to call this.state.go and
// this.wpDisplayRepresentation.setDisplayRepresentation at the same
- // time, it raises a route error (The transition has been superseded by
+ // time, it raises a route error (The transition has been superseded by
// a different transition...). To avoid this error, we are passing
// a cards params to inform the view about the display representation mode
// it has to show (cards or list).
diff --git a/lib/request_headers.rb b/lib/request_headers.rb
index b30215ae376..8450450ac50 100644
--- a/lib/request_headers.rb
+++ b/lib/request_headers.rb
@@ -4,7 +4,8 @@ end
class RequestHeaders
def initialize(app, helper = nil)
- @app, @helper = app, helper
+ @app = app
+ @helper = helper
end
def call(env)
@@ -12,12 +13,12 @@ class RequestHeaders
headers = @helper.headers
if headers.is_a?(Hash)
- headers.each do |k,v|
- env["HTTP_#{k.upcase.gsub("-", "_")}"] = v
+ headers.each do |k, v|
+ env["HTTP_#{k.upcase.gsub('-', '_')}"] = v
end
end
end
@app.call(env)
end
-end
\ No newline at end of file
+end
diff --git a/modules/bim/spec/features/bim_revit_addin_navigation_spec.rb b/modules/bim/spec/features/bim_revit_addin_navigation_spec.rb
index 7bd3bfbe34e..261a068d642 100644
--- a/modules/bim/spec/features/bim_revit_addin_navigation_spec.rb
+++ b/modules/bim/spec/features/bim_revit_addin_navigation_spec.rb
@@ -33,7 +33,7 @@ describe 'BIM Revit Add-in navigation spec',
with_config: { edition: 'bim' },
js: true,
driver: :chrome_headless_revit_addin do
- let(:project) { FactoryBot.create :project, enabled_module_names: [:bim, :work_package_tracking] }
+ let(:project) { FactoryBot.create :project, enabled_module_names: %i[bim work_package_tracking] }
let!(:work_package) { FactoryBot.create(:work_package, project: project) }
let(:role) { FactoryBot.create(:role, permissions: %i[view_ifc_models manage_ifc_models view_work_packages]) }
let(:wp_table) { ::Pages::WorkPackagesTable.new(project) }
@@ -63,7 +63,7 @@ describe 'BIM Revit Add-in navigation spec',
it 'shows a toolbar' do
model_page.page_shows_a_toolbar true
end
-
+
it 'menu has no viewer options' do
model_page.has_no_menu_item_with_text? 'Viewer'
end