From 43b79aba9e8258fcac64a557e24bb8f87f45eef4 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Mon, 29 Apr 2024 17:58:29 +0530 Subject: [PATCH 01/11] 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + From 2012d001099faf1f33103057156e0b4561a7e1af Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:09:08 +0530 Subject: [PATCH 02/11] fix: Start calender is not moving properly is last 30 days range (#9322) * fix: Start calender is not moving properly is last 30 days range * chore: Minor fix --- .../components/ui/DatePicker/DatePicker.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/javascript/dashboard/components/ui/DatePicker/DatePicker.vue b/app/javascript/dashboard/components/ui/DatePicker/DatePicker.vue index cd2348945..225bb90f3 100644 --- a/app/javascript/dashboard/components/ui/DatePicker/DatePicker.vue +++ b/app/javascript/dashboard/components/ui/DatePicker/DatePicker.vue @@ -31,7 +31,7 @@ import CalendarMonth from './components/CalendarMonth.vue'; import CalendarWeek from './components/CalendarWeek.vue'; import CalendarFooter from './components/CalendarFooter.vue'; -const { LAST_7_DAYS, CUSTOM_RANGE } = DATE_RANGE_TYPES; +const { LAST_7_DAYS, LAST_30_DAYS, CUSTOM_RANGE } = DATE_RANGE_TYPES; const { START_CALENDAR, END_CALENDAR } = CALENDAR_TYPES; const { WEEK, MONTH, YEAR } = CALENDAR_PERIODS; @@ -59,14 +59,16 @@ const emit = defineEmits(['change']); // Watcher will set the start and end dates based on the selected range watch(selectedRange, newRange => { if (newRange !== CUSTOM_RANGE) { - // If selecting a range other than last 7 days, set the start and end dates to the selected start and end dates - // If selecting last 7 days, set the start date to the selected start date + // If selecting a range other than last 7 days or last 30 days, set the start and end dates to the selected start and end dates + // If selecting last 7 days or last 30 days is, set the start date to the selected start date // and the end date to one month ahead of the start date if the start date and end date are in the same month // Otherwise set the end date to the selected end date - const isLast7days = newRange === LAST_7_DAYS; + const isLastSevenOrThirtyDays = + newRange === LAST_7_DAYS || newRange === LAST_30_DAYS; startCurrentDate.value = selectedStartDate.value; endCurrentDate.value = - isLast7days && isSameMonth(selectedStartDate.value, selectedEndDate.value) + isLastSevenOrThirtyDays && + isSameMonth(selectedStartDate.value, selectedEndDate.value) ? startOfMonth(addMonths(selectedStartDate.value, 1)) : selectedEndDate.value; selectingEndDate.value = false; From 705f8ef948e3f36dffeb51c2df38edd895b20cc0 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 30 Apr 2024 10:13:50 +0530 Subject: [PATCH 03/11] feat: add composables for migration and update portal settings (#9299) * feat: setup vuelitdate for vue 2.7 * feat: add all composables * fix: portal settings layout * feat: remove styles * feat: use setup API for ListAllCategories * chore: format ListAllCategories * refactor: add useAlert * feat: add track composable * feat: update map getters * fix: import * feat: update edit portal locales page [wip] * feat: migrate locales page * feat: remove alert message ref * chore: format EditPortalLocales * refactor: use composiiton api for PortalCustomization * refactor: remove color * feat: update PortalSettingsCustomizationForm to use setup syntax * refactor: no need to import defineEmits * refactor: format component * fix: update logic * feat: migrate PortalSettingsBasicForm * refactor: format PortalSettingsBasicForm * refactor: migrate EditPortalCustomization to Vue 2.7 * feat: migrate EditPortalBasic to vue 2.7 * chore: revert changes to EditPortal * fix: portal layout * fix: width * feat: use setup syntax * fix: double border * feat: return track method * refactor: track usage --------- Co-authored-by: Muhsin Keloth Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --- .../components/Layout/SettingsLayout.vue | 34 ++ .../components/PortalSettingsBasicForm.vue | 457 +++++++++--------- .../PortalSettingsCustomizationForm.vue | 276 +++++------ .../pages/categories/ListAllCategories.vue | 226 ++++----- .../pages/portals/EditPortalBasic.vue | 149 +++--- .../pages/portals/EditPortalCustomization.vue | 93 ++-- .../pages/portals/EditPortalLocales.vue | 255 +++++----- .../helpcenter/pages/portals/NewPortal.vue | 14 +- .../pages/portals/PortalCustomization.vue | 132 +++-- .../pages/portals/PortalSettingsFinish.vue | 22 +- 10 files changed, 807 insertions(+), 851 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/helpcenter/components/Layout/SettingsLayout.vue diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/components/Layout/SettingsLayout.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/components/Layout/SettingsLayout.vue new file mode 100644 index 000000000..bc3c51a39 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/components/Layout/SettingsLayout.vue @@ -0,0 +1,34 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsBasicForm.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsBasicForm.vue index 85c035a2a..4417fdf57 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsBasicForm.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsBasicForm.vue @@ -1,256 +1,241 @@ - + - + +function onFileChange({ file }) { + if (checkFileSizeLimit(file, MAXIMUM_FILE_UPLOAD_SIZE)) { + uploadLogoToStorage(file); + } else { + const errorKey = + 'PROFILE_SETTINGS.FORM.MESSAGE_SIGNATURE_SECTION.IMAGE_UPLOAD_SIZE_ERROR'; + useAlert(t(errorKey, { size: MAXIMUM_FILE_UPLOAD_SIZE })); + } +} + + + diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsCustomizationForm.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsCustomizationForm.vue index c00ab9beb..7572f5b80 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsCustomizationForm.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/components/PortalSettingsCustomizationForm.vue @@ -1,68 +1,140 @@ + + - diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalBasic.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalBasic.vue index 8e3579f02..aac8125e5 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalBasic.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalBasic.vue @@ -1,3 +1,75 @@ + + - - diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalCustomization.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalCustomization.vue index d1c9341f1..902dc3ca6 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalCustomization.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalCustomization.vue @@ -1,3 +1,48 @@ + + - - diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalLocales.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalLocales.vue index 3c1c4c872..8d0ffecd3 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalLocales.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/EditPortalLocales.vue @@ -1,6 +1,117 @@ + + - - - diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/NewPortal.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/NewPortal.vue index e14723476..0222044bc 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/NewPortal.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/NewPortal.vue @@ -1,5 +1,5 @@ + - - diff --git a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/PortalSettingsFinish.vue b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/PortalSettingsFinish.vue index 690f058a4..3a3e77142 100644 --- a/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/PortalSettingsFinish.vue +++ b/app/javascript/dashboard/routes/dashboard/helpcenter/pages/portals/PortalSettingsFinish.vue @@ -1,6 +1,6 @@ - From 12af2fe026c909afc35f6bde7305dcd4eaf9c8d9 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:35:14 +0530 Subject: [PATCH 04/11] feat: Remove the usage of clickAway mixin with directive (#9323) --- .../dashboard/components/buttons/ResolveAction.vue | 3 +-- .../dashboard/components/layout/AvailabilityStatus.vue | 3 +-- .../components/layout/sidebarComponents/OptionsMenu.vue | 2 -- .../dashboard/components/widgets/ColorPicker.vue | 2 -- .../dashboard/components/widgets/LabelSelector.vue | 3 +-- .../widgets/conversation/ConversationBasicFilter.vue | 3 +-- .../components/widgets/conversation/MoreActions.vue | 3 +-- .../components/widgets/conversation/ReplyBox.vue | 2 -- .../widgets/conversation/components/GalleryView.vue | 3 +-- .../widgets/conversation/components/SLACardLabel.vue | 2 -- .../conversationBulkActions/AgentSelector.vue | 2 -- .../conversation/conversationBulkActions/LabelActions.vue | 2 -- .../conversation/conversationBulkActions/TeamActions.vue | 2 -- .../conversationBulkActions/UpdateActions.vue | 2 -- .../components/widgets/modal/WootKeyShortcutModal.vue | 2 -- .../conversations/components/MessageContextMenu.vue | 3 +-- .../dashboard/modules/search/components/SearchView.vue | 2 -- .../dashboard/contacts/components/ContactsTable.vue | 3 +-- .../dashboard/conversation/ConversationParticipant.vue | 3 +-- .../routes/dashboard/conversation/Macros/MacroItem.vue | 3 +-- .../routes/dashboard/conversation/contact/ContactInfo.vue | 3 +-- .../routes/dashboard/conversation/labels/LabelBox.vue | 8 +------- .../dashboard/conversation/search/PopOverSearch.vue | 3 +-- .../helpcenter/components/ArticleSearch/SearchPopover.vue | 3 +-- .../helpcenter/components/Header/ArticleHeader.vue | 3 --- .../helpcenter/components/Header/EditArticleHeader.vue | 3 +-- .../dashboard/helpcenter/components/PortalPopover.vue | 2 -- .../helpcenter/pages/categories/NameEmojiInput.vue | 3 --- .../routes/dashboard/inbox/components/InboxListHeader.vue | 3 +-- .../notifications/components/NotificationPanel.vue | 3 +-- .../dashboard/settings/campaigns/CampaignsTable.vue | 3 +-- .../settings/reports/components/SLA/SLAViewDetails.vue | 3 --- app/javascript/portal/components/PublicArticleSearch.vue | 3 --- .../shared/components/ui/MultiselectDropdown.vue | 2 -- app/javascript/widget/components/ChatInputWrap.vue | 3 +-- app/javascript/widget/components/Form/PhoneInput.vue | 8 +------- 36 files changed, 20 insertions(+), 86 deletions(-) diff --git a/app/javascript/dashboard/components/buttons/ResolveAction.vue b/app/javascript/dashboard/components/buttons/ResolveAction.vue index 9a70a7f19..61375dc21 100644 --- a/app/javascript/dashboard/components/buttons/ResolveAction.vue +++ b/app/javascript/dashboard/components/buttons/ResolveAction.vue @@ -88,7 +88,6 @@