Compare commits
25
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68ed5a4b4f | ||
|
|
7ecb993d06 | ||
|
|
c00a157c03 | ||
|
|
3750689bee | ||
|
|
0511bf4ba6 | ||
|
|
9f50638a40 | ||
|
|
f5ac272e3b | ||
|
|
2ba7318817 | ||
|
|
412303d1cd | ||
|
|
47b9399208 | ||
|
|
0830ad78b6 | ||
|
|
0b8df762f9 | ||
|
|
f24c87f9b2 | ||
|
|
f62a4170b6 | ||
|
|
2f090dbc61 | ||
|
|
ec17682d7a | ||
|
|
7861ce8c47 | ||
|
|
e5de41fea4 | ||
|
|
adb0e94cbd | ||
|
|
42fb083491 | ||
|
|
9101e1e221 | ||
|
|
91bac16c29 | ||
|
|
97699f3087 | ||
|
|
1242cfd704 | ||
|
|
6963c668bf |
@@ -52,8 +52,11 @@ export default {
|
||||
currentUser: 'getCurrentUser',
|
||||
authUIFlags: 'getAuthUIFlags',
|
||||
accountUIFlags: 'accounts/getUIFlags',
|
||||
currentAccountId: 'getCurrentAccountId',
|
||||
// currentAccountId: 'getCurrentAccountId',
|
||||
}),
|
||||
currentAccountId() {
|
||||
return this.$route.params.accountId;
|
||||
},
|
||||
hasAccounts() {
|
||||
const { accounts = [] } = this.currentUser || {};
|
||||
return accounts.length > 0;
|
||||
@@ -70,15 +73,22 @@ export default {
|
||||
}
|
||||
},
|
||||
currentAccountId() {
|
||||
console.log('THIS CALL', this.currentAccountId);
|
||||
if (this.currentAccountId) {
|
||||
this.initializeAccount();
|
||||
} else {
|
||||
console.log('NO ACCOUNT ID');
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
created() {
|
||||
this.setLocale(window.chatwootConfig.selectedLocale);
|
||||
},
|
||||
async mounted() {
|
||||
this.setLocale(window.chatwootConfig.selectedLocale);
|
||||
this.initializeColorTheme();
|
||||
this.listenToThemeChanges();
|
||||
this.setLocale(window.chatwootConfig.selectedLocale);
|
||||
await this.$store.dispatch('accounts/get');
|
||||
},
|
||||
unmounted() {
|
||||
if (this.reconnectService) {
|
||||
@@ -94,7 +104,7 @@ export default {
|
||||
mql.onchange = e => setColorTheme(e.matches);
|
||||
},
|
||||
setLocale(locale) {
|
||||
this.$root.$i18n.locale = locale;
|
||||
this.$i18n.locale = locale;
|
||||
},
|
||||
async initializeAccount() {
|
||||
await this.$store.dispatch('accounts/get');
|
||||
|
||||
@@ -120,6 +120,7 @@ export default {
|
||||
this.currentUser,
|
||||
this.accountId
|
||||
);
|
||||
|
||||
const menuItems = this.sideMenuConfig.primaryMenu;
|
||||
return menuItems.filter(menuItem => {
|
||||
const isAvailableForTheUser = hasPermissions(
|
||||
@@ -130,6 +131,7 @@ export default {
|
||||
if (!isAvailableForTheUser) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
menuItem.alwaysVisibleOnChatwootInstances &&
|
||||
!this.isACustomBrandedInstance
|
||||
@@ -137,10 +139,12 @@ export default {
|
||||
return true;
|
||||
}
|
||||
if (menuItem.featureFlag) {
|
||||
return this.isFeatureEnabledonAccount(
|
||||
const isEnabled = this.isFeatureEnabledonAccount(
|
||||
this.accountId,
|
||||
menuItem.featureFlag
|
||||
);
|
||||
|
||||
return isEnabled;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
@@ -50,6 +50,9 @@ export default {
|
||||
showOptionsMenu: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
console.log('MENU ITEMS', this.menuItems);
|
||||
},
|
||||
methods: {
|
||||
frontendURL,
|
||||
toggleOptions() {
|
||||
|
||||
@@ -26,6 +26,13 @@ export default {
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(
|
||||
'MOUNTED: PRIMARY NAV ITEM',
|
||||
this.name,
|
||||
this.$t(`SIDEBAR.${this.name}`)
|
||||
);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const showNewButton = computed(
|
||||
button-route="new"
|
||||
:icon="icon"
|
||||
:header-title="t(headerTitle)"
|
||||
:button-text="t(headerButtonText)"
|
||||
:button-text="headerButtonText ? t(headerButtonText) : ''"
|
||||
:show-back-button="showBackButton"
|
||||
:back-url="backUrl"
|
||||
:show-new-button="showNewButton"
|
||||
|
||||
@@ -95,8 +95,8 @@ export default {
|
||||
return this.id.toString();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.initializeAccount();
|
||||
async mounted() {
|
||||
await this.initializeAccount();
|
||||
},
|
||||
methods: {
|
||||
async initializeAccount() {
|
||||
@@ -112,7 +112,7 @@ export default {
|
||||
latest_chatwoot_version: latestChatwootVersion,
|
||||
} = this.getAccount(this.accountId);
|
||||
|
||||
this.$root.$i18n.locale = locale;
|
||||
this.$i18n.locale = locale;
|
||||
this.name = name;
|
||||
this.locale = locale;
|
||||
this.id = id;
|
||||
@@ -140,7 +140,7 @@ export default {
|
||||
support_email: this.supportEmail,
|
||||
auto_resolve_duration: this.autoResolveDuration,
|
||||
});
|
||||
this.$root.$i18n.locale = this.locale;
|
||||
this.$i18n.locale = this.locale;
|
||||
this.getAccount(this.id).locale = this.locale;
|
||||
this.updateDirectionView(this.locale);
|
||||
useAlert(this.$t('GENERAL_SETTINGS.UPDATE.SUCCESS'));
|
||||
|
||||
@@ -43,7 +43,11 @@ export const getters = {
|
||||
return diffDays <= TRIAL_PERIOD_DAYS;
|
||||
},
|
||||
isFeatureEnabledonAccount: $state => (id, featureName) => {
|
||||
console.log('----------------------------------------------------');
|
||||
console.log('CHECK ENABLED for', featureName, id);
|
||||
console.log($state, findRecordById($state, id));
|
||||
const { features = {} } = findRecordById($state, id);
|
||||
console.log('FEATURES', features, features[featureName]);
|
||||
return features[featureName] || false;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -39,6 +39,7 @@ import 'floating-vue/dist/style.css';
|
||||
const i18n = createI18n({
|
||||
legacy: false, // https://github.com/intlify/vue-i18n/issues/1902
|
||||
locale: 'en',
|
||||
fallbackLocale: 'en',
|
||||
messages: i18nMessages,
|
||||
});
|
||||
|
||||
@@ -101,6 +102,7 @@ sync(store, router);
|
||||
// load common helpers into js
|
||||
commonHelpers();
|
||||
window.WOOT_STORE = store;
|
||||
window.dashboardApp = app;
|
||||
window.WootConstants = constants;
|
||||
window.axios = createAxios(axios);
|
||||
// [VITE] Disabled this we don't need it, we can use `useEmitter` directly
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
const i18n = createI18n({
|
||||
legacy: false, // https://github.com/intlify/vue-i18n/issues/1902
|
||||
locale: 'en',
|
||||
fallbackLocale: 'en',
|
||||
messages: i18nMessages,
|
||||
});
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export default {
|
||||
}
|
||||
},
|
||||
setLocale(locale) {
|
||||
this.$root.$i18n.locale = locale || 'en';
|
||||
this.$i18n.locale = locale || 'en';
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ export default {
|
||||
};
|
||||
},
|
||||
setLocale(locale) {
|
||||
this.$root.$i18n.locale = locale;
|
||||
this.$i18n.locale = locale;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -66,6 +66,33 @@ export default {
|
||||
mounted() {
|
||||
const { websiteToken, locale, widgetColor } = window.chatwootWebChannel;
|
||||
this.setLocale(locale);
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 100');
|
||||
this.setLocale(locale);
|
||||
}, 100);
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 200');
|
||||
this.setLocale(locale);
|
||||
}, 200);
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 300');
|
||||
this.setLocale(locale);
|
||||
}, 300);
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 400');
|
||||
this.setLocale(locale);
|
||||
}, 400);
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE AGAIN 500');
|
||||
this.setLocale(locale);
|
||||
}, 500);
|
||||
setTimeout(() => {
|
||||
console.log('SET LOCALE YET AGAIN');
|
||||
this.setLocale(locale);
|
||||
}, 5000);
|
||||
this.setWidgetColor(widgetColor);
|
||||
setHeader(window.authToken);
|
||||
if (this.isIFrame) {
|
||||
@@ -121,6 +148,7 @@ export default {
|
||||
},
|
||||
setLocale(localeWithVariation) {
|
||||
if (!localeWithVariation) return;
|
||||
console.log('SETTING LOCALE HAHAHAHAHA!', localeWithVariation);
|
||||
const { enabledLanguages } = window.chatwootWebChannel;
|
||||
const localeWithoutVariation = localeWithVariation.split('_')[0];
|
||||
const hasLocaleWithoutVariation = enabledLanguages.some(
|
||||
@@ -131,9 +159,9 @@ export default {
|
||||
);
|
||||
|
||||
if (hasLocaleWithVariation) {
|
||||
this.$root.$i18n.locale = localeWithVariation;
|
||||
this.$i18n.locale = localeWithVariation;
|
||||
} else if (hasLocaleWithoutVariation) {
|
||||
this.$root.$i18n.locale = localeWithoutVariation;
|
||||
this.$i18n.locale = localeWithoutVariation;
|
||||
}
|
||||
},
|
||||
registerUnreadEvents() {
|
||||
|
||||
@@ -60,12 +60,7 @@ export default {
|
||||
chatwootWebChannel: { websiteToken },
|
||||
authToken,
|
||||
} = window;
|
||||
popoutChatWindow(
|
||||
origin,
|
||||
websiteToken,
|
||||
this.$root.$i18n.locale,
|
||||
authToken
|
||||
);
|
||||
popoutChatWindow(origin, websiteToken, this.$i18n.locale, authToken);
|
||||
},
|
||||
closeWindow() {
|
||||
if (IFrameHelper.isIFrame()) {
|
||||
|
||||
@@ -37,7 +37,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
locale: this.$root.$i18n.locale,
|
||||
locale: this.$i18n.locale,
|
||||
hasErrorInPhoneInput: false,
|
||||
message: '',
|
||||
formValues: {},
|
||||
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
messageId: this.messageId,
|
||||
});
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
} finally {
|
||||
this.isUpdating = false;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export default {
|
||||
);
|
||||
this.dyteAuthToken = authToken;
|
||||
} catch (error) {
|
||||
// Ignore Error for now
|
||||
console.log(error);
|
||||
} finally {
|
||||
this.isLoading = false;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export const actions = {
|
||||
const { data } = await ContactsAPI.get();
|
||||
commit(SET_CURRENT_USER, data);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
update: async ({ dispatch }, { user }) => {
|
||||
@@ -39,7 +39,7 @@ export const actions = {
|
||||
await ContactsAPI.update(user);
|
||||
dispatch('get');
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
setUser: async ({ dispatch }, { identifier, user: userObject }) => {
|
||||
@@ -91,14 +91,14 @@ export const actions = {
|
||||
try {
|
||||
await ContactsAPI.setCustomAttributes(customAttributes);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
deleteCustomAttribute: async (_, customAttribute) => {
|
||||
try {
|
||||
await ContactsAPI.deleteCustomAttribute(customAttribute);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ export const actions = {
|
||||
// Emit event to notify that conversation is created and show the chat screen
|
||||
emitter.emit(ON_CONVERSATION_CREATED);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
} finally {
|
||||
commit('setConversationUIFlag', { isCreating: false });
|
||||
}
|
||||
@@ -133,7 +133,7 @@ export const actions = {
|
||||
commit('conversation/setMetaUserLastSeenAt', lastSeen, { root: true });
|
||||
commit('setMissingMessagesInConversation', updatedConversation);
|
||||
} catch (error) {
|
||||
// IgnoreError
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -158,7 +158,7 @@ export const actions = {
|
||||
try {
|
||||
await toggleTyping(data);
|
||||
} catch (error) {
|
||||
// IgnoreError
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -172,7 +172,7 @@ export const actions = {
|
||||
commit('setMetaUserLastSeenAt', lastSeen);
|
||||
await setUserLastSeenAt({ lastSeen });
|
||||
} catch (error) {
|
||||
// IgnoreError
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -184,7 +184,7 @@ export const actions = {
|
||||
try {
|
||||
await setCustomAttributes(customAttributes);
|
||||
} catch (error) {
|
||||
// IgnoreError
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -192,7 +192,7 @@ export const actions = {
|
||||
try {
|
||||
await deleteCustomAttribute(customAttribute);
|
||||
} catch (error) {
|
||||
// IgnoreError
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ export const actions = {
|
||||
commit(SET_CONVERSATION_ATTRIBUTES, data);
|
||||
commit('conversation/setMetaUserLastSeenAt', lastSeen, { root: true });
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
update({ commit }, data) {
|
||||
|
||||
@@ -9,14 +9,14 @@ export const actions = {
|
||||
try {
|
||||
await conversationLabels.create(label);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
destroy: async (_, label) => {
|
||||
try {
|
||||
await conversationLabels.destroy(label);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ const actions = {
|
||||
try {
|
||||
await events.create(name);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ export const actions = {
|
||||
);
|
||||
dispatch('contacts/get', {}, { root: true });
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
console.log(error);
|
||||
}
|
||||
commit('toggleUpdateStatus', false);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user