Revert commits accidentally pushed to main

Revert "Add bridged share button to board and card permas"
This reverts commit 069e165b43.

Revert "Move helper to bridge helper file"
This reverts commit 1ee37f046c.
This commit is contained in:
Rosa Gutierrez
2026-02-20 12:58:20 +01:00
parent 069e165b43
commit bb6f2963b4
5 changed files with 8 additions and 67 deletions
+8
View File
@@ -9,4 +9,12 @@ module BoardsHelper
icon_tag("settings") + tag.span("Settings for #{board.name}", class: "for-screen-reader")
end
end
def bridged_button_to_board(board)
link_to "Go to #{board.name}", board, hidden: true, data: {
bridge__buttons_target: "button",
bridge_icon_url: bridge_icon("board"),
bridge_title: "Go to #{board.name}"
}
end
end
-18
View File
@@ -2,22 +2,4 @@ module BridgeHelper
def bridge_icon(name)
asset_url("#{name}.svg")
end
def bridged_button_to_board(board)
link_to "Go to #{board.name}", board, hidden: true, data: {
bridge__buttons_target: "button",
bridge_icon_url: bridge_icon("board"),
bridge_title: "Go to #{board.name}"
}
end
def bridged_share_button(type = nil)
tag.button "Share", hidden: true, data: {
controller: "bridge--share",
action: "bridge--share#share",
bridge__overflow_menu_target: "item",
bridge_title: "Share",
bridge_share_type: type
}
end
end
@@ -1,45 +0,0 @@
import { BridgeComponent } from "@hotwired/hotwire-native-bridge"
export default class extends BridgeComponent {
static component = "share"
share() {
const type = this.bridgeElement.bridgeAttribute("share-type")
switch (type) {
case "card-url":
this.send("shareCardUrl", this.#data(type))
break
default:
this.send("shareUrl", this.#data(type))
}
}
#data(type) {
return {
title: document.title,
url: window.location.href,
...this.#additionalDataFor(type)
}
}
#additionalDataFor(type) {
switch (type) {
case "card-url":
return {
author: this.#author,
dateAdded: this.#dateAdded
}
default:
return null
}
}
get #author() {
return document.querySelector(".card__meta-text--author strong")?.textContent?.trim() ?? null
}
get #dateAdded() {
const timestamp = document.querySelector(".card__meta-text--added time")?.dateTime
return parseInt(timestamp) || null
}
}
-2
View File
@@ -30,5 +30,3 @@
<%= render "boards/show/columns", page: @page, board: @board %>
<% end %>
<% end %>
<%= bridged_share_button() %>
-2
View File
@@ -23,5 +23,3 @@
<%= button_to_remove_card_image(@card) if @card.image.attached? %>
<% end %>
</div>
<%= bridged_share_button("card-url") %>