fix: allow for tracked time to be removed again (#8575)

- `getElementById` requires a id to be passed and not a query selector, change it to `querySelector`.
- Regression of forgejo/forgejo#7408
- Resolves forgejo/forgejo#8571
- Add E2E tests for adding manual tracked time and removing it.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8575
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
Gusted 2025-07-19 16:34:21 +02:00 committed by Gusted
parent 1b21719897
commit a5f7acdd2e
2 changed files with 49 additions and 1 deletions

View file

@ -57,7 +57,7 @@ export function initRepoIssueTimeTracking() {
$(sel).modal({
duration: 200,
onApprove() {
document.getElementById(`${sel} form`).requestSubmit();
document.querySelector(`${sel} form`).requestSubmit();
},
}).modal('show');
});