Added post limit warning (#26793)
* Renamed user limit API to app limit API * Added post warning limit * Added tests * Fixed types * Renamed AppLimits to ServerLimits * Fixed tests and review fixes * Updated generated code * Updated server i18n * Fixed TestCreateUserOrGuest test * Exclude deleted posts from post count for liims * Reduced limits for ease of testing * Restored original limts
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4571c6e3a3
Коммит
b4a1b33d39
@@ -103,7 +103,7 @@ import type {
|
||||
SubmitDialogResponse,
|
||||
} from '@mattermost/types/integrations';
|
||||
import type {Job, JobTypeBase} from '@mattermost/types/jobs';
|
||||
import type {UsersLimits} from '@mattermost/types/limits';
|
||||
import type {ServerLimits} from '@mattermost/types/limits';
|
||||
import type {
|
||||
MarketplaceApp,
|
||||
MarketplacePlugin,
|
||||
@@ -498,8 +498,8 @@ export default class Client4 {
|
||||
return `${this.getBaseRoute()}/limits`;
|
||||
}
|
||||
|
||||
getUsersLimitsRoute() {
|
||||
return `${this.getLimitsRoute()}/users`;
|
||||
getServerLimitsRoute() {
|
||||
return `${this.getLimitsRoute()}/server`;
|
||||
}
|
||||
|
||||
getCSRFFromCookie() {
|
||||
@@ -1220,9 +1220,9 @@ export default class Client4 {
|
||||
|
||||
// Limits Routes
|
||||
|
||||
getUsersLimits = () => {
|
||||
return this.doFetchWithResponse<UsersLimits>(
|
||||
`${this.getUsersLimitsRoute()}`,
|
||||
getServerLimits = () => {
|
||||
return this.doFetchWithResponse<ServerLimits>(
|
||||
`${this.getServerLimitsRoute()}`,
|
||||
{
|
||||
method: 'get',
|
||||
},
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
export type LimitsState = {
|
||||
usersLimits: UsersLimits;
|
||||
serverLimits: ServerLimits;
|
||||
};
|
||||
|
||||
export type UsersLimits = {
|
||||
export type ServerLimits = {
|
||||
activeUserCount: number;
|
||||
maxUsersLimit: number;
|
||||
|
||||
maxPostLimit: number;
|
||||
postCount: number;
|
||||
};
|
||||
|
||||
Ссылка в новой задаче
Block a user