Skip to content

Commit

Permalink
Fix displaying of inactive user views
Browse files Browse the repository at this point in the history
  • Loading branch information
nioc committed Nov 15, 2021
1 parent 325560e commit caa3596
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<div id="navbar-menu" class="navbar-menu">
<div class="navbar-start">
<router-link class="navbar-item" :to="{name: 'rooms'}" title="Pièces"><i class="fa fa-home fa-fw fa-mr" /><span class="is-navbar-label">Pièces</span></router-link>
<div v-if="userViewsList.length" class="navbar-item has-dropdown" :class="{'is-active': hasDropdownViewsDisplayed}" @click="hasDropdownViewsDisplayed = !hasDropdownViewsDisplayed">
<div v-if="activeUserViews.length" class="navbar-item has-dropdown" :class="{'is-active': hasDropdownViewsDisplayed}" @click="hasDropdownViewsDisplayed = !hasDropdownViewsDisplayed">
<router-link v-slot="{href, isActive}" class="navbar-link is-arrowless" :to="{name: 'views'}" custom><a :href="href" :class="{'router-link-active': isActive}" @click.prevent=""><i class="fa fa-binoculars fa-fw fa-mr" /><span class="is-navbar-label">Vues</span></a></router-link>
<div class="navbar-dropdown">
<router-link v-for="userView in userViewsList" :key="userView.code" :to="{name: 'view', params: {code: userView.code}}" class="navbar-item"><span>{{ userView.title }}</span></router-link>
<router-link v-for="userView in activeUserViews" :key="userView.code" :to="{name: 'view', params: {code: userView.code}}" class="navbar-item"><span>{{ userView.title }}</span></router-link>
</div>
</div>
<router-link class="navbar-item" :to="{name: 'scenarios'}" title="Scénarios"><i class="fa fa-book fa-fw fa-mr" /><span class="is-navbar-label">Scénarios</span></router-link>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<b-menu-item v-for="room in ordered" :key="room.id" :to="{name: 'room', params: {id: room.id}}" :label="room.name" tag="router-link" />
</b-menu-item>

<b-menu-item v-if="userViewsList.length" icon="binoculars fa-fw fa-mr">
<b-menu-item v-if="activeUserViews.length" icon="binoculars fa-fw fa-mr">
<template slot="label" slot-scope="props">
Vues
<i class="is-pulled-right fa" :class="props.expanded ? 'fa-caret-down' : 'fa-caret-up'" />
</template>
<b-menu-item v-for="userView in userViewsList" :key="userView.code" :to="{name: 'view', params: {code: userView.code}}" :label="userView.title" tag="router-link" />
<b-menu-item v-for="userView in activeUserViews" :key="userView.code" :to="{name: 'view', params: {code: userView.code}}" :label="userView.title" tag="router-link" />
</b-menu-item>

<b-menu-item v-if="tagsList.length" icon="tags fa-fw fa-mr">
Expand Down
1 change: 1 addition & 0 deletions src/mixins/UserViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const UserViewsMixin = {
...mapGetters([
'getUserViewByCode',
]),
activeUserViews () { return this.userViewsList.filter((userView) => userView.isActive) },
},
methods: {
...mapActions(['vxRefreshUserViews']),
Expand Down

0 comments on commit caa3596

Please sign in to comment.