Implemented ability to quickly add a user to a group

This commit is contained in:
Alvaro 2022-09-26 10:24:52 -06:00 committed by GitHub
parent 190cd9408b
commit 22bf3ebcc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 855 additions and 70 deletions

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
import memoizee from 'memoizee';
import { isNumber } from 'lodash';
import { isNumber, pick } from 'lodash';
import { createSelector } from 'reselect';
import type { StateType } from '../reducer';
@ -477,6 +477,18 @@ export const getAllComposableConversations = createSelector(
)
);
export const getAllGroupsWithInviteAccess = createSelector(
getConversationLookup,
(conversationLookup: ConversationLookupType): Array<ConversationType> =>
Object.values(conversationLookup).filter(conversation => {
return (
conversation.type === 'group' &&
conversation.title &&
conversation.canAddNewMembers
);
})
);
/**
* getComposableContacts/getCandidateContactsForNewGroup both return contacts for the
* composer and group members, a different list from your primary system contacts.
@ -1010,6 +1022,14 @@ export const getGroupAdminsSelector = createSelector(
}
);
export const getContactSelector = createSelector(
getConversationSelector,
conversationSelector => {
return (contactId: string) =>
pick(conversationSelector(contactId), 'id', 'title', 'uuid');
}
);
const getConversationVerificationData = createSelector(
getConversations,
(