Merge branch 'develop' into feature/cw-3191
This commit is contained in:
@@ -180,8 +180,6 @@ ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38:
|
||||
## Sentry
|
||||
# SENTRY_DSN=
|
||||
|
||||
## LogRocket
|
||||
# LOG_ROCKET_PROJECT_ID=xxxxx/some-project
|
||||
|
||||
# MICROSOFT CLARITY
|
||||
# MS_CLARITY_TOKEN=xxxxxxxxx
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import AnalyticsHelper from './AnalyticsHelper';
|
||||
import LogRocket from 'logrocket';
|
||||
import DashboardAudioNotificationHelper from './AudioAlerts/DashboardAudioNotificationHelper';
|
||||
|
||||
export const CHATWOOT_SET_USER = 'CHATWOOT_SET_USER';
|
||||
@@ -11,12 +10,6 @@ export const ANALYTICS_RESET = 'ANALYTICS_RESET';
|
||||
export const initializeAnalyticsEvents = () => {
|
||||
window.bus.$on(ANALYTICS_IDENTITY, ({ user }) => {
|
||||
AnalyticsHelper.identify(user);
|
||||
if (window.logRocketProjectId) {
|
||||
LogRocket.identify(user.id, {
|
||||
email: user.email,
|
||||
name: user.name,
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -46,26 +46,8 @@ import webhooks from './modules/webhooks';
|
||||
import draftMessages from './modules/draftMessages';
|
||||
import SLAReports from './modules/SLAReports';
|
||||
|
||||
import LogRocket from 'logrocket';
|
||||
import createPlugin from 'logrocket-vuex';
|
||||
|
||||
const plugins = [];
|
||||
|
||||
if (window.logRocketProjectId) {
|
||||
LogRocket.init(window.logRocketProjectId);
|
||||
// eslint-disable-next-line func-names
|
||||
const logRocketPlugin = createPlugin(LogRocket, function (mutation) {
|
||||
const eventsToIgnore = ['SET_CURRENT_USER', 'AUTHENTICATE', 'CLEAR_USER'];
|
||||
if (eventsToIgnore.includes(mutation.type)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return mutation;
|
||||
});
|
||||
|
||||
plugins.push(logRocketPlugin);
|
||||
}
|
||||
|
||||
Vue.use(Vuex);
|
||||
export default new Vuex.Store({
|
||||
modules: {
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
browser_name: '<%= browser.name %>',
|
||||
}
|
||||
window.errorLoggingConfig = '<%= ENV.fetch('SENTRY_DSN', '') %>'
|
||||
window.logRocketProjectId = '<%= ENV.fetch('LOG_ROCKET_PROJECT_ID', '') %>'
|
||||
</script>
|
||||
<% if @global_config['ANALYTICS_TOKEN'].present? %>
|
||||
<script>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class CustomMarkdownRenderer < CommonMarker::HtmlRenderer
|
||||
YOUTUBE_REGEX = %r{https?://(?:www\.)?(?:youtube\.com/watch\?v=|youtu\.be/)([^&/]+)}
|
||||
LOOM_REGEX = %r{https?://(?:www\.)?loom\.com/share/([^&/]+)}
|
||||
VIMEO_REGEX = %r{https?://(?:www\.)?vimeo\.com/(\d+)}
|
||||
MP4_REGEX = %r{https?://(?:www\.)?.+\.(mp4)}
|
||||
|
||||
@@ -41,23 +42,19 @@ class CustomMarkdownRenderer < CommonMarker::HtmlRenderer
|
||||
|
||||
def render_embedded_content(node)
|
||||
link_url = node.url
|
||||
embedding_methods = {
|
||||
YOUTUBE_REGEX => :make_youtube_embed,
|
||||
VIMEO_REGEX => :make_vimeo_embed,
|
||||
MP4_REGEX => :make_video_embed,
|
||||
LOOM_REGEX => :make_loom_embed
|
||||
}
|
||||
|
||||
youtube_match = link_url.match(YOUTUBE_REGEX)
|
||||
if youtube_match
|
||||
out(make_youtube_embed(youtube_match))
|
||||
return true
|
||||
end
|
||||
|
||||
vimeo_match = link_url.match(VIMEO_REGEX)
|
||||
if vimeo_match
|
||||
out(make_vimeo_embed(vimeo_match))
|
||||
return true
|
||||
end
|
||||
|
||||
mp4_match = link_url.match(MP4_REGEX)
|
||||
if mp4_match
|
||||
out(make_video_embed(link_url))
|
||||
return true
|
||||
embedding_methods.each do |regex, method|
|
||||
match = link_url.match(regex)
|
||||
if match
|
||||
out(send(method, match))
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
false
|
||||
@@ -76,28 +73,40 @@ class CustomMarkdownRenderer < CommonMarker::HtmlRenderer
|
||||
def make_youtube_embed(youtube_match)
|
||||
video_id = youtube_match[1]
|
||||
%(
|
||||
<iframe
|
||||
width="560"
|
||||
height="315"
|
||||
<div style="position: relative; padding-bottom: 62.5%; height: 0;">
|
||||
<iframe
|
||||
src="https://www.youtube.com/embed/#{video_id}"
|
||||
frameborder="0"
|
||||
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
allowfullscreen></iframe>
|
||||
</div>
|
||||
)
|
||||
end
|
||||
|
||||
def make_loom_embed(loom_match)
|
||||
video_id = loom_match[1]
|
||||
%(
|
||||
<div style="position: relative; padding-bottom: 62.5%; height: 0;">
|
||||
<iframe
|
||||
src="https://www.loom.com/embed/#{video_id}"
|
||||
frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen
|
||||
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
|
||||
</div>
|
||||
)
|
||||
end
|
||||
|
||||
def make_vimeo_embed(vimeo_match)
|
||||
video_id = vimeo_match[1]
|
||||
%(
|
||||
<iframe
|
||||
<div style="position: relative; padding-bottom: 62.5%; height: 0;">
|
||||
<iframe
|
||||
src="https://player.vimeo.com/video/#{video_id}"
|
||||
width="640"
|
||||
height="360"
|
||||
frameborder="0"
|
||||
allow="autoplay; fullscreen; picture-in-picture"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
|
||||
</div>
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
+2
-4
@@ -22,7 +22,7 @@
|
||||
"size-limit": [
|
||||
{
|
||||
"path": "public/packs/js/widget-*.js",
|
||||
"limit": "283 KB"
|
||||
"limit": "300 KB"
|
||||
},
|
||||
{
|
||||
"path": "public/packs/js/sdk.js",
|
||||
@@ -61,8 +61,6 @@
|
||||
"ionicons": "~2.0.1",
|
||||
"js-cookie": "^3.0.5",
|
||||
"libphonenumber-js": "^1.10.24",
|
||||
"logrocket": "^3.0.1",
|
||||
"logrocket-vuex": "^0.0.3",
|
||||
"markdown-it": "^13.0.2",
|
||||
"markdown-it-link-attributes": "^4.0.1",
|
||||
"md5": "^2.3.0",
|
||||
@@ -168,4 +166,4 @@
|
||||
"scss-lint"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,20 @@ describe CustomMarkdownRenderer do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when link is a Loom URL' do
|
||||
let(:loom_url) { 'https://www.loom.com/share/VIDEO_ID' }
|
||||
|
||||
it 'renders an iframe with Loom embed code' do
|
||||
output = render_markdown_link(loom_url)
|
||||
expect(output).to include(`
|
||||
<iframe
|
||||
width="640"
|
||||
height="360"
|
||||
src="https://www.loom.com/embed/VIDEO_ID"
|
||||
`)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when link is a Vimeo URL' do
|
||||
let(:vimeo_url) { 'https://vimeo.com/1234567' }
|
||||
|
||||
|
||||
@@ -14396,16 +14396,6 @@ loglevel@^1.6.8:
|
||||
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197"
|
||||
integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==
|
||||
|
||||
logrocket-vuex@^0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/logrocket-vuex/-/logrocket-vuex-0.0.3.tgz#e11d65d384f0c9fdac72f984436cc038adf3db90"
|
||||
integrity sha512-Xnl3pBEkc/bbtZ5JEtFwqNjVuLzVEohlBpyQHP47BlO+/6sFmSM2JcNWojysYUo4cp3IWpmWXcezax2+Cq4RsA==
|
||||
|
||||
logrocket@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/logrocket/-/logrocket-3.0.1.tgz#c746e8df3d5fee999b152975e51db1908357a6f0"
|
||||
integrity sha512-jOWG+jEzobKVxGytzZ+4KGm2kiMQMRTHab2uDWQyVZcHfEF38BlCH1yjQVY4LCmuQUwZitP9biMzJZnyUQ0dtQ==
|
||||
|
||||
loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
|
||||
|
||||
Reference in New Issue
Block a user