Lean build: gate Shopfloor Dashboard on the notifications plugin
Shopfloor Dashboard is a core view but its content is entirely notificationsApi.getShopfloor() + the calendar (both owned by the notifications plugin). Without notifications the display is empty, so gate the Displays link on the notifications/calendar route being staged. On a site without it the link - and the Displays header when nothing else is present - drops.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
</template>
|
||||
|
||||
<div v-if="showDisplays" class="nav-section">Displays</div>
|
||||
<a v-if="hasRoute('/shopfloor')" :href="withBase('/shopfloor')" target="_blank" class="external-link">Shopfloor Dashboard</a>
|
||||
<a v-if="showShopfloor" :href="withBase('/shopfloor')" target="_blank" class="external-link">Shopfloor Dashboard</a>
|
||||
<a v-if="hasRoute('/tv')" :href="withBase('/tv')" target="_blank" class="external-link">TV Slideshow</a>
|
||||
<a v-if="hasRoute('/parts-kiosk')" :href="withBase('/parts-kiosk')"
|
||||
target="_blank" class="external-link">Parts Kiosk</a>
|
||||
@@ -124,7 +124,12 @@ const authStore = useAuthStore()
|
||||
// report for a plugin that was never staged.
|
||||
const stagedRoutePaths = new Set(router.getRoutes().map(r => r.path))
|
||||
const hasRoute = (path) => stagedRoutePaths.has(path)
|
||||
const showDisplays = ['/shopfloor', '/tv', '/parts-kiosk'].some(hasRoute)
|
||||
// Shopfloor Dashboard is a core view but runs entirely on the notifications
|
||||
// plugin (notificationsApi.getShopfloor + the calendar); without it the display
|
||||
// is empty, so gate the link on the notifications plugin being in this build.
|
||||
const showShopfloor = hasRoute('/shopfloor')
|
||||
&& (hasRoute('/notifications') || hasRoute('/calendar'))
|
||||
const showDisplays = showShopfloor || hasRoute('/tv') || hasRoute('/parts-kiosk')
|
||||
const routeViewKey = computed(() =>
|
||||
route.path.startsWith('/settings') ? '/settings' : route.path
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user