From 990d045cb3324ac251ad2ec2b2122904f0a043ce Mon Sep 17 00:00:00 2001 From: Vishnu Narayanan Date: Fri, 21 Feb 2025 01:57:37 +0530 Subject: [PATCH 1/7] fix: handle empty FIRECRAWL_KEY in captain crawl job (#10936) - handle empty FIRECRAWL_KEY in captain crawl job --- enterprise/app/jobs/captain/documents/crawl_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enterprise/app/jobs/captain/documents/crawl_job.rb b/enterprise/app/jobs/captain/documents/crawl_job.rb index c306a3831..132671385 100644 --- a/enterprise/app/jobs/captain/documents/crawl_job.rb +++ b/enterprise/app/jobs/captain/documents/crawl_job.rb @@ -2,7 +2,7 @@ class Captain::Documents::CrawlJob < ApplicationJob queue_as :low def perform(document) - if InstallationConfig.find_by(name: 'CAPTAIN_FIRECRAWL_API_KEY').present? + if InstallationConfig.find_by(name: 'CAPTAIN_FIRECRAWL_API_KEY')&.value.present? perform_firecrawl_crawl(document) else perform_simple_crawl(document) From b8fc921f9a0558e1ea86a8b56097dfda8630bca9 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Fri, 21 Feb 2025 07:19:28 +0530 Subject: [PATCH 2/7] fix: Convert seconds based metric tooltips to readable format (#10938) # Pull Request Template ## Description Fixes https://linear.app/chatwoot/issue/CW-4064/convert-average-metric-tooltips-from-seconds-to-readable-time-format #### **Cause** Chart tooltip configuration was using outdated Chart.js structure, causing the time formatting function to not be applied correctly to tooltip values in time-based metrics. #### **Solution** Updated tooltip configuration to use correct Chart.js Vue 3 plugin structure ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? ### **Screenshots** #### **Before** image #### **After** image ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --- .../settings/reports/ReportContainer.vue | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/ReportContainer.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/ReportContainer.vue index f89d1ac4d..c831612e0 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/ReportContainer.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/ReportContainer.vue @@ -112,21 +112,32 @@ export default { }; }, getChartOptions(metric) { - let tooltips = {}; - if (this.isAverageMetricType(metric.KEY)) { - tooltips.callbacks = { - label: tooltipItem => { - return this.$t(metric.TOOLTIP_TEXT, { - metricValue: formatTime(tooltipItem.yLabel), - conversationCount: - this.accountReport.data[metric.KEY][tooltipItem.index].count, - }); - }, - }; + const baseOptions = METRIC_CHART[metric.KEY].scales; + + // If not an average metric type, return base options early + if (!this.isAverageMetricType(metric.KEY)) { + return baseOptions; } + + // Only create tooltip config for time-based metrics return { - scales: METRIC_CHART[metric.KEY].scales, - tooltips: tooltips, + ...baseOptions, + plugins: { + tooltip: { + callbacks: { + label: ({ raw, dataIndex }) => { + const value = raw || 0; + const count = + this.accountReport.data[metric.KEY][dataIndex]?.count || 0; + + return this.$t(metric.TOOLTIP_TEXT, { + metricValue: formatTime(value), + conversationCount: count, + }); + }, + }, + }, + }, }; }, }, From 73f6b888cd2a4707ae39e427d89ee08a4c191458 Mon Sep 17 00:00:00 2001 From: Pranav Date: Thu, 20 Feb 2025 20:21:54 -0800 Subject: [PATCH 3/7] fix: Fix issues in bubble design (#10940) Just making it easier to test and merge https://github.com/chatwoot/chatwoot/pull/10796. This PR does the following: - Removes the change on br + br condition. - Support 1x, 1.5x, 2x playbacks - Add a hover on the agent avatar --- .../components-next/message/Message.vue | 6 +++++ .../components-next/message/chips/Audio.vue | 26 ++++++++++++++++++- tailwind.config.js | 4 --- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/app/javascript/dashboard/components-next/message/Message.vue b/app/javascript/dashboard/components-next/message/Message.vue index df0602a49..9d6b30f81 100644 --- a/app/javascript/dashboard/components-next/message/Message.vue +++ b/app/javascript/dashboard/components-next/message/Message.vue @@ -414,6 +414,11 @@ const avatarInfo = computed(() => { }; }); +const avatarTooltip = computed(() => { + if (avatarInfo.value.name === '') return ''; + return `${t('CONVERSATION.SENT_BY')} ${avatarInfo.value.name}`; +}); + const setupHighlightTimer = () => { if (Number(route.query.messageId) !== Number(props.id)) { return; @@ -472,6 +477,7 @@ provideMessageContext({ >
diff --git a/app/javascript/dashboard/components-next/message/chips/Audio.vue b/app/javascript/dashboard/components-next/message/chips/Audio.vue index 0d91fb84c..680584048 100644 --- a/app/javascript/dashboard/components-next/message/chips/Audio.vue +++ b/app/javascript/dashboard/components-next/message/chips/Audio.vue @@ -25,16 +25,22 @@ const isPlaying = ref(false); const isMuted = ref(false); const currentTime = ref(0); const duration = ref(0); +const playbackSpeed = ref(1); const onLoadedMetadata = () => { duration.value = audioPlayer.value?.duration; }; +const playbackSpeedLabel = computed(() => { + return `${playbackSpeed.value}x`; +}); + // There maybe a chance that the audioPlayer ref is not available // When the onLoadMetadata is called, so we need to set the duration // value when the component is mounted onMounted(() => { duration.value = audioPlayer.value?.duration; + audioPlayer.value.playbackRate = playbackSpeed.value; }); const formatTime = time => { @@ -72,6 +78,16 @@ const playOrPause = () => { const onEnd = () => { isPlaying.value = false; currentTime.value = 0; + playbackSpeed.value = 1; + audioPlayer.value.playbackRate = 1; +}; + +const changePlaybackSpeed = () => { + const speeds = [1, 1.5, 2]; + const currentIndex = speeds.indexOf(playbackSpeed.value); + const nextIndex = (currentIndex + 1) % speeds.length; + playbackSpeed.value = speeds[nextIndex]; + audioPlayer.value.playbackRate = playbackSpeed.value; }; const downloadAudio = async () => { @@ -106,7 +122,7 @@ const downloadAudio = async () => {
{{ formatTime(currentTime) }} / {{ formatTime(duration) }}
-
+
{ @input="seek" />
+