More style fixes and remove dead password reset code

This commit is contained in:
Johannes Zellner
2025-03-17 17:49:52 +01:00
parent 66d235a873
commit 8e120bca77
3 changed files with 27 additions and 23 deletions
+15 -18
View File
@@ -52,9 +52,10 @@ async function onChangeDisplayName(currentDisplayName) {
message: t('profile.changeDisplayName.title'),
modal: false,
value: currentDisplayName,
confirmStyle: 'success',
confirmLabel: t('main.dialog.save'),
rejectLabel: t('main.dialog.cancel')
confirmStyle: 'primary',
rejectLabel: t('main.dialog.cancel'),
rejectStyle: 'secondary',
});
if (!displayName || currentDisplayName === displayName) return;
@@ -71,9 +72,10 @@ async function onChangeEmail(currentEmail) {
type: [ 'email', 'password' ],
modal: false,
value: [ currentEmail, '' ],
confirmStyle: 'success',
confirmLabel: t('main.dialog.save'),
rejectLabel: t('main.dialog.cancel')
confirmStyle: 'primary',
rejectLabel: t('main.dialog.cancel'),
rejectStyle: 'secondary',
});
if (!result || !result[0] || !result[1] || currentEmail === result[0]) return;
@@ -90,9 +92,10 @@ async function onChangeFallbackEmail(currentFallbackEmail) {
type: [ 'email', 'password' ],
modal: false,
value: [ currentFallbackEmail, '' ],
confirmStyle: 'success',
confirmLabel: t('main.dialog.save'),
rejectLabel: t('main.dialog.cancel')
confirmStyle: 'primary',
rejectLabel: t('main.dialog.cancel'),
rejectStyle: 'secondary',
});
if (!result || !result[1] || currentFallbackEmail === result[0]) return;
@@ -121,9 +124,10 @@ async function onPasswordChange() {
message: [ t('profile.changePassword.newPassword'), t('profile.changePassword.newPasswordRepeat'), t('profile.changePassword.currentPassword') ],
type: [ 'password', 'password', 'password' ],
modal: false,
confirmStyle: 'success',
confirmLabel: t('main.dialog.save'),
rejectLabel: t('main.dialog.cancel')
confirmStyle: 'primary',
rejectLabel: t('main.dialog.cancel'),
rejectStyle: 'secondary',
});
if (!result || !result[0] || !result[1] || !result[2] || result[0] === result[1]) return;
@@ -132,14 +136,6 @@ async function onPasswordChange() {
if (error) return console.error('Failed to change password', error);
}
// TODO
async function onPasswordReset() {
const error = await profileModel.sendPasswordReset(user.value.email);
if (error) return console.error('Failed to reset password:', error);
window.pankow.notify({ type: 'success', timeout: 5000, text: t('profile.passwordResetNotification.title') + '. ' + t('profile.passwordResetNotification.body', { email: user.value.fallbackEmail || user.value.email }) });
}
// Tokens
const webadminTokens = ref([]);
@@ -196,7 +192,8 @@ async function onTwoFADisable() {
type: 'password',
confirmStyle: 'danger',
confirmLabel: t('main.dialog.yes'),
rejectLabel: t('main.dialog.no')
rejectLabel: t('main.dialog.no'),
rejectStyle: 'secondary',
});
if (!password) return;
@@ -302,7 +299,7 @@ onMounted(async () => {
</FormGroup>
<div style="display: flex; align-items: center">
<!-- TODO translate -->
<Button tool plain @click="displayName(user.email)" v-show="!user.source && !config.profileLocked">Edit</Button>
<Button tool plain @click="onChangeEmail(user.email)" v-show="!user.source && !config.profileLocked">Edit</Button>
</div>
</SettingsItem>