From 60e0b648f085789790b7143be22547513ac0105a Mon Sep 17 00:00:00 2001 From: Kyle Le Date: Tue, 10 Oct 2023 00:55:49 +0700 Subject: [PATCH] Removing the jquery-datatables dependency --- Gemfile | 4 ++ app/assets/javascripts/application.js | 4 +- app/assets/stylesheets/application.css | 4 +- .../kenui/layouts/kenui_application.html.erb | 47 ++++++++++--------- kenui.gemspec | 5 +- lib/kenui/engine.rb | 2 +- 6 files changed, 32 insertions(+), 34 deletions(-) diff --git a/Gemfile b/Gemfile index c5d1067..b5336e0 100644 --- a/Gemfile +++ b/Gemfile @@ -20,7 +20,11 @@ group :development do gem 'rake' gem 'rubocop' gem 'simplecov' + gem 'sprockets-rails' end # gem 'killbill-client', :git => 'https://github.com/killbill/killbill-client-ruby.git', :branch => 'work-for-release-0.21.x' # gem 'killbill-client', '3.2.0' + +gem 'killbill-assets-ui', github: 'killbill/killbill-assets-ui', ref: 'main' +# gem 'killbill-assets-ui', path: '../killbill-assets-ui' diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 62f9941..eb3bdd9 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -10,7 +10,5 @@ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // -//= require jquery -//= require dataTables/jquery.dataTables -//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap //= require kenui/kenui +//= require assets/common diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 6ec6266..b365a28 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -11,8 +11,6 @@ * It is generally better to create a new file per style scope. * *= require_self - *= require dataTables/jquery.dataTables - *= require dataTables/bootstrap/3/jquery.dataTables.bootstrap - *= require font-awesome *= require kenui/email_notifications + *= require assets/common */ diff --git a/app/views/kenui/layouts/kenui_application.html.erb b/app/views/kenui/layouts/kenui_application.html.erb index 144fc7d..d35eca0 100644 --- a/app/views/kenui/layouts/kenui_application.html.erb +++ b/app/views/kenui/layouts/kenui_application.html.erb @@ -1,31 +1,32 @@ - - Kenui - <%= yield :scripts %> - <%= stylesheet_link_tag 'application', :media => 'all' %> - <%= javascript_include_tag 'application' %> - <%= csrf_meta_tags %> - -
- <%- # :alert used by devise -%> - <% [:error, :alert].each do |key| %> - <% if flash[key] %> + + Kenui + <%= yield :scripts %> + <%= stylesheet_link_tag 'application', :media => 'all' %> + <%= javascript_include_tag 'application' %> + <%= csrf_meta_tags %> + + +
+ <%- # :alert used by devise -%> + <% [:error, :alert].each do |key| %> + <% if flash[key] %> +
+
+
<%= flash[key] %>
+
+
+ <% end %> + <% end %> + <% if flash[:notice] %>
-
<%= flash[key] %>
+
<%= flash[:notice] %>
<% end %> - <% end %> - <% if flash[:notice] %> -
-
-
<%= flash[:notice] %>
-
-
- <% end %> - <%= yield %> -
- + <%= yield %> +
+ diff --git a/kenui.gemspec b/kenui.gemspec index 7d6c596..ae94828 100644 --- a/kenui.gemspec +++ b/kenui.gemspec @@ -20,10 +20,7 @@ Gem::Specification.new do |s| s.metadata['rubygems_mfa_required'] = 'true' - s.add_dependency 'font-awesome-rails' - s.add_dependency 'jquery-datatables-rails' - s.add_dependency 'jquery-rails', '~> 4.5.1' s.add_dependency 'killbill-client' + s.add_dependency 'killbill-assets-ui' s.add_dependency 'rails', '~> 7.0' - s.add_dependency 'sass-rails' end diff --git a/lib/kenui/engine.rb b/lib/kenui/engine.rb index 395f988..3006d41 100644 --- a/lib/kenui/engine.rb +++ b/lib/kenui/engine.rb @@ -7,7 +7,7 @@ # # See also https://github.com/carlhuda/bundler/issues/49 require 'jquery-rails' -require 'jquery-datatables-rails' +require 'killbill-assets-ui' require 'font-awesome-rails' require 'killbill_client'