diff --git a/medcat-trainer/webapp/frontend/src/App.vue b/medcat-trainer/webapp/frontend/src/App.vue index e520f6188..998508d4c 100644 --- a/medcat-trainer/webapp/frontend/src/App.vue +++ b/medcat-trainer/webapp/frontend/src/App.vue @@ -64,7 +64,8 @@ import Login from '@/components/common/Login.vue' import EventBus from '@/event-bus' import { readTraditionalSession, authCookieNames } from './authCookies' import { isOidcEnabled, getRuntimeConfig } from './runtimeConfig'; -import { getMenuItems } from './plugins/registry' +import { getMenuItems, clearBootstrap } from './plugins/registry' +import { initPluginBootstrap } from './plugins/bootstrap' import { UNAUTHORIZED_EVENT, resetUnauthorizedGuard, clearClientAuth } from './httpAuth' export default { @@ -78,6 +79,7 @@ export default { version: '', useOidc: isOidcEnabled(), sessionExpired: false, + pluginBootstrapTick: 0, } }, computed: { @@ -87,6 +89,7 @@ export default { return `${v.slice(0, 7)}…${v.slice(-6)}` }, pluginMenuItems () { + void this.pluginBootstrapTick return getMenuItems() } }, @@ -115,7 +118,15 @@ export default { clearClientAuth(this.$http) } }, - loginSuccessful (payload) { + async refreshPluginBootstrap () { + await initPluginBootstrap(this.$http) + this.pluginBootstrapTick++ + }, + dropPluginBootstrap () { + clearBootstrap() + this.pluginBootstrapTick++ + }, + async loginSuccessful (payload) { this.sessionExpired = false resetUnauthorizedGuard() if (!this.useOidc) { @@ -124,6 +135,7 @@ export default { } else { this.updateOidcUser() } + await this.refreshPluginBootstrap() if (this.$route.name !== 'home') { this.$router.push({ name: 'home' }) } @@ -134,6 +146,7 @@ export default { this.uname = null this.isAdmin = false this.sessionExpired = true + this.dropPluginBootstrap() this.openLogin() }, updateOidcUser () { @@ -146,6 +159,7 @@ export default { logout () { this.uname = null this.isAdmin = false + this.dropPluginBootstrap() // Clear header + namespaced cookies together. Do not touch bare // `api-token` / `admin` names — those belong to other MCT versions. clearClientAuth(this.$http) diff --git a/medcat-trainer/webapp/frontend/src/components/common/DocumentSummary.vue b/medcat-trainer/webapp/frontend/src/components/common/DocumentSummary.vue index 3f1e97a2b..55917a7e0 100644 --- a/medcat-trainer/webapp/frontend/src/components/common/DocumentSummary.vue +++ b/medcat-trainer/webapp/frontend/src/components/common/DocumentSummary.vue @@ -25,7 +25,7 @@ {{doc.text === 'nan' ? '' : (limitText(doc.text) || '')}} + v-if="preparedDocIds.includes(doc.id) || completeBgTasks.includes(doc.id)"> Predictions ready for Doc: {{doc.id}} { try { @@ -115,7 +122,5 @@ export function clearPluginRegistry(): void { } buildTimeMenuItems.length = 0 buildTimeVueRoutes.length = 0 - serverMenuExtensions = [] - serverRoutes = [] - serverFeatures = [] + clearBootstrap() }