diff --git a/app/javascript/dashboard/api/ApiClient.js b/app/javascript/dashboard/api/ApiClient.js
index 6b57d32b6..2b85e99d6 100644
--- a/app/javascript/dashboard/api/ApiClient.js
+++ b/app/javascript/dashboard/api/ApiClient.js
@@ -15,6 +15,12 @@ class ApiClient {
// eslint-disable-next-line class-methods-use-this
get accountIdFromRoute() {
+ // eslint-disable-next-line no-underscore-dangle
+ if (window.__WOOT_ACCOUNT_ID__) {
+ // eslint-disable-next-line no-underscore-dangle
+ return window.__WOOT_ACCOUNT_ID__;
+ }
+
const isInsideAccountScopedURLs =
window.location.pathname.includes('/app/accounts');
diff --git a/app/javascript/entrypoints/ui.js b/app/javascript/entrypoints/ui.js
index a1d75fef3..f94be45c3 100644
--- a/app/javascript/entrypoints/ui.js
+++ b/app/javascript/entrypoints/ui.js
@@ -12,12 +12,9 @@ import { domPurifyConfig } from 'shared/helpers/HTMLSanitizer.js';
import store from 'dashboard/store';
import constants from 'dashboard/constants/globals';
import axios from 'axios';
-import createAxios from 'dashboard/helper/APIHelper';
+import createAxios from '../ui/axios';
import commonHelpers from 'dashboard/helper/commons';
-import WootButton from '../dashboard/components-next/button/Button.vue';
-import WootInput from '../dashboard/components-next/input/Input.vue';
-import WootMessage from '../dashboard/components-next/message/Message.vue';
import MessageList from '../ui/MessageList.vue';
import i18nMessages from '../dashboard/i18n';
import { createI18n, I18nInjectionKey } from 'vue-i18n';
@@ -47,14 +44,8 @@ commonHelpers();
window.WootConstants = constants;
window.axios = createAxios(axios);
-export const buttonElement = defineCustomElement(WootButton, ceOptions);
-export const inputElement = defineCustomElement(WootInput, ceOptions);
-export const messageElement = defineCustomElement(WootMessage, ceOptions);
export const messageListElement = defineCustomElement(MessageList, ceOptions);
// eslint-disable-next-line no-underscore-dangle
window.__CHATWOOT_STORE__ = store;
-customElements.define('woot-button', buttonElement);
-customElements.define('woot-input', inputElement);
-customElements.define('woot-message', messageElement);
customElements.define('woot-message-list', messageListElement);
diff --git a/app/javascript/ui/MessageList.vue b/app/javascript/ui/MessageList.vue
index c974d4ce2..8dd56b602 100644
--- a/app/javascript/ui/MessageList.vue
+++ b/app/javascript/ui/MessageList.vue
@@ -1,21 +1,38 @@
diff --git a/app/javascript/ui/axios.js b/app/javascript/ui/axios.js
new file mode 100644
index 000000000..7a02bdba7
--- /dev/null
+++ b/app/javascript/ui/axios.js
@@ -0,0 +1,19 @@
+const parseErrorCode = error => Promise.reject(error);
+
+export default axios => {
+ // eslint-disable-next-line no-underscore-dangle
+ const apiHost = window.__WOOT_API_HOST__;
+ // eslint-disable-next-line no-underscore-dangle
+ const accessToken = window.__WOOT_ACCESS_TOKEN__;
+ const wootApi = axios.create({ baseURL: `${apiHost}/` });
+
+ Object.assign(wootApi.defaults.headers.common, {
+ api_access_token: accessToken,
+ });
+
+ wootApi.interceptors.response.use(
+ response => response,
+ error => parseErrorCode(error)
+ );
+ return wootApi;
+};
diff --git a/public/test-components.html b/public/test-components.html
index 9816b5b47..6c0e1c3be 100644
--- a/public/test-components.html
+++ b/public/test-components.html
@@ -5,18 +5,16 @@
Web Components Test
+
Web Components Test
-
- Button Component
-
-
- Input Component
-
-
Message List
-
+