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/Main.vue";
20 import { routes } from "../routes/erm";
22 const router = createRouter({
23 history: createWebHistory(),
24 linkActiveClass: "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 const AVStore = useAVStore(pinia);
56 app.provide("AVStore", AVStore);
60 const { removeMessages } = mainStore;
61 router.beforeEach((to, from) => {
62 removeMessages(); // This will actually flag the messages as displayed already
64 router.afterEach((to, from) => {
65 let tab_id = 1; // Agreements
66 if (to.path.match(/\/erm\/eholdings\/local\/packages/)) {
68 } else if (to.path.match(/\/erm\/eholdings\/local\/titles/)) {
71 let node = document.getElementById("ui-id-" + tab_id);