Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b7e6e5ab8 | ||
|
|
4a0f0e759f | ||
|
|
8b6fd7ae26 | ||
|
|
5104cdb458 | ||
|
|
ab509b7024 | ||
|
|
c55e159c03 | ||
|
|
9e3783f349 | ||
|
|
1c70da86e3 | ||
|
|
3901abc009 | ||
|
|
73fbfd5782 | ||
|
|
2c1658715e | ||
|
|
c798474f2b |
@@ -1,9 +1,7 @@
|
||||
<script>
|
||||
/* eslint no-console: 0 */
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
|
||||
export default {
|
||||
mixins: [globalConfigMixin],
|
||||
props: {
|
||||
items: {
|
||||
type: Array,
|
||||
|
||||
@@ -3,7 +3,7 @@ import WidgetHead from './WidgetHead.vue';
|
||||
import WidgetBody from './WidgetBody.vue';
|
||||
import WidgetFooter from './WidgetFooter.vue';
|
||||
import InputRadioGroup from 'dashboard/routes/dashboard/settings/inbox/components/InputRadioGroup.vue';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
@@ -14,7 +14,6 @@ export default {
|
||||
WidgetFooter,
|
||||
InputRadioGroup,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
props: {
|
||||
welcomeHeading: {
|
||||
type: String,
|
||||
@@ -144,6 +143,7 @@ export default {
|
||||
this.isWidgetVisible = !this.isWidgetVisible;
|
||||
this.isDefaultScreen = true;
|
||||
},
|
||||
useInstallationName,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import SettingsHeader from 'dashboard/routes/dashboard/settings/SettingsHeader.vue';
|
||||
import SettingIntroBanner from 'dashboard/components/widgets/SettingIntroBanner.vue';
|
||||
|
||||
@@ -8,7 +7,6 @@ export default {
|
||||
SettingsHeader,
|
||||
SettingIntroBanner,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
computed: {
|
||||
currentPortal() {
|
||||
const slug = this.$route.params.portalSlug;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
import SettingsHeader from 'dashboard/routes/dashboard/settings/SettingsHeader.vue';
|
||||
export default {
|
||||
components: {
|
||||
SettingsHeader,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
computed: {
|
||||
...mapGetters({
|
||||
globalConfig: 'globalConfig/get',
|
||||
@@ -38,6 +37,9 @@ export default {
|
||||
return '';
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -3,14 +3,13 @@ import ChannelItem from 'dashboard/components/widgets/ChannelItem.vue';
|
||||
import router from '../../../index';
|
||||
import PageHeader from '../SettingsSubPageHeader.vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ChannelItem,
|
||||
PageHeader,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
data() {
|
||||
return {
|
||||
enabledFeatures: {},
|
||||
@@ -56,6 +55,7 @@ export default {
|
||||
};
|
||||
router.push({ name: 'settings_inboxes_page_channel', params });
|
||||
},
|
||||
useInstallationName,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
|
||||
export default {
|
||||
mixins: [globalConfigMixin],
|
||||
computed: {
|
||||
...mapGetters({
|
||||
globalConfig: 'globalConfig/get',
|
||||
@@ -18,6 +17,9 @@ export default {
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -186,4 +186,4 @@ const openDelete = inbox => {
|
||||
@onClose="closeDelete"
|
||||
/>
|
||||
</SettingsLayout>
|
||||
</template>
|
||||
</template>
|
||||
@@ -10,7 +10,7 @@ import { mapGetters } from 'vuex';
|
||||
import ChannelApi from '../../../../../api/channels';
|
||||
import PageHeader from '../../SettingsSubPageHeader.vue';
|
||||
import router from '../../../../index';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
|
||||
import { loadScript } from 'dashboard/helper/DOMHelpers';
|
||||
import * as Sentry from '@sentry/browser';
|
||||
@@ -20,7 +20,6 @@ export default {
|
||||
LoadingState,
|
||||
PageHeader,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
setup() {
|
||||
const { accountId } = useAccount();
|
||||
return {
|
||||
@@ -74,6 +73,7 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
useInstallationName,
|
||||
async startLogin() {
|
||||
this.hasLoginStarted = true;
|
||||
try {
|
||||
|
||||
-2
@@ -3,7 +3,6 @@ import { mapGetters } from 'vuex';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import DashboardAppModal from './DashboardAppModal.vue';
|
||||
import DashboardAppsRow from './DashboardAppsRow.vue';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import BaseSettingsHeader from '../../components/BaseSettingsHeader.vue';
|
||||
|
||||
export default {
|
||||
@@ -12,7 +11,6 @@ export default {
|
||||
DashboardAppModal,
|
||||
DashboardAppsRow,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
data() {
|
||||
return {
|
||||
loading: {},
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import { frontendURL } from '../../../../helper/URLHelper';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
|
||||
export default {
|
||||
mixins: [globalConfigMixin],
|
||||
props: {
|
||||
integrationId: {
|
||||
type: [String, Number],
|
||||
@@ -30,6 +29,7 @@ export default {
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
frontendURL,
|
||||
openDeletePopup() {
|
||||
this.showDeleteConfirmationPopup = true;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { computed } from 'vue';
|
||||
import { useStoreGetters } from 'dashboard/composables/store';
|
||||
import { useI18n } from 'dashboard/composables/useI18n';
|
||||
import { frontendURL } from 'dashboard/helper/URLHelper';
|
||||
import { useInstallationName } from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import Integration from './Integration.vue';
|
||||
import IntegrationHelpText from './IntegrationHelpText.vue';
|
||||
|
||||
@@ -8,7 +7,6 @@ export default {
|
||||
Integration,
|
||||
IntegrationHelpText,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
|
||||
props: {
|
||||
integrationId: {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import Integration from './Integration.vue';
|
||||
import SelectChannelWarning from './Slack/SelectChannelWarning.vue';
|
||||
import SlackIntegrationHelpText from './Slack/SlackIntegrationHelpText.vue';
|
||||
@@ -12,7 +11,6 @@ export default {
|
||||
SelectChannelWarning,
|
||||
SlackIntegrationHelpText,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
props: {
|
||||
code: { type: String, default: '' },
|
||||
},
|
||||
|
||||
+2
-2
@@ -1,11 +1,10 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
import { useMessageFormatter } from 'shared/composables/useMessageFormatter';
|
||||
|
||||
export default {
|
||||
mixins: [globalConfigMixin],
|
||||
props: {
|
||||
hasConnectedAChannel: {
|
||||
type: Boolean,
|
||||
@@ -33,6 +32,7 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
async fetchChannels() {
|
||||
try {
|
||||
this.availableChannels = await this.$store.dispatch(
|
||||
|
||||
@@ -3,6 +3,7 @@ import { mapGetters } from 'vuex';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import NewWebhook from './NewWebHook.vue';
|
||||
import EditWebhook from './EditWebHook.vue';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
import WebhookRow from './WebhookRow.vue';
|
||||
import BaseSettingsHeader from '../../components/BaseSettingsHeader.vue';
|
||||
import SettingsLayout from '../../SettingsLayout.vue';
|
||||
@@ -37,6 +38,7 @@ export default {
|
||||
this.$store.dispatch('webhooks/get');
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
openAddPopup() {
|
||||
this.showAddPopup = true;
|
||||
},
|
||||
|
||||
+2
-2
@@ -1,12 +1,11 @@
|
||||
<script>
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
import { mapGetters } from 'vuex';
|
||||
import WebhookForm from './WebhookForm.vue';
|
||||
|
||||
export default {
|
||||
components: { WebhookForm },
|
||||
mixins: [globalConfigMixin],
|
||||
props: {
|
||||
onClose: {
|
||||
type: Function,
|
||||
@@ -20,6 +19,7 @@ export default {
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
async onSubmit(webhook) {
|
||||
try {
|
||||
await this.$store.dispatch('webhooks/create', { webhook });
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useAlert } from 'dashboard/composables';
|
||||
import { useUISettings } from 'dashboard/composables/useUISettings';
|
||||
import { clearCookiesOnLogout } from 'dashboard/store/utils/api.js';
|
||||
import { copyTextToClipboard } from 'shared/helpers/clipboard';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
import UserProfilePicture from './UserProfilePicture.vue';
|
||||
import UserBasicDetails from './UserBasicDetails.vue';
|
||||
import MessageSignature from './MessageSignature.vue';
|
||||
@@ -27,7 +27,6 @@ export default {
|
||||
AudioNotifications,
|
||||
AccessToken,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
setup() {
|
||||
const { uiSettings, updateUISettings, isEditorHotKeyEnabled } =
|
||||
useUISettings();
|
||||
@@ -86,6 +85,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
initializeUser() {
|
||||
this.name = this.currentUser.name;
|
||||
this.email = this.currentUser.email;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
|
||||
const {
|
||||
LOGO_THUMBNAIL: logoThumbnail,
|
||||
@@ -8,7 +8,6 @@ const {
|
||||
} = window.globalConfig || {};
|
||||
|
||||
export default {
|
||||
mixins: [globalConfigMixin],
|
||||
props: {
|
||||
disableBranding: {
|
||||
type: Boolean,
|
||||
@@ -41,6 +40,9 @@ export default {
|
||||
return '';
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Replaces occurrences of "Chatwoot" with the provided installation name in a given string.
|
||||
*
|
||||
* @param {string} str - The original string that may contain "Chatwoot".
|
||||
* @param {string} installationName - The name to replace "Chatwoot" with.
|
||||
* @returns {string} The modified string with "Chatwoot" replaced by the installation name,
|
||||
* or the original string if either input is falsy.
|
||||
*/
|
||||
export const useInstallationName = (str, installationName) => {
|
||||
if (str && installationName) {
|
||||
return str.replace(/Chatwoot/g, installationName);
|
||||
}
|
||||
return str;
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
import { useInstallationName } from '../installationNameHelper';
|
||||
|
||||
describe('installationNameHelper', () => {
|
||||
it('should return the string with the installation name', () => {
|
||||
const str = 'Chatwoot is awesome';
|
||||
const installationName = 'Acme Inc';
|
||||
expect(useInstallationName(str, installationName)).toBe(
|
||||
'Acme Inc is awesome'
|
||||
);
|
||||
});
|
||||
|
||||
it('should return the string without the installation name', () => {
|
||||
const str = 'Chatwoot is awesome';
|
||||
const installationName = '';
|
||||
expect(useInstallationName(str, installationName)).toBe(
|
||||
'Chatwoot is awesome'
|
||||
);
|
||||
});
|
||||
|
||||
it('should handle null installation name properly', () => {
|
||||
const str = 'Chatwoot is super cool';
|
||||
const installationName = null;
|
||||
expect(useInstallationName(str, installationName)).toBe(
|
||||
'Chatwoot is super cool'
|
||||
);
|
||||
});
|
||||
|
||||
it('should handle undefined installation name properly', () => {
|
||||
const str = 'Chatwoot is super cool';
|
||||
const installationName = undefined;
|
||||
expect(useInstallationName(str, installationName)).toBe(
|
||||
'Chatwoot is super cool'
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1,12 +0,0 @@
|
||||
export const useInstallationName = (str, installationName) => {
|
||||
if (str && installationName) {
|
||||
return str.replace(/Chatwoot/g, installationName);
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
useInstallationName,
|
||||
},
|
||||
};
|
||||
@@ -3,14 +3,13 @@ import { useVuelidate } from '@vuelidate/core';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import { required, minLength, email } from '@vuelidate/validators';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
import FormInput from '../../../../components/Form/Input.vue';
|
||||
import { resetPassword } from '../../../../api/auth';
|
||||
import SubmitButton from '../../../../components/Button/SubmitButton.vue';
|
||||
|
||||
export default {
|
||||
components: { FormInput, SubmitButton },
|
||||
mixins: [globalConfigMixin],
|
||||
setup() {
|
||||
return { v$: useVuelidate() };
|
||||
},
|
||||
@@ -37,6 +36,7 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
showAlertMessage(message) {
|
||||
// Reset loading, current selected agent
|
||||
this.resetPassword.showLoading = false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
import SignupForm from './components/Signup/Form.vue';
|
||||
import Testimonials from './components/Testimonials/Index.vue';
|
||||
import Spinner from 'shared/components/Spinner.vue';
|
||||
@@ -11,7 +11,6 @@ export default {
|
||||
Spinner,
|
||||
Testimonials,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
data() {
|
||||
return { isLoading: false };
|
||||
},
|
||||
@@ -25,6 +24,7 @@ export default {
|
||||
this.isLoading = this.isAChatwootInstance;
|
||||
},
|
||||
methods: {
|
||||
useInstallationName,
|
||||
resizeContainers() {
|
||||
this.isLoading = false;
|
||||
},
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useVuelidate } from '@vuelidate/core';
|
||||
import { required, minLength, email } from '@vuelidate/validators';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { DEFAULT_REDIRECT_URL } from 'dashboard/constants/globals';
|
||||
import VueHcaptcha from '@hcaptcha/vue-hcaptcha';
|
||||
import FormInput from '../../../../../components/Form/Input.vue';
|
||||
@@ -20,7 +19,6 @@ export default {
|
||||
SubmitButton,
|
||||
VueHcaptcha,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
setup() {
|
||||
return { v$: useVuelidate() };
|
||||
},
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
import { useVuelidate } from '@vuelidate/core';
|
||||
import { required, email } from '@vuelidate/validators';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||
import { useInstallationName } from 'shared/helpers/installationNameHelper';
|
||||
|
||||
import SubmitButton from '../../components/Button/SubmitButton.vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { parseBoolean } from '@chatwoot/utils';
|
||||
@@ -22,7 +23,6 @@ export default {
|
||||
Spinner,
|
||||
SubmitButton,
|
||||
},
|
||||
mixins: [globalConfigMixin],
|
||||
props: {
|
||||
ssoAuthToken: { type: String, default: '' },
|
||||
ssoAccountId: { type: String, default: '' },
|
||||
@@ -88,6 +88,7 @@ export default {
|
||||
// TODO: Remove this when Safari gets wider support
|
||||
// Ref: https://caniuse.com/requestidlecallback
|
||||
//
|
||||
useInstallationName,
|
||||
requestIdleCallbackPolyfill(callback) {
|
||||
if (window.requestIdleCallback) {
|
||||
window.requestIdleCallback(callback);
|
||||
|
||||
Reference in New Issue
Block a user