Commit a237caa
authored
Refactor: Convert User Profile tab to Nuxt UI (betaflight#5010)
* Refactor: Convert User Profile tab to Nuxt UI
Replace legacy i18n attributes with $t(), gui_box with UiBox component,
globalThis.confirm with useDialog composable, and custom CSS modal with
native dialog element. Rename to UserProfileTab.vue for consistency.
* Address PR review: delete buttons, null profile guard
Replace remaining anchor-based delete actions with button elements
for accessibility/semantics. Add v-if guard on profile UiBox to
prevent runtime errors when profile fetch fails.
* Address PR review: grid layout, stale profile, consistency fixes
Replace token/passkey <table> elements with CSS Grid + subgrid to
match the Backups tab pattern and use UButton for delete actions.
In loadProfile(), clear profile.value and null userApi on the
not-logged-in and login-check-failure paths to prevent a stale
profile from leaking across users when the next load fails.
Split !confirmed/!userApi guards in deleteToken/deletePasskey so a
confirmed delete without an active session surfaces notLoggedIn
via gui_log. Fix --primary-500 -> --color-primary-500 on the
profile-info title, and drop the now-dead profile-table CSS.
* Fix edit-profile Cancel button using undefined i18n key
actionCancel is not in messages.json, so the button rendered the
raw key instead of "Cancel". Reuse the existing top-level cancel
key which already resolves to "Cancel".
* Address PR nits: drop redundant cancel.prevent and dialog CSS
The native <dialog> default stylesheet already handles display:block
when [open] and display:none otherwise, so the explicit rules in
.profile-edit-dialog were no-ops. Drop them.
The @cancel.prevent on the dialog was paired with an idempotent
close() in cancelEdit(), so the .prevent is redundant — switch to
plain @cancel="cancelEdit". cancelEdit still calls close() because
the Cancel button's @click path has no native cancel event and
still needs to close the dialog explicitly.
* Clear tokens/passkeys on fetch failure to avoid stale entries
Mirror the profile.value reset already applied above: when
userApi.getTokens() or userApi.getPasskeys() throws, set the
respective ref to [] before logging, so a failed fetch after a
successful one (e.g. after a session change) doesn't leave the
previous user's entries on screen.1 parent 5dd5f0f commit a237caa
3 files changed
Lines changed: 495 additions & 634 deletions
0 commit comments