Replace link with button in nofications

This commit is contained in:
cyrillefr
2025-04-15 11:36:07 +02:00
parent 267dd931d8
commit 75ed7ae3ef
3 changed files with 20 additions and 12 deletions

View File

@@ -1190,9 +1190,17 @@ form {
@include breakpoint(medium) {
.mark-notification {
@include anchor-color;
cursor: pointer;
position: absolute;
right: 12px;
top: 12px;
&:hover,
&:active,
&:focus {
@include anchor-color-hover;
}
}
}

View File

@@ -15,16 +15,16 @@
<% end %>
<% if notification.unread? %>
<%= link_to t("notifications.notification.mark_as_read"),
mark_as_read_notification_path(notification),
method: :put,
remote: true,
class: "mark-notification small" %>
<%= button_to t("notifications.notification.mark_as_read"),
mark_as_read_notification_path(notification),
method: :put,
remote: true,
class: "mark-notification small" %>
<% else %>
<%= link_to t("notifications.notification.mark_as_unread"),
mark_as_unread_notification_path(notification),
method: :put,
remote: true,
class: "mark-notification small" %>
<%= button_to t("notifications.notification.mark_as_unread"),
mark_as_unread_notification_path(notification),
method: :put,
remote: true,
class: "mark-notification small" %>
<% end %>
</li>

View File

@@ -59,7 +59,7 @@ describe "Notifications" do
click_notifications_icon
within("#notification_#{notification1.id}") do
click_link "Mark as read"
click_button "Mark as read"
end
expect(page).to have_css(".notification", count: 1)
@@ -89,7 +89,7 @@ describe "Notifications" do
expect(page).to have_css(".notification", count: 1)
within("#notification_#{notification1.id}") do
click_link "Mark as unread"
click_button "Mark as unread"
end
expect(page).to have_css(".notification", count: 0)