Commit 0dc03e5
Feature: Adjust/Hide Events/Courses (#197)
* feat: allow filtering courses from calendar
* feat: fix tests, add filtering test
* fix: adjust course tag regex
* fix: address style comments, fix switch statement
* feat: filter by course name, not tag
* replace redundant code
* fix variable rename during rebase
* app_test: fix course filtering
* add recurrences to course adjustment view
* change 'filter' to 'hide', add offet input
* output course adjustments as query params
* remove todo for prefilling course adjustments
In order to be able to prefill the course adjustment page with
previously selected values, we would need to have the user
provide his https://campus.tum... link instead of https://cal.tum.ap...
It's probably better to just store the settings in the browser and
load them when revisiting the site.
* parse offsets and apply to vevents
* fix parseOffsetQuery
* adjustEventTimes: actually do the adjustment (facepalm)
* adjustTimes: use endOffset (not startOffset)
* fix test: change of getCleanedCalendar parameters
* add test for time adjustment
* display recurringid on course adjustment section
* Fix startOffset generation and improve parsing robustness (#198)
- Fixed a bug in `internal/static/main.js` where negative start offsets were generated with an extra space (e.g., `123 -10` instead of `123-10`), causing parsing errors on the backend.
- Updated `internal/app.go` `parseOffsetsQuery` to trim spaces from input parts, making the backend robust against malformed or space-padded offset strings.
- Refactored boolean checks in `internal/app.go` to use idiomatic Go (e.g., `!exists` instead of `exists == false`).
- Added comprehensive unit tests for `parseOffsetsQuery` in `internal/app_test.go` covering valid, negative, malformed, and space-padded inputs.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* Remove time adjustment query parameters and functionality (#199)
- Removed `startOffset` and `endOffset` query parameter handling in `internal/app.go`.
- Removed `adjustEventTimes` logic for shifting event times.
- Updated `getCleanedCalendar` signature to remove offset maps.
- Removed frontend UI and logic for setting time offsets in `internal/static/main.js`.
- Cleaned up tests in `internal/app_test.go` by removing `TestCourseTimeAdjustment` and updating calls.
- Removed unused imports in `internal/app.go`.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Kordian Bruck <[email protected]>
* Fix imports
* Fix variable overload
* Use non versioned alpine image for go, instead of locking the alpine version.
* Remove test cases for time adjustments
* Remove time adjustment code
* Fixups to make this work properly.
* Cleanup the code a bit more.
* Properly cleanup the summary for hiding courses.
* Make sure to respect the boolean when populating the checkboxes in the frontend.
* Fix test cases
---------
Co-authored-by: Florian Pfisterer <[email protected]>
Co-authored-by: Sandro Pischinger <[email protected]>
Co-authored-by: Joscha Henningsen <[email protected]>
Co-authored-by: nycex <[email protected]>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 66ac945 commit 0dc03e5
File tree
8 files changed
+353
-44
lines changed- internal
- static
- testdata
8 files changed
+353
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| |||
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
| 151 | + | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| |||
180 | 188 | | |
181 | 189 | | |
182 | 190 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
187 | 195 | | |
188 | | - | |
| 196 | + | |
189 | 197 | | |
190 | | - | |
191 | | - | |
| 198 | + | |
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
195 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
196 | 220 | | |
197 | 221 | | |
198 | | - | |
| 222 | + | |
| 223 | + | |
199 | 224 | | |
200 | | - | |
| 225 | + | |
201 | 226 | | |
202 | 227 | | |
| 228 | + | |
203 | 229 | | |
204 | | - | |
205 | | - | |
| 230 | + | |
| 231 | + | |
206 | 232 | | |
207 | | - | |
| 233 | + | |
208 | 234 | | |
209 | 235 | | |
210 | 236 | | |
211 | 237 | | |
212 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
213 | 276 | | |
214 | 277 | | |
215 | 278 | | |
216 | 279 | | |
217 | 280 | | |
218 | | - | |
| 281 | + | |
219 | 282 | | |
220 | 283 | | |
221 | 284 | | |
222 | 285 | | |
223 | 286 | | |
224 | 287 | | |
225 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
226 | 297 | | |
227 | 298 | | |
228 | 299 | | |
229 | 300 | | |
230 | 301 | | |
| 302 | + | |
| 303 | + | |
231 | 304 | | |
232 | 305 | | |
233 | 306 | | |
| |||
248 | 321 | | |
249 | 322 | | |
250 | 323 | | |
251 | | - | |
| 324 | + | |
252 | 325 | | |
253 | 326 | | |
254 | 327 | | |
| |||
272 | 345 | | |
273 | 346 | | |
274 | 347 | | |
275 | | - | |
| 348 | + | |
276 | 349 | | |
277 | 350 | | |
278 | 351 | | |
| |||
285 | 358 | | |
286 | 359 | | |
287 | 360 | | |
288 | | - | |
| 361 | + | |
289 | 362 | | |
290 | | - | |
| 363 | + | |
291 | 364 | | |
292 | 365 | | |
293 | 366 | | |
| |||
299 | 372 | | |
300 | 373 | | |
301 | 374 | | |
302 | | - | |
| 375 | + | |
303 | 376 | | |
304 | 377 | | |
305 | 378 | | |
| |||
329 | 402 | | |
330 | 403 | | |
331 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
| 6 | + | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
74 | | - | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| |||
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
0 commit comments