From dc775bf6e38f90fc4f61c554f7f956de8223b0f8 Mon Sep 17 00:00:00 2001 From: Adrian Marin Date: Mon, 9 Dec 2024 16:06:21 +0200 Subject: [PATCH 1/7] feature: external link on records --- app/components/avo/items/panel_component.rb | 3 ++- app/components/avo/panel_component.html.erb | 3 ++- app/components/avo/panel_component.rb | 1 + app/components/avo/panel_header_component.html.erb | 10 +++++++++- app/components/avo/panel_header_component.rb | 1 + lib/avo/resources/base.rb | 5 +++++ spec/dummy/app/avo/resources/post.rb | 4 ++++ spec/dummy/app/controllers/posts_controller.rb | 9 +++++++++ spec/dummy/app/views/posts/index.html.erb | 4 ++++ spec/dummy/app/views/posts/show.html.erb | 4 ++++ spec/dummy/config/locales/avo.en.yml | 1 + spec/dummy/config/routes.rb | 2 ++ 12 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 spec/dummy/app/controllers/posts_controller.rb create mode 100644 spec/dummy/app/views/posts/index.html.erb create mode 100644 spec/dummy/app/views/posts/show.html.erb diff --git a/app/components/avo/items/panel_component.rb b/app/components/avo/items/panel_component.rb index 5e0dc8ce78..f8a17cc974 100644 --- a/app/components/avo/items/panel_component.rb +++ b/app/components/avo/items/panel_component.rb @@ -34,7 +34,8 @@ def args index: 0, data: {panel_id: "main"}, cover_photo: @resource.cover_photo, - profile_photo: @resource.profile_photo + profile_photo: @resource.profile_photo, + external_link: @resource.get_external_link } else {name: @item.name, description: @item.description, index: @index} diff --git a/app/components/avo/panel_component.html.erb b/app/components/avo/panel_component.html.erb index 63da39b304..a289ee8bc7 100644 --- a/app/components/avo/panel_component.html.erb +++ b/app/components/avo/panel_component.html.erb @@ -4,7 +4,8 @@ name: @name, description: @description, display_breadcrumbs: @display_breadcrumbs, - profile_photo: @profile_photo + profile_photo: @profile_photo, + external_link: @external_link ) do |header| %> <% if name_slot.present? %> <% header.with_name_slot do %> diff --git a/app/components/avo/panel_component.rb b/app/components/avo/panel_component.rb index e36ea5a09a..832bf9879c 100644 --- a/app/components/avo/panel_component.rb +++ b/app/components/avo/panel_component.rb @@ -27,6 +27,7 @@ class Avo::PanelComponent < Avo::BaseComponent prop :name do |value| value || @args&.dig(:title) end + prop :external_link def classes class_names(@classes, "has-cover-photo": @cover_photo.present?, "has-profile-photo": @profile_photo.present?) diff --git a/app/components/avo/panel_header_component.html.erb b/app/components/avo/panel_header_component.html.erb index 4f1b08fd02..7ff8ad9938 100644 --- a/app/components/avo/panel_header_component.html.erb +++ b/app/components/avo/panel_header_component.html.erb @@ -12,7 +12,15 @@ <% if name_slot? %> <%= name_slot %> <% else %> - <%= render Avo::PanelNameComponent.new name: @name %> + <%= render Avo::PanelNameComponent.new name: @name do |panel_name_component| %> + <% panel_name_component.with_body do %> + <% if @external_link.present? %> + <%= link_to @external_link, class: "text-gray-600 hover:text-gray-900 mt-1", title: helpers.t("avo.visit_record_on_external_path"), data: {tippy: :tooltip}, target: :_blank do %> + <%= svg "heroicons/outline/arrow-top-right-on-square", class: "ml-2 text-2xl h-4" %> + <% end %> + <% end %> + <% end %> + <% end %> <% end %> <% if @description.present? %>
diff --git a/app/components/avo/panel_header_component.rb b/app/components/avo/panel_header_component.rb index 5155c86a9a..168cc60c2f 100644 --- a/app/components/avo/panel_header_component.rb +++ b/app/components/avo/panel_header_component.rb @@ -7,6 +7,7 @@ class Avo::PanelHeaderComponent < Avo::BaseComponent renders_one :tools prop :name + prop :external_link prop :description prop :display_breadcrumbs, default: false prop :profile_photo diff --git a/lib/avo/resources/base.rb b/lib/avo/resources/base.rb index b8b8cae16e..ac4a3f9134 100644 --- a/lib/avo/resources/base.rb +++ b/lib/avo/resources/base.rb @@ -80,6 +80,7 @@ def current_user class_attribute :default_sort_column, default: :created_at class_attribute :default_sort_direction, default: :desc class_attribute :controls_placement, default: nil + class_attribute :external_link, default: nil # EXTRACT: class_attribute :ordering @@ -644,6 +645,10 @@ def resolve_component(original_component) custom_components.dig(original_component.to_s)&.to_s&.safe_constantize || original_component end + def get_external_link + Avo::ExecutionContext.new(target: external_link, resource: self, record: record).handle + end + private def flatten_keys(array) diff --git a/spec/dummy/app/avo/resources/post.rb b/spec/dummy/app/avo/resources/post.rb index e99173b743..c7a89c8e55 100644 --- a/spec/dummy/app/avo/resources/post.rb +++ b/spec/dummy/app/avo/resources/post.rb @@ -28,6 +28,10 @@ class Avo::Resources::Post < Avo::BaseResource end } self.view_types = [:grid, :table] + # Show a link to the post outside Avo + self.external_link = -> { + main_app.post_path(record) + } def fields field :id, as: :id diff --git a/spec/dummy/app/controllers/posts_controller.rb b/spec/dummy/app/controllers/posts_controller.rb new file mode 100644 index 0000000000..05e7a9f25f --- /dev/null +++ b/spec/dummy/app/controllers/posts_controller.rb @@ -0,0 +1,9 @@ +class PostsController < ApplicationController + def index + @posts = Post.all + end + + def show + @post = Post.find(params[:id]) + end +end diff --git a/spec/dummy/app/views/posts/index.html.erb b/spec/dummy/app/views/posts/index.html.erb new file mode 100644 index 0000000000..7141919097 --- /dev/null +++ b/spec/dummy/app/views/posts/index.html.erb @@ -0,0 +1,4 @@ +

Posts#index

+

Find me in app/views/posts/index.html.erb

+ +<%= @posts.count %> diff --git a/spec/dummy/app/views/posts/show.html.erb b/spec/dummy/app/views/posts/show.html.erb new file mode 100644 index 0000000000..445201d996 --- /dev/null +++ b/spec/dummy/app/views/posts/show.html.erb @@ -0,0 +1,4 @@ +

Posts#show

+

Find me in app/views/posts/show.html.erb

+ +<%= @post.inspect %> diff --git a/spec/dummy/config/locales/avo.en.yml b/spec/dummy/config/locales/avo.en.yml index b0527a658f..94c1036381 100644 --- a/spec/dummy/config/locales/avo.en.yml +++ b/spec/dummy/config/locales/avo.en.yml @@ -110,6 +110,7 @@ en: undo: undo view: View view_item: view %{item} + visit_record_on_external_path: Visit record on external path was_successfully_created: was successfully created was_successfully_updated: was successfully updated x_items_more: diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb index 29dcb07d2b..1dad6d2d4e 100644 --- a/spec/dummy/config/routes.rb +++ b/spec/dummy/config/routes.rb @@ -5,6 +5,8 @@ get "hey", to: "home#index" + resources :posts + authenticate :user, ->(user) { user.is_admin? } do scope :admin do get "custom_tool", to: "avo/tools#custom_tool", as: :custom_tool From d12fb146f0c69fb8f8f6028a30f722febc2cc66d Mon Sep 17 00:00:00 2001 From: Adrian Marin Date: Mon, 9 Dec 2024 16:18:12 +0200 Subject: [PATCH 2/7] remove rails 8 gemfile github lock --- Appraisals | 10 - Gemfile.lock | 4 +- gemfiles/rails_8.0_ruby_3.1.4.gemfile | 7 +- gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock | 212 ++++++++++----------- gemfiles/rails_8.0_ruby_3.3.0.gemfile | 7 +- gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock | 212 ++++++++++----------- 6 files changed, 210 insertions(+), 242 deletions(-) diff --git a/Appraisals b/Appraisals index cae721aced..6027b4ac4f 100644 --- a/Appraisals +++ b/Appraisals @@ -7,14 +7,4 @@ gem "activestorage" end end - - # TODO: we'll probably have to remove these when Rails 8 is released - appraise "rails-8.0-ruby-#{ruby_version}" do - gem "psych", "< 4" - gem "rails", github: "rails/rails", branch: "main" - gem "activestorage", github: "rails/rails", branch: "main" - - # Temporary Rails 8 support - gem "acts-as-taggable-on", github: "avo-hq/acts-as-taggable-on" - end end diff --git a/Gemfile.lock b/Gemfile.lock index ecb0e69f86..9e7153b750 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -400,10 +400,10 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.4) - nokogiri (1.16.8) + nokogiri (1.17.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.8-x86_64-linux) + nokogiri (1.17.0-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) pagy (9.0.9) diff --git a/gemfiles/rails_8.0_ruby_3.1.4.gemfile b/gemfiles/rails_8.0_ruby_3.1.4.gemfile index 5366e6ffaf..670f9fdfa1 100644 --- a/gemfiles/rails_8.0_ruby_3.1.4.gemfile +++ b/gemfiles/rails_8.0_ruby_3.1.4.gemfile @@ -4,8 +4,8 @@ source "https://rubygems.org" gem "jsbundling-rails" gem "cssbundling-rails" -gem "rails", branch: "main", git: "https://github.com/rails/rails.git" -gem "activestorage", branch: "main", git: "https://github.com/rails/rails.git" +gem "rails", ">= 8.0.0" +gem "activestorage", ">= 8.0.0" gem "pg", ">= 0.18", "< 2.0" gem "puma", "~> 6.4" gem "redis", "~> 5.0" @@ -30,7 +30,7 @@ gem "groupdate" gem "hightop" gem "active_median" gem "acts_as_list" -gem "acts-as-taggable-on", git: "https://github.com/avo-hq/acts-as-taggable-on.git" +gem "acts-as-taggable-on" gem "bundler-integrity", "~> 1.0" gem "countries" gem "chartkick" @@ -45,7 +45,6 @@ gem "avo-money_field" gem "avo-record_link_field" gem "pagy", "> 8" gem "csv" -gem "psych", "< 4" group :development do gem "standard", require: false diff --git a/gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock b/gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock index db55e7e83a..1d7042bc31 100644 --- a/gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock +++ b/gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock @@ -1,38 +1,53 @@ -GIT - remote: https://github.com/avo-hq/acts-as-taggable-on.git - revision: 33f0eac41ba392b3cae69faf3dee69a698a7871a +PATH + remote: ../pluggy specs: - acts-as-taggable-on (10.0.0) - activerecord (>= 6.1, < 8) + pluggy (0.0.1) -GIT - remote: https://github.com/rails/rails.git - revision: b88d9af34fbc1c84ce2769ba02584eab2c28ac6e - branch: main +PATH + remote: .. specs: - actioncable (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + avo (3.15.2) + actionview (>= 6.1) + active_link_to + activerecord (>= 6.1) + activesupport (>= 6.1) + addressable + docile + inline_svg + meta-tags + pagy (>= 7.0.0) + prop_initializer (>= 0.2.0) + turbo-rails (>= 2.0.0) + turbo_power (>= 0.6.0) + view_component (>= 3.7.0) + zeitwerk (>= 2.6.12) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (8.0.0) + actionpack (= 8.0.0) + activesupport (= 8.0.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activejob (= 8.0.0.alpha) - activerecord (= 8.0.0.alpha) - activestorage (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actionmailbox (8.0.0) + actionpack (= 8.0.0) + activejob (= 8.0.0) + activerecord (= 8.0.0) + activestorage (= 8.0.0) + activesupport (= 8.0.0) mail (>= 2.8.0) - actionmailer (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - actionview (= 8.0.0.alpha) - activejob (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actionmailer (8.0.0) + actionpack (= 8.0.0) + actionview (= 8.0.0) + activejob (= 8.0.0) + activesupport (= 8.0.0) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.0.alpha) - actionview (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actionpack (8.0.0) + actionview (= 8.0.0) + activesupport (= 8.0.0) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -40,35 +55,40 @@ GIT rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activerecord (= 8.0.0.alpha) - activestorage (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actiontext (8.0.0) + actionpack (= 8.0.0) + activerecord (= 8.0.0) + activestorage (= 8.0.0) + activesupport (= 8.0.0) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actionview (8.0.0) + activesupport (= 8.0.0) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (8.0.0.alpha) - activesupport (= 8.0.0.alpha) + active_link_to (1.0.5) + actionpack + addressable + active_median (0.4.1) + activesupport (>= 6.1) + activejob (8.0.0) + activesupport (= 8.0.0) globalid (>= 0.3.6) - activemodel (8.0.0.alpha) - activesupport (= 8.0.0.alpha) - activerecord (8.0.0.alpha) - activemodel (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + activemodel (8.0.0) + activesupport (= 8.0.0) + activerecord (8.0.0) + activemodel (= 8.0.0) + activesupport (= 8.0.0) timeout (>= 0.4.0) - activestorage (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activejob (= 8.0.0.alpha) - activerecord (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + activestorage (8.0.0) + actionpack (= 8.0.0) + activejob (= 8.0.0) + activerecord (= 8.0.0) + activesupport (= 8.0.0) marcel (~> 1.0) - activesupport (8.0.0.alpha) + activesupport (8.0.0) base64 benchmark (>= 0.3) bigdecimal @@ -81,61 +101,9 @@ GIT securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) - rails (8.0.0.alpha) - actioncable (= 8.0.0.alpha) - actionmailbox (= 8.0.0.alpha) - actionmailer (= 8.0.0.alpha) - actionpack (= 8.0.0.alpha) - actiontext (= 8.0.0.alpha) - actionview (= 8.0.0.alpha) - activejob (= 8.0.0.alpha) - activemodel (= 8.0.0.alpha) - activerecord (= 8.0.0.alpha) - activestorage (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) - bundler (>= 1.15.0) - railties (= 8.0.0.alpha) - railties (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) - irb (~> 1.13) - rackup (>= 1.0.0) - rake (>= 12.2) - thor (~> 1.0, >= 1.2.2) - zeitwerk (~> 2.6) - -PATH - remote: ../pluggy - specs: - pluggy (0.0.1) - -PATH - remote: .. - specs: - avo (3.15.2) - actionview (>= 6.1) - active_link_to - activerecord (>= 6.1) - activesupport (>= 6.1) - addressable - docile - inline_svg - meta-tags - pagy (>= 7.0.0) - prop_initializer (>= 0.2.0) - turbo-rails (>= 2.0.0) - turbo_power (>= 0.6.0) - view_component (>= 3.7.0) - zeitwerk (>= 2.6.12) - -GEM - remote: https://rubygems.org/ - specs: - active_link_to (1.0.5) - actionpack - addressable - active_median (0.4.1) - activesupport (>= 6.1) + acts-as-taggable-on (12.0.0) + activerecord (>= 7.1, < 8.1) + zeitwerk (>= 2.4, < 3.0) acts_as_list (1.2.2) activerecord (>= 6.1) activesupport (>= 6.1) @@ -146,9 +114,9 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) amazing_print (1.6.0) - annotate (3.2.0) - activerecord (>= 3.2, < 8.0) - rake (>= 10.4, < 14.0) + annotate (2.6.5) + activerecord (>= 2.3.0) + rake (>= 0.8.7) appraisal (2.5.0) bundler rake @@ -436,6 +404,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) + rails (8.0.0) + actioncable (= 8.0.0) + actionmailbox (= 8.0.0) + actionmailer (= 8.0.0) + actionpack (= 8.0.0) + actiontext (= 8.0.0) + actionview (= 8.0.0) + activejob (= 8.0.0) + activemodel (= 8.0.0) + activerecord (= 8.0.0) + activestorage (= 8.0.0) + activesupport (= 8.0.0) + bundler (>= 1.15.0) + railties (= 8.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -447,9 +429,17 @@ GEM rails-html-sanitizer (1.6.1) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - rails-i18n (7.0.9) + rails-i18n (8.0.1) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 8) + railties (>= 8.0.0, < 9) + railties (8.0.0) + actionpack (= 8.0.0) + activesupport (= 8.0.0) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) ransack (4.2.1) @@ -611,8 +601,8 @@ GEM unicode-display_width (2.6.0) uri (0.13.1) useragent (0.16.10) - view_component (3.15.1) - activesupport (>= 5.2.0, < 8.0) + view_component (3.20.0) + activesupport (>= 5.2.0, < 8.1) concurrent-ruby (~> 1.0) method_source (~> 1.0) virtus (2.0.0) @@ -646,8 +636,8 @@ PLATFORMS DEPENDENCIES active_link_to active_median - activestorage! - acts-as-taggable-on! + activestorage (>= 8.0.0) + acts-as-taggable-on acts_as_list actual_db_schema addressable @@ -700,7 +690,7 @@ DEPENDENCIES prefixed_ids psych (< 4) puma (~> 6.4) - rails! + rails (>= 8.0.0) rails-controller-testing ransack (>= 4.2.0) redis (~> 5.0) diff --git a/gemfiles/rails_8.0_ruby_3.3.0.gemfile b/gemfiles/rails_8.0_ruby_3.3.0.gemfile index 5366e6ffaf..670f9fdfa1 100644 --- a/gemfiles/rails_8.0_ruby_3.3.0.gemfile +++ b/gemfiles/rails_8.0_ruby_3.3.0.gemfile @@ -4,8 +4,8 @@ source "https://rubygems.org" gem "jsbundling-rails" gem "cssbundling-rails" -gem "rails", branch: "main", git: "https://github.com/rails/rails.git" -gem "activestorage", branch: "main", git: "https://github.com/rails/rails.git" +gem "rails", ">= 8.0.0" +gem "activestorage", ">= 8.0.0" gem "pg", ">= 0.18", "< 2.0" gem "puma", "~> 6.4" gem "redis", "~> 5.0" @@ -30,7 +30,7 @@ gem "groupdate" gem "hightop" gem "active_median" gem "acts_as_list" -gem "acts-as-taggable-on", git: "https://github.com/avo-hq/acts-as-taggable-on.git" +gem "acts-as-taggable-on" gem "bundler-integrity", "~> 1.0" gem "countries" gem "chartkick" @@ -45,7 +45,6 @@ gem "avo-money_field" gem "avo-record_link_field" gem "pagy", "> 8" gem "csv" -gem "psych", "< 4" group :development do gem "standard", require: false diff --git a/gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock b/gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock index db55e7e83a..1d7042bc31 100644 --- a/gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock +++ b/gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock @@ -1,38 +1,53 @@ -GIT - remote: https://github.com/avo-hq/acts-as-taggable-on.git - revision: 33f0eac41ba392b3cae69faf3dee69a698a7871a +PATH + remote: ../pluggy specs: - acts-as-taggable-on (10.0.0) - activerecord (>= 6.1, < 8) + pluggy (0.0.1) -GIT - remote: https://github.com/rails/rails.git - revision: b88d9af34fbc1c84ce2769ba02584eab2c28ac6e - branch: main +PATH + remote: .. specs: - actioncable (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + avo (3.15.2) + actionview (>= 6.1) + active_link_to + activerecord (>= 6.1) + activesupport (>= 6.1) + addressable + docile + inline_svg + meta-tags + pagy (>= 7.0.0) + prop_initializer (>= 0.2.0) + turbo-rails (>= 2.0.0) + turbo_power (>= 0.6.0) + view_component (>= 3.7.0) + zeitwerk (>= 2.6.12) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (8.0.0) + actionpack (= 8.0.0) + activesupport (= 8.0.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activejob (= 8.0.0.alpha) - activerecord (= 8.0.0.alpha) - activestorage (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actionmailbox (8.0.0) + actionpack (= 8.0.0) + activejob (= 8.0.0) + activerecord (= 8.0.0) + activestorage (= 8.0.0) + activesupport (= 8.0.0) mail (>= 2.8.0) - actionmailer (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - actionview (= 8.0.0.alpha) - activejob (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actionmailer (8.0.0) + actionpack (= 8.0.0) + actionview (= 8.0.0) + activejob (= 8.0.0) + activesupport (= 8.0.0) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.0.alpha) - actionview (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actionpack (8.0.0) + actionview (= 8.0.0) + activesupport (= 8.0.0) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -40,35 +55,40 @@ GIT rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activerecord (= 8.0.0.alpha) - activestorage (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actiontext (8.0.0) + actionpack (= 8.0.0) + activerecord (= 8.0.0) + activestorage (= 8.0.0) + activesupport (= 8.0.0) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.0.alpha) - activesupport (= 8.0.0.alpha) + actionview (8.0.0) + activesupport (= 8.0.0) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (8.0.0.alpha) - activesupport (= 8.0.0.alpha) + active_link_to (1.0.5) + actionpack + addressable + active_median (0.4.1) + activesupport (>= 6.1) + activejob (8.0.0) + activesupport (= 8.0.0) globalid (>= 0.3.6) - activemodel (8.0.0.alpha) - activesupport (= 8.0.0.alpha) - activerecord (8.0.0.alpha) - activemodel (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + activemodel (8.0.0) + activesupport (= 8.0.0) + activerecord (8.0.0) + activemodel (= 8.0.0) + activesupport (= 8.0.0) timeout (>= 0.4.0) - activestorage (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activejob (= 8.0.0.alpha) - activerecord (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) + activestorage (8.0.0) + actionpack (= 8.0.0) + activejob (= 8.0.0) + activerecord (= 8.0.0) + activesupport (= 8.0.0) marcel (~> 1.0) - activesupport (8.0.0.alpha) + activesupport (8.0.0) base64 benchmark (>= 0.3) bigdecimal @@ -81,61 +101,9 @@ GIT securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) - rails (8.0.0.alpha) - actioncable (= 8.0.0.alpha) - actionmailbox (= 8.0.0.alpha) - actionmailer (= 8.0.0.alpha) - actionpack (= 8.0.0.alpha) - actiontext (= 8.0.0.alpha) - actionview (= 8.0.0.alpha) - activejob (= 8.0.0.alpha) - activemodel (= 8.0.0.alpha) - activerecord (= 8.0.0.alpha) - activestorage (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) - bundler (>= 1.15.0) - railties (= 8.0.0.alpha) - railties (8.0.0.alpha) - actionpack (= 8.0.0.alpha) - activesupport (= 8.0.0.alpha) - irb (~> 1.13) - rackup (>= 1.0.0) - rake (>= 12.2) - thor (~> 1.0, >= 1.2.2) - zeitwerk (~> 2.6) - -PATH - remote: ../pluggy - specs: - pluggy (0.0.1) - -PATH - remote: .. - specs: - avo (3.15.2) - actionview (>= 6.1) - active_link_to - activerecord (>= 6.1) - activesupport (>= 6.1) - addressable - docile - inline_svg - meta-tags - pagy (>= 7.0.0) - prop_initializer (>= 0.2.0) - turbo-rails (>= 2.0.0) - turbo_power (>= 0.6.0) - view_component (>= 3.7.0) - zeitwerk (>= 2.6.12) - -GEM - remote: https://rubygems.org/ - specs: - active_link_to (1.0.5) - actionpack - addressable - active_median (0.4.1) - activesupport (>= 6.1) + acts-as-taggable-on (12.0.0) + activerecord (>= 7.1, < 8.1) + zeitwerk (>= 2.4, < 3.0) acts_as_list (1.2.2) activerecord (>= 6.1) activesupport (>= 6.1) @@ -146,9 +114,9 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) amazing_print (1.6.0) - annotate (3.2.0) - activerecord (>= 3.2, < 8.0) - rake (>= 10.4, < 14.0) + annotate (2.6.5) + activerecord (>= 2.3.0) + rake (>= 0.8.7) appraisal (2.5.0) bundler rake @@ -436,6 +404,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) + rails (8.0.0) + actioncable (= 8.0.0) + actionmailbox (= 8.0.0) + actionmailer (= 8.0.0) + actionpack (= 8.0.0) + actiontext (= 8.0.0) + actionview (= 8.0.0) + activejob (= 8.0.0) + activemodel (= 8.0.0) + activerecord (= 8.0.0) + activestorage (= 8.0.0) + activesupport (= 8.0.0) + bundler (>= 1.15.0) + railties (= 8.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -447,9 +429,17 @@ GEM rails-html-sanitizer (1.6.1) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - rails-i18n (7.0.9) + rails-i18n (8.0.1) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 8) + railties (>= 8.0.0, < 9) + railties (8.0.0) + actionpack (= 8.0.0) + activesupport (= 8.0.0) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) ransack (4.2.1) @@ -611,8 +601,8 @@ GEM unicode-display_width (2.6.0) uri (0.13.1) useragent (0.16.10) - view_component (3.15.1) - activesupport (>= 5.2.0, < 8.0) + view_component (3.20.0) + activesupport (>= 5.2.0, < 8.1) concurrent-ruby (~> 1.0) method_source (~> 1.0) virtus (2.0.0) @@ -646,8 +636,8 @@ PLATFORMS DEPENDENCIES active_link_to active_median - activestorage! - acts-as-taggable-on! + activestorage (>= 8.0.0) + acts-as-taggable-on acts_as_list actual_db_schema addressable @@ -700,7 +690,7 @@ DEPENDENCIES prefixed_ids psych (< 4) puma (~> 6.4) - rails! + rails (>= 8.0.0) rails-controller-testing ransack (>= 4.2.0) redis (~> 5.0) From 94ae45d8f95754b35882263b7ff534536f2646e6 Mon Sep 17 00:00:00 2001 From: Adrian Marin Date: Mon, 9 Dec 2024 16:31:00 +0200 Subject: [PATCH 3/7] wip --- Appraisals | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Appraisals b/Appraisals index 6027b4ac4f..faf9860b8e 100644 --- a/Appraisals +++ b/Appraisals @@ -7,4 +7,14 @@ gem "activestorage" end end + + # TODO: we'll probably have to remove these when Rails 8 is released + appraise "rails-8.0-ruby-#{ruby_version}" do + # gem "psych", "< 4" + # gem "rails", github: "rails/rails", branch: "main" + # gem "activestorage", github: "rails/rails", branch: "main" + + # Temporary Rails 8 support + # gem "acts-as-taggable-on", github: "avo-hq/acts-as-taggable-on" + end end From 78f45c4c31ab01f42c0d13d79e0ce18f70b35b22 Mon Sep 17 00:00:00 2001 From: Paul Bob Date: Tue, 10 Dec 2024 09:57:23 +0200 Subject: [PATCH 4/7] Revert "remove rails 8 gemfile github lock" and "wip" This reverts commit d12fb146f0c69fb8f8f6028a30f722febc2cc66d and 94ae45d8f95754b35882263b7ff534536f2646e6. --- Appraisals | 8 +- Gemfile.lock | 4 +- gemfiles/rails_8.0_ruby_3.1.4.gemfile | 7 +- gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock | 212 +++++++++++---------- gemfiles/rails_8.0_ruby_3.3.0.gemfile | 7 +- gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock | 212 +++++++++++---------- 6 files changed, 236 insertions(+), 214 deletions(-) diff --git a/Appraisals b/Appraisals index faf9860b8e..cae721aced 100644 --- a/Appraisals +++ b/Appraisals @@ -10,11 +10,11 @@ # TODO: we'll probably have to remove these when Rails 8 is released appraise "rails-8.0-ruby-#{ruby_version}" do - # gem "psych", "< 4" - # gem "rails", github: "rails/rails", branch: "main" - # gem "activestorage", github: "rails/rails", branch: "main" + gem "psych", "< 4" + gem "rails", github: "rails/rails", branch: "main" + gem "activestorage", github: "rails/rails", branch: "main" # Temporary Rails 8 support - # gem "acts-as-taggable-on", github: "avo-hq/acts-as-taggable-on" + gem "acts-as-taggable-on", github: "avo-hq/acts-as-taggable-on" end end diff --git a/Gemfile.lock b/Gemfile.lock index 9e7153b750..ecb0e69f86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -400,10 +400,10 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.4) - nokogiri (1.17.0) + nokogiri (1.16.8) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.17.0-x86_64-linux) + nokogiri (1.16.8-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) pagy (9.0.9) diff --git a/gemfiles/rails_8.0_ruby_3.1.4.gemfile b/gemfiles/rails_8.0_ruby_3.1.4.gemfile index 670f9fdfa1..5366e6ffaf 100644 --- a/gemfiles/rails_8.0_ruby_3.1.4.gemfile +++ b/gemfiles/rails_8.0_ruby_3.1.4.gemfile @@ -4,8 +4,8 @@ source "https://rubygems.org" gem "jsbundling-rails" gem "cssbundling-rails" -gem "rails", ">= 8.0.0" -gem "activestorage", ">= 8.0.0" +gem "rails", branch: "main", git: "https://github.com/rails/rails.git" +gem "activestorage", branch: "main", git: "https://github.com/rails/rails.git" gem "pg", ">= 0.18", "< 2.0" gem "puma", "~> 6.4" gem "redis", "~> 5.0" @@ -30,7 +30,7 @@ gem "groupdate" gem "hightop" gem "active_median" gem "acts_as_list" -gem "acts-as-taggable-on" +gem "acts-as-taggable-on", git: "https://github.com/avo-hq/acts-as-taggable-on.git" gem "bundler-integrity", "~> 1.0" gem "countries" gem "chartkick" @@ -45,6 +45,7 @@ gem "avo-money_field" gem "avo-record_link_field" gem "pagy", "> 8" gem "csv" +gem "psych", "< 4" group :development do gem "standard", require: false diff --git a/gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock b/gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock index 1d7042bc31..db55e7e83a 100644 --- a/gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock +++ b/gemfiles/rails_8.0_ruby_3.1.4.gemfile.lock @@ -1,53 +1,38 @@ -PATH - remote: ../pluggy +GIT + remote: https://github.com/avo-hq/acts-as-taggable-on.git + revision: 33f0eac41ba392b3cae69faf3dee69a698a7871a specs: - pluggy (0.0.1) + acts-as-taggable-on (10.0.0) + activerecord (>= 6.1, < 8) -PATH - remote: .. +GIT + remote: https://github.com/rails/rails.git + revision: b88d9af34fbc1c84ce2769ba02584eab2c28ac6e + branch: main specs: - avo (3.15.2) - actionview (>= 6.1) - active_link_to - activerecord (>= 6.1) - activesupport (>= 6.1) - addressable - docile - inline_svg - meta-tags - pagy (>= 7.0.0) - prop_initializer (>= 0.2.0) - turbo-rails (>= 2.0.0) - turbo_power (>= 0.6.0) - view_component (>= 3.7.0) - zeitwerk (>= 2.6.12) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (8.0.0) - actionpack (= 8.0.0) - activesupport (= 8.0.0) + actioncable (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.0) - actionpack (= 8.0.0) - activejob (= 8.0.0) - activerecord (= 8.0.0) - activestorage (= 8.0.0) - activesupport (= 8.0.0) + actionmailbox (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activejob (= 8.0.0.alpha) + activerecord (= 8.0.0.alpha) + activestorage (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) mail (>= 2.8.0) - actionmailer (8.0.0) - actionpack (= 8.0.0) - actionview (= 8.0.0) - activejob (= 8.0.0) - activesupport (= 8.0.0) + actionmailer (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + actionview (= 8.0.0.alpha) + activejob (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.0) - actionview (= 8.0.0) - activesupport (= 8.0.0) + actionpack (8.0.0.alpha) + actionview (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -55,40 +40,35 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.0) - actionpack (= 8.0.0) - activerecord (= 8.0.0) - activestorage (= 8.0.0) - activesupport (= 8.0.0) + actiontext (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activerecord (= 8.0.0.alpha) + activestorage (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.0) - activesupport (= 8.0.0) + actionview (8.0.0.alpha) + activesupport (= 8.0.0.alpha) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - active_link_to (1.0.5) - actionpack - addressable - active_median (0.4.1) - activesupport (>= 6.1) - activejob (8.0.0) - activesupport (= 8.0.0) + activejob (8.0.0.alpha) + activesupport (= 8.0.0.alpha) globalid (>= 0.3.6) - activemodel (8.0.0) - activesupport (= 8.0.0) - activerecord (8.0.0) - activemodel (= 8.0.0) - activesupport (= 8.0.0) + activemodel (8.0.0.alpha) + activesupport (= 8.0.0.alpha) + activerecord (8.0.0.alpha) + activemodel (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) timeout (>= 0.4.0) - activestorage (8.0.0) - actionpack (= 8.0.0) - activejob (= 8.0.0) - activerecord (= 8.0.0) - activesupport (= 8.0.0) + activestorage (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activejob (= 8.0.0.alpha) + activerecord (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) marcel (~> 1.0) - activesupport (8.0.0) + activesupport (8.0.0.alpha) base64 benchmark (>= 0.3) bigdecimal @@ -101,9 +81,61 @@ GEM securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) - acts-as-taggable-on (12.0.0) - activerecord (>= 7.1, < 8.1) - zeitwerk (>= 2.4, < 3.0) + rails (8.0.0.alpha) + actioncable (= 8.0.0.alpha) + actionmailbox (= 8.0.0.alpha) + actionmailer (= 8.0.0.alpha) + actionpack (= 8.0.0.alpha) + actiontext (= 8.0.0.alpha) + actionview (= 8.0.0.alpha) + activejob (= 8.0.0.alpha) + activemodel (= 8.0.0.alpha) + activerecord (= 8.0.0.alpha) + activestorage (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) + bundler (>= 1.15.0) + railties (= 8.0.0.alpha) + railties (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + +PATH + remote: ../pluggy + specs: + pluggy (0.0.1) + +PATH + remote: .. + specs: + avo (3.15.2) + actionview (>= 6.1) + active_link_to + activerecord (>= 6.1) + activesupport (>= 6.1) + addressable + docile + inline_svg + meta-tags + pagy (>= 7.0.0) + prop_initializer (>= 0.2.0) + turbo-rails (>= 2.0.0) + turbo_power (>= 0.6.0) + view_component (>= 3.7.0) + zeitwerk (>= 2.6.12) + +GEM + remote: https://rubygems.org/ + specs: + active_link_to (1.0.5) + actionpack + addressable + active_median (0.4.1) + activesupport (>= 6.1) acts_as_list (1.2.2) activerecord (>= 6.1) activesupport (>= 6.1) @@ -114,9 +146,9 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) amazing_print (1.6.0) - annotate (2.6.5) - activerecord (>= 2.3.0) - rake (>= 0.8.7) + annotate (3.2.0) + activerecord (>= 3.2, < 8.0) + rake (>= 10.4, < 14.0) appraisal (2.5.0) bundler rake @@ -404,20 +436,6 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (8.0.0) - actioncable (= 8.0.0) - actionmailbox (= 8.0.0) - actionmailer (= 8.0.0) - actionpack (= 8.0.0) - actiontext (= 8.0.0) - actionview (= 8.0.0) - activejob (= 8.0.0) - activemodel (= 8.0.0) - activerecord (= 8.0.0) - activestorage (= 8.0.0) - activesupport (= 8.0.0) - bundler (>= 1.15.0) - railties (= 8.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -429,17 +447,9 @@ GEM rails-html-sanitizer (1.6.1) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - rails-i18n (8.0.1) + rails-i18n (7.0.9) i18n (>= 0.7, < 2) - railties (>= 8.0.0, < 9) - railties (8.0.0) - actionpack (= 8.0.0) - activesupport (= 8.0.0) - irb (~> 1.13) - rackup (>= 1.0.0) - rake (>= 12.2) - thor (~> 1.0, >= 1.2.2) - zeitwerk (~> 2.6) + railties (>= 6.0.0, < 8) rainbow (3.1.1) rake (13.2.1) ransack (4.2.1) @@ -601,8 +611,8 @@ GEM unicode-display_width (2.6.0) uri (0.13.1) useragent (0.16.10) - view_component (3.20.0) - activesupport (>= 5.2.0, < 8.1) + view_component (3.15.1) + activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) virtus (2.0.0) @@ -636,8 +646,8 @@ PLATFORMS DEPENDENCIES active_link_to active_median - activestorage (>= 8.0.0) - acts-as-taggable-on + activestorage! + acts-as-taggable-on! acts_as_list actual_db_schema addressable @@ -690,7 +700,7 @@ DEPENDENCIES prefixed_ids psych (< 4) puma (~> 6.4) - rails (>= 8.0.0) + rails! rails-controller-testing ransack (>= 4.2.0) redis (~> 5.0) diff --git a/gemfiles/rails_8.0_ruby_3.3.0.gemfile b/gemfiles/rails_8.0_ruby_3.3.0.gemfile index 670f9fdfa1..5366e6ffaf 100644 --- a/gemfiles/rails_8.0_ruby_3.3.0.gemfile +++ b/gemfiles/rails_8.0_ruby_3.3.0.gemfile @@ -4,8 +4,8 @@ source "https://rubygems.org" gem "jsbundling-rails" gem "cssbundling-rails" -gem "rails", ">= 8.0.0" -gem "activestorage", ">= 8.0.0" +gem "rails", branch: "main", git: "https://github.com/rails/rails.git" +gem "activestorage", branch: "main", git: "https://github.com/rails/rails.git" gem "pg", ">= 0.18", "< 2.0" gem "puma", "~> 6.4" gem "redis", "~> 5.0" @@ -30,7 +30,7 @@ gem "groupdate" gem "hightop" gem "active_median" gem "acts_as_list" -gem "acts-as-taggable-on" +gem "acts-as-taggable-on", git: "https://github.com/avo-hq/acts-as-taggable-on.git" gem "bundler-integrity", "~> 1.0" gem "countries" gem "chartkick" @@ -45,6 +45,7 @@ gem "avo-money_field" gem "avo-record_link_field" gem "pagy", "> 8" gem "csv" +gem "psych", "< 4" group :development do gem "standard", require: false diff --git a/gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock b/gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock index 1d7042bc31..db55e7e83a 100644 --- a/gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock +++ b/gemfiles/rails_8.0_ruby_3.3.0.gemfile.lock @@ -1,53 +1,38 @@ -PATH - remote: ../pluggy +GIT + remote: https://github.com/avo-hq/acts-as-taggable-on.git + revision: 33f0eac41ba392b3cae69faf3dee69a698a7871a specs: - pluggy (0.0.1) + acts-as-taggable-on (10.0.0) + activerecord (>= 6.1, < 8) -PATH - remote: .. +GIT + remote: https://github.com/rails/rails.git + revision: b88d9af34fbc1c84ce2769ba02584eab2c28ac6e + branch: main specs: - avo (3.15.2) - actionview (>= 6.1) - active_link_to - activerecord (>= 6.1) - activesupport (>= 6.1) - addressable - docile - inline_svg - meta-tags - pagy (>= 7.0.0) - prop_initializer (>= 0.2.0) - turbo-rails (>= 2.0.0) - turbo_power (>= 0.6.0) - view_component (>= 3.7.0) - zeitwerk (>= 2.6.12) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (8.0.0) - actionpack (= 8.0.0) - activesupport (= 8.0.0) + actioncable (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.0) - actionpack (= 8.0.0) - activejob (= 8.0.0) - activerecord (= 8.0.0) - activestorage (= 8.0.0) - activesupport (= 8.0.0) + actionmailbox (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activejob (= 8.0.0.alpha) + activerecord (= 8.0.0.alpha) + activestorage (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) mail (>= 2.8.0) - actionmailer (8.0.0) - actionpack (= 8.0.0) - actionview (= 8.0.0) - activejob (= 8.0.0) - activesupport (= 8.0.0) + actionmailer (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + actionview (= 8.0.0.alpha) + activejob (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.0) - actionview (= 8.0.0) - activesupport (= 8.0.0) + actionpack (8.0.0.alpha) + actionview (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -55,40 +40,35 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.0) - actionpack (= 8.0.0) - activerecord (= 8.0.0) - activestorage (= 8.0.0) - activesupport (= 8.0.0) + actiontext (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activerecord (= 8.0.0.alpha) + activestorage (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.0) - activesupport (= 8.0.0) + actionview (8.0.0.alpha) + activesupport (= 8.0.0.alpha) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - active_link_to (1.0.5) - actionpack - addressable - active_median (0.4.1) - activesupport (>= 6.1) - activejob (8.0.0) - activesupport (= 8.0.0) + activejob (8.0.0.alpha) + activesupport (= 8.0.0.alpha) globalid (>= 0.3.6) - activemodel (8.0.0) - activesupport (= 8.0.0) - activerecord (8.0.0) - activemodel (= 8.0.0) - activesupport (= 8.0.0) + activemodel (8.0.0.alpha) + activesupport (= 8.0.0.alpha) + activerecord (8.0.0.alpha) + activemodel (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) timeout (>= 0.4.0) - activestorage (8.0.0) - actionpack (= 8.0.0) - activejob (= 8.0.0) - activerecord (= 8.0.0) - activesupport (= 8.0.0) + activestorage (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activejob (= 8.0.0.alpha) + activerecord (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) marcel (~> 1.0) - activesupport (8.0.0) + activesupport (8.0.0.alpha) base64 benchmark (>= 0.3) bigdecimal @@ -101,9 +81,61 @@ GEM securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) - acts-as-taggable-on (12.0.0) - activerecord (>= 7.1, < 8.1) - zeitwerk (>= 2.4, < 3.0) + rails (8.0.0.alpha) + actioncable (= 8.0.0.alpha) + actionmailbox (= 8.0.0.alpha) + actionmailer (= 8.0.0.alpha) + actionpack (= 8.0.0.alpha) + actiontext (= 8.0.0.alpha) + actionview (= 8.0.0.alpha) + activejob (= 8.0.0.alpha) + activemodel (= 8.0.0.alpha) + activerecord (= 8.0.0.alpha) + activestorage (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) + bundler (>= 1.15.0) + railties (= 8.0.0.alpha) + railties (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + +PATH + remote: ../pluggy + specs: + pluggy (0.0.1) + +PATH + remote: .. + specs: + avo (3.15.2) + actionview (>= 6.1) + active_link_to + activerecord (>= 6.1) + activesupport (>= 6.1) + addressable + docile + inline_svg + meta-tags + pagy (>= 7.0.0) + prop_initializer (>= 0.2.0) + turbo-rails (>= 2.0.0) + turbo_power (>= 0.6.0) + view_component (>= 3.7.0) + zeitwerk (>= 2.6.12) + +GEM + remote: https://rubygems.org/ + specs: + active_link_to (1.0.5) + actionpack + addressable + active_median (0.4.1) + activesupport (>= 6.1) acts_as_list (1.2.2) activerecord (>= 6.1) activesupport (>= 6.1) @@ -114,9 +146,9 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) amazing_print (1.6.0) - annotate (2.6.5) - activerecord (>= 2.3.0) - rake (>= 0.8.7) + annotate (3.2.0) + activerecord (>= 3.2, < 8.0) + rake (>= 10.4, < 14.0) appraisal (2.5.0) bundler rake @@ -404,20 +436,6 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (8.0.0) - actioncable (= 8.0.0) - actionmailbox (= 8.0.0) - actionmailer (= 8.0.0) - actionpack (= 8.0.0) - actiontext (= 8.0.0) - actionview (= 8.0.0) - activejob (= 8.0.0) - activemodel (= 8.0.0) - activerecord (= 8.0.0) - activestorage (= 8.0.0) - activesupport (= 8.0.0) - bundler (>= 1.15.0) - railties (= 8.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -429,17 +447,9 @@ GEM rails-html-sanitizer (1.6.1) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - rails-i18n (8.0.1) + rails-i18n (7.0.9) i18n (>= 0.7, < 2) - railties (>= 8.0.0, < 9) - railties (8.0.0) - actionpack (= 8.0.0) - activesupport (= 8.0.0) - irb (~> 1.13) - rackup (>= 1.0.0) - rake (>= 12.2) - thor (~> 1.0, >= 1.2.2) - zeitwerk (~> 2.6) + railties (>= 6.0.0, < 8) rainbow (3.1.1) rake (13.2.1) ransack (4.2.1) @@ -601,8 +611,8 @@ GEM unicode-display_width (2.6.0) uri (0.13.1) useragent (0.16.10) - view_component (3.20.0) - activesupport (>= 5.2.0, < 8.1) + view_component (3.15.1) + activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) virtus (2.0.0) @@ -636,8 +646,8 @@ PLATFORMS DEPENDENCIES active_link_to active_median - activestorage (>= 8.0.0) - acts-as-taggable-on + activestorage! + acts-as-taggable-on! acts_as_list actual_db_schema addressable @@ -690,7 +700,7 @@ DEPENDENCIES prefixed_ids psych (< 4) puma (~> 6.4) - rails (>= 8.0.0) + rails! rails-controller-testing ransack (>= 4.2.0) redis (~> 5.0) From f28995074e0dadaec250faf15e8aee4358960e61 Mon Sep 17 00:00:00 2001 From: Paul Bob Date: Fri, 20 Dec 2024 13:40:45 +0200 Subject: [PATCH 5/7] fix new records --- lib/avo/resources/base.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/avo/resources/base.rb b/lib/avo/resources/base.rb index ac4a3f9134..a215aa80f3 100644 --- a/lib/avo/resources/base.rb +++ b/lib/avo/resources/base.rb @@ -646,6 +646,8 @@ def resolve_component(original_component) end def get_external_link + return unless record.persisted? + Avo::ExecutionContext.new(target: external_link, resource: self, record: record).handle end From 4a924885fe0cce050b54a6d77c29aa1d946902db Mon Sep 17 00:00:00 2001 From: Paul Bob Date: Fri, 20 Dec 2024 16:22:58 +0200 Subject: [PATCH 6/7] test --- spec/features/avo/external_link_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/features/avo/external_link_spec.rb diff --git a/spec/features/avo/external_link_spec.rb b/spec/features/avo/external_link_spec.rb new file mode 100644 index 0000000000..0dac2bf7eb --- /dev/null +++ b/spec/features/avo/external_link_spec.rb @@ -0,0 +1,25 @@ +require "rails_helper" + +RSpec.feature "external_link", type: :feature do + let!(:post) { create :post } + + describe "external_link" do + it "on show" do + visit avo.resources_post_path(post) + + find("[target='_blank'][href='/posts/#{post.to_param}']").click + + expect(current_path).to eq "/posts/#{post.to_param}" + expect(page).to have_text("Find me in app/views/posts/show.html.erb") + end + + it "on edit" do + visit avo.edit_resources_post_path(post) + + find("[target='_blank'][href='/posts/#{post.to_param}']").click + + expect(current_path).to eq "/posts/#{post.to_param}" + expect(page).to have_text("Find me in app/views/posts/show.html.erb") + end + end +end From 6edd8675a91e67b06e462f4b87b1a93b0e85f2d2 Mon Sep 17 00:00:00 2001 From: Paul Bob Date: Fri, 20 Dec 2024 17:03:08 +0200 Subject: [PATCH 7/7] locales --- lib/generators/avo/templates/locales/avo.ar.yml | 1 + lib/generators/avo/templates/locales/avo.de.yml | 1 + lib/generators/avo/templates/locales/avo.en.yml | 1 + lib/generators/avo/templates/locales/avo.es.yml | 1 + lib/generators/avo/templates/locales/avo.fr.yml | 1 + lib/generators/avo/templates/locales/avo.it.yml | 1 + lib/generators/avo/templates/locales/avo.ja.yml | 1 + lib/generators/avo/templates/locales/avo.nb.yml | 1 + lib/generators/avo/templates/locales/avo.nl.yml | 1 + lib/generators/avo/templates/locales/avo.nn.yml | 1 + lib/generators/avo/templates/locales/avo.pl.yml | 1 + lib/generators/avo/templates/locales/avo.pt-BR.yml | 1 + lib/generators/avo/templates/locales/avo.pt.yml | 1 + lib/generators/avo/templates/locales/avo.ro.yml | 1 + lib/generators/avo/templates/locales/avo.ru.yml | 1 + lib/generators/avo/templates/locales/avo.tr.yml | 1 + lib/generators/avo/templates/locales/avo.uk.yml | 1 + lib/generators/avo/templates/locales/avo.zh.yml | 1 + 18 files changed, 18 insertions(+) diff --git a/lib/generators/avo/templates/locales/avo.ar.yml b/lib/generators/avo/templates/locales/avo.ar.yml index d9c7a622b3..89a7122a3f 100644 --- a/lib/generators/avo/templates/locales/avo.ar.yml +++ b/lib/generators/avo/templates/locales/avo.ar.yml @@ -121,6 +121,7 @@ ar: undo: تراجع view: عرض view_item: عرض %{item} + visit_record_on_external_path: زيارة السجل على الرابط الخارجي was_successfully_created: تم إنشاؤه بنجاح was_successfully_updated: تم تحديثه بنجاح x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.de.yml b/lib/generators/avo/templates/locales/avo.de.yml index 3adafaf5d2..3a913439ba 100644 --- a/lib/generators/avo/templates/locales/avo.de.yml +++ b/lib/generators/avo/templates/locales/avo.de.yml @@ -111,6 +111,7 @@ de: undo: Rückgängig machen view: Anzeigen view_item: "%{item} anzeigen" + visit_record_on_external_path: Datensatz über externen Link besuchen was_successfully_created: wurde erfolgreich erstellt was_successfully_updated: wurde erfolgreich aktualisiert x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.en.yml b/lib/generators/avo/templates/locales/avo.en.yml index 31330c706c..4be4213237 100644 --- a/lib/generators/avo/templates/locales/avo.en.yml +++ b/lib/generators/avo/templates/locales/avo.en.yml @@ -111,6 +111,7 @@ en: undo: undo view: View view_item: view %{item} + visit_record_on_external_path: Visit record on external path was_successfully_created: was successfully created was_successfully_updated: was successfully updated x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.es.yml b/lib/generators/avo/templates/locales/avo.es.yml index ea50e8f0cf..f8714ae274 100644 --- a/lib/generators/avo/templates/locales/avo.es.yml +++ b/lib/generators/avo/templates/locales/avo.es.yml @@ -113,6 +113,7 @@ es: undo: deshacer view: Vista view_item: ver %{item} + visit_record_on_external_path: Visitar registro en enlace externo was_successfully_created: se ha creado con éxito was_successfully_updated: se ha actualizado con éxito x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.fr.yml b/lib/generators/avo/templates/locales/avo.fr.yml index 1d88cf0285..b47323f2cf 100644 --- a/lib/generators/avo/templates/locales/avo.fr.yml +++ b/lib/generators/avo/templates/locales/avo.fr.yml @@ -113,6 +113,7 @@ fr: undo: annuler view: Vue view_item: voir %{item} + visit_record_on_external_path: Consulter l'enregistrement via un lien externe was_successfully_created: a été créé avec succès was_successfully_updated: a été mis à jour avec succès x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.it.yml b/lib/generators/avo/templates/locales/avo.it.yml index fbf7c1b594..4ebda32fbd 100644 --- a/lib/generators/avo/templates/locales/avo.it.yml +++ b/lib/generators/avo/templates/locales/avo.it.yml @@ -111,6 +111,7 @@ it: undo: Annulla view: Visualizza view_item: Visualizza %{item} + visit_record_on_external_path: Visita il record tramite link esterno was_successfully_created: è stato creato con successo was_successfully_updated: è stato aggiornato con successo x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.ja.yml b/lib/generators/avo/templates/locales/avo.ja.yml index ca84e6a359..cad218a0cf 100644 --- a/lib/generators/avo/templates/locales/avo.ja.yml +++ b/lib/generators/avo/templates/locales/avo.ja.yml @@ -113,6 +113,7 @@ ja: undo: 元に戻す view: ビュー view_item: "%{item}を表示" + visit_record_on_external_path: 外部リンクで記録を確認する was_successfully_created: は正常に作成されました was_successfully_updated: は正常に更新されました x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.nb.yml b/lib/generators/avo/templates/locales/avo.nb.yml index 5282cc6bcd..01a89eabe1 100644 --- a/lib/generators/avo/templates/locales/avo.nb.yml +++ b/lib/generators/avo/templates/locales/avo.nb.yml @@ -113,6 +113,7 @@ nb: undo: angre view: Vis view_item: vis %{item} + visit_record_on_external_path: Besøk posten via en ekstern lenke was_successfully_created: ble opprettet was_successfully_updated: ble oppdatert x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.nl.yml b/lib/generators/avo/templates/locales/avo.nl.yml index 31cfd51014..00880d90da 100644 --- a/lib/generators/avo/templates/locales/avo.nl.yml +++ b/lib/generators/avo/templates/locales/avo.nl.yml @@ -111,6 +111,7 @@ nl: undo: Ongedaan maken view: Bekijken view_item: "%{item} bekijken" + visit_record_on_external_path: Bezoek record via een externe link was_successfully_created: is succesvol aangemaakt was_successfully_updated: is succesvol bijgewerkt x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.nn.yml b/lib/generators/avo/templates/locales/avo.nn.yml index 247a5b91ad..5a2099edbb 100644 --- a/lib/generators/avo/templates/locales/avo.nn.yml +++ b/lib/generators/avo/templates/locales/avo.nn.yml @@ -113,6 +113,7 @@ nn: undo: angre view: Vis view_item: vis %{item} + visit_record_on_external_path: Besøk posten via ein ekstern lenke was_successfully_created: vart oppretta was_successfully_updated: vart oppdatert x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.pl.yml b/lib/generators/avo/templates/locales/avo.pl.yml index b698d73f62..fb518f243f 100644 --- a/lib/generators/avo/templates/locales/avo.pl.yml +++ b/lib/generators/avo/templates/locales/avo.pl.yml @@ -113,6 +113,7 @@ pl: undo: Cofnij view: Widok view_item: Wyświetl %{item} + visit_record_on_external_path: Odwiedź rekord za pomocą zewnętrznego linku was_successfully_created: został pomyślnie utworzony was_successfully_updated: został pomyślnie zaktualizowany x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.pt-BR.yml b/lib/generators/avo/templates/locales/avo.pt-BR.yml index fcc6a1c650..57ff17624f 100644 --- a/lib/generators/avo/templates/locales/avo.pt-BR.yml +++ b/lib/generators/avo/templates/locales/avo.pt-BR.yml @@ -113,6 +113,7 @@ pt-BR: undo: desfazer view: Visualizar view_item: visualizar %{item} + visit_record_on_external_path: Visitar registro através de link externo was_successfully_created: foi criado com sucesso was_successfully_updated: foi atualizado com sucesso x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.pt.yml b/lib/generators/avo/templates/locales/avo.pt.yml index f61de9cd3b..f13972cbff 100644 --- a/lib/generators/avo/templates/locales/avo.pt.yml +++ b/lib/generators/avo/templates/locales/avo.pt.yml @@ -113,6 +113,7 @@ pt: undo: desfazer view: Ver view_item: ver %{item} + visit_record_on_external_path: Visitar registro através de link externo was_successfully_created: foi criado com sucesso was_successfully_updated: foi atualizado com sucesso x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.ro.yml b/lib/generators/avo/templates/locales/avo.ro.yml index d1aa5e733d..85c446308c 100644 --- a/lib/generators/avo/templates/locales/avo.ro.yml +++ b/lib/generators/avo/templates/locales/avo.ro.yml @@ -115,6 +115,7 @@ ro: undo: Anulează view: vezi view_item: vezi %{item} + visit_record_on_external_path: Vizitați înregistrarea printr-un link extern was_successfully_created: a fost creat was_successfully_updated: a fost actualizat x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.ru.yml b/lib/generators/avo/templates/locales/avo.ru.yml index 1c0703a258..231b810087 100644 --- a/lib/generators/avo/templates/locales/avo.ru.yml +++ b/lib/generators/avo/templates/locales/avo.ru.yml @@ -113,6 +113,7 @@ ru: undo: Отменить view: Просмотр view_item: Просмотр %{item} + visit_record_on_external_path: Перейти к записи через внешнюю ссылку was_successfully_created: успешно создана was_successfully_updated: успешно обновлена x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.tr.yml b/lib/generators/avo/templates/locales/avo.tr.yml index 1db265e5ca..836e48383c 100644 --- a/lib/generators/avo/templates/locales/avo.tr.yml +++ b/lib/generators/avo/templates/locales/avo.tr.yml @@ -113,6 +113,7 @@ tr: undo: geri al view: Görünüm view_item: "%{item} öğresini görüntüle" + visit_record_on_external_path: Harici bağlantı yoluyla kaydı ziyaret et was_successfully_created: başarıyla oluşturuldu was_successfully_updated: başarıyla güncellendi x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.uk.yml b/lib/generators/avo/templates/locales/avo.uk.yml index fadc18a74c..1b7a1b29f9 100644 --- a/lib/generators/avo/templates/locales/avo.uk.yml +++ b/lib/generators/avo/templates/locales/avo.uk.yml @@ -113,6 +113,7 @@ uk: undo: Скасувати view: Перегляд view_item: Перегляд %{item} + visit_record_on_external_path: Перейти до запису через зовнішнє посилання was_successfully_created: успішно створено was_successfully_updated: успішно оновлено x_items_more: diff --git a/lib/generators/avo/templates/locales/avo.zh.yml b/lib/generators/avo/templates/locales/avo.zh.yml index aeabdae42c..edbd796455 100644 --- a/lib/generators/avo/templates/locales/avo.zh.yml +++ b/lib/generators/avo/templates/locales/avo.zh.yml @@ -111,6 +111,7 @@ zh: undo: 撤销 view: 查看 view_item: 查看 %{item} + visit_record_on_external_path: 通过外部链接访问记录 was_successfully_created: 创建成功 was_successfully_updated: 更新成功 x_items_more: