From 40b8fdaaa49c5a27d44a46f36b5d76106822baed Mon Sep 17 00:00:00 2001 From: Henriette Darge Date: Thu, 24 Oct 2024 08:46:59 +0200 Subject: [PATCH] Change model default to get CI green --- .changeset/fast-pants-rhyme.md | 5 +++++ app/components/primer/open_project/page_header/title.rb | 2 +- test/components/primer/open_project/page_header_test.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/fast-pants-rhyme.md diff --git a/.changeset/fast-pants-rhyme.md b/.changeset/fast-pants-rhyme.md new file mode 100644 index 0000000000..18afee7f62 --- /dev/null +++ b/.changeset/fast-pants-rhyme.md @@ -0,0 +1,5 @@ +--- +'@openproject/primer-view-components': patch +--- + +Change default for model in PageHeader title form to "false" diff --git a/app/components/primer/open_project/page_header/title.rb b/app/components/primer/open_project/page_header/title.rb index 137af246ec..53fb5f9b17 100644 --- a/app/components/primer/open_project/page_header/title.rb +++ b/app/components/primer/open_project/page_header/title.rb @@ -11,7 +11,7 @@ class Title < Primer::Component HEADING_TAG_OPTIONS = [:h1, :h2, :h3, :h4, :h5, :h6].freeze HEADING_TAG_FALLBACK = :h1 - renders_one :editable_form, lambda { |model: nil, update_path:, cancel_path:, input_name: :title, method: :put, label: I18n.t(:label_title), placeholder: I18n.t(:label_title), **system_arguments| + renders_one :editable_form, lambda { |model: false, update_path:, cancel_path:, input_name: :title, method: :put, label: I18n.t(:label_title), placeholder: I18n.t(:label_title), **system_arguments| primer_form_with( model: model, method: method, diff --git a/test/components/primer/open_project/page_header_test.rb b/test/components/primer/open_project/page_header_test.rb index f6191d1a62..b54e154441 100644 --- a/test/components/primer/open_project/page_header_test.rb +++ b/test/components/primer/open_project/page_header_test.rb @@ -251,7 +251,7 @@ def test_renders_segmented_control def test_renders_editable_title render_inline(Primer::OpenProject::PageHeader.new(state: :edit)) do |header| header.with_title do |title| - title.with_editable_form(model: nil, update_path: "/foo", cancel_path: "/bar") + title.with_editable_form(update_path: "/foo", cancel_path: "/bar") "Hello" end