Skip to content

Commit

Permalink
Chore: removed Turbo true attributes (#3878)
Browse files Browse the repository at this point in the history
<!-- Thank you for taking the time to contribute to The Odin Project. In
order to get this pull request (PR) merged in a reasonable amount of
time, you must complete this entire template. -->

## Because
<!-- Summarize the purpose or reasons for this PR, e.g. what problem it
solves or what benefit it provides. -->
Removed attributes enabling Turbo in a couple of components, since now
Turbo is enabled globally.

## This PR
<!-- A bullet point list of one or more items describing the specific
changes. -->
- Removed turbo: true from the [complete/icon_component.html.erb
file](https://github.com/TheOdinProject/theodinproject/blob/main/app/components/complete/icon_component.html.erb#L1)
- Removed turbo: 'true' from the [theme/switcher_component.html.erb
file](https://github.com/TheOdinProject/theodinproject/blob/main/app/components/theme/switcher_component.html.erb#L5)
- Removed data-turbo="true" from the [complete/button_component.html.erb
file](https://github.com/TheOdinProject/theodinproject/blob/main/app/components/complete/button_component.html.erb#L2)

## Issue
<!--
If this PR closes an open issue in this repo, replace the XXXXX below
with the issue number, e.g. Closes #2013.

If this PR closes an open issue in another TOP repo, replace the #XXXXX
with the URL of the issue, e.g. Closes
https://github.com/TheOdinProject/curriculum/issues/XXXXX

If this PR does not close, but is related to another issue or PR, you
can link it as above without the 'Closes' keyword, e.g. 'Related to
#2013'.
-->
Closes #3873 

## Additional Information
<!-- Any other information about this PR, such as a link to a Discord
discussion. -->


## Pull Request Requirements
<!-- Replace the whitespace between the square brackets with an 'x',
e.g. [x]. After you create the PR, they will become checkboxes that you
can click on. -->
- [x] I have thoroughly read and understand [The Odin Project
Contributing
Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md)
- [x] The title of this PR follows the `keyword: brief description of
change` format, using one of the following keywords:
  - `Feature` - adds new or amends existing user-facing behavior
- `Chore` - changes that have no user-facing value, refactors,
dependency bumps, etc
  - `Fix` - bug fixes
-   [x] The `Because` section summarizes the reason for this PR
- [x] The `This PR` section has a bullet point list describing the
changes in this PR
- [ ] I have verified all tests and linters pass after making these
changes.
- [x] If this PR addresses an open issue, it is linked in the `Issue`
section
-   [ ] If applicable, this PR includes new or updated automated tests
  • Loading branch information
hebiscus authored Jun 25, 2023
1 parent 441afe7 commit b85d2c3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/complete/button_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div data-turbo="true" id="complete-button" class="flex items-center justify-center">
<div id="complete-button" class="flex items-center justify-center">
<% if lesson.completed? %>
<%= button_to lesson_completion_path(lesson.id), form_class: 'w-full h-full', method: :delete, data: { test_id: 'complete-button' }, class: 'button button--primary h-[54px] sm:h-full w-full md:w-60 hover:bg-teal-700' do %>
<span class="flex items-center">
Expand Down
2 changes: 1 addition & 1 deletion app/components/complete/icon_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= tag.turbo_frame(id: dom_id(lesson, 'complete-button'), data: { turbo: true, controller: 'complete' }) do %>
<%= tag.turbo_frame(id: dom_id(lesson, 'complete-button'), data: { controller: 'complete' }) do %>
<% if lesson.completed? %>
<%= link_to lesson_completion_path(lesson.id, icon_only: true), data: { turbo_method: :delete, complete: @lesson.completed?, test_id: 'complete-button', action: 'click->complete#updateProgress' } do %>
<%= inline_svg_tag 'icons/checkmark-circle-solid.svg', class: "h-7 sm:h-8 text-teal-600 #{animation_class}", aria: true, title: 'check', desc: 'checkmark icon' %>
Expand Down
1 change: 0 additions & 1 deletion app/components/theme/switcher_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
themes_path(theme: other_theme.name),
class: yass(link: type),
data: {
turbo: 'true',
'turbo-method' => :put,
'turbo-frame' => '_top',
controller: 'theme--switcher',
Expand Down

0 comments on commit b85d2c3

Please sign in to comment.