Skip to content

Commit

Permalink
Merge pull request #4236 from nextcloud/fix/circlesRouting
Browse files Browse the repository at this point in the history
Add proper routing for circles, removing the import button when not needed
  • Loading branch information
GretaD authored Jan 20, 2025
2 parents 84abda7 + a0a80c9 commit baae7ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/models/circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Vue from 'vue'
import Member from './member'

import { CircleConfigs, MemberLevels } from './constants'
import { CircleConfigs, MemberLevels, ROUTE_CIRCLE } from './constants'

type MemberList = Record<string, Member>

Expand Down Expand Up @@ -303,7 +303,7 @@ export default class Circle {
get router() {
return {
name: 'circle',
params: { selectedCircle: this.id },
params: { selectedCircle: this.id, selectedGroup: ROUTE_CIRCLE },
}
}

Expand Down
11 changes: 10 additions & 1 deletion src/views/Contacts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:selected-group="selectedGroup"
:selected-contact="selectedContact">
<div class="import-and-new-contact-buttons">
<SettingsImportContacts v-if="!loadingContacts && isEmptyGroup && !isChartView" />
<SettingsImportContacts v-if="!loadingContacts && isEmptyGroup && !isChartView && !isCirclesView" />
<!-- new-contact-button -->
<Button v-if="!loadingContacts"
type="secondary"
Expand Down Expand Up @@ -146,6 +146,9 @@ export default {
groups() {
return this.$store.getters.getGroups
},
circles() {
return this.$store.getters.getCircles
},
orderKey() {
return this.$store.getters.getOrderKey
},
Expand Down Expand Up @@ -193,6 +196,8 @@ export default {
return this.sortedContacts
} else if (this.selectedGroup === GROUP_NO_GROUP_CONTACTS) {
return this.ungroupedContacts.map(contact => this.sortedContacts.find(item => item.key === contact.key))
} else if (this.selectedGroup === ROUTE_CIRCLE) {
return []
}
const group = this.groups.filter(group => group.name === this.selectedGroup)[0]
if (group) {
Expand All @@ -201,6 +206,10 @@ export default {
return []
},

isCirclesView() {
return this.selectedGroup === ROUTE_CIRCLE
},

ungroupedContacts() {
return this.sortedContacts.filter(contact => this.contacts[contact.key].groups && this.contacts[contact.key].groups.length === 0)
},
Expand Down

0 comments on commit baae7ad

Please sign in to comment.