diff --git a/Gemfile b/Gemfile index 6326757..05bef0a 100644 --- a/Gemfile +++ b/Gemfile @@ -18,8 +18,6 @@ gem "turbo-rails" gem "stimulus-rails" # Build JSON APIs with ease [https://github.com/rails/jbuilder] gem "jbuilder" -# Avo Community -gem "avo", ">= 3.2.1" # PaperTrail for auditing gem "paper_trail" # Handle CORS (Cross-Origin Resource Sharing) @@ -121,5 +119,3 @@ group :test do gem "capybara" gem "selenium-webdriver" end - -gem "avo-record_link_field", "~> 0.0.2" diff --git a/Gemfile.lock b/Gemfile.lock index 83ecf41..f2c0dea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,9 +62,6 @@ GEM erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - active_link_to (1.0.5) - actionpack - addressable activejob (8.0.2) activesupport (= 8.0.2) globalid (>= 0.3.6) @@ -102,24 +99,6 @@ GEM device_detector (>= 1) safely_block (>= 0.4) ast (2.4.2) - avo (3.20.1) - actionview (>= 6.1) - active_link_to - activerecord (>= 6.1) - activesupport (>= 6.1) - addressable - avo-heroicons (>= 0.1.1) - 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) - avo-heroicons (0.1.1) - avo-record_link_field (0.0.2) base64 (0.2.0) bcrypt_pbkdf (1.1.1) bcrypt_pbkdf (1.1.1-arm64-darwin) @@ -157,7 +136,6 @@ GEM irb (~> 1.10) reline (>= 0.3.8) device_detector (1.1.3) - docile (1.4.1) domain_name (0.6.20240107) dotenv (3.1.8) dotenv-rails (3.1.8) @@ -231,9 +209,6 @@ GEM actionpack (>= 6.0.0) activesupport (>= 6.0.0) railties (>= 6.0.0) - inline_svg (1.10.0) - activesupport (>= 3.0) - nokogiri (>= 1.6) io-console (0.8.0) irb (1.15.2) pp (>= 0.6.0) @@ -282,8 +257,6 @@ GEM marcel (1.0.4) matrix (0.4.2) memory_profiler (1.1.0) - meta-tags (2.22.1) - actionpack (>= 6.0.0, < 8.1) method_source (1.1.0) mini_mime (1.1.5) minitest (5.25.5) @@ -339,8 +312,6 @@ GEM pp (0.6.2) prettyprint prettyprint (0.2.0) - prop_initializer (0.2.0) - zeitwerk (>= 2.6.18) propshaft (1.1.0) actionpack (>= 7.0.0) activesupport (>= 7.0.0) @@ -500,8 +471,6 @@ GEM turbo-rails (2.0.13) actionpack (>= 7.1.0) railties (>= 7.1.0) - turbo_power (0.7.0) - turbo-rails (>= 1.3.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unaccent (0.4.0) @@ -545,8 +514,6 @@ DEPENDENCIES activerecord-import ahoy_captain! ahoy_matey - avo (>= 3.2.1) - avo-record_link_field (~> 0.0.2) bootsnap brakeman bullet diff --git a/app/avo/actions/.keep b/app/avo/actions/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/app/avo/resources/api_key.rb b/app/avo/resources/api_key.rb deleted file mode 100644 index ee6b9b7..0000000 --- a/app/avo/resources/api_key.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Avo::Resources::ApiKey < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - def fields - field :id, as: :id - field :user, as: :text - field :name, as: :textarea - field :token, as: :textarea - end -end diff --git a/app/avo/resources/commit.rb b/app/avo/resources/commit.rb deleted file mode 100644 index ef8aded..0000000 --- a/app/avo/resources/commit.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Avo::Resources::Commit < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - def fields - field :id, as: :id - field :sha, as: :text - field :user, as: :belongs_to - field :github_raw, as: :code - end -end diff --git a/app/avo/resources/heartbeat.rb b/app/avo/resources/heartbeat.rb deleted file mode 100644 index c8d6692..0000000 --- a/app/avo/resources/heartbeat.rb +++ /dev/null @@ -1,27 +0,0 @@ -class Avo::Resources::Heartbeat < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - def fields - field :id, as: :id - field :user, as: :text - field :entity, as: :textarea - field :type, as: :textarea - field :category, as: :text - field :time, as: :number - field :project, as: :text - field :project_root_count, as: :number - field :branch, as: :text - field :language, as: :text - field :dependencies, as: :text - field :lines, as: :number - field :line_additions, as: :number - field :line_deletions, as: :number - field :lineno, as: :number - field :cursorpos, as: :number - field :is_write, as: :boolean - end -end diff --git a/app/avo/resources/leaderboard.rb b/app/avo/resources/leaderboard.rb deleted file mode 100644 index e1ff07d..0000000 --- a/app/avo/resources/leaderboard.rb +++ /dev/null @@ -1,16 +0,0 @@ -class Avo::Resources::Leaderboard < Avo::BaseResource - def fields - field :id, as: :id - field :start_date, as: :date - field :finished_generating_at, as: :date_time - field :has_generated, as: :boolean do - record.finished_generating_at.present? - end - field :entries_count, as: :number do - record.entries.count - end - field :deleted, as: :boolean do - record.deleted_at.present? - end - end -end diff --git a/app/avo/resources/project_repo_mapping.rb b/app/avo/resources/project_repo_mapping.rb deleted file mode 100644 index 3752f19..0000000 --- a/app/avo/resources/project_repo_mapping.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Avo::Resources::ProjectRepoMapping < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - def fields - field :id, as: :id - field :user, as: :belongs_to - field :project_name, as: :text - field :repo_url, as: :text - end -end diff --git a/app/avo/resources/repo_host_event.rb b/app/avo/resources/repo_host_event.rb deleted file mode 100644 index 484f9fa..0000000 --- a/app/avo/resources/repo_host_event.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Avo::Resources::RepoHostEvent < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - def fields - field :id, as: :id - field :user, as: :belongs_to - field :raw_event_payload, as: :code - field :provider, as: :number - end -end diff --git a/app/avo/resources/sailors_log.rb b/app/avo/resources/sailors_log.rb deleted file mode 100644 index d3e163f..0000000 --- a/app/avo/resources/sailors_log.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Avo::Resources::SailorsLog < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - def fields - field :id, as: :id - field :slack_uid, as: :text - field :projects_summary, as: :textarea - end -end diff --git a/app/avo/resources/sailors_log_leaderboard.rb b/app/avo/resources/sailors_log_leaderboard.rb deleted file mode 100644 index f3415de..0000000 --- a/app/avo/resources/sailors_log_leaderboard.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Avo::Resources::SailorsLogLeaderboard < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - def fields - field :id, as: :id - field :slack_channel_id, as: :text - field :slack_uid, as: :text - field :message, as: :textarea, placeholder: "Generating..." - end -end diff --git a/app/avo/resources/sailors_log_notification_preference.rb b/app/avo/resources/sailors_log_notification_preference.rb deleted file mode 100644 index 7bf66eb..0000000 --- a/app/avo/resources/sailors_log_notification_preference.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Avo::Resources::SailorsLogNotificationPreference < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - def fields - field :id, as: :id - field :slack_uid, as: :text - field :enabled, as: :boolean - field :slack_channel_id, as: :text - end -end diff --git a/app/avo/resources/sailors_log_slack_notification.rb b/app/avo/resources/sailors_log_slack_notification.rb deleted file mode 100644 index c70200b..0000000 --- a/app/avo/resources/sailors_log_slack_notification.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Avo::Resources::SailorsLogSlackNotification < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - def fields - field :id, as: :id - field :slack_uid, as: :text - field :slack_channel_id, as: :text - field :project_name, as: :text - end -end diff --git a/app/avo/resources/user.rb b/app/avo/resources/user.rb deleted file mode 100644 index d6559ea..0000000 --- a/app/avo/resources/user.rb +++ /dev/null @@ -1,18 +0,0 @@ -class Avo::Resources::User < Avo::BaseResource - self.title = :email - self.includes = [] - - def fields - field :id, as: :id - field :email, as: :text - field :username, as: :text - field :slack_uid, as: :text - field :is_admin, as: :boolean - field :created_at, as: :date_time, readonly: true - field :slack_scopes - field :uses_slack_status, as: :boolean - - # Show versions/history in the show page - field :versions, as: :has_many - end -end diff --git a/app/avo/resources/version.rb b/app/avo/resources/version.rb deleted file mode 100644 index ee61856..0000000 --- a/app/avo/resources/version.rb +++ /dev/null @@ -1,20 +0,0 @@ -class Avo::Resources::Version < Avo::BaseResource - # self.includes = [] - # self.attachments = [] - # self.search = { - # query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) } - # } - - self.model_class = PaperTrail::Version - - def fields - field :id, as: :id - field :item_type, as: :text - field :item_id, as: :number - field :event, as: :text - field :whodunnit, as: :text - field :user, as: :record_link - field :object, as: :code - field :created_at, as: :date_time - end -end diff --git a/app/controllers/avo/api_keys_controller.rb b/app/controllers/avo/api_keys_controller.rb deleted file mode 100644 index 2a56ee8..0000000 --- a/app/controllers/avo/api_keys_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::ApiKeysController < Avo::ResourcesController -end diff --git a/app/controllers/avo/commits_controller.rb b/app/controllers/avo/commits_controller.rb deleted file mode 100644 index 50e00c9..0000000 --- a/app/controllers/avo/commits_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::CommitsController < Avo::ResourcesController -end diff --git a/app/controllers/avo/heartbeats_controller.rb b/app/controllers/avo/heartbeats_controller.rb deleted file mode 100644 index e8b5942..0000000 --- a/app/controllers/avo/heartbeats_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::HeartbeatsController < Avo::ResourcesController -end diff --git a/app/controllers/avo/leaderboards_controller.rb b/app/controllers/avo/leaderboards_controller.rb deleted file mode 100644 index 1219830..0000000 --- a/app/controllers/avo/leaderboards_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::LeaderboardsController < Avo::ResourcesController -end diff --git a/app/controllers/avo/project_repo_mappings_controller.rb b/app/controllers/avo/project_repo_mappings_controller.rb deleted file mode 100644 index d68bcdf..0000000 --- a/app/controllers/avo/project_repo_mappings_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::ProjectRepoMappingsController < Avo::ResourcesController -end diff --git a/app/controllers/avo/repo_host_events_controller.rb b/app/controllers/avo/repo_host_events_controller.rb deleted file mode 100644 index 05216c9..0000000 --- a/app/controllers/avo/repo_host_events_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::RepoHostEventsController < Avo::ResourcesController -end diff --git a/app/controllers/avo/sailors_log_leaderboards_controller.rb b/app/controllers/avo/sailors_log_leaderboards_controller.rb deleted file mode 100644 index d425e0d..0000000 --- a/app/controllers/avo/sailors_log_leaderboards_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::SailorsLogLeaderboardsController < Avo::ResourcesController -end diff --git a/app/controllers/avo/sailors_log_notification_preferences_controller.rb b/app/controllers/avo/sailors_log_notification_preferences_controller.rb deleted file mode 100644 index 216255c..0000000 --- a/app/controllers/avo/sailors_log_notification_preferences_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::SailorsLogNotificationPreferencesController < Avo::ResourcesController -end diff --git a/app/controllers/avo/sailors_log_slack_notifications_controller.rb b/app/controllers/avo/sailors_log_slack_notifications_controller.rb deleted file mode 100644 index 867da5c..0000000 --- a/app/controllers/avo/sailors_log_slack_notifications_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::SailorsLogSlackNotificationsController < Avo::ResourcesController -end diff --git a/app/controllers/avo/sailors_logs_controller.rb b/app/controllers/avo/sailors_logs_controller.rb deleted file mode 100644 index 5174c30..0000000 --- a/app/controllers/avo/sailors_logs_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::SailorsLogsController < Avo::ResourcesController -end diff --git a/app/controllers/avo/users_controller.rb b/app/controllers/avo/users_controller.rb deleted file mode 100644 index a9987c6..0000000 --- a/app/controllers/avo/users_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::UsersController < Avo::ResourcesController -end diff --git a/app/controllers/avo/versions_controller.rb b/app/controllers/avo/versions_controller.rb deleted file mode 100644 index 31b3bfb..0000000 --- a/app/controllers/avo/versions_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# This controller has been generated to enable Rails' resource routes. -# More information on https://docs.avohq.io/3.0/controllers.html -class Avo::VersionsController < Avo::ResourcesController -end diff --git a/app/views/shared/_nav.html.erb b/app/views/shared/_nav.html.erb index 7dce7ec..291a528 100644 --- a/app/views/shared/_nav.html.erb +++ b/app/views/shared/_nav.html.erb @@ -77,11 +77,6 @@ Ahoy Captain <% end %> <% end %> - <% admin_tool(nil, "li") do %> - <%= link_to avo_path, class: "nav-item #{current_page?(avo_path) ? 'active' : ''}" do %> - Avo - <% end %> - <% end %> <% admin_tool(nil, "li") do %> <%= link_to good_job_path, class: "nav-item #{current_page?(good_job_path) ? 'active' : ''}" do %> GoodJob diff --git a/config/initializers/avo.rb b/config/initializers/avo.rb deleted file mode 100644 index 2959095..0000000 --- a/config/initializers/avo.rb +++ /dev/null @@ -1,175 +0,0 @@ -# For more information regarding these settings check out our docs https://docs.avohq.io -# The values disaplayed here are the default ones. Uncomment and change them to fit your needs. -Avo.configure do |config| - ## == Routing == - config.root_path = "/avo" - # used only when you have custom `map` configuration in your config.ru - # config.prefix_path = "/internal" - - # Sometimes you might want to mount Avo's engines yourself. - # https://docs.avohq.io/3.0/routing.html - # config.mount_avo_engines = true - - # Where should the user be redirected when visiting the `/avo` url - # config.home_path = nil - - ## == Licensing == - # config.license_key = ENV['AVO_LICENSE_KEY'] - - ## == Set the context == - config.set_context do - # Return a context object that gets evaluated within Avo::ApplicationController - end - - ## == Authentication == - # Ensure user is signed in and is an admin - config.authenticate_with do |controller| - user = User.find_by(id: controller.session[:user_id]) - if !user - controller.redirect_to "/", alert: "Please sign in first" - elsif !user.admin? - controller.redirect_to "/", alert: "Not authorized" - end - end - - # Set current user for auditing/tracking - config.current_user = proc do |request| - User.find_by(id: request.session[:user_id]) - end - - ## == Authorization == - # config.is_admin_method = :is_admin - # config.is_developer_method = :is_developer - # config.authorization_methods = { - # index: 'index?', - # show: 'show?', - # edit: 'edit?', - # new: 'new?', - # update: 'update?', - # create: 'create?', - # destroy: 'destroy?', - # search: 'search?', - # } - # config.raise_error_on_missing_policy = false - config.authorization_client = nil - config.explicit_authorization = true - - ## == Localization == - # config.locale = 'en-US' - - ## == Resource options == - # config.resource_row_controls_config = { - # placement: :right, - # float: false, - # show_on_hover: false - # }.freeze - # config.model_resource_mapping = {} - # config.default_view_type = :table - # config.per_page = 24 - # config.per_page_steps = [12, 24, 48, 72] - # config.via_per_page = 8 - # config.id_links_to_resource = false - # config.pagination = -> do - # { - # type: :default, - # size: 9, # `[1, 2, 2, 1]` for pagy < 9.0 - # } - # end - - ## == Response messages dismiss time == - # config.alert_dismiss_time = 5000 - - - ## == Number of search results to display == - # config.search_results_count = 8 - - ## == Associations lookup list limit == - # config.associations_lookup_list_limit = 1000 - - ## == Cache options == - ## Provide a lambda to customize the cache store used by Avo. - ## We compute the cache store by default, this is NOT the default, just an example. - # config.cache_store = -> { - # ActiveSupport::Cache.lookup_store(:solid_cache_store) - # } - # config.cache_resources_on_index_view = true - - ## == Turbo options == - # config.turbo = -> do - # { - # instant_click: true - # } - # end - - ## == Logger == - # config.logger = -> { - # file_logger = ActiveSupport::Logger.new(Rails.root.join("log", "avo.log")) - # - # file_logger.datetime_format = "%Y-%m-%d %H:%M:%S" - # file_logger.formatter = proc do |severity, time, progname, msg| - # "[Avo] #{time}: #{msg}\n".tap do |i| - # puts i - # end - # end - # - # file_logger - # } - - ## == Customization == - config.click_row_to_view_record = true - # config.app_name = 'Avocadelicious' - # config.timezone = 'UTC' - # config.currency = 'USD' - # config.hide_layout_when_printing = false - # config.full_width_container = false - # config.full_width_index_view = false - # config.search_debounce = 300 - # config.view_component_path = "app/components" - # config.display_license_request_timeout_error = true - # config.disabled_features = [] - # config.buttons_on_form_footers = true - # config.field_wrapper_layout = true - # config.resource_parent_controller = "Avo::ResourcesController" - # config.first_sorting_option = :desc # :desc or :asc - # config.exclude_from_status = [] - - ## == Branding == - # config.branding = { - # colors: { - # background: "248 246 242", - # 100 => "#CEE7F8", - # 400 => "#399EE5", - # 500 => "#0886DE", - # 600 => "#066BB2", - # }, - # chart_colors: ["#0B8AE2", "#34C683", "#2AB1EE", "#34C6A8"], - # logo: "/avo-assets/logo.png", - # logomark: "/avo-assets/logomark.png", - # placeholder: "/avo-assets/placeholder.svg", - # favicon: "/avo-assets/favicon.ico" - # } - - ## == Breadcrumbs == - # config.display_breadcrumbs = true - # config.set_initial_breadcrumbs do - # add_breadcrumb "Home", '/avo' - # end - - ## == Menus == - # config.main_menu = -> { - # section "Dashboards", icon: "avo/dashboards" do - # all_dashboards - # end - - # section "Resources", icon: "avo/resources" do - # all_resources - # end - - # section "Tools", icon: "avo/tools" do - # all_tools - # end - # } - # config.profile_menu = -> { - # link "Profile", path: "/avo/profile", icon: "heroicons/outline/user-circle" - # } -end diff --git a/config/initializers/monkey_patches.rb b/config/initializers/monkey_patches.rb index 75e9019..9a50640 100644 --- a/config/initializers/monkey_patches.rb +++ b/config/initializers/monkey_patches.rb @@ -1,13 +1,6 @@ # 🔧🐒 Rails.configuration.to_prepare do - Avo::BaseApplicationController.class_eval do - before_action :set_paper_trail_whodunnit - def user_for_paper_trail - Avo::Current.user&.id - end - end - PaperTrail::Version.class_eval do def user begin diff --git a/config/routes.rb b/config/routes.rb index 8e7464d..2fb4e3b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,6 @@ end Rails.application.routes.draw do constraints AdminConstraint do - mount Avo::Engine, at: Avo.configuration.root_path mount GoodJob::Engine => "good_job" mount AhoyCaptain::Engine => "/ahoy_captain" diff --git a/config/skylight.yml b/config/skylight.yml index 26f1b67..0e7778d 100644 --- a/config/skylight.yml +++ b/config/skylight.yml @@ -9,7 +9,6 @@ ignored_endpoints: - Api::Hackatime::V1::HackatimeController#push_heartbeats - Api::Hackatime::V1::HackatimeController#status_bar_today - Api::V1::StatsController#user_stats - - Avo::ApiKeysController#index - Rails::HealthController#show - AhoyCaptain::StatsController#show - ActionDispatch::Routing::RouteSet#*