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
@@ -7,7 +7,7 @@ import type {Dispatch} from 'redux';
|
||||
|
||||
import {uploadLicense, removeLicense, getPrevTrialLicense} from 'mattermost-redux/actions/admin';
|
||||
import {getLicenseConfig} from 'mattermost-redux/actions/general';
|
||||
import {getUsersLimits} from 'mattermost-redux/actions/limits';
|
||||
import {getServerLimits} from 'mattermost-redux/actions/limits';
|
||||
import {getFilteredUsersStats} from 'mattermost-redux/actions/users';
|
||||
import {getConfig} from 'mattermost-redux/selectors/entities/general';
|
||||
import {getFilteredUsersStats as selectFilteredUserStats} from 'mattermost-redux/selectors/entities/users';
|
||||
@@ -43,7 +43,7 @@ function mapDispatchToProps(dispatch: Dispatch) {
|
||||
requestTrialLicense,
|
||||
openModal,
|
||||
getFilteredUsersStats,
|
||||
getUsersLimits,
|
||||
getServerLimits,
|
||||
}, dispatch),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ describe('components/admin_console/license_settings/LicenseSettings', () => {
|
||||
upgradeToE0Status: jest.fn().mockImplementation(() => Promise.resolve({percentage: 0, error: null})),
|
||||
openModal: jest.fn(),
|
||||
getFilteredUsersStats: jest.fn(),
|
||||
getUsersLimits: jest.fn(),
|
||||
getServerLimits: jest.fn(),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {FormattedMessage, defineMessages} from 'react-intl';
|
||||
import type {StatusOK} from '@mattermost/types/client4';
|
||||
import type {ClientLicense} from '@mattermost/types/config';
|
||||
import type {ServerError} from '@mattermost/types/errors';
|
||||
import type {UsersLimits} from '@mattermost/types/limits';
|
||||
import type {ServerLimits} from '@mattermost/types/limits';
|
||||
import type {GetFilteredUsersStatsOpts, UsersStats} from '@mattermost/types/users';
|
||||
|
||||
import type {ActionResult} from 'mattermost-redux/types/actions';
|
||||
@@ -55,7 +55,7 @@ type Props = {
|
||||
ping: () => Promise<{status: string}>;
|
||||
requestTrialLicense: (users: number, termsAccepted: boolean, receiveEmailsAccepted: boolean, featureName: string) => Promise<ActionResult>;
|
||||
openModal: <P>(modalData: ModalData<P>) => void;
|
||||
getUsersLimits: () => Promise<ActionResult<UsersLimits, ServerError>>;
|
||||
getServerLimits: () => Promise<ActionResult<ServerLimits, ServerError>>;
|
||||
getFilteredUsersStats: (filters: GetFilteredUsersStatsOpts) => Promise<{
|
||||
data?: UsersStats;
|
||||
error?: ServerError;
|
||||
@@ -196,7 +196,7 @@ export default class LicenseSettings extends React.PureComponent<Props, State> {
|
||||
this.props.actions.getLicenseConfig(),
|
||||
]);
|
||||
|
||||
await this.props.actions.getUsersLimits();
|
||||
await this.props.actions.getServerLimits();
|
||||
|
||||
this.setState({serverError: null, removing: false});
|
||||
};
|
||||
|
||||
Ссылка в новой задаче
Block a user