[MM-56318] Global warning banners of user limit for admins (#25797)

* get data to store

* inin

* added inside loadme

* useCWSAvailabilityCheck hook improve

* modal airgap

* the bar

* Update announcement_bar_controller.tsx

* Update true_up_review.tsx

* csw

* fixes

* fixed

* more tests

* icon changed

* changes

* Extended tests

* Update index.ts

* redux harrison changes

* Updated copy

* Lint fixes

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: harshil Sharma <harshilsharma63@gmail.com>
Этот коммит содержится в:
M-ZubairAhmed
2024-01-11 14:11:04 +00:00
коммит произвёл GitHub
родитель 539412b353
Коммит 2676caa52f
34 изменённых файлов: 503 добавлений и 72 удалений

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

@@ -148,6 +148,7 @@ import {
} from '@mattermost/types/data_retention';
import {CompleteOnboardingRequest} from '@mattermost/types/setup';
import {UserThreadList, UserThread, UserThreadWithPost} from '@mattermost/types/threads';
import {UsersLimits} from '@mattermost/types/limits';
import {cleanUrlForLogging} from './errors';
import {buildQueryString} from './helpers';
@@ -488,6 +489,10 @@ export default class Client4 {
return `${this.getBaseRoute()}/limits`;
}
getUsersLimitsRoute() {
return `${this.getLimitsRoute()}/users`;
}
getCSRFFromCookie() {
if (typeof document !== 'undefined' && typeof document.cookie !== 'undefined') {
const cookies = document.cookie.split(';');
@@ -1196,6 +1201,18 @@ export default class Client4 {
);
}
// Limits Routes
getUsersLimits = () => {
return this.doFetchWithResponse<UsersLimits>(
`${this.getUsersLimitsRoute()}`,
{
method: 'get',
},
);
}
// Team Routes
createTeam = (team: Team) => {

11
webapp/platform/types/src/limits.ts Обычный файл
Просмотреть файл

@@ -0,0 +1,11 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export type LimitsState = {
usersLimits: UsersLimits;
};
export type UsersLimits = {
activeUserCount: number;
maxUsersLimit: number;
};

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

@@ -29,11 +29,13 @@ import {ThreadsState} from './threads';
import {Typing} from './typing';
import {UsersState} from './users';
import {AppsState} from './apps';
import {LimitsState} from './limits';
export type GlobalState = {
entities: {
general: GeneralState;
users: UsersState;
limits: LimitsState;
teams: TeamsState;
channels: ChannelsState;
posts: PostsState;