From 43b79aba9e8258fcac64a557e24bb8f87f45eef4 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Mon, 29 Apr 2024 17:58:29 +0530 Subject: [PATCH] feat: Revamp hotkeys and change password in profile settings (#9311) Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Shivam Mishra --- .../settings/personal/ChangePassword.vue | 137 ++++++++++++++++++ .../settings/personal/HotKeyCard.vue | 64 ++++++++ .../dashboard/settings/personal/Index.vue | 67 +++++++++ .../profile/hot-key-ctrl-enter-dark.svg | 25 ++++ .../dashboard/profile/hot-key-ctrl-enter.svg | 25 ++++ .../dashboard/profile/hot-key-enter-dark.svg | 25 ++++ .../dashboard/profile/hot-key-enter.svg | 25 ++++ 7 files changed, 368 insertions(+) create mode 100644 app/javascript/dashboard/routes/dashboard/settings/personal/ChangePassword.vue create mode 100644 app/javascript/dashboard/routes/dashboard/settings/personal/HotKeyCard.vue create mode 100644 public/assets/images/dashboard/profile/hot-key-ctrl-enter-dark.svg create mode 100644 public/assets/images/dashboard/profile/hot-key-ctrl-enter.svg create mode 100644 public/assets/images/dashboard/profile/hot-key-enter-dark.svg create mode 100644 public/assets/images/dashboard/profile/hot-key-enter.svg diff --git a/app/javascript/dashboard/routes/dashboard/settings/personal/ChangePassword.vue b/app/javascript/dashboard/routes/dashboard/settings/personal/ChangePassword.vue new file mode 100644 index 000000000..0c2fa9e78 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/personal/ChangePassword.vue @@ -0,0 +1,137 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/personal/HotKeyCard.vue b/app/javascript/dashboard/routes/dashboard/settings/personal/HotKeyCard.vue new file mode 100644 index 000000000..35cbbeb7b --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/personal/HotKeyCard.vue @@ -0,0 +1,64 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/personal/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/personal/Index.vue index 2ba74a90b..78f4c61bf 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/personal/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/personal/Index.vue @@ -33,6 +33,35 @@ @update-signature="updateSignature" /> + +
+ +
+
+ + + @@ -49,6 +78,8 @@ import { clearCookiesOnLogout } from 'dashboard/store/utils/api.js'; import UserProfilePicture from './UserProfilePicture.vue'; import UserBasicDetails from './UserBasicDetails.vue'; import MessageSignature from './MessageSignature.vue'; +import HotKeyCard from './HotKeyCard.vue'; +import ChangePassword from './ChangePassword.vue'; import FormSection from 'dashboard/components/FormSection.vue'; export default { @@ -57,6 +88,8 @@ export default { FormSection, UserProfilePicture, UserBasicDetails, + HotKeyCard, + ChangePassword, }, mixins: [alertMixin, globalConfigMixin, uiSettingsMixin], data() { @@ -67,6 +100,31 @@ export default { displayName: '', email: '', messageSignature: '', + hotKeys: [ + { + key: 'enter', + title: this.$t( + 'PROFILE_SETTINGS.FORM.SEND_MESSAGE.CARD.ENTER_KEY.HEADING' + ), + description: this.$t( + 'PROFILE_SETTINGS.FORM.SEND_MESSAGE.CARD.ENTER_KEY.CONTENT' + ), + lightImage: '/assets/images/dashboard/profile/hot-key-enter.svg', + darkImage: '/assets/images/dashboard/profile/hot-key-enter-dark.svg', + }, + { + key: 'cmd_enter', + title: this.$t( + 'PROFILE_SETTINGS.FORM.SEND_MESSAGE.CARD.CMD_ENTER_KEY.HEADING' + ), + description: this.$t( + 'PROFILE_SETTINGS.FORM.SEND_MESSAGE.CARD.CMD_ENTER_KEY.CONTENT' + ), + lightImage: '/assets/images/dashboard/profile/hot-key-ctrl-enter.svg', + darkImage: + '/assets/images/dashboard/profile/hot-key-ctrl-enter-dark.svg', + }, + ], }; }, computed: { @@ -156,6 +214,15 @@ export default { this.showAlert(this.$t('PROFILE_SETTINGS.AVATAR_DELETE_FAILED')); } }, + toggleHotKey(key) { + this.hotKeys = this.hotKeys.map(hotKey => + hotKey.key === key ? { ...hotKey, active: !hotKey.active } : hotKey + ); + this.updateUISettings({ editor_message_key: key }); + this.showAlert( + this.$t('PROFILE_SETTINGS.FORM.SEND_MESSAGE.UPDATE_SUCCESS') + ); + }, }, }; diff --git a/public/assets/images/dashboard/profile/hot-key-ctrl-enter-dark.svg b/public/assets/images/dashboard/profile/hot-key-ctrl-enter-dark.svg new file mode 100644 index 000000000..8c0cab866 --- /dev/null +++ b/public/assets/images/dashboard/profile/hot-key-ctrl-enter-dark.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/images/dashboard/profile/hot-key-ctrl-enter.svg b/public/assets/images/dashboard/profile/hot-key-ctrl-enter.svg new file mode 100644 index 000000000..15edc521b --- /dev/null +++ b/public/assets/images/dashboard/profile/hot-key-ctrl-enter.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/images/dashboard/profile/hot-key-enter-dark.svg b/public/assets/images/dashboard/profile/hot-key-enter-dark.svg new file mode 100644 index 000000000..9bc38bbba --- /dev/null +++ b/public/assets/images/dashboard/profile/hot-key-enter-dark.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/images/dashboard/profile/hot-key-enter.svg b/public/assets/images/dashboard/profile/hot-key-enter.svg new file mode 100644 index 000000000..b27f4ee0b --- /dev/null +++ b/public/assets/images/dashboard/profile/hot-key-enter.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + +