1 import { createApp } from "vue";
2 import { createWebHistory, createRouter } from "vue-router";
3 import { createPinia } from "pinia";
5 import { library } from "@fortawesome/fontawesome-svg-core";
12 } from "@fortawesome/free-solid-svg-icons";
13 import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
14 import vSelect from "vue-select";
16 library.add(faPlus, faMinus, faPencil, faTrash, faSpinner);
18 import App from "./components/ERM/ERMMain.vue";
20 import { routes } from "./routes";
22 const router = createRouter({
23 history: createWebHistory(),
24 linkExactActiveClass: "current",
28 import { useMainStore } from "./stores/main";
29 import { useVendorStore } from "./stores/vendors";
30 import { useAVStore } from "./stores/authorised_values";
32 const pinia = createPinia();
35 install: (app, options) => {
36 app.config.globalProperties.$__ = (key) => {
37 return window["__"](key);
42 const app = createApp(App);
44 const rootComponent = app
48 .component("font-awesome-icon", FontAwesomeIcon)
49 .component("v-select", vSelect);
51 app.config.unwrapInjectedRef = true;
52 app.provide("vendorStore", useVendorStore(pinia));
53 const mainStore = useMainStore(pinia);
54 app.provide("mainStore", mainStore);
55 app.provide("AVStore", useAVStore(pinia));
59 const { removeMessages } = mainStore;
60 router.beforeEach((to, from) => {
61 removeMessages(); // This will actually flag the messages as displayed already
63 router.afterEach((to, from) => {
64 let tab_id = 1; // Agreements
65 if ( to.path.match(/\/erm\/eholdings\/local\/titles/)){
67 } else if ( to.path.match(/\/erm\/eholdings\/local\/packages/)){
70 document.getElementById('ui-id-' + tab_id).click();