diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-06-24 13:55:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 13:55:59 +0200 |
commit | 57607e0813378a569be0a53a567a5071a3fe159c (patch) | |
tree | 9d963c2ce20bd8d593b2b1c25d8c948b7a6021f5 | |
parent | af1d8cd6ec40d1e46800b7b5658a6cf7d3082e79 (diff) | |
parent | 87cfdf99a52989aab5d57ca0c4744242039107fe (diff) |
Merge pull request #2298 from nextcloud/fix/contacts-type-display
-rw-r--r-- | src/components/MemberList.vue | 12 | ||||
-rw-r--r-- | src/models/constants.ts | 12 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/components/MemberList.vue b/src/components/MemberList.vue index ffd8fb12..e8a1a6d7 100644 --- a/src/components/MemberList.vue +++ b/src/components/MemberList.vue @@ -151,11 +151,15 @@ export default { .map(type => parseInt(type, 10)) // Map populated types to the group entry .map(type => CIRCLES_MEMBER_GROUPING.find(group => group.type === type)) + // Removed undefined group + .filter(group => group !== undefined) // Injecting headings - .map(group => [{ - heading: true, - ...group, - }, ...(this.groupedList[group.type] || [])]) + .map(group => { + return [{ + heading: true, + ...group, + }, ...(this.groupedList[group.type] || [])] + }) // Merging sub-arrays .flat() }, diff --git a/src/models/constants.ts b/src/models/constants.ts index ae7b4374..d8356e17 100644 --- a/src/models/constants.ts +++ b/src/models/constants.ts @@ -156,11 +156,21 @@ export const CIRCLES_MEMBER_GROUPING = [ share: OC.Share.SHARE_TYPE_EMAIL, type: MEMBER_TYPE_MAIL }, + // TODO: implement SHARE_TYPE_CONTACT + { + id: `picker-contact`, + label: t('contacts', 'Contacts'), + share: OC.Share.SHARE_TYPE_EMAIL, + type: MEMBER_TYPE_CONTACT + }, ] // Generating a map between share types and circle member types export const SHARES_TYPES_MEMBER_MAP = CIRCLES_MEMBER_GROUPING.reduce((list, entry) => { - list[entry.share] = entry.type + // ! Ignore duplicate share types + if (!list[entry.share]) { + list[entry.share] = entry.type + } return list }, {}) |