diff --git a/Gemfile.lock b/Gemfile.lock index 91d3b3d8b..32f54c64d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -103,8 +103,8 @@ GEM tzinfo (~> 2.0) acts-as-taggable-on (9.0.1) activerecord (>= 6.0, < 7.1) - addressable (2.8.4) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) administrate (0.20.1) actionpack (>= 6.0, < 8.0) actionview (>= 6.0, < 8.0) @@ -171,7 +171,8 @@ GEM commonmarker (0.23.10) concurrent-ruby (1.3.3) connection_pool (2.4.1) - crack (0.4.5) + crack (1.0.0) + bigdecimal rexml crass (1.0.6) csv (3.3.0) @@ -358,7 +359,7 @@ GEM ruby2ruby (~> 2.4) ruby_parser (~> 3.10) hana (1.3.7) - hashdiff (1.0.1) + hashdiff (1.1.0) hashie (5.0.0) http (5.1.1) addressable (~> 2.8) @@ -550,7 +551,7 @@ GEM method_source (~> 1.0) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (5.0.1) + public_suffix (6.0.0) puma (6.4.2) nio4r (~> 2.0) pundit (2.3.0) @@ -633,8 +634,8 @@ GEM retriable (3.1.2) reverse_markdown (2.1.1) nokogiri - rexml (3.2.8) - strscan (>= 3.0.9) + rexml (3.3.2) + strscan rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.1) @@ -809,7 +810,7 @@ GEM web-push (3.0.1) jwt (~> 2.0) openssl (~> 3.0) - webmock (3.18.1) + webmock (3.23.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue index ee5354027..b25ca4bbb 100644 --- a/app/javascript/dashboard/components/ChatList.vue +++ b/app/javascript/dashboard/components/ChatList.vue @@ -122,7 +122,6 @@ import ChatListHeader from './ChatListHeader.vue'; import ConversationAdvancedFilter from './widgets/conversation/ConversationAdvancedFilter.vue'; import ChatTypeTabs from './widgets/ChatTypeTabs.vue'; import ConversationItem from './ConversationItem.vue'; -import timeMixin from '../mixins/time'; import keyboardEventListenerMixins from 'shared/mixins/keyboardEventListenerMixins'; import conversationMixin from '../mixins/conversations'; import wootConstants from 'dashboard/constants/globals'; @@ -159,7 +158,6 @@ export default { VirtualList, }, mixins: [ - timeMixin, conversationMixin, keyboardEventListenerMixins, alertMixin, diff --git a/app/javascript/dashboard/components/ui/TimeAgo.vue b/app/javascript/dashboard/components/ui/TimeAgo.vue index 787c53e1e..14dcc82d5 100644 --- a/app/javascript/dashboard/components/ui/TimeAgo.vue +++ b/app/javascript/dashboard/components/ui/TimeAgo.vue @@ -5,7 +5,7 @@ delay: { show: 1500, hide: 0 }, hideOnClick: true, }" - class="text-xxs text-slate-500 dark:text-slate-500 leading-4 ml-auto hover:text-slate-900 dark:hover:text-slate-100" + class="ml-auto leading-4 text-xxs text-slate-500 dark:text-slate-500 hover:text-slate-900 dark:hover:text-slate-100" > {{ `${createdAtTime} • ${lastActivityTime}` }} @@ -16,11 +16,14 @@ const MINUTE_IN_MILLI_SECONDS = 60000; const HOUR_IN_MILLI_SECONDS = MINUTE_IN_MILLI_SECONDS * 60; const DAY_IN_MILLI_SECONDS = HOUR_IN_MILLI_SECONDS * 24; -import timeMixin from 'dashboard/mixins/time'; +import { + dynamicTime, + dateFormat, + shortTimestamp, +} from 'shared/helpers/timeHelper'; export default { name: 'TimeAgo', - mixins: [timeMixin], props: { isAutoRefreshEnabled: { type: Boolean, @@ -37,17 +40,17 @@ export default { }, data() { return { - lastActivityAtTimeAgo: this.dynamicTime(this.lastActivityTimestamp), - createdAtTimeAgo: this.dynamicTime(this.createdAtTimestamp), + lastActivityAtTimeAgo: dynamicTime(this.lastActivityTimestamp), + createdAtTimeAgo: dynamicTime(this.createdAtTimestamp), timer: null, }; }, computed: { lastActivityTime() { - return this.shortTimestamp(this.lastActivityAtTimeAgo); + return shortTimestamp(this.lastActivityAtTimeAgo); }, createdAtTime() { - return this.shortTimestamp(this.createdAtTimeAgo); + return shortTimestamp(this.createdAtTimeAgo); }, createdAt() { const createdTimeDiff = Date.now() - this.createdAtTimestamp * 1000; @@ -56,9 +59,9 @@ export default { ? `${this.$t('CHAT_LIST.CHAT_TIME_STAMP.CREATED.LATEST')} ${ this.createdAtTimeAgo }` - : `${this.$t( - 'CHAT_LIST.CHAT_TIME_STAMP.CREATED.OLDEST' - )} ${this.dateFormat(this.createdAtTimestamp)}`; + : `${this.$t('CHAT_LIST.CHAT_TIME_STAMP.CREATED.OLDEST')} ${dateFormat( + this.createdAtTimestamp + )}`; }, lastActivity() { const lastActivityTimeDiff = @@ -70,7 +73,7 @@ export default { }` : `${this.$t( 'CHAT_LIST.CHAT_TIME_STAMP.LAST_ACTIVITY.NOT_ACTIVE' - )} ${this.dateFormat(this.lastActivityTimestamp)}`; + )} ${dateFormat(this.lastActivityTimestamp)}`; }, tooltipText() { return `${this.createdAt} @@ -79,10 +82,10 @@ export default { }, watch: { lastActivityTimestamp() { - this.lastActivityAtTimeAgo = this.dynamicTime(this.lastActivityTimestamp); + this.lastActivityAtTimeAgo = dynamicTime(this.lastActivityTimestamp); }, createdAtTimestamp() { - this.createdAtTimeAgo = this.dynamicTime(this.createdAtTimestamp); + this.createdAtTimeAgo = dynamicTime(this.createdAtTimestamp); }, }, mounted() { @@ -96,10 +99,8 @@ export default { methods: { createTimer() { this.timer = setTimeout(() => { - this.lastActivityAtTimeAgo = this.dynamicTime( - this.lastActivityTimestamp - ); - this.createdAtTimeAgo = this.dynamicTime(this.createdAtTimestamp); + this.lastActivityAtTimeAgo = dynamicTime(this.lastActivityTimestamp); + this.createdAtTimeAgo = dynamicTime(this.createdAtTimestamp); this.createTimer(); }, this.refreshTime()); }, diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue index 777c9fdcd..944ac369e 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue @@ -120,7 +120,6 @@ import { mapGetters } from 'vuex'; import Thumbnail from '../Thumbnail.vue'; import MessagePreview from './MessagePreview.vue'; import conversationMixin from '../../../mixins/conversations'; -import timeMixin from '../../../mixins/time'; import router from '../../../routes'; import { frontendURL, conversationUrl } from '../../../helper/URLHelper'; import InboxName from '../InboxName.vue'; @@ -144,7 +143,7 @@ export default { SLACardLabel, }, - mixins: [inboxMixin, timeMixin, conversationMixin, alertMixin], + mixins: [inboxMixin, conversationMixin, alertMixin], props: { activeLabel: { type: String, diff --git a/app/javascript/dashboard/components/widgets/conversation/Message.vue b/app/javascript/dashboard/components/widgets/conversation/Message.vue index 54167db71..0de7b5193 100644 --- a/app/javascript/dashboard/components/widgets/conversation/Message.vue +++ b/app/javascript/dashboard/components/widgets/conversation/Message.vue @@ -158,7 +158,7 @@ import InstagramStory from './bubble/InstagramStory.vue'; import InstagramStoryReply from './bubble/InstagramStoryReply.vue'; import Spinner from 'shared/components/Spinner.vue'; import alertMixin from 'shared/mixins/alertMixin'; -import contentTypeMixin from 'shared/mixins/contentTypeMixin'; +import { CONTENT_TYPES } from 'shared/constants/contentType'; import { MESSAGE_TYPE, MESSAGE_STATUS } from 'shared/constants/messages'; import { generateBotMessageContent } from './helpers/botMessageContentHelper'; import { BUS_EVENTS } from 'shared/constants/busEvents'; @@ -184,7 +184,7 @@ export default { InstagramStoryReply, Spinner, }, - mixins: [alertMixin, messageFormatterMixin, contentTypeMixin], + mixins: [alertMixin, messageFormatterMixin], props: { data: { type: Object, @@ -482,6 +482,9 @@ export default { } return ''; }, + isEmailContentType() { + return this.contentType === CONTENT_TYPES.INCOMING_EMAIL; + }, }, watch: { data() { diff --git a/app/javascript/dashboard/components/widgets/conversation/bubble/Actions.vue b/app/javascript/dashboard/components/widgets/conversation/bubble/Actions.vue index 416af5d06..b7b8ce2e5 100644 --- a/app/javascript/dashboard/components/widgets/conversation/bubble/Actions.vue +++ b/app/javascript/dashboard/components/widgets/conversation/bubble/Actions.vue @@ -77,10 +77,10 @@ import { MESSAGE_TYPE, MESSAGE_STATUS } from 'shared/constants/messages'; import inboxMixin from 'shared/mixins/inboxMixin'; import { mapGetters } from 'vuex'; -import timeMixin from '../../../../mixins/time'; +import { messageTimestamp } from 'shared/helpers/timeHelper'; export default { - mixins: [inboxMixin, timeMixin], + mixins: [inboxMixin], props: { sender: { type: Object, @@ -159,7 +159,7 @@ export default { return MESSAGE_STATUS.SENT === this.messageStatus; }, readableTime() { - return this.messageTimestamp(this.createdAt, 'LLL d, h:mm a'); + return messageTimestamp(this.createdAt, 'LLL d, h:mm a'); }, screenName() { const { additional_attributes: additionalAttributes = {} } = diff --git a/app/javascript/dashboard/components/widgets/conversation/components/GalleryView.vue b/app/javascript/dashboard/components/widgets/conversation/components/GalleryView.vue index 08f77be9a..8684134ca 100644 --- a/app/javascript/dashboard/components/widgets/conversation/components/GalleryView.vue +++ b/app/javascript/dashboard/components/widgets/conversation/components/GalleryView.vue @@ -12,7 +12,7 @@ @click="onClose" >
{{ $t('AUDIT_LOGS.LIST.404') }}
@@ -16,7 +16,7 @@| + | {{ generateLogText(auditLogItem) }} | -+ | {{ messageTimestamp( auditLogItem.created_at, @@ -65,7 +65,7 @@ diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Facebook.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Facebook.vue index 1a3f42c24..05735cc4f 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Facebook.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/channels/Facebook.vue @@ -2,14 +2,15 @@ |