Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper routing for circles, removing the import button when not needed #4236

Merged
merged 1 commit into from
Jan 20, 2025
Merged
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
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 @@
groups() {
return this.$store.getters.getGroups
},
circles() {

Check warning on line 149 in src/views/Contacts.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Contacts.vue#L149

Added line #L149 was not covered by tests
return this.$store.getters.getCircles
},

Check warning on line 151 in src/views/Contacts.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Contacts.vue#L151

Added line #L151 was not covered by tests
orderKey() {
return this.$store.getters.getOrderKey
},
Expand Down Expand Up @@ -193,6 +196,8 @@
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 @@
return []
},

isCirclesView() {

Check warning on line 209 in src/views/Contacts.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Contacts.vue#L209

Added line #L209 was not covered by tests
return this.selectedGroup === ROUTE_CIRCLE
},

Check warning on line 212 in src/views/Contacts.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Contacts.vue#L212

Added line #L212 was not covered by tests
ungroupedContacts() {
return this.sortedContacts.filter(contact => this.contacts[contact.key].groups && this.contacts[contact.key].groups.length === 0)
},
Expand Down
Loading