Add report name and details to CSV files

This commit is contained in:
Gareth Rogers
2025-07-30 20:39:00 -04:00
committed by Maikel Linke
parent f5a9ec7fa9
commit 0a9eb173ea
12 changed files with 245 additions and 15 deletions

View File

@@ -0,0 +1,31 @@
import { Controller } from "stimulus";
export default class extends Controller {
static targets = ["reportType", "checkbox", "label"];
handleSelectChange() {
this.reportTypeTarget.value == "csv" ?
this.enableField():
this.disableField();
}
disableField() {
if (this.hasCheckboxTarget) {
this.checkboxTarget.checked = false;
this.checkboxTarget.disabled = true;
}
if (this.hasLabelTarget) {
this.labelTarget.classList.add("disabled");
}
}
enableField() {
if (this.hasCheckboxTarget) {
this.checkboxTarget.checked = true;
this.checkboxTarget.disabled = false;
}
if (this.hasLabelTarget) {
this.labelTarget.classList.remove("disabled");
}
}
}