Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/components/AppNavigation/GroupNavigationItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
<AppNavigationItem
:key="group.key"
:to="group.router"
:name="group.name">
:name="group.name"
:active="routeState === `group:${group.id}`"
@click="$emit('updateRouteState', `group:${group.id}`)">

Check warning on line 19 in src/components/AppNavigation/GroupNavigationItem.vue

View workflow job for this annotation

GitHub Actions / NPM lint

The "updateRouteState" event has been triggered but not declared on `emits` option
<template #icon>
<IconContact :size="20" />
<IconContactFilled v-if="routeState === `group:${group.id}`" :size="20" />
<IconContact v-else :size="20" />
</template>
<template #actions>
<ActionButton
Expand Down Expand Up @@ -87,6 +90,7 @@
} from '@nextcloud/vue'
import download from 'downloadjs'
import moment from 'moment'
import IconContactFilled from 'vue-material-design-icons/AccountMultiple.vue'
import IconContact from 'vue-material-design-icons/AccountMultipleOutline.vue'
import IconEmail from 'vue-material-design-icons/EmailOutline.vue'
import IconRename from 'vue-material-design-icons/FolderEditOutline.vue'
Expand All @@ -111,13 +115,19 @@
IconRename,
IconDelete,
IconLoading,
IconContactFilled,
},

props: {
group: {
type: Object,
required: true,
},

routeState: {
type: String,
required: true,
},
},

data() {
Expand Down Expand Up @@ -239,7 +249,7 @@
* Open mailto: for contacts in a group
*
* @param {object} group of contacts to be emailed
* @param {string} mode

Check warning on line 252 in src/components/AppNavigation/GroupNavigationItem.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing JSDoc @param "mode" description
*/
emailGroup(group, mode = 'to') {
const emails = []
Expand Down
46 changes: 32 additions & 14 deletions src/components/AppNavigation/RootNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
:to="{
name: 'group',
params: { selectedGroup: GROUP_ALL_CONTACTS },
}">
}"
:active="routeState === 'all'"
@click="updateRouteState('all')">
<template #icon>
<IconContact :size="20" />
<IconContactFilled v-if="routeState === 'all'" :size="20" />
<IconContact v-else :size="20" />
</template>
<template #counter>
<NcCounterBubble
Expand All @@ -44,7 +47,9 @@
name: 'chart',
params: { selectedChart: GROUP_ALL_CONTACTS },
}"
icon="icon-category-monitoring" />
:active="routeState === 'orgchart'"
icon="icon-category-monitoring"
@click="updateRouteState('orgchart')" />

<!-- Not grouped group -->
<AppNavigationItem
Expand All @@ -54,9 +59,12 @@
:to="{
name: 'group',
params: { selectedGroup: GROUP_NO_GROUP_CONTACTS },
}">
}"
:active="routeState === 'notgrouped'"
@click="updateRouteState('notgrouped')">
<template #icon>
<IconUser :size="20" />
<IconUserFilled v-if="routeState === 'notgrouped'" :size="20" />
<IconUser v-else :size="20" />
</template>
<template #counter>
<NcCounterBubble
Expand All @@ -73,7 +81,9 @@
:to="{
name: 'group',
params: { selectedGroup: GROUP_RECENTLY_CONTACTED },
}">
}"
:active="routeState === 'recentlycontacted'"
@click="updateRouteState('recentlycontacted')">
<template #icon>
<IconRecentlyContacted :size="20" />
</template>
Expand Down Expand Up @@ -113,7 +123,9 @@
<GroupNavigationItem
v-for="group in ellipsisGroupsMenu"
:key="group.key"
:group="group" />
:route-state="routeState"
:group="group"
@update-route-state="updateRouteState" />

<template v-if="isCirclesEnabled">
<!-- Toggle groups ellipsis -->
Expand Down Expand Up @@ -148,7 +160,8 @@
<CircleNavigationItem
v-for="circle in ellipsisCirclesMenu"
:key="circle.key"
:circle="circle" />
:circle="circle"
@click="updateRouteState(`circle:${circle.id}`)" />

<!-- Toggle circles ellipsis -->
<AppNavigationItem
Expand Down Expand Up @@ -198,6 +211,8 @@ import {
} from '@nextcloud/vue'
import { mapStores } from 'pinia'
import naturalCompare from 'string-natural-compare'
import IconUserFilled from 'vue-material-design-icons/Account.vue'
import IconContactFilled from 'vue-material-design-icons/AccountMultiple.vue'
import IconContact from 'vue-material-design-icons/AccountMultipleOutline.vue'
import IconUser from 'vue-material-design-icons/AccountOutline.vue'
import IconError from 'vue-material-design-icons/AlertCircleOutline.vue'
Expand Down Expand Up @@ -230,7 +245,9 @@ export default {
ContactsSettings,
GroupNavigationItem,
IconContact,
IconContactFilled,
IconUser,
IconUserFilled,
IconAdd,
IconError,
IconLoading,
Expand All @@ -243,12 +260,7 @@ export default {
props: {
loading: {
type: Boolean,
default: true,
},

contactsList: {
type: Array,
required: true,
default: false,
},
},

Expand Down Expand Up @@ -278,6 +290,8 @@ export default {
collapsedCircles: true,

showSettings: false,

routeState: 'all',
}
},

Expand Down Expand Up @@ -493,6 +507,10 @@ export default {
showContactsSettings() {
this.showSettings = true
},

updateRouteState(state) {
this.routeState = state
},
},
}
</script>
Expand Down
Loading