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

Add on-off status component for testing our own component paths

Oliver Günther5bf20ec45b57
diff --git a/spec/components/previews/on_off_status_component_preview.rb b/spec/components/previews/on_off_status_component_preview.rb
new file mode 100644
index 00000000000..5074844e620
--- /dev/null
+++ b/spec/components/previews/on_off_status_component_preview.rb
@@ -0,0 +1,23 @@
+# @logical_path OpenProject
+# @label On-Off status
+class OnOffStatusComponentPreview < Lookbook::Preview
+ def default
+ render ::Components::OnOffStatusComponent.new({
+ is_on: true,
+ on_text: 'Is enabled',
+ on_description: 'Text when enabled',
+ off_text: 'Is disabled',
+ off_description: 'Text when disabled'
+ })
+ end
+
+ def off
+ render ::Components::OnOffStatusComponent.new({
+ is_on: false,
+ on_text: 'Is enabled',
+ on_description: 'Text when enabled',
+ off_text: 'Is disabled',
+ off_description: 'Text when disabled'
+ })
+ end
+end