Skip to content

Commit

Permalink
Merge pull request #196 from opf/test/ci
Browse files Browse the repository at this point in the history
Change model default for editable PageHeader title
  • Loading branch information
HDinger authored Oct 24, 2024
2 parents 01ce364 + 40b8fda commit a18340c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-pants-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openproject/primer-view-components': patch
---

Change default for model in PageHeader title form to "false"
2 changes: 1 addition & 1 deletion app/components/primer/open_project/page_header/title.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion test/components/primer/open_project/page_header_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a18340c

Please sign in to comment.