add additional checks for service setting.
Этот коммит содержится в:
@@ -21,6 +21,7 @@ import {StatTypes, Preferences, AnnouncementBarTypes, ConsolePages} from 'utils/
|
|||||||
import './overage_users_banner.scss';
|
import './overage_users_banner.scss';
|
||||||
import {getSiteURL} from 'utils/url';
|
import {getSiteURL} from 'utils/url';
|
||||||
import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand';
|
import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand';
|
||||||
|
import {getConfig} from 'mattermost-redux/selectors/entities/admin';
|
||||||
|
|
||||||
type AdminHasDismissedItArgs = {
|
type AdminHasDismissedItArgs = {
|
||||||
preferenceName: string;
|
preferenceName: string;
|
||||||
@@ -55,7 +56,8 @@ const OverageUsersBanner = () => {
|
|||||||
activeUsers,
|
activeUsers,
|
||||||
seatsPurchased,
|
seatsPurchased,
|
||||||
});
|
});
|
||||||
const canSelfHostedExpand = useCanSelfHostedExpand();
|
const isSelfHostedExpansionEnabled = useSelector(getConfig)?.ServiceSettings?.SelfHostedExpansion;
|
||||||
|
const canSelfHostedExpand = useCanSelfHostedExpand() && isSelfHostedExpansionEnabled;
|
||||||
const siteURL = getSiteURL();
|
const siteURL = getSiteURL();
|
||||||
const prefixPreferences = isOver10PercerntPurchasedSeats ? 'error' : 'warn';
|
const prefixPreferences = isOver10PercerntPurchasedSeats ? 'error' : 'warn';
|
||||||
const prefixLicenseId = (license.Id || '').substring(0, 8);
|
const prefixLicenseId = (license.Id || '').substring(0, 8);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import './overage_users_banner_notice.scss';
|
|||||||
import ExternalLink from 'components/external_link';
|
import ExternalLink from 'components/external_link';
|
||||||
import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand';
|
import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand';
|
||||||
import {getSiteURL} from 'utils/url';
|
import {getSiteURL} from 'utils/url';
|
||||||
|
import {getConfig} from 'mattermost-redux/selectors/entities/admin';
|
||||||
|
|
||||||
type AdminHasDismissedArgs = {
|
type AdminHasDismissedArgs = {
|
||||||
preferenceName: string;
|
preferenceName: string;
|
||||||
@@ -45,7 +46,8 @@ const OverageUsersBannerNotice = () => {
|
|||||||
const currentUser = useSelector((state: GlobalState) => getCurrentUser(state));
|
const currentUser = useSelector((state: GlobalState) => getCurrentUser(state));
|
||||||
const overagePreferences = useSelector((state: GlobalState) => getPreferencesCategory(state, Preferences.OVERAGE_USERS_BANNER));
|
const overagePreferences = useSelector((state: GlobalState) => getPreferencesCategory(state, Preferences.OVERAGE_USERS_BANNER));
|
||||||
const activeUsers = ((stats || {})[StatTypes.TOTAL_USERS]) as number || 0;
|
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 siteURL = getSiteURL();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user