Skip to content

Update ButtonComponent usage to use url/method abstraction#10468

Merged
aduth merged 3 commits intomainfrom
aduth-button-action-to-url
Apr 22, 2024
Merged

Update ButtonComponent usage to use url/method abstraction#10468
aduth merged 3 commits intomainfrom
aduth-button-action-to-url

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Apr 19, 2024

🎫 Ticket

Refactoring after #10464, which supports LG-12716

🛠 Summary of changes

Updates instances of ButtonComponent action to use the new url & method shorthand introduced in #10464.

Related comment: #10464 (comment)

📜 Testing Plan

Verify no regressions in the impacted buttons.

Comment on lines 24 to 20
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One tricky thing is that button_to has an implicit method: :post, which needs to be made explicit with these updates, otherwise ButtonComponent defaults to :get. I've double-checked all of the button_to updates across this branch and #10464.

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, now I'd expect we can remove the action: keyword entirely from ButtonComponent#initialize in this PR right?

@aduth
Copy link
Contributor Author

aduth commented Apr 19, 2024

LGTM, now I'd expect we can remove the action: keyword entirely from ButtonComponent#initialize in this PR right?

Probably could, yeah. I don't think there's any other usage of it. It could be useful for more advanced customization, but also fair to rip it out for YAGNI.

@zachmargolis
Copy link
Contributor

LGTM, now I'd expect we can remove the action: keyword entirely from ButtonComponent#initialize in this PR right?

Probably could, yeah. I don't think there's any other usage of it. It could be useful for more advanced customization, but also fair to rip it out for YAGNI.

+1 YAGNI

I think while the flexibility of it was well-intentioned, it's a really complicated API, if a new case comes along where we need additional behavior, we can cross that bridge when we get there

@aduth
Copy link
Contributor Author

aduth commented Apr 19, 2024

LGTM, now I'd expect we can remove the action: keyword entirely from ButtonComponent#initialize in this PR right?

Probably could, yeah. I don't think there's any other usage of it. It could be useful for more advanced customization, but also fair to rip it out for YAGNI.

+1 YAGNI

I think while the flexibility of it was well-intentioned, it's a really complicated API, if a new case comes along where we need additional behavior, we can cross that bridge when we get there

👍 Removed support in b33a4e667e.

Base automatically changed from aduth-backup-code-s-form-link to main April 22, 2024 12:46
aduth added 3 commits April 22, 2024 08:47
changelog: Bug Fixes, Regenerate Backup Codes, Fix issues linking to confirm regenerating backup codes
Through subclassing and external component slot abstractions
@aduth aduth force-pushed the aduth-button-action-to-url branch from 57f3ca2 to 98a3c24 Compare April 22, 2024 12:47
@aduth aduth merged commit fce7d23 into main Apr 22, 2024
@aduth aduth deleted the aduth-button-action-to-url branch April 22, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants