[MM-56399][MM-56397][MM-56456][MM-56269] Various changes for user reporting for admins (#25839)
* [MM-56399] Add user count endpoint for reporting * [MM-56397] Added search term to user report filter * Missing translation * [MM-56456] Rename up/down to prev/next for reporting cursoring * [MM-56269] Add DeleteAt, MfaActive and AuthService fields to UserReport * PR feedback * Fix test --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bb88b92b4c
Коммит
0a4e9eeb92
@@ -52,7 +52,7 @@ import {
|
||||
ChannelSearchOpts,
|
||||
ServerChannel,
|
||||
} from '@mattermost/types/channels';
|
||||
import {Options, StatusOK, ClientResponse, LogLevel, FetchPaginatedThreadOptions, UserReportOptions} from '@mattermost/types/client4';
|
||||
import {Options, StatusOK, ClientResponse, LogLevel, FetchPaginatedThreadOptions, UserReportOptions, UserReportFilter} from '@mattermost/types/client4';
|
||||
import {Compliance} from '@mattermost/types/compliance';
|
||||
import {
|
||||
ClientConfig,
|
||||
@@ -999,6 +999,14 @@ export default class Client4 {
|
||||
);
|
||||
}
|
||||
|
||||
getUserCountForReporting = (filter: UserReportFilter) => {
|
||||
const queryString = buildQueryString(filter);
|
||||
return this.doFetch<number>(
|
||||
`${this.getReportsRoute()}/users/count${queryString}`,
|
||||
{method: 'get'},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
@@ -44,7 +44,16 @@ export enum ReportDuration {
|
||||
Last6Months = 'last_6_months',
|
||||
}
|
||||
|
||||
export type UserReportOptions = {
|
||||
export type UserReportFilter = {
|
||||
role_filter?: string,
|
||||
has_no_team?: boolean,
|
||||
team_filter?: string,
|
||||
hide_active?: boolean,
|
||||
hide_inactive?: boolean,
|
||||
searchTerm?: string,
|
||||
}
|
||||
|
||||
export type UserReportOptions = UserReportFilter & {
|
||||
sort_column: 'CreateAt' | 'Username' | 'FirstName' | 'LastName' | 'Nickname' | 'Email',
|
||||
page_size: number,
|
||||
sort_direction?: 'asc' | 'desc',
|
||||
@@ -52,9 +61,4 @@ export type UserReportOptions = {
|
||||
date_range?: ReportDuration,
|
||||
from_column_value?: string,
|
||||
from_id?: string,
|
||||
role_filter?: string,
|
||||
has_no_team?: boolean,
|
||||
team_filter?: string,
|
||||
hide_active?: boolean,
|
||||
hide_inactive?: boolean,
|
||||
}
|
||||
|
||||
@@ -144,12 +144,7 @@ export type AuthChangeResponse = {
|
||||
follow_link: string;
|
||||
};
|
||||
|
||||
export type UserReport = {
|
||||
id: string;
|
||||
username: string;
|
||||
email: string;
|
||||
create_at: number;
|
||||
display_name: string;
|
||||
export type UserReport = UserProfile & {
|
||||
last_login_at: number;
|
||||
last_status_at?: number;
|
||||
last_post_date?: number;
|
||||
|
||||
Ссылка в новой задаче
Block a user