Confirmation dialog ux: Logout, set password and change name

This commit is contained in:
10G Meow 2025-12-21 22:23:09 +02:00
parent 0abde8fee3
commit 6bb0189078
3 changed files with 57 additions and 47 deletions

View file

@ -253,6 +253,7 @@
"title": "My Profile", "title": "My Profile",
"temporary_identity": "This identity is temporary. Set a password to use it again", "temporary_identity": "This identity is temporary. Set a password to use it again",
"set_password": "Set password", "set_password": "Set password",
"set_password_desc": "Convene does not store passwords and cannot recover them. We recommend storing your password in a secure location before clicking save.",
"change_name": "Change name", "change_name": "Change name",
"change_password": "Change password", "change_password": "Change password",
"my_rooms": "My rooms", "my_rooms": "My rooms",
@ -323,7 +324,8 @@
"copy_credentials": "Copy Username & Password", "copy_credentials": "Copy Username & Password",
"copied_credentials": "Copied Username & Password", "copied_credentials": "Copied Username & Password",
"copied_credentials_value": "Username: {userId} \nPassword: {password}", "copied_credentials_value": "Username: {userId} \nPassword: {password}",
"copy_credentials_desc": "Your username and password are required to regain access to your chats from a new device or browser. We recommend storing these credentials in a secure location." "copy_credentials_desc": "Your username and password are required to regain access to your chats from a new device or browser. We recommend storing these credentials in a secure location.",
"copy_credentials_desc_for_real_user": "Your username (ex: {'@user:server'}) and your password are required to regain access to your chats from a new device or browser."
}, },
"delete_post": { "delete_post": {
"confirm_text": "Are you sure you want to delete this message?", "confirm_text": "Are you sure you want to delete this message?",

View file

@ -4,8 +4,8 @@
@click:outside="$emit('onOutsideLogoutPopupClicked')"> @click:outside="$emit('onOutsideLogoutPopupClicked')">
<div class="dialog-content text-center"> <div class="dialog-content text-center">
<h2 class="dialog-title">{{ $t("logout.confirm_text") }}</h2> <h2 class="dialog-title">{{ $t("logout.confirm_text") }}</h2>
<div class="dialog-text">{{ $t("logout.copy_credentials_desc") }}</div> <div class="dialog-text">{{ copyCredentialsSubText }}</div>
<v-row> <v-row v-if="this.$matrix.currentUser.is_guest">
<v-col sm="12" md="6" offset-md="3" class="d-flex justify-center"> <v-col sm="12" md="6" offset-md="3" class="d-flex justify-center">
<v-btn <v-btn
ref="copyCredentialsBtn" ref="copyCredentialsBtn"
@ -59,7 +59,10 @@ export default {
]), ]),
credentials() { credentials() {
return this.$t(`logout.copied_credentials_value`, { userId: this.auth.user.user_id, password: this.auth.user.password}) return this.$t(`logout.copied_credentials_value`, { userId: this.auth.user.user_id, password: this.auth.user.password})
} },
copyCredentialsSubText() {
return this.$t(`${this.$matrix.currentUser.is_guest ? 'logout.copy_credentials_desc': 'logout.copy_credentials_desc_for_real_user'}`)
},
}, },
methods: { methods: {
onCopyCredentials() { onCopyCredentials() {

View file

@ -116,6 +116,7 @@
> >
<v-card :disabled="settingPassword" class="dialog-content"> <v-card :disabled="settingPassword" class="dialog-content">
<h2 class="dialog-title">{{ $matrix.currentUser.is_guest ? $t("profile.set_password") : $t("profile.change_password") }}</h2> <h2 class="dialog-title">{{ $matrix.currentUser.is_guest ? $t("profile.set_password") : $t("profile.change_password") }}</h2>
<div class="dialog-text mb-4">{{ $t("profile.set_password_desc") }}</div>
<div class="dialog-text"> <div class="dialog-text">
<v-text-field <v-text-field
v-if="!$matrix.currentUser.is_guest" v-if="!$matrix.currentUser.is_guest"
@ -149,28 +150,30 @@
{{ passwordErrorMessage }} {{ passwordErrorMessage }}
</div> </div>
</div> </div>
<v-divider></v-divider> <v-container fluid>
<v-card-actions> <v-row cols="12">
<v-spacer></v-spacer> <v-col cols="6">
<v-btn id="btn-password-cancel" variant="text" @click="closeEditPasswordDialog">{{ <v-btn variant="flat" block class="text-button" @click.stop="closeEditPasswordDialog">{{
$t("menu.cancel") $t("menu.cancel") }}</v-btn>
}}</v-btn> </v-col>
<v-btn <v-col cols="6" align="center">
id="btn-password-set" <v-btn
:disabled="!passwordsMatch" :disabled="!passwordsMatch"
color="primary" color="#4642F1"
variant="text" variant="flat"
@click=" block
setPassword( class="filled-button"
$matrix.currentUser.is_guest @click="
? $matrix.currentUser.password setPassword(
: password, $matrix.currentUser.is_guest
newPassword1 ? $matrix.currentUser.password
) : password,
" newPassword1
>{{ $t("global.save") }}</v-btn )
> ">{{ $t("global.save") }}</v-btn>
</v-card-actions> </v-col>
</v-row>
</v-container>
</v-card> </v-card>
</v-dialog> </v-dialog>
@ -180,33 +183,35 @@
class="ma-0 pa-0" class="ma-0 pa-0"
:width="$vuetify.display.smAndUp ? '940px' : '80%'" :width="$vuetify.display.smAndUp ? '940px' : '80%'"
> >
<v-card> <v-card class="dialog-content">
<v-card-title>{{ $t("profile.display_name") }}</v-card-title> <v-card-title>{{ $t("profile.display_name") }}</v-card-title>
<v-card-text> <div class="dialog-text">
<v-text-field <v-text-field
v-model="editValue" v-model="editValue"
:rules="[(v) => !!v || $t('profile.display_name_required')]" :rules="[(v) => !!v || $t('profile.display_name_required')]"
required required
/> />
</v-card-text> <v-container fluid>
<v-divider></v-divider> <v-row cols="12">
<v-card-actions> <v-col cols="6">
<v-spacer></v-spacer> <v-btn variant="flat" block class="text-button" @click="showEditDisplaynameDialog = false">{{
<v-btn id="btn-displayname-cancel" variant="text" @click="showEditDisplaynameDialog = false">{{ $t("menu.cancel") }}</v-btn>
$t("menu.cancel") </v-col>
}}</v-btn> <v-col cols="6" align="center">
<v-btn <v-btn
id="btn-displayname-set" :disabled="!editValue"
color="primary" color="#4642F1"
variant="text" variant="flat"
@click=" block
updateDisplayName(editValue); class="filled-button"
showEditDisplaynameDialog = false; @click="
" updateDisplayName(editValue);
:disabled="!editValue" showEditDisplaynameDialog = false;
>{{ $t("global.save") }}</v-btn ">{{ $t("global.save") }}</v-btn>
> </v-col>
</v-card-actions> </v-row>
</v-container>
</div>
</v-card> </v-card>
</RoundedDialog> </RoundedDialog>