diff --git a/.rubocop.yml b/.rubocop.yml index b25398e..c85ebfe 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,9 @@ +require: + - rubocop-performance + - rubocop-rails + - rubocop-rspec + - rubocop-thread_safety + inherit_mode: merge: - Exclude @@ -8,6 +14,7 @@ AllCops: - 'app/controllers/kpm/engine_controller.rb' # Too much magic going on NewCops: enable SuggestExtensions: false + TargetRubyVersion: 3.2 Gemspec/RequiredRubyVersion: Enabled: false @@ -51,3 +58,34 @@ Style/Documentation: Style/EmptyElse: EnforcedStyle: empty + +# Rails cops +Rails: + Enabled: true + +Rails/I18nLocaleTexts: + Enabled: false + +Rails/SkipsModelValidations: + Enabled: false + +# RSpec cops +RSpec: + Enabled: true + +RSpec/MultipleExpectations: + Enabled: false + +RSpec/ExampleLength: + Enabled: false + +# Performance cops +Performance: + Enabled: true + +# Thread Safety cops +ThreadSafety: + Enabled: true + +ThreadSafety/ClassAndModuleAttributes: + Enabled: false diff --git a/Gemfile b/Gemfile index 8f489d1..bed68ee 100644 --- a/Gemfile +++ b/Gemfile @@ -24,6 +24,10 @@ group :development do gem 'puma' gem 'rake' gem 'rubocop' + gem 'rubocop-performance' + gem 'rubocop-rails' + gem 'rubocop-rspec' + gem 'rubocop-thread_safety' gem 'simplecov' gem 'sprockets-rails' end diff --git a/app/assets/stylesheets/kpm/kpm.css b/app/assets/stylesheets/kpm/kpm.css index 3377040..e73b58f 100644 --- a/app/assets/stylesheets/kpm/kpm.css +++ b/app/assets/stylesheets/kpm/kpm.css @@ -41,6 +41,12 @@ /* app/views/kpm/nodes_info/_nodes_table.html.erb */ +.nodes-separator { + border: none; + border-top: 0.1875rem solid #d2d6db; + margin: 1.5rem 0; +} + .nodes-info b { font-weight: 600; font-size: 0.875rem; @@ -60,6 +66,31 @@ /* app/views/kpm/nodes_info/_official_plugins.html.erb */ +.official-plugins-data .node-group { + margin-bottom: 1.5rem; +} + +.official-plugins-data .node-group-header { + display: flex; + align-items: center; + padding: 0.5rem 0; + margin-bottom: 0.25rem; + border-bottom: 0.125rem solid #e9eaeb; +} + +.official-plugins-data .node-group-label { + font-weight: 600; + font-size: 0.875rem; + line-height: 1.25rem; + color: #414651; + text-transform: uppercase; + letter-spacing: 0.05em; +} + +.official-plugins-data .node-group .official-plugin:last-child { + border-bottom: none; +} + .official-plugins-data .official-plugin { padding: 1rem 0; display: flex; diff --git a/app/controllers/kpm/nodes_info_controller.rb b/app/controllers/kpm/nodes_info_controller.rb index 2f6b255..e4b04fe 100644 --- a/app/controllers/kpm/nodes_info_controller.rb +++ b/app/controllers/kpm/nodes_info_controller.rb @@ -8,7 +8,7 @@ class NodesInfoController < EngineController include ActionController::Live def index - @installing = !params[:i].blank? + @installing = params[:i].present? @nodes_info = ::KillBillClient::Model::NodesInfo.nodes_info(options_for_klient) diff --git a/app/views/kpm/nodes_info/_nodes_table.html.erb b/app/views/kpm/nodes_info/_nodes_table.html.erb index f805f62..f478e9b 100644 --- a/app/views/kpm/nodes_info/_nodes_table.html.erb +++ b/app/views/kpm/nodes_info/_nodes_table.html.erb @@ -1,5 +1,6 @@ <%- has_kpm_plugin = kpm_plugin_installed?(nodes_info) %> -<% nodes_info.each do |node_info| %> +<% nodes_info.each_with_index do |node_info, index| %> + <%= content_tag :hr, nil, class: 'nodes-separator' if index > 0 %>
Commons: <%= node_info.common_version %>