Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Avo 3 #2044

Merged
merged 9 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ js_bundle_metadata.json
/public/avo-assets/avo.base.js.map
/public/packs-test
/node_modules
node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
Expand All @@ -73,3 +74,6 @@ app/assets/builds

TAGS
brakeman_results.html

.env
.env.test
27 changes: 27 additions & 0 deletions .solargraph_definitions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# @!parse
# class ActionController::Base
# include ActionController::MimeResponds
# extend ActiveSupport::Callbacks::ClassMethods
# extend AbstractController::Callbacks::ClassMethods
# end
# class ActiveRecord::Base
# extend ActiveRecord::QueryMethods
# extend ActiveRecord::FinderMethods
# extend ActiveRecord::Associations::ClassMethods
# extend ActiveRecord::Inheritance::ClassMethods
# include ActiveRecord::Persistence
# end
# @!override ActiveRecord::FinderMethods#find
# @overload find(id)
# @param id [Integer]
# @return [self]
# @overload find(list)
# @param list [Array]
# @return [Array<self>]
# @overload find(*args)
# @return [Array<self>]
# @return [self, Array<self>]
4 changes: 4 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ ignore: # default: []
- Style/MissingRespondToMissing
- 'spec/requests/avo/authorization/scopes_spec.rb':
- Lint/ConstantDefinitionInBlock
- 'lib/**/*':
- Style/TrailingCommaInHashLiteral
- 'app/**/*':
- Style/TrailingCommaInHashLiteral
18 changes: 8 additions & 10 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
["3.0.3", "3.2.2"].each do |ruby_version|
appraise "rails-6.0-ruby-#{ruby_version}" do
gem "rails", "~> 6.0.0"
gem "ransack", "~> 3.1.0"
end
end

["3.0.3", "3.2.2"].each do |ruby_version|
["6.1", "7.0"].each do |rails_version|
["6.0", "6.1", "7.0", "7.1"].each do |rails_version|
appraise "rails-#{rails_version}-ruby-#{ruby_version}" do
gem "rails", "~> #{rails_version}.0"
gem "ransack", "~> 4.0.0"
gem "psych", "< 4"
gem "rails", "~> #{rails_version}"
gem "ransack", "~> 4.1", ">= 4.1.1"

# source "https://rubygems.pkg.github.com/avo-hq" do
# gem "avo-dynamic_filters"
# end
end
end
end
6 changes: 3 additions & 3 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ You may do that using the `RESOURCE_CLASS.with_temporary_items` method.
```ruby
RSpec.describe "Time field", type: :system do
after do
CourseResource.restore_items_from_backup
Avo::Resources::Course.restore_items_from_backup
end

describe "relative: false"
before do
CourseResource.with_temporary_items do
Avo::Resources::Course.with_temporary_items do
field :starting_at, as: :time, relative: false
end
end
Expand All @@ -154,7 +154,7 @@ RSpec.describe "Time field", type: :system do

describe "relative: true"
before do
CourseResource.with_temporary_items do
Avo::Resources::Course.with_temporary_items do
field :starting_at, as: :time, relative: true
end
end
Expand Down
54 changes: 28 additions & 26 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ gem 'cssbundling-rails'
# Dependencies for dummy_app
#
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 6.1.0"
gem "rails", "~> 7.1.0"

# Use postgresql as the database for Active Record
gem "pg", ">= 0.18", "< 2.0"
# Use Puma as the app server
gem "puma", "~> 5.6.4"
gem "puma", "~> 6.4"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem "jbuilder", "~> 2.7"
# Use Redis adapter to run Action Cable in production
Expand All @@ -44,13 +44,10 @@ gem "web-console", ">= 3.3.0"
gem "listen", ">= 3.5.1"
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "spring"

gem "factory_bot_rails"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem "devise"
gem "database_cleaner"

gem "ruby-debug-ide", require: false
#
Expand All @@ -75,20 +72,17 @@ group :development do

gem "htmlbeautifier"

gem "hotwire-livereload", "~> 1.2"
gem "hotwire-livereload", "~> 1.2.3"

gem "brakeman"
end

gem "awesome_print"

group :development, :test do
gem "faker", require: false
gem "i18n-tasks", "~> 1.0.12"
gem "rubocop"
gem "ripper-tags"
gem "rubocop-shopify", require: false
end

group :test do
gem "rspec-rails", "~> 4.0.0"
gem "rspec-rails", "~> 6.0", ">= 6.0.3"
gem "rails-controller-testing"
# Adds support for Capybara system testing and selenium driver
gem "capybara"
Expand All @@ -103,10 +97,22 @@ group :test do
gem "launchy", require: false

gem "test-prof"
gem "database_cleaner"
end

gem "rubocop"
gem "rubocop-shopify", require: false
gem "awesome_print"

group :development, :test do
gem "faker", require: false
gem "i18n-tasks", "~> 1.0.12"
gem "erb-formatter"
gem "solargraph"
gem "solargraph-rails"

gem "factory_bot_rails"

gem "appraisal"
end

gem "zeitwerk"

Expand All @@ -118,14 +124,10 @@ gem "active_link_to"

gem "addressable"

gem "appraisal"

gem 'meta-tags'

gem 'manifester'

# Search
gem 'ransack'
gem "ransack", "~> 4.1", ">= 4.1.1"

gem 'friendly_id', '~> 5.4.0'

Expand All @@ -140,15 +142,10 @@ gem "active_median"

gem 'acts_as_list'

gem 'acts-as-taggable-on', '~> 9.0'
gem 'acts-as-taggable-on', '~> 10.0'

gem "bundler-integrity", "~> 1.0"

gem 'erb-formatter'

# Avo authorization requires this gem
gem "pundit"

# Avo country field requires this gem
gem "countries"

Expand All @@ -164,8 +161,13 @@ gem "sprockets-rails"
# Use Active Storage variant
gem "image_processing", "~> 1.12"

# source "https://rubygems.pkg.github.com/avo-hq" do
# gem "avo-dynamic_filters"
# end
gem "prefixed_ids"

gem "mapkick-rb", "~> 0.1.4"

gem "pluggy", path: "./pluggy"

gem "turbo_power", "~> 0.5.0"