Change date and closedBy properties for a more generic description

This commit is contained in:
Adrien Maston
2026-03-17 11:09:37 +01:00
parent 7974629e20
commit 0b29a67e17
3 changed files with 11 additions and 21 deletions
@@ -14,6 +14,14 @@ export default class extends BridgeComponent {
}
notifyBridgeOfConnect() {
this.send("connect", this.bridgeElement.getStamp())
this.send("connect", this.#data)
}
get #data() {
const bridgeElement = this.bridgeElement
return {
title: bridgeElement.title,
description: bridgeElement.bridgeAttribute("description") ?? null
}
}
}
@@ -9,14 +9,6 @@ BridgeElement.prototype.getButton = function() {
}
}
BridgeElement.prototype.getStamp = function() {
return {
title: this.title,
date: this.getDate(),
closedBy: this.getClosedBy()
}
}
BridgeElement.prototype.getIcon = function() {
const url = this.bridgeAttribute("icon-url")
@@ -27,14 +19,6 @@ BridgeElement.prototype.getIcon = function() {
return null
}
BridgeElement.prototype.getDate = function() {
return this.bridgeAttribute("date") ?? null
}
BridgeElement.prototype.getClosedBy = function() {
return this.bridgeAttribute("closed-by") ?? null
}
BridgeElement.prototype.getDisplayTitle = function() {
return !!this.bridgeAttribute("display-title")
}
@@ -2,8 +2,7 @@
<%= tag.div class: token_list("card__closed", "card__closed--system": card.postponed_by&.system?), data: {
controller: "bridge--stamp",
bridge_title: "Not Now",
bridge_date: card.postponed_at.strftime("%b %d, %Y"),
bridge_closed_by: card.postponed_by&.familiar_name
bridge_description: card.postponed_at.strftime("%b %d, %Y")
} do %>
<span class="card__closed-title" data-text="Not Now">Not Now</span>
<strong class="card__closed-date"><%= card.postponed_at.strftime("%b %d, %Y") %></strong>
@@ -15,8 +14,7 @@
<%= tag.div class: "card__closed", data: {
controller: "bridge--stamp",
bridge_title: "Done",
bridge_date: card.closed_at.strftime("%b %d, %Y"),
bridge_closed_by: card.closed_by.familiar_name
bridge_description: card.closed_at.strftime("%b %d, %Y")
} do %>
<span class="card__closed-title" data-text="Done">Done</span>
<strong class="card__closed-date"><%= card.closed_at.strftime("%b %d, %Y") %></strong>