Skip to content

Commit bdb2332

Browse files
authored
Resolves #5063: Create product drive update button styling improvements (#5161)
* change submit button class to use 'btn-success' for better visibility * comment out default button class in SimpleForm configuration * add product_drive model translation to en.yml * fix: correct button text for creating product drives * fix: remove default button class configuration in SimpleForm setup
1 parent 2abc01c commit bdb2332

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

app/views/product_drives/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</div>
4545
<!-- /.card-body -->
4646
<div class="card-footer">
47-
<%= f.button :submit, :class => 'diaper-drive-submit btn btn-primary', :id => 'product_drive_submit' %>
47+
<%= f.button :submit, :class => 'diaper-drive-submit btn btn-success', :id => 'product_drive_submit' %>
4848
</div>
4949
</div>
5050
<!-- /.card -->

config/initializers/simple_form_bootstrap.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# Use this setup block to configure all options available in SimpleForm.
1616
SimpleForm.setup do |config|
1717
# Default class for buttons
18-
config.button_class = 'btn btn-default'
1918

2019
# Define the default class of the input wrapper of the boolean input.
2120
config.boolean_label_class = 'form-check-label'

config/locales/en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ en:
3838
issued_at: "Purchase date"
3939
distribution:
4040
issued_at: "Distribution date and time"
41+
models:
42+
product_drive: "Product Drive"

spec/system/product_drive_system_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@
6262
fill_in 'Name', with: 'Normal 1'
6363
fill_in 'Start Date', with: Time.zone.today
6464
fill_in 'End Date', with: Time.zone.today + 4.hours
65-
click_button 'Create Product drive'
65+
click_button 'Create Product Drive'
6666
end.to change(ProductDrive, :count).by(1)
6767
end
6868

6969
it 'must have correct attributes' do
7070
fill_in 'Name', with: 'Normal 1'
7171
fill_in 'Start Date', with: Time.zone.today
7272
fill_in 'End Date', with: Time.zone.today + 1.day
73-
click_button 'Create Product drive'
73+
click_button 'Create Product Drive'
7474

7575
expect(ProductDrive.last).to have_attributes({ name: 'Normal 1', start_date: Time.zone.today, end_date: Time.zone.today + 1.day, virtual: false })
7676
end
@@ -79,7 +79,7 @@
7979
fill_in 'Name', with: 'Virtual 1'
8080
fill_in 'Start Date', with: Time.zone.today
8181
fill_in 'End Date', with: Time.zone.today + 4.hours
82-
click_button 'Create Product drive'
82+
click_button 'Create Product Drive'
8383

8484
expect(page.find('.alert')).to have_content('added')
8585
end
@@ -96,7 +96,7 @@
9696
fill_in 'Start Date', with: Time.zone.today
9797
fill_in 'End Date', with: Time.zone.today + 4.hours
9898
check 'virtual'
99-
click_button 'Create Product drive'
99+
click_button 'Create Product Drive'
100100
end.to change(ProductDrive, :count).by(1)
101101
end
102102

@@ -105,7 +105,7 @@
105105
fill_in 'Start Date', with: Time.zone.today
106106
fill_in 'End Date', with: Time.zone.today + 1.day
107107
check 'virtual'
108-
click_button 'Create Product drive'
108+
click_button 'Create Product Drive'
109109

110110
expect(ProductDrive.last).to have_attributes({ name: 'Virtual 1', start_date: Time.zone.today, end_date: Time.zone.today + 1.day, virtual: true })
111111
end
@@ -115,7 +115,7 @@
115115
fill_in 'Start Date', with: Time.zone.today
116116
fill_in 'End Date', with: Time.zone.today + 4.hours
117117
check 'virtual'
118-
click_button 'Create Product drive'
118+
click_button 'Create Product Drive'
119119

120120
expect(page.find('.alert')).to have_content('added')
121121
end

0 commit comments

Comments
 (0)