FlowAuth: make Latest expiry picker clearable on Server and Role admin#7285
FlowAuth: make Latest expiry picker clearable on Server and Role admin#7285jakejellinek merged 1 commit intomasterfrom
Conversation
The backend now accepts NULL for `latest_token_expiry` on both Server and Role (PR #7277), but the admin UI made that value unreachable: the Material-UI v4 DateTimePickers had no Clear option, and Server's `handleSubmit` always wrapped the state in `new Date(...).toISOString()`, turning empty/null state into the 1970 epoch string. - Add `clearable={true}` to the DateTimePickers on `ServerAdminDetails` and `RoleDetails`, with a small helper line explaining what blank means. - In `ServerAdminDetails.handleSubmit`, only stringify the date when it has a truthy value; otherwise pass `null` through to the API. The role form already passes the picker value through unchanged, so no change is needed there beyond exposing the Clear button. Without this, operators saw "no absolute expiry cap" semantics in the API but had no UI path to actually clear an existing cap.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThe pull request updates the FlowAuth admin UI to make the "Latest expiry" fields clearable in both Server and Role forms. The submission logic is modified to send Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
FlowAuth
|
||||||||||||||||||||||||||||
| Project |
FlowAuth
|
| Branch Review |
flowauth/clearable-expiry-picker
|
| Run status |
|
| Run duration | 00m 49s |
| Commit |
|
| Committer | Joachim Jellinek |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
4
|
| View all changes introduced in this branch ↗︎ | |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7285 +/- ##
==========================================
- Coverage 94.23% 92.02% -2.22%
==========================================
Files 258 279 +21
Lines 9305 10878 +1573
Branches 697 697
==========================================
+ Hits 8769 10010 +1241
- Misses 387 716 +329
- Partials 149 152 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
The backend started accepting
NULLforlatest_token_expiryon Server and Role in #7277, but the admin UI made that value unreachable:DateTimePickers on both forms had no Clear option — there was no UI gesture that produced an empty value.ServerAdminDetails.handleSubmitalways wrapped state innew Date(latest_expiry).toISOString(), so even if the picker heldnullyou'd send the 1970 epoch string back to the API.Both fixed here. Operators can now actually clear an existing absolute expiry cap on a server or role from the admin UI.
Changes
flowauth/frontend/src/ServerAdminDetails.jsx—clearable={true}on the picker, helper text, conditionalnull/ISO string inhandleSubmit.flowauth/frontend/src/RoleDetails.jsx—clearable={true}on the picker. The role form already passes the picker value through unchanged, so the API path is fine once the Clear button exists.Test plan
/servers/<id>returnslatest_token_expiry: null.latest_token_expiryandlongest_token_life_minutesonly → token expiry equalsnow + longest_token_life_minutes, no silent clamp.Summary by CodeRabbit
New Features
Bug Fixes