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

Begin documenting WidgetComponent

Alexander Brandon Colesb616a9ceb804
diff --git a/modules/grids/app/components/grids/widget_component.rb b/modules/grids/app/components/grids/widget_component.rb
index 08190134c09..154685f069a 100644
--- a/modules/grids/app/components/grids/widget_component.rb
+++ b/modules/grids/app/components/grids/widget_component.rb
@@ -29,6 +29,10 @@
#++
module Grids
+ ##
+ # An abstract base class for all Rails-rendered grid widgets.
+ #
+ # @abstract Subclass and implement {#title} to create a new widget.
class WidgetComponent < Primer::BaseComponent
extend Dry::Initializer
@@ -37,8 +41,10 @@ module Grids
option :current_user, default: -> { User.current }
+ # @abstract Subclasses must implement this method.
+ # @return [String] a title suitable for display to users.
def title
- raise NotImplementedError
+ raise NotImplementedError, "#{self.class} must implement #{__method__}"
end
def widget_wrapper(**, &)