1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Implement transaction filtering UI (#578)

* Rough sketch of implementation

* Consolidate auto submit controller

* Store ransack params in session

* Improve how summary is calculated for txns

* Implement filters UI
This commit is contained in:
Zach Gollwitzer 2024-03-28 13:23:54 -04:00 committed by GitHub
parent 7ae25dd6df
commit f0c2d4ead0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 296 additions and 146 deletions

View file

@ -21,15 +21,17 @@ export default class extends Controller {
onTurboLoad = () => {
this.updateClasses(this.defaultTabValue);
}
};
updateClasses = (selectedId) => {
this.btnTargets.forEach((btn) => btn.classList.remove(this.activeClass));
this.btnTargets.forEach((btn) =>
btn.classList.remove(...this.activeClasses)
);
this.tabTargets.forEach((tab) => tab.classList.add("hidden"));
this.btnTargets.forEach((btn) => {
if (btn.dataset.id === selectedId) {
btn.classList.add(this.activeClass);
btn.classList.add(...this.activeClasses);
}
});
@ -38,5 +40,5 @@ export default class extends Controller {
tab.classList.remove("hidden");
}
});
}
};
}