Skip to content

Commit ab76984

Browse files
myabcclaude
andcommitted
Make datepicker_options optional
Default `datepicker_options` to `{}` in `SingleDatePickerInput` (inherited by `RangeDatePickerInput`), and remove now-redundant empty hash arguments from callsites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 67cdb49 commit ab76984

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

lib/primer/open_project/forms/dsl/single_date_picker_input.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module Dsl
3535
class SingleDatePickerInput < Primer::Forms::Dsl::TextFieldInput
3636
attr_reader :datepicker_options
3737

38-
def initialize(name:, label:, datepicker_options:, **system_arguments)
38+
def initialize(name:, label:, datepicker_options: {}, **system_arguments)
3939
@datepicker_options = derive_datepicker_options(datepicker_options)
4040

4141
super(name:, label:, **system_arguments)

modules/backlogs/app/forms/backlogs/backlog_header_form.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,14 @@ class BacklogHeaderForm < ApplicationForm
4848
label: attribute_name(:start_date),
4949
placeholder: attribute_name(:start_date),
5050
visually_hide_label: true,
51-
leading_visual: { icon: :calendar },
52-
datepicker_options: {}
51+
leading_visual: { icon: :calendar }
5352
)
5453
dates.single_date_picker(
5554
name: :effective_date,
5655
label: attribute_name(:effective_date),
5756
placeholder: attribute_name(:effective_date),
5857
visually_hide_label: true,
59-
leading_visual: { icon: :calendar },
60-
datepicker_options: {}
58+
leading_visual: { icon: :calendar }
6159
)
6260
end
6361

spec/lib/primer/open_project/forms/dsl/input_methods_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,14 @@
226226
end
227227

228228
describe "#single_date_picker" do
229-
let(:field_group) { form_dsl.single_date_picker(name:, label:, datepicker_options: {}, **options) }
229+
let(:field_group) { form_dsl.single_date_picker(name:, label:, **options) }
230230

231231
include_examples "input class", Primer::OpenProject::Forms::Dsl::SingleDatePickerInput
232232
it_behaves_like "supporting help texts"
233233
end
234234

235235
describe "#range_date_picker" do
236-
let(:field_group) { form_dsl.range_date_picker(name:, label:, datepicker_options: {}, **options) }
236+
let(:field_group) { form_dsl.range_date_picker(name:, label:, **options) }
237237

238238
include_examples "input class", Primer::OpenProject::Forms::Dsl::RangeDatePickerInput
239239
it_behaves_like "supporting help texts"

0 commit comments

Comments
 (0)