diff --git a/app/javascript/dashboard/i18n/locale/ar/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/ar/inboxMgmt.json index da5e213e9..2b590b411 100644 --- a/app/javascript/dashboard/i18n/locale/ar/inboxMgmt.json +++ b/app/javascript/dashboard/i18n/locale/ar/inboxMgmt.json @@ -398,8 +398,8 @@ "MESSENGER_SUB_HEAD": "ضع هذا الكود داخل وسم الـ body في موقعك", "INBOX_AGENTS": "موظف الدعم", "INBOX_AGENTS_SUB_TEXT": "إضافة أو إزالة موظفين من قناة التواصل هذه", - "AGENT_ASSIGNMENT": "Conversation Assignment", - "AGENT_ASSIGNMENT_SUB_TEXT": "Update conversation assignment settings", + "AGENT_ASSIGNMENT": "إسناد المحادثات", + "AGENT_ASSIGNMENT_SUB_TEXT": "تحديث إعدادات إسناد المحادثات", "UPDATE": "تحديث", "ENABLE_EMAIL_COLLECT_BOX": "تفعيل صندوق جمع البريد الإلكتروني", "ENABLE_EMAIL_COLLECT_BOX_SUB_TEXT": "تمكين أو تعطيل مربع جمع البريد الإلكتروني في محادثة جديدة", diff --git a/app/javascript/dashboard/i18n/locale/ar/settings.json b/app/javascript/dashboard/i18n/locale/ar/settings.json index 45ea1db14..9b779f25c 100644 --- a/app/javascript/dashboard/i18n/locale/ar/settings.json +++ b/app/javascript/dashboard/i18n/locale/ar/settings.json @@ -151,7 +151,7 @@ }, "SIDEBAR": { "CURRENTLY_VIEWING_ACCOUNT": "مشاهدة حاليا:", - "SWITCH": "Switch", + "SWITCH": "تبديل", "CONVERSATIONS": "المحادثات", "ALL_CONVERSATIONS": "كل المحادثات", "MENTIONED_CONVERSATIONS": "الإشارات", diff --git a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactInfoPanel.vue b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactInfoPanel.vue index 985179d83..3a3076e9c 100644 --- a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactInfoPanel.vue +++ b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactInfoPanel.vue @@ -8,7 +8,6 @@ diff --git a/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactInfo.vue b/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactInfo.vue index 24aeeff88..db20d7043 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactInfo.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactInfo.vue @@ -65,7 +65,6 @@
{ .replace(/"/g, '"') .replace(/'/g, '''); }; + +export const afterSanitizeAttributes = currentNode => { + if ('target' in currentNode) { + currentNode.setAttribute('target', '_blank'); + } +}; + +export const domPurifyConfig = { + hooks: { + afterSanitizeAttributes, + }, +}; diff --git a/app/javascript/shared/helpers/MessageFormatter.js b/app/javascript/shared/helpers/MessageFormatter.js index 260436da4..c4d0bb62e 100644 --- a/app/javascript/shared/helpers/MessageFormatter.js +++ b/app/javascript/shared/helpers/MessageFormatter.js @@ -1,6 +1,6 @@ import { marked } from 'marked'; import DOMPurify from 'dompurify'; -import { escapeHtml } from './HTMLSanitizer'; +import { escapeHtml, afterSanitizeAttributes } from './HTMLSanitizer'; const TWITTER_USERNAME_REGEX = /(^|[^@\w])@(\w{1,15})\b/g; const TWITTER_USERNAME_REPLACEMENT = @@ -48,9 +48,7 @@ class MessageFormatter { const markedDownOutput = marked(withHash); return markedDownOutput; } - DOMPurify.addHook('afterSanitizeAttributes', node => { - if ('target' in node) node.setAttribute('target', '_blank'); - }); + DOMPurify.addHook('afterSanitizeAttributes', afterSanitizeAttributes); return DOMPurify.sanitize( marked(this.message, { breaks: true, gfm: true }) ); diff --git a/config/app.yml b/config/app.yml index d370e1d74..1ea45235d 100644 --- a/config/app.yml +++ b/config/app.yml @@ -1,5 +1,5 @@ shared: &shared - version: '2.4.1' + version: '2.5.0' development: <<: *shared diff --git a/package.json b/package.json index 8bfdaf74a..f862e0fbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chatwoot/chatwoot", - "version": "2.4.1", + "version": "2.5.0", "license": "MIT", "scripts": { "eslint": "eslint app/**/*.{js,vue} --fix", @@ -63,7 +63,7 @@ "vue-chartjs": "3.5.1", "vue-clickaway": "~2.1.0", "vue-color": "2.8.1", - "vue-dompurify-html": "^2.5.1", + "vue-dompurify-html": "^2.5.2", "vue-easytable": "2.5.5", "vue-i18n": "8.24.3", "vue-loader": "15.9.6", diff --git a/yarn.lock b/yarn.lock index 82d266618..fa46ddb37 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15284,10 +15284,10 @@ vue-docgen-loader@^1.5.0: loader-utils "^1.2.3" querystring "^0.2.0" -vue-dompurify-html@^2.5.1: - version "2.5.1" - resolved "https://registry.npmjs.org/vue-dompurify-html/-/vue-dompurify-html-2.5.1.tgz#a754f4ac7b18eb8fe41f461cb2bb1c4956a9bd2d" - integrity sha512-B8rQj2jAPJJhtKHHa6jg5B3/RoKBmmUl/awP/GxWXGu75j4Y7+MHqv0DG52v0Uz0taEpHyZun34KEYMAfrPWnA== +vue-dompurify-html@^2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/vue-dompurify-html/-/vue-dompurify-html-2.5.2.tgz#f547d4eacae4640f95eb0e9308e7ef8e223887c6" + integrity sha512-G6I135+BhlACJ9xftqK7fvhXyjNrgHCI594qHnUW5e2Bmp8BOTV1kz7cxwI37b4BJnHkj9IY10RwMPOtJqw+pw== dependencies: dompurify "^2.3.4"