Chore: Use installation config in frontend (#847)

* Use installation config in widget
* Add configuration for installation in UI
* Add config for mailer

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Pranav Raj S 2020-05-12 01:31:40 +05:30 committed by GitHub
parent c74b5c21d7
commit f819bc0f33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 264 additions and 49 deletions

View file

@ -0,0 +1,7 @@
export default {
methods: {
useInstallationName(str = '', installationName) {
return str.replace(/Chatwoot/g, installationName);
},
},
};

View file

@ -0,0 +1,33 @@
const {
LOGO_THUMBNAIL: logoThumbnail,
LOGO: logo,
INSTALLATION_NAME: installationName,
WIDGET_BRAND_URL: widgetBrandURL,
TERMS_URL: termsURL,
PRIVACY_URL: privacyURL,
} = window.globalConfig;
const state = {
logoThumbnail,
logo,
installationName,
widgetBrandURL,
termsURL,
privacyURL,
};
export const getters = {
get: $state => $state,
};
export const actions = {};
export const mutations = {};
export default {
namespaced: true,
state,
getters,
actions,
mutations,
};