Add legacy device deprecation banner for users and admins#420
Add legacy device deprecation banner for users and admins#420
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
WalkthroughAdds a deprecated backend endpoint GET /devices/has-legacy-devices (DeviceResource.hasAnyLegacyDevices) that returns a boolean by delegating to LegacyDevice.Repository.existsAny(), which checks for the presence of any LegacyDevice record. Frontend: DeviceService.hasLegacyDevices() calls that endpoint. AdminSettings, LegacyDeviceList, and VaultList components fetch legacy-device state and conditionally render a ContentBanner. Three i18n keys for the banner title and user/admin descriptions were added. CHANGELOG updated with an "Added" entry about displaying the legacy-device banner. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/src/components/VaultList.vue (1)
219-220: Optional chaining on non-optional field.The
devicesfield onUserDtois typed asDeviceDto[](non-optional). The optional chainingmeWithLegacy.devices?.lengthis defensive but technically unnecessary. This is a minor nitpick and safe to keep as-is.📝 Optional simplification
- hasLegacyDevices.value = (meWithLegacy.devices?.length ?? 0) > 0; + hasLegacyDevices.value = meWithLegacy.devices.length > 0;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/components/VaultList.vue` around lines 219 - 220, The optional chaining on a non-optional field is unnecessary; in the block that awaits userdata.meWithLegacyDevicesAndLastAccess, replace the defensive access meWithLegacy.devices?.length with a direct access meWithLegacy.devices.length (keeping the surrounding assignment to hasLegacyDevices.value) so the code uses the declared DeviceDto[] type correctly; update the expression where meWithLegacy and hasLegacyDevices are referenced to remove the "?".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@frontend/src/components/VaultList.vue`:
- Around line 219-220: The optional chaining on a non-optional field is
unnecessary; in the block that awaits userdata.meWithLegacyDevicesAndLastAccess,
replace the defensive access meWithLegacy.devices?.length with a direct access
meWithLegacy.devices.length (keeping the surrounding assignment to
hasLegacyDevices.value) so the code uses the declared DeviceDto[] type
correctly; update the expression where meWithLegacy and hasLegacyDevices are
referenced to remove the "?".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 10fdecee-193f-4700-8683-2e922ec07cc0
📒 Files selected for processing (7)
backend/src/main/java/org/cryptomator/hub/api/DeviceResource.javabackend/src/main/java/org/cryptomator/hub/entities/LegacyDevice.javafrontend/src/common/backend.tsfrontend/src/components/AdminSettings.vuefrontend/src/components/LegacyDeviceList.vuefrontend/src/components/VaultList.vuefrontend/src/i18n/en-US.json
overheadhunter
left a comment
There was a problem hiding this comment.
I have slight concerns regarding fetch efficiency of userdata.meWithLegacyDevicesAndLastAccess but since this is just a temporary banner, this should work.
@SailReal do you agree?
SailReal
left a comment
There was a problem hiding this comment.
We should remove the banner soon again but then I think it is okay to use meWithLegacyDevicesAndLastAccess.
backend/src/main/java/org/cryptomator/hub/entities/LegacyDevice.java
Outdated
Show resolved
Hide resolved
…e.java Co-authored-by: Julian Raufelder <Julian@Raufelder.com>
To inform users ahead of time, a warning banner is shown on the profile page and vault list whenever the logged-in user still has legacy devices.
Admins additionally see a variant of this banner on the vault list and admin settings page when any user in the system has legacy devices.
Screenshots:

User – Profile Page
User – Vault List

Admin – Vault List

Admin – Admin Settings
