-
diff --git a/app/javascript/dashboard/store/modules/accounts.js b/app/javascript/dashboard/store/modules/accounts.js
index c757b7fcb..fb2c8b89f 100644
--- a/app/javascript/dashboard/store/modules/accounts.js
+++ b/app/javascript/dashboard/store/modules/accounts.js
@@ -4,6 +4,7 @@ import AccountAPI from '../../api/account';
import { differenceInDays } from 'date-fns';
import EnterpriseAccountAPI from '../../api/enterprise/account';
import { throwErrorMessage } from '../utils/api';
+import { getLanguageDirection } from 'dashboard/components/widgets/conversation/advancedFilterItems/languages';
const findRecordById = ($state, id) =>
$state.records.find(record => record.id === Number(id)) || {};
@@ -27,6 +28,13 @@ export const getters = {
getUIFlags($state) {
return $state.uiFlags;
},
+ isRTL: ($state, _, rootState) => {
+ const accountId = rootState.route?.params?.accountId;
+ if (!accountId) return false;
+
+ const { locale } = findRecordById($state, Number(accountId));
+ return locale ? getLanguageDirection(locale) : false;
+ },
isTrialAccount: $state => id => {
const account = findRecordById($state, id);
const createdAt = new Date(account.created_at);
diff --git a/app/javascript/dashboard/store/modules/cannedResponse.js b/app/javascript/dashboard/store/modules/cannedResponse.js
index 7b24d1171..568150392 100644
--- a/app/javascript/dashboard/store/modules/cannedResponse.js
+++ b/app/javascript/dashboard/store/modules/cannedResponse.js
@@ -18,6 +18,15 @@ const getters = {
getCannedResponses(_state) {
return _state.records;
},
+ getSortedCannedResponses(_state) {
+ return sortOrder =>
+ [..._state.records].sort((a, b) => {
+ if (sortOrder === 'asc') {
+ return a.short_code.localeCompare(b.short_code);
+ }
+ return b.short_code.localeCompare(a.short_code);
+ });
+ },
getUIFlags(_state) {
return _state.uiFlags;
},
diff --git a/app/javascript/dashboard/store/modules/conversations/actions.js b/app/javascript/dashboard/store/modules/conversations/actions.js
index 6a8b94e1e..eaf385372 100644
--- a/app/javascript/dashboard/store/modules/conversations/actions.js
+++ b/app/javascript/dashboard/store/modules/conversations/actions.js
@@ -12,6 +12,7 @@ import {
} from './helpers/actionHelpers';
import messageReadActions from './actions/messageReadActions';
import messageTranslateActions from './actions/messageTranslateActions';
+import * as Sentry from '@sentry/browser';
export const hasMessageFailedWithExternalError = pendingMessage => {
// This helper is used to check if the message has failed with an external error.
@@ -100,14 +101,24 @@ const actions = {
},
fetchAllAttachments: async ({ commit }, conversationId) => {
+ let attachments = null;
+
try {
const { data } = await ConversationApi.getAllAttachments(conversationId);
+ attachments = data.payload;
+ } catch (error) {
+ // in case of error, log the error and continue
+ Sentry.setContext('Conversation', {
+ id: conversationId,
+ });
+ Sentry.captureException(error);
+ } finally {
+ // we run the commit even if the request fails
+ // this ensures that the `attachment` variable is always present on chat
commit(types.SET_ALL_ATTACHMENTS, {
id: conversationId,
- data: data.payload,
+ data: attachments,
});
- } catch (error) {
- // Handle error
}
},
diff --git a/app/javascript/dashboard/store/modules/conversations/getters.js b/app/javascript/dashboard/store/modules/conversations/getters.js
index 8c2070963..1a905c3c5 100644
--- a/app/javascript/dashboard/store/modules/conversations/getters.js
+++ b/app/javascript/dashboard/store/modules/conversations/getters.js
@@ -18,9 +18,8 @@ const getters = {
);
return selectedChat || {};
},
- getSelectedChatAttachments: (_state, _getters) => {
- const selectedChat = _getters.getSelectedChat;
- return selectedChat.attachments || [];
+ getSelectedChatAttachments: ({ selectedChatId, attachments }) => {
+ return attachments[selectedChatId] || [];
},
getChatListFilters: ({ conversationFilters }) => conversationFilters,
getLastEmailInSelectedChat: (stage, _getters) => {
diff --git a/app/javascript/dashboard/store/modules/conversations/index.js b/app/javascript/dashboard/store/modules/conversations/index.js
index 769354ed2..b3e39d397 100644
--- a/app/javascript/dashboard/store/modules/conversations/index.js
+++ b/app/javascript/dashboard/store/modules/conversations/index.js
@@ -10,6 +10,7 @@ import { emitter } from 'shared/helpers/mitt';
const state = {
allConversations: [],
+ attachments: {},
listLoadingStatus: true,
chatStatusFilter: wootConstants.STATUS_TYPE.OPEN,
chatSortFilter: wootConstants.SORT_BY_TYPE.LATEST,
@@ -48,7 +49,6 @@ export const mutations = {
allMessagesLoaded: existingConversation.allMessagesLoaded,
messages: existingConversation.messages,
dataFetched: existingConversation.dataFetched,
- attachments: existingConversation.attachments,
};
}
});
@@ -78,10 +78,10 @@ export const mutations = {
}
},
[types.SET_ALL_ATTACHMENTS](_state, { id, data }) {
- const [chat] = _state.allConversations.filter(c => c.id === id);
- if (!chat) return;
- Vue.set(chat, 'attachments', []);
- chat.attachments.push(...data);
+ const attachments = _state.attachments[id] || [];
+
+ attachments.push(...data);
+ _state.attachments[id] = [...attachments];
},
[types.SET_MISSING_MESSAGES](_state, { id, data }) {
const [chat] = _state.allConversations.filter(c => c.id === id);
@@ -144,42 +144,40 @@ export const mutations = {
Vue.set(chat, 'muted', false);
},
- [types.ADD_CONVERSATION_ATTACHMENTS]({ allConversations }, message) {
- const { conversation_id: conversationId } = message;
- const [chat] = getSelectedChatConversation({
- allConversations,
- selectedChatId: conversationId,
+ [types.ADD_CONVERSATION_ATTACHMENTS](_state, message) {
+ // early return if the message has not been sent, or has no attachments
+ if (
+ message.status !== MESSAGE_STATUS.SENT ||
+ !message.attachments?.length
+ ) {
+ return;
+ }
+
+ const id = message.conversation_id;
+ const existingAttachments = _state.attachments[id] || [];
+
+ const attachmentsToAdd = message.attachments.filter(attachment => {
+ // if the attachment is not already in the store, add it
+ // this is to prevent duplicates
+ return !existingAttachments.some(
+ existingAttachment => existingAttachment.id === attachment.id
+ );
});
- if (!chat) return;
-
- const isMessageSent =
- message.status === MESSAGE_STATUS.SENT && message.attachments;
- if (isMessageSent) {
- message.attachments.forEach(attachment => {
- if (!chat.attachments.some(a => a.id === attachment.id)) {
- chat.attachments.push(attachment);
- }
- });
- }
+ // replace the attachments in the store
+ _state.attachments[id] = [...existingAttachments, ...attachmentsToAdd];
},
- [types.DELETE_CONVERSATION_ATTACHMENTS]({ allConversations }, message) {
- const { conversation_id: conversationId } = message;
- const [chat] = getSelectedChatConversation({
- allConversations,
- selectedChatId: conversationId,
+ [types.DELETE_CONVERSATION_ATTACHMENTS](_state, message) {
+ if (message.status !== MESSAGE_STATUS.SENT) return;
+
+ const { conversation_id: id } = message;
+ const existingAttachments = _state.attachments[id] || [];
+ if (!existingAttachments.length) return;
+
+ _state.attachments[id] = existingAttachments.filter(attachment => {
+ return attachment.message_id !== message.id;
});
-
- if (!chat) return;
-
- const isMessageSent = message.status === MESSAGE_STATUS.SENT;
- if (isMessageSent) {
- const attachmentIndex = chat.attachments.findIndex(
- a => a.message_id === message.id
- );
- if (attachmentIndex !== -1) chat.attachments.splice(attachmentIndex, 1);
- }
},
[types.ADD_MESSAGE]({ allConversations, selectedChatId }, message) {
diff --git a/app/javascript/dashboard/store/modules/integrations.js b/app/javascript/dashboard/store/modules/integrations.js
index 3183afbe3..add8f022f 100644
--- a/app/javascript/dashboard/store/modules/integrations.js
+++ b/app/javascript/dashboard/store/modules/integrations.js
@@ -20,28 +20,18 @@ const state = {
},
};
-const isAValidAppIntegration = integration => {
- return [
- 'dialogflow',
- 'dyte',
- 'google_translate',
- 'openai',
- 'linear',
- ].includes(integration.id);
-};
export const getters = {
- getIntegrations($state) {
- return $state.records.filter(item => !isAValidAppIntegration(item));
- },
getAppIntegrations($state) {
- return $state.records.filter(item => isAValidAppIntegration(item));
- },
- getIntegration: $state => integrationId => {
- const [integration] = $state.records.filter(
- record => record.id === integrationId
- );
- return integration || {};
+ return $state.records;
},
+ getIntegration:
+ $state =>
+ (integrationId, defaultValue = {}) => {
+ const [integration] = $state.records.filter(
+ record => record.id === integrationId
+ );
+ return integration || defaultValue;
+ },
getUIFlags($state) {
return $state.uiFlags;
},
diff --git a/app/javascript/dashboard/store/modules/specs/account/getters.spec.js b/app/javascript/dashboard/store/modules/specs/account/getters.spec.js
index 676720c29..77cc9b357 100644
--- a/app/javascript/dashboard/store/modules/specs/account/getters.spec.js
+++ b/app/javascript/dashboard/store/modules/specs/account/getters.spec.js
@@ -1,4 +1,5 @@
import { getters } from '../../accounts';
+import * as languageHelpers from 'dashboard/components/widgets/conversation/advancedFilterItems/languages';
const accountData = {
id: 1,
@@ -46,4 +47,37 @@ describe('#getters', () => {
)(1, 'auto_resolve_conversations')
).toEqual(true);
});
+
+ describe('isRTL', () => {
+ it('returns false when accountId is not present', () => {
+ const rootState = { route: { params: {} } };
+ expect(getters.isRTL({}, null, rootState)).toBe(false);
+ });
+
+ it('returns true for RTL language', () => {
+ const state = {
+ records: [{ id: 1, locale: 'ar' }],
+ };
+ const rootState = { route: { params: { accountId: '1' } } };
+ vi.spyOn(languageHelpers, 'getLanguageDirection').mockReturnValue(true);
+ expect(getters.isRTL(state, null, rootState)).toBe(true);
+ });
+
+ it('returns false for LTR language', () => {
+ const state = {
+ records: [{ id: 1, locale: 'en' }],
+ };
+ const rootState = { route: { params: { accountId: '1' } } };
+ vi.spyOn(languageHelpers, 'getLanguageDirection').mockReturnValue(false);
+ expect(getters.isRTL(state, null, rootState)).toBe(false);
+ });
+
+ it('returns false when account is not found', () => {
+ const state = {
+ records: [],
+ };
+ const rootState = { route: { params: { accountId: '1' } } };
+ expect(getters.isRTL(state, null, rootState)).toBe(false);
+ });
+ });
});
diff --git a/app/javascript/dashboard/store/modules/specs/cannedResponses/getters.spec.js b/app/javascript/dashboard/store/modules/specs/cannedResponses/getters.spec.js
new file mode 100644
index 000000000..7a80aed8c
--- /dev/null
+++ b/app/javascript/dashboard/store/modules/specs/cannedResponses/getters.spec.js
@@ -0,0 +1,43 @@
+import CannedResponses from '../../cannedResponse';
+
+const CANNED_RESPONSES = [
+ { short_code: 'hello', content: 'Hi ' },
+ { short_code: 'ask', content: 'Ask questions' },
+ { short_code: 'greet', content: 'Good morning' },
+];
+
+const getters = CannedResponses.getters;
+
+describe('#getCannedResponses', () => {
+ it('returns canned responses', () => {
+ const state = { records: CANNED_RESPONSES };
+ expect(getters.getCannedResponses(state)).toEqual(CANNED_RESPONSES);
+ });
+});
+
+describe('#getSortedCannedResponses', () => {
+ it('returns sort canned responses in ascending order', () => {
+ const state = { records: CANNED_RESPONSES };
+ expect(getters.getSortedCannedResponses(state)('asc')).toEqual([
+ CANNED_RESPONSES[1],
+ CANNED_RESPONSES[2],
+ CANNED_RESPONSES[0],
+ ]);
+ });
+
+ it('returns sort canned responses in descending order', () => {
+ const state = { records: CANNED_RESPONSES };
+ expect(getters.getSortedCannedResponses(state)('desc')).toEqual([
+ CANNED_RESPONSES[0],
+ CANNED_RESPONSES[2],
+ CANNED_RESPONSES[1],
+ ]);
+ });
+});
+
+describe('#getUIFlags', () => {
+ it('returns uiFlags', () => {
+ const state = { uiFlags: { isFetching: true } };
+ expect(getters.getUIFlags(state)).toEqual({ isFetching: true });
+ });
+});
diff --git a/app/javascript/dashboard/store/modules/specs/conversations/getters.spec.js b/app/javascript/dashboard/store/modules/specs/conversations/getters.spec.js
index 3c3bf79de..cded29329 100644
--- a/app/javascript/dashboard/store/modules/specs/conversations/getters.spec.js
+++ b/app/javascript/dashboard/store/modules/specs/conversations/getters.spec.js
@@ -245,30 +245,18 @@ describe('#getters', () => {
describe('#getSelectedChatAttachments', () => {
it('Returns attachments in selected chat', () => {
- const state = {};
- const getSelectedChat = {
- attachments: [
- {
- id: 1,
- file_name: 'test1',
- },
- {
- id: 2,
- file_name: 'test2',
- },
+ const attachments = {
+ 1: [
+ { id: 1, file_name: 'test1' },
+ { id: 2, file_name: 'test2' },
],
};
+ const selectedChatId = 1;
expect(
- getters.getSelectedChatAttachments(state, { getSelectedChat })
+ getters.getSelectedChatAttachments({ selectedChatId, attachments })
).toEqual([
- {
- id: 1,
- file_name: 'test1',
- },
- {
- id: 2,
- file_name: 'test2',
- },
+ { id: 1, file_name: 'test1' },
+ { id: 2, file_name: 'test2' },
]);
});
});
diff --git a/app/javascript/dashboard/store/modules/specs/conversations/mutations.spec.js b/app/javascript/dashboard/store/modules/specs/conversations/mutations.spec.js
index de596534c..6340e4de9 100644
--- a/app/javascript/dashboard/store/modules/specs/conversations/mutations.spec.js
+++ b/app/javascript/dashboard/store/modules/specs/conversations/mutations.spec.js
@@ -313,7 +313,6 @@ describe('#mutations', () => {
{
id: 1,
messages: [{ id: 1, content: 'test' }],
- attachments: [{ id: 1, name: 'test1.png' }],
dataFetched: true,
allMessagesLoaded: true,
},
@@ -325,7 +324,6 @@ describe('#mutations', () => {
id: 1,
name: 'test',
messages: [{ id: 1, content: 'updated message' }],
- attachments: [{ id: 1, name: 'test.png' }],
dataFetched: true,
allMessagesLoaded: true,
},
@@ -335,7 +333,6 @@ describe('#mutations', () => {
id: 1,
name: 'test',
messages: [{ id: 1, content: 'test' }],
- attachments: [{ id: 1, name: 'test1.png' }],
dataFetched: true,
allMessagesLoaded: true,
},
@@ -371,25 +368,28 @@ describe('#mutations', () => {
it('set all attachments', () => {
const state = {
allConversations: [{ id: 1 }],
+ attachments: {},
};
const data = [{ id: 1, name: 'test' }];
mutations[types.SET_ALL_ATTACHMENTS](state, { id: 1, data });
- expect(state.allConversations[0].attachments).toEqual(data);
+ expect(state.attachments[1]).toEqual(data);
});
it('set attachments key even if the attachments are empty', () => {
const state = {
allConversations: [{ id: 1 }],
+ attachments: {},
};
const data = [];
mutations[types.SET_ALL_ATTACHMENTS](state, { id: 1, data });
- expect(state.allConversations[0].attachments).toEqual([]);
+ expect(state.attachments[1]).toEqual([]);
});
});
describe('#ADD_CONVERSATION_ATTACHMENTS', () => {
it('add conversation attachments', () => {
const state = {
- allConversations: [{ id: 1, attachments: [] }],
+ allConversations: [{ id: 1 }],
+ attachments: {},
};
const message = {
conversation_id: 1,
@@ -398,19 +398,13 @@ describe('#mutations', () => {
};
mutations[types.ADD_CONVERSATION_ATTACHMENTS](state, message);
- expect(state.allConversations[0].attachments).toEqual(
- message.attachments
- );
+ expect(state.attachments[1]).toEqual(message.attachments);
});
it('should not add duplicate attachments', () => {
const state = {
- allConversations: [
- {
- id: 1,
- attachments: [{ id: 1, name: 'existing' }],
- },
- ],
+ allConversations: [{ id: 1 }],
+ attachments: { 1: [{ id: 1, name: 'existing' }] },
};
const message = {
conversation_id: 1,
@@ -422,12 +416,12 @@ describe('#mutations', () => {
};
mutations[types.ADD_CONVERSATION_ATTACHMENTS](state, message);
- expect(state.allConversations[0].attachments).toHaveLength(2);
- expect(state.allConversations[0].attachments).toContainEqual({
+ expect(state.attachments[1]).toHaveLength(2);
+ expect(state.attachments[1]).toContainEqual({
id: 1,
name: 'existing',
});
- expect(state.allConversations[0].attachments).toContainEqual({
+ expect(state.attachments[1]).toContainEqual({
id: 2,
name: 'new',
});
@@ -436,6 +430,9 @@ describe('#mutations', () => {
it('should not add attachments if chat not found', () => {
const state = {
allConversations: [{ id: 1, attachments: [] }],
+ attachments: {
+ 1: [],
+ },
};
const message = {
conversation_id: 2,
@@ -444,14 +441,17 @@ describe('#mutations', () => {
};
mutations[types.ADD_CONVERSATION_ATTACHMENTS](state, message);
- expect(state.allConversations[0].attachments).toHaveLength(0);
+ expect(state.attachments[1]).toHaveLength(0);
});
});
describe('#DELETE_CONVERSATION_ATTACHMENTS', () => {
it('delete conversation attachments', () => {
const state = {
- allConversations: [{ id: 1, attachments: [{ id: 1, message_id: 1 }] }],
+ allConversations: [{ id: 1 }],
+ attachments: {
+ 1: [{ id: 1, message_id: 1 }],
+ },
};
const message = {
conversation_id: 1,
@@ -460,12 +460,15 @@ describe('#mutations', () => {
};
mutations[types.DELETE_CONVERSATION_ATTACHMENTS](state, message);
- expect(state.allConversations[0].attachments).toHaveLength(0);
+ expect(state.attachments[1]).toHaveLength(0);
});
it('should not delete attachments for non-matching message id', () => {
const state = {
- allConversations: [{ id: 1, attachments: [{ id: 1, message_id: 1 }] }],
+ allConversations: [{ id: 1 }],
+ attachments: {
+ 1: [{ id: 1, message_id: 1 }],
+ },
};
const message = {
conversation_id: 1,
@@ -474,12 +477,13 @@ describe('#mutations', () => {
};
mutations[types.DELETE_CONVERSATION_ATTACHMENTS](state, message);
- expect(state.allConversations[0].attachments).toHaveLength(1);
+ expect(state.attachments[1]).toHaveLength(1);
});
it('should not delete attachments if chat not found', () => {
const state = {
- allConversations: [{ id: 1, attachments: [{ id: 1, message_id: 1 }] }],
+ allConversations: [{ id: 1 }],
+ attachments: { 1: [{ id: 1, message_id: 1 }] },
};
const message = {
conversation_id: 2,
@@ -488,7 +492,7 @@ describe('#mutations', () => {
};
mutations[types.DELETE_CONVERSATION_ATTACHMENTS](state, message);
- expect(state.allConversations[0].attachments).toHaveLength(1);
+ expect(state.attachments[1]).toHaveLength(1);
});
});
diff --git a/app/javascript/dashboard/store/modules/specs/integrations/getters.spec.js b/app/javascript/dashboard/store/modules/specs/integrations/getters.spec.js
index 43080a7d8..feb358684 100644
--- a/app/javascript/dashboard/store/modules/specs/integrations/getters.spec.js
+++ b/app/javascript/dashboard/store/modules/specs/integrations/getters.spec.js
@@ -1,60 +1,9 @@
import { getters } from '../../integrations';
describe('#getters', () => {
- it('getIntegrations', () => {
- const state = {
- records: [
- {
- id: 'test1',
- name: 'test1',
- logo: 'test',
- enabled: true,
- },
- {
- id: 'test2',
- name: 'test2',
- logo: 'test',
- enabled: true,
- },
- {
- id: 'dyte',
- name: 'dyte',
- logo: 'test',
- enabled: true,
- },
- {
- id: 'dialogflow',
- name: 'dialogflow',
- logo: 'test',
- enabled: true,
- },
- ],
- };
- expect(getters.getIntegrations(state)).toEqual([
- {
- id: 'test1',
- name: 'test1',
- logo: 'test',
- enabled: true,
- },
- {
- id: 'test2',
- name: 'test2',
- logo: 'test',
- enabled: true,
- },
- ]);
- });
-
it('getAppIntegrations', () => {
const state = {
records: [
- {
- id: 'test1',
- name: 'test1',
- logo: 'test',
- enabled: true,
- },
{
id: 'dyte',
name: 'dyte',
diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js
index bbf36fa9a..81e62b950 100644
--- a/app/javascript/packs/application.js
+++ b/app/javascript/packs/application.js
@@ -9,7 +9,6 @@ import VueFormulate from '@braid/vue-formulate';
import WootSwitch from 'components/ui/Switch';
import WootWizard from 'components/ui/Wizard';
import { sync } from 'vuex-router-sync';
-import Vuelidate from 'vuelidate';
import VTooltip from 'v-tooltip';
import WootUiKit from '../dashboard/components';
import App from '../dashboard/App';
@@ -65,7 +64,6 @@ Vue.use(VueDOMPurifyHTML, domPurifyConfig);
Vue.use(VueRouter);
Vue.use(VueI18n);
Vue.use(WootUiKit);
-Vue.use(Vuelidate);
Vue.use(VueFormulate, {
rules: {
JSON: ({ value }) => isJSONValid(value),
diff --git a/app/javascript/packs/survey.js b/app/javascript/packs/survey.js
index 031767052..fdcaec106 100644
--- a/app/javascript/packs/survey.js
+++ b/app/javascript/packs/survey.js
@@ -1,5 +1,4 @@
import Vue from 'vue';
-import Vuelidate from 'vuelidate';
import VueI18n from 'vue-i18n';
import App from '../survey/App.vue';
import i18n from '../survey/i18n';
@@ -7,7 +6,6 @@ import store from '../survey/store';
import { emitter } from 'shared/helpers/mitt';
Vue.use(VueI18n);
-Vue.use(Vuelidate);
const i18nConfig = new VueI18n({
locale: 'en',
diff --git a/app/javascript/packs/v3app.js b/app/javascript/packs/v3app.js
index 5807ff60f..d5180675c 100644
--- a/app/javascript/packs/v3app.js
+++ b/app/javascript/packs/v3app.js
@@ -1,7 +1,6 @@
import Vue from 'vue';
import VueI18n from 'vue-i18n';
import VueRouter from 'vue-router';
-import Vuelidate from 'vuelidate';
import i18n from 'dashboard/i18n';
import * as Sentry from '@sentry/vue';
import { Integrations } from '@sentry/tracing';
@@ -44,7 +43,7 @@ if (window.errorLoggingConfig) {
Vue.use(VueRouter);
Vue.use(VueI18n);
-Vue.use(Vuelidate);
+
Vue.use(AnalyticsPlugin);
Vue.prototype.$emitter = emitter;
Vue.component('fluent-icon', FluentIcon);
diff --git a/app/javascript/packs/widget.js b/app/javascript/packs/widget.js
index ea3bb8200..a6c873c55 100644
--- a/app/javascript/packs/widget.js
+++ b/app/javascript/packs/widget.js
@@ -1,5 +1,4 @@
import Vue from 'vue';
-import Vuelidate from 'vuelidate';
import VueI18n from 'vue-i18n';
import VueDOMPurifyHTML from 'vue-dompurify-html';
import VueFormulate from '@braid/vue-formulate';
@@ -18,7 +17,7 @@ import { domPurifyConfig } from '../shared/helpers/HTMLSanitizer';
const PhoneInput = () => import('../widget/components/Form/PhoneInput');
Vue.use(VueI18n);
-Vue.use(Vuelidate);
+
Vue.use(VueDOMPurifyHTML, domPurifyConfig);
Vue.directive('on-clickaway', onClickaway);
diff --git a/app/javascript/portal/components/PublicArticleSearch.vue b/app/javascript/portal/components/PublicArticleSearch.vue
index 1174c636c..3e4be5ba9 100644
--- a/app/javascript/portal/components/PublicArticleSearch.vue
+++ b/app/javascript/portal/components/PublicArticleSearch.vue
@@ -1,27 +1,3 @@
-
-
-
-
+
+
+
+
diff --git a/app/javascript/portal/components/PublicSearchInput.vue b/app/javascript/portal/components/PublicSearchInput.vue
index ffa0f99a7..08dd5e1cf 100644
--- a/app/javascript/portal/components/PublicSearchInput.vue
+++ b/app/javascript/portal/components/PublicSearchInput.vue
@@ -1,25 +1,3 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/app/javascript/portal/components/SearchSuggestions.vue b/app/javascript/portal/components/SearchSuggestions.vue
index 2c9697e14..68abe44f5 100644
--- a/app/javascript/portal/components/SearchSuggestions.vue
+++ b/app/javascript/portal/components/SearchSuggestions.vue
@@ -1,60 +1,10 @@
-
-
-
- {{ loadingPlaceholder }}
-
-
-
-
- {{ emptyPlaceholder }}
-
-
-
-
+
+
+
+
+ {{ loadingPlaceholder }}
+
+
+
+
+ {{ emptyPlaceholder }}
+
+
+
diff --git a/app/javascript/portal/components/TableOfContents.vue b/app/javascript/portal/components/TableOfContents.vue
index d7b3bb021..d907bc49e 100644
--- a/app/javascript/portal/components/TableOfContents.vue
+++ b/app/javascript/portal/components/TableOfContents.vue
@@ -1,33 +1,3 @@
-
-
-
+
+
+
+
diff --git a/app/javascript/portal/portalHelpers.js b/app/javascript/portal/portalHelpers.js
index 3e9690b20..dfe2951f0 100644
--- a/app/javascript/portal/portalHelpers.js
+++ b/app/javascript/portal/portalHelpers.js
@@ -33,7 +33,7 @@ export const openExternalLinksInNewTab = () => {
const isOnArticlePage =
isSameHost && document.querySelector('#cw-article-content') !== null;
- document.addEventListener('click', function (event) {
+ document.addEventListener('click', event => {
if (!isOnArticlePage) return;
// Some of the links come wrapped in strong tag through prosemirror
diff --git a/app/javascript/shared/components/Branding.vue b/app/javascript/shared/components/Branding.vue
index bbeb578e9..8034e3506 100644
--- a/app/javascript/shared/components/Branding.vue
+++ b/app/javascript/shared/components/Branding.vue
@@ -1,27 +1,3 @@
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/app/javascript/survey/components/Banner.vue b/app/javascript/survey/components/Banner.vue
index b178b6797..f2a907bf6 100644
--- a/app/javascript/survey/components/Banner.vue
+++ b/app/javascript/survey/components/Banner.vue
@@ -1,16 +1,3 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/app/javascript/survey/components/Feedback.vue b/app/javascript/survey/components/Feedback.vue
index 2b870cc47..fcae0cb31 100644
--- a/app/javascript/survey/components/Feedback.vue
+++ b/app/javascript/survey/components/Feedback.vue
@@ -1,22 +1,3 @@
-
-
-
-
-
-
-
- {{ $t('SURVEY.FEEDBACK.BUTTON_TEXT') }}
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ $t('SURVEY.FEEDBACK.BUTTON_TEXT') }}
+
+
+
+
diff --git a/app/javascript/survey/components/Rating.vue b/app/javascript/survey/components/Rating.vue
index 530bc6c21..8d1e84bcf 100644
--- a/app/javascript/survey/components/Rating.vue
+++ b/app/javascript/survey/components/Rating.vue
@@ -1,18 +1,3 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/app/javascript/widget/components/AgentMessage.vue b/app/javascript/widget/components/AgentMessage.vue
index c38726031..e7d592abd 100755
--- a/app/javascript/widget/components/AgentMessage.vue
+++ b/app/javascript/widget/components/AgentMessage.vue
@@ -1,103 +1,15 @@
-
-
-
-
+
+
+
+
diff --git a/app/javascript/widget/components/AgentMessageBubble.vue b/app/javascript/widget/components/AgentMessageBubble.vue
index f5bad52fc..c1c0cc8d0 100755
--- a/app/javascript/widget/components/AgentMessageBubble.vue
+++ b/app/javascript/widget/components/AgentMessageBubble.vue
@@ -1,64 +1,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/widget/components/AgentTypingBubble.vue b/app/javascript/widget/components/AgentTypingBubble.vue
index e8f8e7b09..a84d8fc7b 100644
--- a/app/javascript/widget/components/AgentTypingBubble.vue
+++ b/app/javascript/widget/components/AgentTypingBubble.vue
@@ -1,3 +1,11 @@
+
+
@@ -17,14 +25,6 @@
-
-
+
+
+
diff --git a/app/javascript/widget/components/ArticleList.vue b/app/javascript/widget/components/ArticleList.vue
index 4043bf060..5aef7e265 100644
--- a/app/javascript/widget/components/ArticleList.vue
+++ b/app/javascript/widget/components/ArticleList.vue
@@ -1,15 +1,3 @@
-
-
-
-
+
+
+
+
diff --git a/app/javascript/widget/components/ArticleListItem.vue b/app/javascript/widget/components/ArticleListItem.vue
index f16afa5e1..a7e828649 100644
--- a/app/javascript/widget/components/ArticleListItem.vue
+++ b/app/javascript/widget/components/ArticleListItem.vue
@@ -1,18 +1,3 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/widget/components/ArticleSearch.vue b/app/javascript/widget/components/ArticleSearch.vue
index 8ce663321..275d44ec1 100644
--- a/app/javascript/widget/components/ArticleSearch.vue
+++ b/app/javascript/widget/components/ArticleSearch.vue
@@ -1,29 +1,3 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+ {{ '⌘K' }}
+
+
+
+
diff --git a/app/javascript/widget/components/AvailableAgents.vue b/app/javascript/widget/components/AvailableAgents.vue
index 7e51b887b..10ecd7afb 100644
--- a/app/javascript/widget/components/AvailableAgents.vue
+++ b/app/javascript/widget/components/AvailableAgents.vue
@@ -1,7 +1,3 @@
-
-
-
-
+
+
+
+
diff --git a/app/javascript/widget/components/Banner.vue b/app/javascript/widget/components/Banner.vue
index 173dfabb2..bdd11a5b7 100644
--- a/app/javascript/widget/components/Banner.vue
+++ b/app/javascript/widget/components/Banner.vue
@@ -1,11 +1,3 @@
-
-
-
- {{ bannerMessage }}
-
-
-
-
+
+
+
+ {{ bannerMessage }}
+
+
+
+