Skip to content

Commit

Permalink
AO3-6686 AO3-6687 Update configs to Rails 7.0 defaults (otwcode#4860)
Browse files Browse the repository at this point in the history
* Configuration options that needed to wait

These options just needed to wait until things like cookies had a chance to be rotated.
It's been a few months, so that should be enough time now.

* Frontend changes

* Move everything to 7.0 configs

* AO3-6687 while I'm here

* Fix tests

* Experiment to fix redirects

* Fix test

* AO3-6686 Button styles

* One last CSS (hopefully)

* Un-fix the test to fix it

---------

Co-authored-by: Sarken <sarken@gmail.com>
  • Loading branch information
brianjaustin and sarken authored Sep 8, 2024
1 parent dade1c1 commit 6ffe102
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 149 deletions.
2 changes: 1 addition & 1 deletion app/controllers/pseuds_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def create
# if setting this one as default, unset the attribute of the current default pseud
old_default.update_attribute(:is_default, false)
end
redirect_to([@user, @pseud])
redirect_to polymorphic_path([@user, @pseud])
else
render action: "new"
end
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Application < Rails::Application
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.

config.load_defaults 6.1
config.load_defaults 7.0

# TODO: Remove in Rails 7.1, where it's false by default.
config.add_autoload_paths_to_load_path = false
Expand Down
24 changes: 0 additions & 24 deletions config/initializers/cookie_rotator.rb

This file was deleted.

5 changes: 0 additions & 5 deletions config/initializers/cookies_serializer.rb

This file was deleted.

110 changes: 0 additions & 110 deletions config/initializers/new_framework_defaults_7_0.rb

This file was deleted.

6 changes: 3 additions & 3 deletions features/collections/collection_participants.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
And I press "Submit"
Then I should see "New members invited: sam"
When I select "Owner" from "sam_role"
And I submit with the 5th button
And I submit with the 4th button
Then I should see "Updated sam."
When I submit with the 6th button
When I click the 2nd button
Then I should see "Removed sam from collection."

Scenario: Owner can't invite a nonexistent user to the collection
Expand Down Expand Up @@ -60,7 +60,7 @@
And I press "Submit"
Then I should see "New members invited: sam"
When I select "Invited" from "sam_role"
And I submit with the 5th button
And I submit with the 4th button
Then I should see "Updated sam."
When I am in sam's browser
And I follow "Join"
Expand Down
2 changes: 1 addition & 1 deletion features/other_a/pseud_delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Feature: Delete pseud.
And I press "Submit"
Then I should see "New members invited: other_pseud (myself)"
When I select "Moderator" from "myself_role"
And I submit with the 5th button
And I submit with the 4th button
Then I should see "Updated other_pseud."
When I go to the collections page
Then I should see "My Collection Thing"
Expand Down
8 changes: 7 additions & 1 deletion features/step_definitions/generic_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,16 @@ def assure_xpath_not_present(tag, attribute, value, selector)
# "I submit with the 2nd button", but in those cases you probably want to make sure that
# the different forms have different button text anyway, and submit them using
# When I press "Button Text"
When /^I submit with the (\d+)(?:st|nd|rd|th) button$/ do |index|
When /^I submit with the (\d+)(?:st|nd|rd|th) button$/ do |index| # rubocop:disable Cucumber/RegexStepName
page.all("input[type='submit']")[(index.to_i - 1)].click
end

# This is for buttons generated with the button_to helper method. They use a different HTML element,
# <button> instead of <input type="submit">.
When /^I click the (\d+)(?:st|nd|rd|th) button$/ do |index| # rubocop:disable Cucumber/RegexStepName
page.all("button")[index.to_i - 1].click
end

# This will submit the first submit button inside a <p class="submit"> by default
# That wrapping paragraph tag will be generated automatically if you use
# the submit_button or submit_fieldset helpers in application_helper.rb
Expand Down
2 changes: 2 additions & 0 deletions lib/skin_wizard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ def header_styles(color)
#header .user a:focus,
#dashboard a:hover,
.actions a:hover,
.actions button:hover,
.actions input:hover,
.actions a:focus,
.actions button:focus,
.actions input:focus,
label.action:hover,
.action:hover,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ media .listbox {
.actions input,
.actions input:hover,
.actions input:focus,
.actions button,
.actions button:hover,
.actions button:focus,
.flash,
fieldset,
#header ul.primary li.search,
Expand Down
4 changes: 4 additions & 0 deletions public/stylesheets/masters/reversi/reversi_site_screen_.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ a.tag:hover,
#header p,
#dashboard a:hover,
.actions a:hover,
.actions button:hover,
.actions input:hover,
.delete a,
span.delete,
Expand Down Expand Up @@ -256,6 +257,7 @@ span.series .divider {
.actions a:link,
.action,
.action:link,
.actions button,
.actions input,
input[type="submit"],
button,
Expand All @@ -270,9 +272,11 @@ button,
}

.actions a:hover,
.actions button:hover,
.actions input:hover,
#dashboard a:hover,
.actions a:focus,
.actions button:focus,
.actions input:focus,
#dashboard a:focus,
.actions .disabled select {
Expand Down
1 change: 1 addition & 0 deletions public/stylesheets/masters/snow/snow_site_screen_.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ col.name,
fieldset fieldset,
fieldset dl dl,
form blockquote.userstuff,
button:focus,
input:focus,
select:focus,
textarea:focus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ a.tag:hover {
#header p,
#dashboard a:hover,
.actions a:hover,
.actions button:hover,
.actions input:hover,
.delete a,
span.delete,
Expand Down
6 changes: 3 additions & 3 deletions public/stylesheets/site/2.0/08-actions.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ul.actions {
padding-top: 0;
}

.actions a, .actions a:link, .action, .action:link, .actions input, input[type="submit"], button, .current, .actions label {
.actions a, .actions a:link, .action, .action:link, .actions button, .actions input, input[type="submit"], button, .current, .actions label {
background: #eee;
color: #444;
width: auto;
Expand Down Expand Up @@ -87,7 +87,7 @@ ol.pagination, div.pagination, ol.year {
color: #111;
}

.actions a:hover, .actions input:hover, .actions a:focus, .actions input:focus, label.action:hover, .action:hover, .action:focus {
.actions a:hover, .actions button:hover, .actions input:hover, .actions a:focus, .actions button:focus, .actions input:focus, label.action:hover, .action:hover, .action:focus {
color: #900;
border-top: 1px solid #999;
border-left: 1px solid #999;
Expand All @@ -111,7 +111,7 @@ ol.pagination, div.pagination, ol.year {
border-color: #aaa;
}

.actions li a, .actions li input, .actions li input[type="submit"], .actions li .current, .actions li label {
.actions li a, .actions li button, .actions li input, .actions li input[type="submit"], .actions li .current, .actions li label {
margin: 0.375em auto;
}

Expand Down

0 comments on commit 6ffe102

Please sign in to comment.