Replace collection with board in the code, tests green

This commit is contained in:
Jorge Manrubia
2025-11-05 13:39:58 +01:00
parent 03a345609e
commit 39ec6cf062
146 changed files with 316 additions and 264 deletions
@@ -0,0 +1,21 @@
import { Controller } from "@hotwired/stimulus"
import { nextEventLoopTick } from "helpers/timing_helpers";
export default class extends Controller {
static targets = ["meCheckbox"]
static values = { selfRemovalPromptMessage: { type: String, default: "Are you sure?" } }
async submitWithWarning(event) {
if (this.hasMeCheckboxTarget && !this.meCheckboxTarget.checked && !this.confirmed) {
event.detail.formSubmission.stop()
const message = this.selfRemovalPromptMessageValue
if (confirm(message)) {
await nextEventLoopTick()
this.confirmed = true
this.element.requestSubmit()
}
}
}
}