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