add additional checks for service setting.

Этот коммит содержится в:
Conor Macpherson
2023-04-14 16:53:28 -04:00
родитель 42f6568d09
Коммит 3a64bda171
2 изменённых файлов: 6 добавлений и 2 удалений

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

@@ -21,6 +21,7 @@ import {StatTypes, Preferences, AnnouncementBarTypes, ConsolePages} from 'utils/
import './overage_users_banner.scss';
import {getSiteURL} from 'utils/url';
import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand';
import {getConfig} from 'mattermost-redux/selectors/entities/admin';
type AdminHasDismissedItArgs = {
preferenceName: string;
@@ -55,7 +56,8 @@ const OverageUsersBanner = () => {
activeUsers,
seatsPurchased,
});
const canSelfHostedExpand = useCanSelfHostedExpand();
const isSelfHostedExpansionEnabled = useSelector(getConfig)?.ServiceSettings?.SelfHostedExpansion;
const canSelfHostedExpand = useCanSelfHostedExpand() && isSelfHostedExpansionEnabled;
const siteURL = getSiteURL();
const prefixPreferences = isOver10PercerntPurchasedSeats ? 'error' : 'warn';
const prefixLicenseId = (license.Id || '').substring(0, 8);

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

@@ -23,6 +23,7 @@ import './overage_users_banner_notice.scss';
import ExternalLink from 'components/external_link';
import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand';
import {getSiteURL} from 'utils/url';
import {getConfig} from 'mattermost-redux/selectors/entities/admin';
type AdminHasDismissedArgs = {
preferenceName: string;
@@ -45,7 +46,8 @@ const OverageUsersBannerNotice = () => {
const currentUser = useSelector((state: GlobalState) => getCurrentUser(state));
const overagePreferences = useSelector((state: GlobalState) => getPreferencesCategory(state, Preferences.OVERAGE_USERS_BANNER));
const activeUsers = ((stats || {})[StatTypes.TOTAL_USERS]) as number || 0;
const canSelfHostedExpand = useCanSelfHostedExpand();
const isSelfHostedExpansionEnabled = useSelector(getConfig)?.ServiceSettings?.SelfHostedExpansion;
const canSelfHostedExpand = useCanSelfHostedExpand() && isSelfHostedExpansionEnabled;
const siteURL = getSiteURL();
const {