Restore previously archived groups (#22597)

* add ability to restore groups from the user group modal

* factory selector for groups to reduce number of renders across the app

* react window and infinite scroll for user groups

* adding archive groups to dropdown

* restore user group from the view modal

* component cleanup

* lint

* adding websocket for archiveGroup

* updating tests

* adding some tests and fixing types

* lint

* fixing broken test

* fixing snapshot

* fixing infinitescroll

* lint

* increasing max-height and updating snapshots

* fixing PR comments

* fixing case for button

* snapshot and translation

* fixing PR comments

* tiding up repition and creating new hook

* fixing tests

* add additional parammeter for call to getGroups()

* make sure popup is visible for all rows

* update text for admin console

* update css for lint

* fix edge cases found in review

* revert package-lock.json

* revert adding query to GetGroupsParam

* fixing lint

* change include_archived to false in team_controller

---------

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Ben Cooke
2023-08-31 10:07:51 -04:00
коммит произвёл GitHub
родитель 32512d35fb
Коммит 2c6179a0a6
44 изменённых файлов: 1031 добавлений и 1019 удалений

Просмотреть файл

@@ -74,8 +74,10 @@ import {
UsersWithGroupsAndCount,
GroupsWithCount,
GroupCreateWithUserIds,
GroupSearachParams,
GroupSearchParams,
CustomGroupPatch,
GetGroupsParams,
GetGroupsForUserParams,
} from '@mattermost/types/groups';
import {PostActionResponse} from '@mattermost/types/integration_actions';
import {
@@ -3502,20 +3504,9 @@ export default class Client4 {
);
};
getGroups = (q = '', filterAllowReference = false, page = 0, perPage = 10, includeMemberCount = false, hasFilterMember = false) => {
const qs: any = {
q,
filter_allow_reference: filterAllowReference,
page,
per_page: perPage,
include_member_count: includeMemberCount,
};
if (hasFilterMember) {
qs.filter_has_member = hasFilterMember;
}
getGroups = (opts: GetGroupsForUserParams | GetGroupsParams) => {
return this.doFetch<Group[]>(
`${this.getGroupsRoute()}${buildQueryString(qs)}`,
`${this.getGroupsRoute()}${buildQueryString(opts)}`,
{method: 'get'},
);
};
@@ -3573,7 +3564,7 @@ export default class Client4 {
);
}
searchGroups = (params: GroupSearachParams) => {
searchGroups = (params: GroupSearchParams) => {
return this.doFetch<Group[]>(
`${this.getGroupsRoute()}${buildQueryString(params)}`,
{method: 'get'},
@@ -3676,6 +3667,13 @@ export default class Client4 {
);
}
restoreGroup = (groupId: string) => {
return this.doFetch<Group>(
`${this.getGroupRoute(groupId)}/restore`,
{method: 'post'},
);
}
createGroupTeamsAndChannels = (userID: string) => {
return this.doFetch<Group>(
`${this.getBaseRoute()}/ldap/users/${userID}/group_sync_memberships`,