Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

chore(View Components): Rename base class to `ApplicationComponent`

Kabiru Mwenjad11800427cc4
diff --git a/app/components/rails_component.rb b/app/components/application_component.rb
similarity index 97%
rename from app/components/rails_component.rb
rename to app/components/application_component.rb
index fe49cecf32e..74c860c1266 100644
--- a/app/components/rails_component.rb
+++ b/app/components/application_component.rb
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-class RailsComponent < ViewComponent::Base
+class ApplicationComponent < ViewComponent::Base
attr_reader :model, :options
def initialize(model = nil, **options)
diff --git a/app/components/components/on_off_status_component.rb b/app/components/components/on_off_status_component.rb
index 5b6fd051afa..20b56fac14b 100644
--- a/app/components/components/on_off_status_component.rb
+++ b/app/components/components/on_off_status_component.rb
@@ -31,7 +31,7 @@
module Components
##
# A language switch and text area for updating a localized text setting.
- class OnOffStatusComponent < ::RailsComponent
+ class OnOffStatusComponent < ::ApplicationComponent
options :on_text
options :on_description
options :off_text
diff --git a/app/components/individual_principal_base_filter_component.rb b/app/components/individual_principal_base_filter_component.rb
index 559e8e3c029..c8b80f07256 100644
--- a/app/components/individual_principal_base_filter_component.rb
+++ b/app/components/individual_principal_base_filter_component.rb
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-class IndividualPrincipalBaseFilterComponent < RailsComponent
+class IndividualPrincipalBaseFilterComponent < ApplicationComponent
class << self
def query(params)
q = base_query.new
diff --git a/app/components/members/role_form_component.rb b/app/components/members/role_form_component.rb
index 81d63245359..c0c7a15666f 100644
--- a/app/components/members/role_form_component.rb
+++ b/app/components/members/role_form_component.rb
@@ -29,7 +29,7 @@
#++
module Members
- class RoleFormComponent < ::RailsComponent
+ class RoleFormComponent < ::ApplicationComponent
options :row, :params, :roles
def member
diff --git a/app/components/row_component.rb b/app/components/row_component.rb
index af30516b38d..d5578daa524 100644
--- a/app/components/row_component.rb
+++ b/app/components/row_component.rb
@@ -30,7 +30,7 @@
##
# Abstract view component. Subclass this for a concrete table row.
-class RowComponent < RailsComponent
+class RowComponent < ApplicationComponent
attr_reader :table
def initialize(row:, table:, **options)
diff --git a/app/components/settings/numeric_setting_component.rb b/app/components/settings/numeric_setting_component.rb
index 4658e00012f..09ba3da0a4f 100644
--- a/app/components/settings/numeric_setting_component.rb
+++ b/app/components/settings/numeric_setting_component.rb
@@ -31,7 +31,7 @@
module Settings
##
# A text field to enter numeric values.
- class NumericSettingComponent < ::RailsComponent
+ class NumericSettingComponent < ::ApplicationComponent
options :unit, :title
options size: 3
diff --git a/app/components/settings/text_setting_component.rb b/app/components/settings/text_setting_component.rb
index a49c3723b4e..05efe5c2f0f 100644
--- a/app/components/settings/text_setting_component.rb
+++ b/app/components/settings/text_setting_component.rb
@@ -31,7 +31,7 @@
module Settings
##
# A language switch and text area for updating a localized text setting.
- class TextSettingComponent < ::RailsComponent
+ class TextSettingComponent < ::ApplicationComponent
include OpenProject::FormTagHelper
options :name # name of setting and tag to differentiate between different language selects
diff --git a/app/components/settings/time_zone_setting_component.rb b/app/components/settings/time_zone_setting_component.rb
index c38027834c9..fe052d702bf 100644
--- a/app/components/settings/time_zone_setting_component.rb
+++ b/app/components/settings/time_zone_setting_component.rb
@@ -31,7 +31,7 @@
module Settings
##
# A text field to enter numeric values.
- class TimeZoneSettingComponent < ::RailsComponent
+ class TimeZoneSettingComponent < ::ApplicationComponent
options :form, :title
options container_class: "-wide"
options include_blank: true
diff --git a/app/components/table_component.rb b/app/components/table_component.rb
index 3f0cc4392cb..b1052e5775d 100644
--- a/app/components/table_component.rb
+++ b/app/components/table_component.rb
@@ -30,7 +30,7 @@
##
# Abstract view component. Subclass this for a concrete table.
-class TableComponent < RailsComponent
+class TableComponent < ApplicationComponent
def initialize(rows: [], **options)
super(rows, **options)
end
diff --git a/modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.rb b/modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.rb
index ed12c33b4f4..36b3b2259a1 100644
--- a/modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.rb
+++ b/modules/webhooks/app/components/webhooks/outgoing/deliveries/response_component.rb
@@ -1,7 +1,7 @@
module ::Webhooks
module Outgoing
module Deliveries
- class ResponseComponent < RailsComponent
+ class ResponseComponent < ApplicationComponent
property :id
property :response_headers
property :response_body