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
43 changes: 0 additions & 43 deletions src/components/AppContent/CircleContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,10 @@
props: {
loading: {
type: Boolean,
default: true,

Check warning on line 57 in src/components/AppContent/CircleContent.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Boolean prop should only be defaulted to false
},
},

data() {
return {
loadingList: false,
}
},

computed: {
// store variables
circles() {
Expand All @@ -82,25 +76,10 @@
return Object.values(this.circle?.members || [])
},

/**
* Is the current circle empty
*
* @return {boolean}
*/
isEmptyCircle() {
return this.members.length === 0
},

...mapStores(useUserGroupStore),
},

watch: {
circle(newCircle) {
if (newCircle?.id) {
this.fetchCircleMembers(newCircle.id)
}
},

userGroup(newUserGroup) {
if (newUserGroup?.id) {
this.fetchUserGroupMembers(newUserGroup.id)
Expand All @@ -109,40 +88,18 @@
},

beforeMount() {
if (this.circle?.id) {
this.fetchCircleMembers(this.circle.id)
}

if (this.userGroup?.id) {
this.fetchUserGroupMembers(this.userGroup.id)
}
},

methods: {
async fetchCircleMembers(circleId) {
this.loadingList = true
this.logger.debug('Fetching members for', { circleId })

try {
await this.$store.dispatch('getCircleMembers', circleId)
} catch (error) {
console.error(error)
showError(t('contacts', 'There was an error fetching the member list'))
} finally {
this.loadingList = false
}
},

async fetchUserGroupMembers(userGroupId) {
this.loadingList = true

try {
await this.userGroupStore.getUserGroupMembers(userGroupId)
} catch (error) {
console.error(error)
showError(t('contacts', 'There was an error fetching the member list'))
} finally {
this.loadingList = false
}
},
},
Expand Down
3 changes: 3 additions & 0 deletions src/components/MemberList/MemberGridItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@

<script>
import { DialogBuilder, showError } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'
import { NcActionButton, NcActions, NcActionSeparator, NcActionText, NcAvatar, NcButton } from '@nextcloud/vue'
import IconAccountGroupOutline from 'vue-material-design-icons/AccountGroupOutline.vue'
import IconCheckOutline from 'vue-material-design-icons/CheckOutline.vue'
Expand Down Expand Up @@ -317,6 +318,7 @@ export default {
member: this.member,
leave: this.isCurrentUser,
})
emit('contacts:circles:member:deleted')
} catch (error) {
if (error?.response?.status === 404) {
this.logger.debug('Member is not in circle')
Expand Down Expand Up @@ -346,6 +348,7 @@ export default {
// this.member is a class. We're modifying the class setter, not the prop itself
// eslint-disable-next-line vue/no-mutating-props
this.member.level = level
emit('contacts:circles:member:changed')
} catch (error) {
this.logger.error('Could not change the member level', { level: CIRCLES_MEMBER_LEVELS[level], error })
showError(t('contacts', 'Could not change the member level to {level}', {
Expand Down
Loading
Loading