2019-06-23 03:35:23 -07:00
|
|
|
// The Vue build version to load with the `import` command
|
|
|
|
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
2021-08-29 04:36:17 -07:00
|
|
|
import './plugins';
|
2019-09-11 01:59:50 -07:00
|
|
|
import 'prismjs';
|
|
|
|
import 'prismjs/themes/prism.css';
|
|
|
|
import 'vue-prism-editor/dist/VuePrismEditor.css';
|
2020-12-18 09:55:53 -08:00
|
|
|
import 'vue-json-pretty/lib/styles.css';
|
2023-01-30 09:20:50 -08:00
|
|
|
import '@jsplumb/browser-ui/css/jsplumbtoolkit.css';
|
2022-09-23 07:14:28 -07:00
|
|
|
import 'n8n-design-system/css/index.scss';
|
2019-06-23 03:35:23 -07:00
|
|
|
import './n8n-theme.scss';
|
2023-02-16 03:47:19 -08:00
|
|
|
import './styles/autocomplete-theme.scss';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-12-14 01:04:10 -08:00
|
|
|
import '@fontsource/open-sans/latin-400.css';
|
|
|
|
import '@fontsource/open-sans/latin-600.css';
|
|
|
|
import '@fontsource/open-sans/latin-700.css';
|
2021-09-21 05:35:55 -07:00
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
import App from '@/App.vue';
|
|
|
|
import router from './router';
|
|
|
|
|
2022-11-23 04:41:53 -08:00
|
|
|
import { runExternalHook } from '@/mixins/externalHooks';
|
2021-10-18 20:57:49 -07:00
|
|
|
import { TelemetryPlugin } from './plugins/telemetry';
|
2022-09-05 07:36:22 -07:00
|
|
|
import { I18nPlugin, i18nInstance } from './plugins/i18n';
|
2021-01-19 14:48:30 -08:00
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
import { createPinia, PiniaVuePlugin } from 'pinia';
|
|
|
|
|
2022-11-09 01:01:50 -08:00
|
|
|
import { useWebhooksStore } from './stores/webhooks';
|
2023-04-11 09:43:47 -07:00
|
|
|
import { useUsersStore } from './stores/users';
|
|
|
|
import { VIEWS } from '@/constants';
|
|
|
|
import { useUIStore } from './stores/ui';
|
2020-10-23 04:44:34 -07:00
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
Vue.config.productionTip = false;
|
|
|
|
|
2021-10-18 20:57:49 -07:00
|
|
|
Vue.use(TelemetryPlugin);
|
2022-11-09 01:01:50 -08:00
|
|
|
Vue.use((vue) => I18nPlugin(vue));
|
2022-11-04 06:04:31 -07:00
|
|
|
Vue.use(PiniaVuePlugin);
|
|
|
|
|
|
|
|
const pinia = createPinia();
|
2021-10-18 20:57:49 -07:00
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
new Vue({
|
2022-09-05 07:36:22 -07:00
|
|
|
i18n: i18nInstance,
|
2019-06-23 03:35:23 -07:00
|
|
|
router,
|
2022-11-04 06:04:31 -07:00
|
|
|
pinia,
|
2022-12-14 01:04:10 -08:00
|
|
|
render: (h) => h(App),
|
2019-06-23 03:35:23 -07:00
|
|
|
}).$mount('#app');
|
|
|
|
|
2022-11-09 01:01:50 -08:00
|
|
|
router.afterEach((to, from) => {
|
|
|
|
runExternalHook('main.routeChange', useWebhooksStore(), { from, to });
|
2023-04-11 09:43:47 -07:00
|
|
|
const userStore = useUsersStore();
|
|
|
|
if (userStore.currentUser && to.name && to.name !== VIEWS.SIGNOUT && !to.name.includes('Modal')) {
|
|
|
|
setTimeout(() => {
|
|
|
|
userStore.showUserActivationSurveyModal();
|
|
|
|
}, 500);
|
|
|
|
}
|
2022-11-09 01:01:50 -08:00
|
|
|
});
|
|
|
|
|
2023-01-11 13:22:12 -08:00
|
|
|
if (!import.meta.env.PROD) {
|
2019-06-23 03:35:23 -07:00
|
|
|
// Make sure that we get all error messages properly displayed
|
|
|
|
// as long as we are not in production mode
|
|
|
|
window.onerror = (message, source, lineno, colno, error) => {
|
|
|
|
if (message.toString().includes('ResizeObserver')) {
|
|
|
|
// That error can apparently be ignored and can probably
|
|
|
|
// not do anything about it anyway
|
|
|
|
return;
|
|
|
|
}
|
2020-04-05 18:06:00 -07:00
|
|
|
console.error('error caught in main.ts'); // eslint-disable-line no-console
|
2019-09-22 13:03:58 -07:00
|
|
|
console.error(message); // eslint-disable-line no-console
|
|
|
|
console.error(error); // eslint-disable-line no-console
|
2019-06-23 03:35:23 -07:00
|
|
|
};
|
|
|
|
}
|