avo 2.7.0 → 2.7.1.pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/app/assets/builds/action_cable.js +2 -0
- data/app/assets/builds/action_cable.js.map +7 -0
- data/app/assets/builds/avo.css +9610 -0
- data/app/assets/builds/avo.js +512 -0
- data/app/assets/builds/avo.js.map +7 -0
- data/app/assets/svgs/download-solid-reversed.svg +2 -2
- data/app/controllers/avo/cards_controller.rb +25 -0
- data/app/controllers/avo/dashboards_controller.rb +2 -8
- data/app/controllers/avo/home_controller.rb +8 -1
- data/app/views/avo/{dashboards → cards}/_chartkick_card.html.erb +0 -0
- data/app/views/avo/{dashboards → cards}/_metric_card.html.erb +0 -0
- data/app/views/avo/{dashboards/card.html.erb → cards/show.html.erb} +0 -0
- data/config/routes.rb +6 -3
- data/lib/avo/version.rb +1 -1
- metadata +13 -7
| @@ -1,3 +1,3 @@ | |
| 1 | 
            -
            <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" | 
| 2 | 
            -
              <path fill-rule="evenodd" d="M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd" />
         | 
| 1 | 
            +
            <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
         | 
| 2 | 
            +
              <path fill-rule="evenodd" d="M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd" transform="rotate(-180 10 10)" />
         | 
| 3 3 | 
             
            </svg>
         | 
| @@ -0,0 +1,25 @@ | |
| 1 | 
            +
            require_dependency "avo/application_controller"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Avo
         | 
| 4 | 
            +
              class CardsController < ApplicationController
         | 
| 5 | 
            +
                before_action :set_dashboard, only: :show
         | 
| 6 | 
            +
                before_action :set_card, only: :show
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                def show
         | 
| 9 | 
            +
                end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                private
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                def set_dashboard
         | 
| 14 | 
            +
                  @dashboard = Avo::App.get_dashboard_by_id params[:dashboard_id]
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                  raise ActionController::RoutingError.new("Not Found") if @dashboard.nil? || @dashboard.is_hidden?
         | 
| 17 | 
            +
                end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                def set_card
         | 
| 20 | 
            +
                  @card = @dashboard.item_at_index(params[:index].to_i).tap do |card|
         | 
| 21 | 
            +
                    card.hydrate(dashboard: @dashboard, params: params)
         | 
| 22 | 
            +
                  end
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
            end
         | 
| @@ -2,21 +2,15 @@ require_dependency "avo/application_controller" | |
| 2 2 |  | 
| 3 3 | 
             
            module Avo
         | 
| 4 4 | 
             
              class DashboardsController < ApplicationController
         | 
| 5 | 
            -
                before_action :set_dashboard
         | 
| 5 | 
            +
                before_action :set_dashboard, only: :show
         | 
| 6 6 |  | 
| 7 7 | 
             
                def show
         | 
| 8 8 | 
             
                end
         | 
| 9 9 |  | 
| 10 | 
            -
                def card
         | 
| 11 | 
            -
                  @card = @dashboard.item_at_index(params[:index].to_i).tap do |card|
         | 
| 12 | 
            -
                    card.hydrate(dashboard: @dashboard, params: params)
         | 
| 13 | 
            -
                  end
         | 
| 14 | 
            -
                end
         | 
| 15 | 
            -
             | 
| 16 10 | 
             
                private
         | 
| 17 11 |  | 
| 18 12 | 
             
                def set_dashboard
         | 
| 19 | 
            -
                  @dashboard = Avo::App.get_dashboard_by_id params[: | 
| 13 | 
            +
                  @dashboard = Avo::App.get_dashboard_by_id params[:id]
         | 
| 20 14 |  | 
| 21 15 | 
             
                  raise ActionController::RoutingError.new("Not Found") if @dashboard.nil? || @dashboard.is_hidden?
         | 
| 22 16 | 
             
                end
         | 
| @@ -4,7 +4,14 @@ module Avo | |
| 4 4 | 
             
              class HomeController < ApplicationController
         | 
| 5 5 | 
             
                def index
         | 
| 6 6 | 
             
                  if Avo.configuration.home_path.present?
         | 
| 7 | 
            -
                     | 
| 7 | 
            +
                    # If the home_path is a block run it, if not, just use it
         | 
| 8 | 
            +
                    computed_path = if Avo.configuration.home_path.respond_to? :call
         | 
| 9 | 
            +
                      instance_exec(&Avo.configuration.home_path)
         | 
| 10 | 
            +
                    else
         | 
| 11 | 
            +
                      Avo.configuration.home_path
         | 
| 12 | 
            +
                    end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                    redirect_to computed_path
         | 
| 8 15 | 
             
                  elsif !Rails.env.development?
         | 
| 9 16 | 
             
                    @page_title = "Get started"
         | 
| 10 17 | 
             
                    resource = Avo::App.resources.min_by { |resource| resource.model_key }
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
    
        data/config/routes.rb
    CHANGED
    
    | @@ -1,11 +1,14 @@ | |
| 1 1 | 
             
            Avo::Engine.routes.draw do
         | 
| 2 2 | 
             
              root "home#index"
         | 
| 3 3 |  | 
| 4 | 
            -
              get "resources", to: redirect( | 
| 4 | 
            +
              get "resources", to: redirect(Avo.configuration.root_path)
         | 
| 5 | 
            +
              get "dashboards", to: redirect(Avo.configuration.root_path)
         | 
| 6 | 
            +
             | 
| 5 7 | 
             
              post "/rails/active_storage/direct_uploads", to: "/active_storage/direct_uploads#create"
         | 
| 6 8 |  | 
| 7 | 
            -
               | 
| 8 | 
            -
             | 
| 9 | 
            +
              resources :dashboards do
         | 
| 10 | 
            +
                resources :cards
         | 
| 11 | 
            +
              end
         | 
| 9 12 |  | 
| 10 13 | 
             
              scope "avo_api", as: "avo_api" do
         | 
| 11 14 | 
             
                get "/search", to: "search#index"
         | 
    
        data/lib/avo/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: avo
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2.7. | 
| 4 | 
            +
              version: 2.7.1.pre.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Adrian Marin
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2022-05- | 
| 12 | 
            +
            date: 2022-05-20 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: rails
         | 
| @@ -248,6 +248,11 @@ files: | |
| 248 248 | 
             
            - Gemfile.lock
         | 
| 249 249 | 
             
            - README.md
         | 
| 250 250 | 
             
            - Rakefile
         | 
| 251 | 
            +
            - app/assets/builds/action_cable.js
         | 
| 252 | 
            +
            - app/assets/builds/action_cable.js.map
         | 
| 253 | 
            +
            - app/assets/builds/avo.css
         | 
| 254 | 
            +
            - app/assets/builds/avo.js
         | 
| 255 | 
            +
            - app/assets/builds/avo.js.map
         | 
| 251 256 | 
             
            - app/assets/config/avo_manifest.js
         | 
| 252 257 | 
             
            - app/assets/stylesheets/avo.css
         | 
| 253 258 | 
             
            - app/assets/stylesheets/css/active-storage.css
         | 
| @@ -1041,6 +1046,7 @@ files: | |
| 1041 1046 | 
             
            - app/controllers/avo/associations_controller.rb
         | 
| 1042 1047 | 
             
            - app/controllers/avo/attachments_controller.rb
         | 
| 1043 1048 | 
             
            - app/controllers/avo/base_controller.rb
         | 
| 1049 | 
            +
            - app/controllers/avo/cards_controller.rb
         | 
| 1044 1050 | 
             
            - app/controllers/avo/dashboards_controller.rb
         | 
| 1045 1051 | 
             
            - app/controllers/avo/debug_controller.rb
         | 
| 1046 1052 | 
             
            - app/controllers/avo/home_controller.rb
         | 
| @@ -1099,9 +1105,9 @@ files: | |
| 1099 1105 | 
             
            - app/views/avo/base/index.html.erb
         | 
| 1100 1106 | 
             
            - app/views/avo/base/new.html.erb
         | 
| 1101 1107 | 
             
            - app/views/avo/base/show.html.erb
         | 
| 1102 | 
            -
            - app/views/avo/ | 
| 1103 | 
            -
            - app/views/avo/ | 
| 1104 | 
            -
            - app/views/avo/ | 
| 1108 | 
            +
            - app/views/avo/cards/_chartkick_card.html.erb
         | 
| 1109 | 
            +
            - app/views/avo/cards/_metric_card.html.erb
         | 
| 1110 | 
            +
            - app/views/avo/cards/show.html.erb
         | 
| 1105 1111 | 
             
            - app/views/avo/dashboards/show.html.erb
         | 
| 1106 1112 | 
             
            - app/views/avo/debug/index.html.erb
         | 
| 1107 1113 | 
             
            - app/views/avo/debug/report.html.erb
         | 
| @@ -1339,9 +1345,9 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 1339 1345 | 
             
                  version: 2.4.0
         | 
| 1340 1346 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 1341 1347 | 
             
              requirements:
         | 
| 1342 | 
            -
              - - " | 
| 1348 | 
            +
              - - ">"
         | 
| 1343 1349 | 
             
                - !ruby/object:Gem::Version
         | 
| 1344 | 
            -
                  version:  | 
| 1350 | 
            +
                  version: 1.3.1
         | 
| 1345 1351 | 
             
            requirements: []
         | 
| 1346 1352 | 
             
            rubygems_version: 3.3.3
         | 
| 1347 1353 | 
             
            signing_key: 
         |