mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 11:19:11 +08:00
chore: use platform property to evaluate type of user, update all references (#7162)
* feat: use platform property to evaluate type of user, update all references
This commit is contained in:
parent
4177b88a4e
commit
cb2c492618
@ -4,6 +4,7 @@ import getOrgUser from 'api/user/getOrgUser';
|
|||||||
import { FeatureKeys } from 'constants/features';
|
import { FeatureKeys } from 'constants/features';
|
||||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { isEmpty } from 'lodash-es';
|
import { isEmpty } from 'lodash-es';
|
||||||
import { useAppContext } from 'providers/App/App';
|
import { useAppContext } from 'providers/App/App';
|
||||||
@ -13,7 +14,6 @@ import { matchPath, useLocation } from 'react-router-dom';
|
|||||||
import { LicenseState, LicenseStatus } from 'types/api/licensesV3/getActive';
|
import { LicenseState, LicenseStatus } from 'types/api/licensesV3/getActive';
|
||||||
import { Organization } from 'types/api/user/getOrganization';
|
import { Organization } from 'types/api/user/getOrganization';
|
||||||
import { USER_ROLES } from 'types/roles';
|
import { USER_ROLES } from 'types/roles';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
import { routePermission } from 'utils/permission';
|
import { routePermission } from 'utils/permission';
|
||||||
|
|
||||||
import routes, {
|
import routes, {
|
||||||
@ -55,7 +55,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
|||||||
);
|
);
|
||||||
const isOldRoute = oldRoutes.indexOf(pathname) > -1;
|
const isOldRoute = oldRoutes.indexOf(pathname) > -1;
|
||||||
const currentRoute = mapRoutes.get('current');
|
const currentRoute = mapRoutes.get('current');
|
||||||
const isCloudUserVal = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const [orgData, setOrgData] = useState<Organization | undefined>(undefined);
|
const [orgData, setOrgData] = useState<Organization | undefined>(undefined);
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import AppLayout from 'container/AppLayout';
|
|||||||
import useAnalytics from 'hooks/analytics/useAnalytics';
|
import useAnalytics from 'hooks/analytics/useAnalytics';
|
||||||
import { KeyboardHotkeysProvider } from 'hooks/hotkeys/useKeyboardHotkeys';
|
import { KeyboardHotkeysProvider } from 'hooks/hotkeys/useKeyboardHotkeys';
|
||||||
import { useThemeConfig } from 'hooks/useDarkMode';
|
import { useThemeConfig } from 'hooks/useDarkMode';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { LICENSE_PLAN_KEY } from 'hooks/useLicense';
|
import { LICENSE_PLAN_KEY } from 'hooks/useLicense';
|
||||||
import { NotificationProvider } from 'hooks/useNotifications';
|
import { NotificationProvider } from 'hooks/useNotifications';
|
||||||
import { ResourceProvider } from 'hooks/useResourceAttribute';
|
import { ResourceProvider } from 'hooks/useResourceAttribute';
|
||||||
@ -24,7 +25,7 @@ import { QueryBuilderProvider } from 'providers/QueryBuilder';
|
|||||||
import { Suspense, useCallback, useEffect, useState } from 'react';
|
import { Suspense, useCallback, useEffect, useState } from 'react';
|
||||||
import { Route, Router, Switch } from 'react-router-dom';
|
import { Route, Router, Switch } from 'react-router-dom';
|
||||||
import { CompatRouter } from 'react-router-dom-v5-compat';
|
import { CompatRouter } from 'react-router-dom-v5-compat';
|
||||||
import { extractDomain, isCloudUser, isEECloudUser } from 'utils/app';
|
import { extractDomain } from 'utils/app';
|
||||||
|
|
||||||
import PrivateRoute from './Private';
|
import PrivateRoute from './Private';
|
||||||
import defaultRoutes, {
|
import defaultRoutes, {
|
||||||
@ -54,7 +55,10 @@ function App(): JSX.Element {
|
|||||||
|
|
||||||
const { hostname, pathname } = window.location;
|
const { hostname, pathname } = window.location;
|
||||||
|
|
||||||
const isCloudUserVal = isCloudUser();
|
const {
|
||||||
|
isCloudUser: isCloudUserVal,
|
||||||
|
isEECloudUser: isEECloudUserVal,
|
||||||
|
} = useGetTenantLicense();
|
||||||
|
|
||||||
const enableAnalytics = useCallback(
|
const enableAnalytics = useCallback(
|
||||||
(user: IUser): void => {
|
(user: IUser): void => {
|
||||||
@ -150,7 +154,7 @@ function App(): JSX.Element {
|
|||||||
|
|
||||||
let updatedRoutes = defaultRoutes;
|
let updatedRoutes = defaultRoutes;
|
||||||
// if the user is a cloud user
|
// if the user is a cloud user
|
||||||
if (isCloudUserVal || isEECloudUser()) {
|
if (isCloudUserVal || isEECloudUserVal) {
|
||||||
// if the user is on basic plan then remove billing
|
// if the user is on basic plan then remove billing
|
||||||
if (isOnBasicPlan) {
|
if (isOnBasicPlan) {
|
||||||
updatedRoutes = updatedRoutes.filter(
|
updatedRoutes = updatedRoutes.filter(
|
||||||
@ -175,6 +179,7 @@ function App(): JSX.Element {
|
|||||||
isCloudUserVal,
|
isCloudUserVal,
|
||||||
isFetchingLicenses,
|
isFetchingLicenses,
|
||||||
isFetchingUser,
|
isFetchingUser,
|
||||||
|
isEECloudUserVal,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -6,6 +6,7 @@ import logEvent from 'api/common/logEvent';
|
|||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
import { SOMETHING_WENT_WRONG } from 'constants/api';
|
import { SOMETHING_WENT_WRONG } from 'constants/api';
|
||||||
import { FeatureKeys } from 'constants/features';
|
import { FeatureKeys } from 'constants/features';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { useNotifications } from 'hooks/useNotifications';
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import { defaultTo } from 'lodash-es';
|
import { defaultTo } from 'lodash-es';
|
||||||
import { CreditCard, HelpCircle, X } from 'lucide-react';
|
import { CreditCard, HelpCircle, X } from 'lucide-react';
|
||||||
@ -16,7 +17,6 @@ import { useLocation } from 'react-router-dom';
|
|||||||
import { ErrorResponse, SuccessResponse } from 'types/api';
|
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||||||
import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';
|
import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';
|
||||||
import { License } from 'types/api/licenses/def';
|
import { License } from 'types/api/licenses/def';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
export interface LaunchChatSupportProps {
|
export interface LaunchChatSupportProps {
|
||||||
eventName: string;
|
eventName: string;
|
||||||
@ -38,7 +38,7 @@ function LaunchChatSupport({
|
|||||||
onHoverText = '',
|
onHoverText = '',
|
||||||
intercomMessageDisabled = false,
|
intercomMessageDisabled = false,
|
||||||
}: LaunchChatSupportProps): JSX.Element | null {
|
}: LaunchChatSupportProps): JSX.Element | null {
|
||||||
const isCloudUserVal = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
const { notifications } = useNotifications();
|
const { notifications } = useNotifications();
|
||||||
const {
|
const {
|
||||||
licenses,
|
licenses,
|
||||||
@ -77,7 +77,6 @@ function LaunchChatSupport({
|
|||||||
) {
|
) {
|
||||||
let isChatSupportEnabled = false;
|
let isChatSupportEnabled = false;
|
||||||
let isPremiumSupportEnabled = false;
|
let isPremiumSupportEnabled = false;
|
||||||
const isCloudUserVal = isCloudUser();
|
|
||||||
if (featureFlags && featureFlags.length > 0) {
|
if (featureFlags && featureFlags.length > 0) {
|
||||||
isChatSupportEnabled =
|
isChatSupportEnabled =
|
||||||
featureFlags.find((flag) => flag.name === FeatureKeys.CHAT_SUPPORT)
|
featureFlags.find((flag) => flag.name === FeatureKeys.CHAT_SUPPORT)
|
||||||
@ -99,6 +98,7 @@ function LaunchChatSupport({
|
|||||||
}, [
|
}, [
|
||||||
featureFlags,
|
featureFlags,
|
||||||
featureFlagsFetchError,
|
featureFlagsFetchError,
|
||||||
|
isCloudUserVal,
|
||||||
isFetchingFeatureFlags,
|
isFetchingFeatureFlags,
|
||||||
isLoggedIn,
|
isLoggedIn,
|
||||||
licenses,
|
licenses,
|
||||||
|
@ -16,6 +16,7 @@ import { OnboardingStatusResponse } from 'api/messagingQueues/onboarding/getOnbo
|
|||||||
import { QueryParams } from 'constants/query';
|
import { QueryParams } from 'constants/query';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import { History } from 'history';
|
import { History } from 'history';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { Bolt, Check, OctagonAlert, X } from 'lucide-react';
|
import { Bolt, Check, OctagonAlert, X } from 'lucide-react';
|
||||||
import {
|
import {
|
||||||
KAFKA_SETUP_DOC_LINK,
|
KAFKA_SETUP_DOC_LINK,
|
||||||
@ -23,7 +24,6 @@ import {
|
|||||||
} from 'pages/MessagingQueues/MessagingQueuesUtils';
|
} from 'pages/MessagingQueues/MessagingQueuesUtils';
|
||||||
import { ReactNode, useEffect, useState } from 'react';
|
import { ReactNode, useEffect, useState } from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
interface AttributeCheckListProps {
|
interface AttributeCheckListProps {
|
||||||
@ -181,7 +181,7 @@ function AttributeCheckList({
|
|||||||
const handleFilterChange = (value: AttributesFilters): void => {
|
const handleFilterChange = (value: AttributesFilters): void => {
|
||||||
setFilter(value);
|
setFilter(value);
|
||||||
};
|
};
|
||||||
const isCloudUserVal = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -23,6 +23,7 @@ import SideNav from 'container/SideNav';
|
|||||||
import TopNav from 'container/TopNav';
|
import TopNav from 'container/TopNav';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useIsDarkMode } from 'hooks/useDarkMode';
|
import { useIsDarkMode } from 'hooks/useDarkMode';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { useNotifications } from 'hooks/useNotifications';
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { isNull } from 'lodash-es';
|
import { isNull } from 'lodash-es';
|
||||||
@ -54,7 +55,6 @@ import { ErrorResponse, SuccessResponse } from 'types/api';
|
|||||||
import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';
|
import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';
|
||||||
import { LicenseEvent } from 'types/api/licensesV3/getActive';
|
import { LicenseEvent } from 'types/api/licensesV3/getActive';
|
||||||
import { USER_ROLES } from 'types/roles';
|
import { USER_ROLES } from 'types/roles';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
import { eventEmitter } from 'utils/getEventEmitter';
|
import { eventEmitter } from 'utils/getEventEmitter';
|
||||||
import {
|
import {
|
||||||
getFormattedDate,
|
getFormattedDate,
|
||||||
@ -122,6 +122,8 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
const { t } = useTranslation(['titles']);
|
const { t } = useTranslation(['titles']);
|
||||||
|
|
||||||
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const [getUserVersionResponse, getUserLatestVersionResponse] = useQueries([
|
const [getUserVersionResponse, getUserLatestVersionResponse] = useQueries([
|
||||||
{
|
{
|
||||||
queryFn: getUserVersion,
|
queryFn: getUserVersion,
|
||||||
@ -354,7 +356,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
) {
|
) {
|
||||||
let isChatSupportEnabled = false;
|
let isChatSupportEnabled = false;
|
||||||
let isPremiumSupportEnabled = false;
|
let isPremiumSupportEnabled = false;
|
||||||
const isCloudUserVal = isCloudUser();
|
|
||||||
if (featureFlags && featureFlags.length > 0) {
|
if (featureFlags && featureFlags.length > 0) {
|
||||||
isChatSupportEnabled =
|
isChatSupportEnabled =
|
||||||
featureFlags.find((flag) => flag.name === FeatureKeys.CHAT_SUPPORT)
|
featureFlags.find((flag) => flag.name === FeatureKeys.CHAT_SUPPORT)
|
||||||
@ -376,6 +377,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
}, [
|
}, [
|
||||||
featureFlags,
|
featureFlags,
|
||||||
featureFlagsFetchError,
|
featureFlagsFetchError,
|
||||||
|
isCloudUserVal,
|
||||||
isFetchingFeatureFlags,
|
isFetchingFeatureFlags,
|
||||||
isLoggedIn,
|
isLoggedIn,
|
||||||
licenses,
|
licenses,
|
||||||
|
@ -24,6 +24,7 @@ import Spinner from 'components/Spinner';
|
|||||||
import { SOMETHING_WENT_WRONG } from 'constants/api';
|
import { SOMETHING_WENT_WRONG } from 'constants/api';
|
||||||
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
|
||||||
import useAxiosError from 'hooks/useAxiosError';
|
import useAxiosError from 'hooks/useAxiosError';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { useNotifications } from 'hooks/useNotifications';
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import { isEmpty, pick } from 'lodash-es';
|
import { isEmpty, pick } from 'lodash-es';
|
||||||
import { useAppContext } from 'providers/App/App';
|
import { useAppContext } from 'providers/App/App';
|
||||||
@ -33,7 +34,6 @@ import { useMutation, useQuery } from 'react-query';
|
|||||||
import { ErrorResponse, SuccessResponse } from 'types/api';
|
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||||||
import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';
|
import { CheckoutSuccessPayloadProps } from 'types/api/billing/checkout';
|
||||||
import { License } from 'types/api/licenses/def';
|
import { License } from 'types/api/licenses/def';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
import { getFormattedDate, getRemainingDays } from 'utils/timeUtils';
|
import { getFormattedDate, getRemainingDays } from 'utils/timeUtils';
|
||||||
|
|
||||||
import { BillingUsageGraph } from './BillingUsageGraph/BillingUsageGraph';
|
import { BillingUsageGraph } from './BillingUsageGraph/BillingUsageGraph';
|
||||||
@ -145,7 +145,7 @@ export default function BillingContainer(): JSX.Element {
|
|||||||
|
|
||||||
const handleError = useAxiosError();
|
const handleError = useAxiosError();
|
||||||
|
|
||||||
const isCloudUserVal = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const processUsageData = useCallback(
|
const processUsageData = useCallback(
|
||||||
(data: any): void => {
|
(data: any): void => {
|
||||||
|
@ -5,6 +5,7 @@ import setRetentionApi from 'api/settings/setRetention';
|
|||||||
import TextToolTip from 'components/TextToolTip';
|
import TextToolTip from 'components/TextToolTip';
|
||||||
import GeneralSettingsCloud from 'container/GeneralSettingsCloud';
|
import GeneralSettingsCloud from 'container/GeneralSettingsCloud';
|
||||||
import useComponentPermission from 'hooks/useComponentPermission';
|
import useComponentPermission from 'hooks/useComponentPermission';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { useNotifications } from 'hooks/useNotifications';
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import find from 'lodash-es/find';
|
import find from 'lodash-es/find';
|
||||||
import { useAppContext } from 'providers/App/App';
|
import { useAppContext } from 'providers/App/App';
|
||||||
@ -23,7 +24,6 @@ import {
|
|||||||
PayloadPropsMetrics as GetRetentionPeriodMetricsPayload,
|
PayloadPropsMetrics as GetRetentionPeriodMetricsPayload,
|
||||||
PayloadPropsTraces as GetRetentionPeriodTracesPayload,
|
PayloadPropsTraces as GetRetentionPeriodTracesPayload,
|
||||||
} from 'types/api/settings/getRetention';
|
} from 'types/api/settings/getRetention';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
import Retention from './Retention';
|
import Retention from './Retention';
|
||||||
import StatusMessage from './StatusMessage';
|
import StatusMessage from './StatusMessage';
|
||||||
@ -394,7 +394,7 @@ function GeneralSettings({
|
|||||||
onModalToggleHandler(type);
|
onModalToggleHandler(type);
|
||||||
};
|
};
|
||||||
|
|
||||||
const isCloudUserVal = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const renderConfig = [
|
const renderConfig = [
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Col, Row, Select } from 'antd';
|
import { Col, Row, Select } from 'antd';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { find } from 'lodash-es';
|
import { find } from 'lodash-es';
|
||||||
import {
|
import {
|
||||||
ChangeEvent,
|
ChangeEvent,
|
||||||
@ -8,7 +9,6 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Input,
|
Input,
|
||||||
@ -39,6 +39,9 @@ function Retention({
|
|||||||
initialValue,
|
initialValue,
|
||||||
);
|
);
|
||||||
const interacted = useRef(false);
|
const interacted = useRef(false);
|
||||||
|
|
||||||
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!interacted.current) setSelectedValue(initialValue);
|
if (!interacted.current) setSelectedValue(initialValue);
|
||||||
}, [initialValue]);
|
}, [initialValue]);
|
||||||
@ -91,8 +94,6 @@ function Retention({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isCloudUserVal = isCloudUser();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RetentionContainer>
|
<RetentionContainer>
|
||||||
<Row justify="space-between">
|
<Row justify="space-between">
|
||||||
|
@ -34,6 +34,7 @@ import { Base64Icons } from 'container/NewDashboard/DashboardSettings/General/ut
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useGetAllDashboard } from 'hooks/dashboard/useGetAllDashboard';
|
import { useGetAllDashboard } from 'hooks/dashboard/useGetAllDashboard';
|
||||||
import useComponentPermission from 'hooks/useComponentPermission';
|
import useComponentPermission from 'hooks/useComponentPermission';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { useNotifications } from 'hooks/useNotifications';
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import { useSafeNavigate } from 'hooks/useSafeNavigate';
|
import { useSafeNavigate } from 'hooks/useSafeNavigate';
|
||||||
import { get, isEmpty, isUndefined } from 'lodash-es';
|
import { get, isEmpty, isUndefined } from 'lodash-es';
|
||||||
@ -82,7 +83,6 @@ import {
|
|||||||
WidgetRow,
|
WidgetRow,
|
||||||
Widgets,
|
Widgets,
|
||||||
} from 'types/api/dashboard/getAll';
|
} from 'types/api/dashboard/getAll';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
import DashboardTemplatesModal from './DashboardTemplates/DashboardTemplatesModal';
|
import DashboardTemplatesModal from './DashboardTemplates/DashboardTemplatesModal';
|
||||||
import ImportJSON from './ImportJSON';
|
import ImportJSON from './ImportJSON';
|
||||||
@ -111,6 +111,8 @@ function DashboardsList(): JSX.Element {
|
|||||||
setListSortOrder: setSortOrder,
|
setListSortOrder: setSortOrder,
|
||||||
} = useDashboard();
|
} = useDashboard();
|
||||||
|
|
||||||
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const [searchString, setSearchString] = useState<string>(
|
const [searchString, setSearchString] = useState<string>(
|
||||||
sortOrder.search || '',
|
sortOrder.search || '',
|
||||||
);
|
);
|
||||||
@ -694,7 +696,7 @@ function DashboardsList(): JSX.Element {
|
|||||||
Create and manage dashboards for your workspace.
|
Create and manage dashboards for your workspace.
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
{isCloudUser() && (
|
{isCloudUserVal && (
|
||||||
<div className="integrations-container">
|
<div className="integrations-container">
|
||||||
<div className="integrations-content">
|
<div className="integrations-content">
|
||||||
<RequestDashboardBtn />
|
<RequestDashboardBtn />
|
||||||
@ -735,7 +737,7 @@ function DashboardsList(): JSX.Element {
|
|||||||
<Button
|
<Button
|
||||||
type="text"
|
type="text"
|
||||||
className="learn-more"
|
className="learn-more"
|
||||||
onClick={(): void => handleContactSupport(isCloudUser())}
|
onClick={(): void => handleContactSupport(isCloudUserVal)}
|
||||||
>
|
>
|
||||||
Contact Support
|
Contact Support
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -3,13 +3,15 @@
|
|||||||
import './LogsError.styles.scss';
|
import './LogsError.styles.scss';
|
||||||
|
|
||||||
import { Typography } from 'antd';
|
import { Typography } from 'antd';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { ArrowRight } from 'lucide-react';
|
import { ArrowRight } from 'lucide-react';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
export default function LogsError(): JSX.Element {
|
export default function LogsError(): JSX.Element {
|
||||||
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const handleContactSupport = (): void => {
|
const handleContactSupport = (): void => {
|
||||||
if (isCloudUser()) {
|
if (isCloudUserVal) {
|
||||||
history.push('/support');
|
history.push('/support');
|
||||||
} else {
|
} else {
|
||||||
window.open('https://signoz.io/slack', '_blank');
|
window.open('https://signoz.io/slack', '_blank');
|
||||||
|
@ -3,10 +3,10 @@ import './NoLogs.styles.scss';
|
|||||||
import { Typography } from 'antd';
|
import { Typography } from 'antd';
|
||||||
import logEvent from 'api/common/logEvent';
|
import logEvent from 'api/common/logEvent';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { ArrowUpRight } from 'lucide-react';
|
import { ArrowUpRight } from 'lucide-react';
|
||||||
import { DataSource } from 'types/common/queryBuilder';
|
import { DataSource } from 'types/common/queryBuilder';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
import DOCLINKS from 'utils/docLinks';
|
import DOCLINKS from 'utils/docLinks';
|
||||||
|
|
||||||
export default function NoLogs({
|
export default function NoLogs({
|
||||||
@ -14,14 +14,15 @@ export default function NoLogs({
|
|||||||
}: {
|
}: {
|
||||||
dataSource: DataSource;
|
dataSource: DataSource;
|
||||||
}): JSX.Element {
|
}): JSX.Element {
|
||||||
const cloudUser = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const handleLinkClick = (
|
const handleLinkClick = (
|
||||||
e: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
e: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
||||||
): void => {
|
): void => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (cloudUser) {
|
if (isCloudUserVal) {
|
||||||
if (dataSource === DataSource.TRACES) {
|
if (dataSource === DataSource.TRACES) {
|
||||||
logEvent('Traces Explorer: Navigate to onboarding', {});
|
logEvent('Traces Explorer: Navigate to onboarding', {});
|
||||||
} else if (dataSource === DataSource.LOGS) {
|
} else if (dataSource === DataSource.LOGS) {
|
||||||
|
@ -5,6 +5,7 @@ import { ENTITY_VERSION_V4 } from 'constants/app';
|
|||||||
import { MAX_RPS_LIMIT } from 'constants/global';
|
import { MAX_RPS_LIMIT } from 'constants/global';
|
||||||
import ResourceAttributesFilter from 'container/ResourceAttributesFilter';
|
import ResourceAttributesFilter from 'container/ResourceAttributesFilter';
|
||||||
import { useGetQueriesRange } from 'hooks/queryBuilder/useGetQueriesRange';
|
import { useGetQueriesRange } from 'hooks/queryBuilder/useGetQueriesRange';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { useNotifications } from 'hooks/useNotifications';
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import { useAppContext } from 'providers/App/App';
|
import { useAppContext } from 'providers/App/App';
|
||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
@ -14,7 +15,6 @@ import { useLocation } from 'react-router-dom';
|
|||||||
import { AppState } from 'store/reducers';
|
import { AppState } from 'store/reducers';
|
||||||
import { ServicesList } from 'types/api/metrics/getService';
|
import { ServicesList } from 'types/api/metrics/getService';
|
||||||
import { GlobalReducer } from 'types/reducer/globalTime';
|
import { GlobalReducer } from 'types/reducer/globalTime';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
import { getTotalRPS } from 'utils/services';
|
import { getTotalRPS } from 'utils/services';
|
||||||
|
|
||||||
import { getColumns } from '../Columns/ServiceColumn';
|
import { getColumns } from '../Columns/ServiceColumn';
|
||||||
@ -34,7 +34,7 @@ function ServiceMetricTable({
|
|||||||
const { t: getText } = useTranslation(['services']);
|
const { t: getText } = useTranslation(['services']);
|
||||||
|
|
||||||
const { licenses, isFetchingLicenses } = useAppContext();
|
const { licenses, isFetchingLicenses } = useAppContext();
|
||||||
const isCloudUserVal = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const queries = useGetQueriesRange(queryRangeRequestData, ENTITY_VERSION_V4, {
|
const queries = useGetQueriesRange(queryRangeRequestData, ENTITY_VERSION_V4, {
|
||||||
queryKey: [
|
queryKey: [
|
||||||
|
@ -3,11 +3,11 @@ import { Flex, Typography } from 'antd';
|
|||||||
import { ResizeTable } from 'components/ResizeTable';
|
import { ResizeTable } from 'components/ResizeTable';
|
||||||
import { MAX_RPS_LIMIT } from 'constants/global';
|
import { MAX_RPS_LIMIT } from 'constants/global';
|
||||||
import ResourceAttributesFilter from 'container/ResourceAttributesFilter';
|
import ResourceAttributesFilter from 'container/ResourceAttributesFilter';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { useAppContext } from 'providers/App/App';
|
import { useAppContext } from 'providers/App/App';
|
||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
import { getTotalRPS } from 'utils/services';
|
import { getTotalRPS } from 'utils/services';
|
||||||
|
|
||||||
import { getColumns } from '../Columns/ServiceColumn';
|
import { getColumns } from '../Columns/ServiceColumn';
|
||||||
@ -22,7 +22,7 @@ function ServiceTraceTable({
|
|||||||
const { t: getText } = useTranslation(['services']);
|
const { t: getText } = useTranslation(['services']);
|
||||||
|
|
||||||
const { licenses, isFetchingLicenses } = useAppContext();
|
const { licenses, isFetchingLicenses } = useAppContext();
|
||||||
const isCloudUserVal = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
const tableColumns = useMemo(() => getColumns(search, false), [search]);
|
const tableColumns = useMemo(() => getColumns(search, false), [search]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -11,6 +11,7 @@ import ROUTES from 'constants/routes';
|
|||||||
import { GlobalShortcuts } from 'constants/shortcuts/globalShortcuts';
|
import { GlobalShortcuts } from 'constants/shortcuts/globalShortcuts';
|
||||||
import { useKeyboardHotkeys } from 'hooks/hotkeys/useKeyboardHotkeys';
|
import { useKeyboardHotkeys } from 'hooks/hotkeys/useKeyboardHotkeys';
|
||||||
import useComponentPermission from 'hooks/useComponentPermission';
|
import useComponentPermission from 'hooks/useComponentPermission';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { LICENSE_PLAN_KEY, LICENSE_PLAN_STATUS } from 'hooks/useLicense';
|
import { LICENSE_PLAN_KEY, LICENSE_PLAN_STATUS } from 'hooks/useLicense';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import {
|
import {
|
||||||
@ -28,7 +29,7 @@ import { AppState } from 'store/reducers';
|
|||||||
import { License } from 'types/api/licenses/def';
|
import { License } from 'types/api/licenses/def';
|
||||||
import AppReducer from 'types/reducer/app';
|
import AppReducer from 'types/reducer/app';
|
||||||
import { USER_ROLES } from 'types/roles';
|
import { USER_ROLES } from 'types/roles';
|
||||||
import { checkVersionState, isCloudUser, isEECloudUser } from 'utils/app';
|
import { checkVersionState } from 'utils/app';
|
||||||
|
|
||||||
import { routeConfig } from './config';
|
import { routeConfig } from './config';
|
||||||
import { getQueryString } from './helper';
|
import { getQueryString } from './helper';
|
||||||
@ -86,7 +87,10 @@ function SideNav(): JSX.Element {
|
|||||||
|
|
||||||
const { registerShortcut, deregisterShortcut } = useKeyboardHotkeys();
|
const { registerShortcut, deregisterShortcut } = useKeyboardHotkeys();
|
||||||
|
|
||||||
const isCloudUserVal = isCloudUser();
|
const {
|
||||||
|
isCloudUser: isCloudUserVal,
|
||||||
|
isEECloudUser: isEECloudUserVal,
|
||||||
|
} = useGetTenantLicense();
|
||||||
|
|
||||||
const { t } = useTranslation('');
|
const { t } = useTranslation('');
|
||||||
|
|
||||||
@ -275,7 +279,7 @@ function SideNav(): JSX.Element {
|
|||||||
let updatedUserManagementItems: UserManagementMenuItems[] = [
|
let updatedUserManagementItems: UserManagementMenuItems[] = [
|
||||||
manageLicenseMenuItem,
|
manageLicenseMenuItem,
|
||||||
];
|
];
|
||||||
if (isCloudUserVal || isEECloudUser()) {
|
if (isCloudUserVal || isEECloudUserVal) {
|
||||||
const isOnboardingEnabled =
|
const isOnboardingEnabled =
|
||||||
featureFlags?.find((feature) => feature.name === FeatureKeys.ONBOARDING)
|
featureFlags?.find((feature) => feature.name === FeatureKeys.ONBOARDING)
|
||||||
?.active || false;
|
?.active || false;
|
||||||
@ -330,6 +334,7 @@ function SideNav(): JSX.Element {
|
|||||||
featureFlags,
|
featureFlags,
|
||||||
isCloudUserVal,
|
isCloudUserVal,
|
||||||
isCurrentVersionError,
|
isCurrentVersionError,
|
||||||
|
isEECloudUserVal,
|
||||||
isLatestVersion,
|
isLatestVersion,
|
||||||
licenses?.licenses,
|
licenses?.licenses,
|
||||||
onClickVersionHandler,
|
onClickVersionHandler,
|
||||||
|
15
frontend/src/hooks/useGetTenantLicense.ts
Normal file
15
frontend/src/hooks/useGetTenantLicense.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { useAppContext } from 'providers/App/App';
|
||||||
|
import { LicensePlatform } from 'types/api/licensesV3/getActive';
|
||||||
|
|
||||||
|
export const useGetTenantLicense = (): {
|
||||||
|
isCloudUser: boolean;
|
||||||
|
isEECloudUser: boolean;
|
||||||
|
} => {
|
||||||
|
const { activeLicenseV3 } = useAppContext();
|
||||||
|
|
||||||
|
return {
|
||||||
|
isCloudUser: activeLicenseV3?.platform === LicensePlatform.CLOUD || false,
|
||||||
|
isEECloudUser:
|
||||||
|
activeLicenseV3?.platform === LicensePlatform.SELF_HOSTED || false,
|
||||||
|
};
|
||||||
|
};
|
@ -7,9 +7,9 @@ import { Color } from '@signozhq/design-tokens';
|
|||||||
import { Button, Flex, Skeleton, Typography } from 'antd';
|
import { Button, Flex, Skeleton, Typography } from 'antd';
|
||||||
import { useGetIntegration } from 'hooks/Integrations/useGetIntegration';
|
import { useGetIntegration } from 'hooks/Integrations/useGetIntegration';
|
||||||
import { useGetIntegrationStatus } from 'hooks/Integrations/useGetIntegrationStatus';
|
import { useGetIntegrationStatus } from 'hooks/Integrations/useGetIntegrationStatus';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { defaultTo } from 'lodash-es';
|
import { defaultTo } from 'lodash-es';
|
||||||
import { ArrowLeft, MoveUpRight, RotateCw } from 'lucide-react';
|
import { ArrowLeft, MoveUpRight, RotateCw } from 'lucide-react';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
import { handleContactSupport } from '../utils';
|
import { handleContactSupport } from '../utils';
|
||||||
import IntegrationDetailContent from './IntegrationDetailContent';
|
import IntegrationDetailContent from './IntegrationDetailContent';
|
||||||
@ -44,6 +44,8 @@ function IntegrationDetailPage(props: IntegrationDetailPageProps): JSX.Element {
|
|||||||
integrationId: selectedIntegration,
|
integrationId: selectedIntegration,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: integrationStatus,
|
data: integrationStatus,
|
||||||
isLoading: isStatusLoading,
|
isLoading: isStatusLoading,
|
||||||
@ -104,7 +106,7 @@ function IntegrationDetailPage(props: IntegrationDetailPageProps): JSX.Element {
|
|||||||
</Button>
|
</Button>
|
||||||
<div
|
<div
|
||||||
className="contact-support"
|
className="contact-support"
|
||||||
onClick={(): void => handleContactSupport(isCloudUser())}
|
onClick={(): void => handleContactSupport(isCloudUserVal)}
|
||||||
>
|
>
|
||||||
<Typography.Link className="text">Contact Support </Typography.Link>
|
<Typography.Link className="text">Contact Support </Typography.Link>
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@ import './Integrations.styles.scss';
|
|||||||
import { Color } from '@signozhq/design-tokens';
|
import { Color } from '@signozhq/design-tokens';
|
||||||
import { Button, List, Typography } from 'antd';
|
import { Button, List, Typography } from 'antd';
|
||||||
import { useGetAllIntegrations } from 'hooks/Integrations/useGetAllIntegrations';
|
import { useGetAllIntegrations } from 'hooks/Integrations/useGetAllIntegrations';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { MoveUpRight, RotateCw } from 'lucide-react';
|
import { MoveUpRight, RotateCw } from 'lucide-react';
|
||||||
import { Dispatch, SetStateAction, useMemo } from 'react';
|
import { Dispatch, SetStateAction, useMemo } from 'react';
|
||||||
import { IntegrationsProps } from 'types/api/integrations/types';
|
import { IntegrationsProps } from 'types/api/integrations/types';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
import { handleContactSupport, INTEGRATION_TYPES } from './utils';
|
import { handleContactSupport, INTEGRATION_TYPES } from './utils';
|
||||||
|
|
||||||
@ -44,6 +44,8 @@ function IntegrationsList(props: IntegrationsListProps): JSX.Element {
|
|||||||
refetch,
|
refetch,
|
||||||
} = useGetAllIntegrations();
|
} = useGetAllIntegrations();
|
||||||
|
|
||||||
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const filteredDataList = useMemo(() => {
|
const filteredDataList = useMemo(() => {
|
||||||
let integrationsList: IntegrationsProps[] = [];
|
let integrationsList: IntegrationsProps[] = [];
|
||||||
|
|
||||||
@ -90,7 +92,7 @@ function IntegrationsList(props: IntegrationsListProps): JSX.Element {
|
|||||||
</Button>
|
</Button>
|
||||||
<div
|
<div
|
||||||
className="contact-support"
|
className="contact-support"
|
||||||
onClick={(): void => handleContactSupport(isCloudUser())}
|
onClick={(): void => handleContactSupport(isCloudUserVal)}
|
||||||
>
|
>
|
||||||
<Typography.Link className="text">Contact Support </Typography.Link>
|
<Typography.Link className="text">Contact Support </Typography.Link>
|
||||||
|
|
||||||
|
@ -8,10 +8,10 @@ import MessagingQueueHealthCheck from 'components/MessagingQueueHealthCheck/Mess
|
|||||||
import { QueryParams } from 'constants/query';
|
import { QueryParams } from 'constants/query';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import DateTimeSelectionV2 from 'container/TopNav/DateTimeSelectionV2';
|
import DateTimeSelectionV2 from 'container/TopNav/DateTimeSelectionV2';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
KAFKA_SETUP_DOC_LINK,
|
KAFKA_SETUP_DOC_LINK,
|
||||||
@ -34,7 +34,7 @@ function MessagingQueues(): JSX.Element {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const isCloudUserVal = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
const getStartedRedirect = (link: string, sourceCard: string): void => {
|
const getStartedRedirect = (link: string, sourceCard: string): void => {
|
||||||
logEvent('Messaging Queues: Get started clicked', {
|
logEvent('Messaging Queues: Get started clicked', {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import RouteTab from 'components/RouteTab';
|
import RouteTab from 'components/RouteTab';
|
||||||
import { FeatureKeys } from 'constants/features';
|
import { FeatureKeys } from 'constants/features';
|
||||||
import useComponentPermission from 'hooks/useComponentPermission';
|
import useComponentPermission from 'hooks/useComponentPermission';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { useAppContext } from 'providers/App/App';
|
import { useAppContext } from 'providers/App/App';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
@ -12,6 +13,10 @@ import { getRoutes } from './utils';
|
|||||||
function SettingsPage(): JSX.Element {
|
function SettingsPage(): JSX.Element {
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
const { user, featureFlags, licenses } = useAppContext();
|
const { user, featureFlags, licenses } = useAppContext();
|
||||||
|
const {
|
||||||
|
isCloudUser: isCloudAccount,
|
||||||
|
isEECloudUser: isEECloudAccount,
|
||||||
|
} = useGetTenantLicense();
|
||||||
|
|
||||||
const isWorkspaceBlocked = licenses?.workSpaceBlock || false;
|
const isWorkspaceBlocked = licenses?.workSpaceBlock || false;
|
||||||
|
|
||||||
@ -32,9 +37,19 @@ function SettingsPage(): JSX.Element {
|
|||||||
isCurrentOrgSettings,
|
isCurrentOrgSettings,
|
||||||
isGatewayEnabled,
|
isGatewayEnabled,
|
||||||
isWorkspaceBlocked,
|
isWorkspaceBlocked,
|
||||||
|
isCloudAccount,
|
||||||
|
isEECloudAccount,
|
||||||
t,
|
t,
|
||||||
),
|
),
|
||||||
[user.role, isCurrentOrgSettings, isGatewayEnabled, isWorkspaceBlocked, t],
|
[
|
||||||
|
user.role,
|
||||||
|
isCurrentOrgSettings,
|
||||||
|
isGatewayEnabled,
|
||||||
|
isWorkspaceBlocked,
|
||||||
|
isCloudAccount,
|
||||||
|
isEECloudAccount,
|
||||||
|
t,
|
||||||
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
return <RouteTab routes={routes} activeKey={pathname} history={history} />;
|
return <RouteTab routes={routes} activeKey={pathname} history={history} />;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { RouteTabProps } from 'components/RouteTab/types';
|
import { RouteTabProps } from 'components/RouteTab/types';
|
||||||
import { TFunction } from 'i18next';
|
import { TFunction } from 'i18next';
|
||||||
import { ROLES, USER_ROLES } from 'types/roles';
|
import { ROLES, USER_ROLES } from 'types/roles';
|
||||||
import { isCloudUser, isEECloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
alertChannels,
|
alertChannels,
|
||||||
@ -18,13 +17,12 @@ export const getRoutes = (
|
|||||||
isCurrentOrgSettings: boolean,
|
isCurrentOrgSettings: boolean,
|
||||||
isGatewayEnabled: boolean,
|
isGatewayEnabled: boolean,
|
||||||
isWorkspaceBlocked: boolean,
|
isWorkspaceBlocked: boolean,
|
||||||
|
isCloudAccount: boolean,
|
||||||
|
isEECloudAccount: boolean,
|
||||||
t: TFunction,
|
t: TFunction,
|
||||||
): RouteTabProps['routes'] => {
|
): RouteTabProps['routes'] => {
|
||||||
const settings = [];
|
const settings = [];
|
||||||
|
|
||||||
const isCloudAccount = isCloudUser();
|
|
||||||
const isEECloudAccount = isEECloudUser();
|
|
||||||
|
|
||||||
const isAdmin = userRole === USER_ROLES.ADMIN;
|
const isAdmin = userRole === USER_ROLES.ADMIN;
|
||||||
const isEditor = userRole === USER_ROLES.EDITOR;
|
const isEditor = userRole === USER_ROLES.EDITOR;
|
||||||
|
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import './NoData.styles.scss';
|
import './NoData.styles.scss';
|
||||||
|
|
||||||
import { Button, Typography } from 'antd';
|
import { Button, Typography } from 'antd';
|
||||||
|
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
|
||||||
import { LifeBuoy, RefreshCw } from 'lucide-react';
|
import { LifeBuoy, RefreshCw } from 'lucide-react';
|
||||||
import { handleContactSupport } from 'pages/Integrations/utils';
|
import { handleContactSupport } from 'pages/Integrations/utils';
|
||||||
import { isCloudUser } from 'utils/app';
|
|
||||||
|
|
||||||
function NoData(): JSX.Element {
|
function NoData(): JSX.Element {
|
||||||
const isCloudUserVal = isCloudUser();
|
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="not-found-trace">
|
<div className="not-found-trace">
|
||||||
<section className="description">
|
<section className="description">
|
||||||
|
@ -16,6 +16,7 @@ import thunk from 'redux-thunk';
|
|||||||
import store from 'store';
|
import store from 'store';
|
||||||
import {
|
import {
|
||||||
LicenseEvent,
|
LicenseEvent,
|
||||||
|
LicensePlatform,
|
||||||
LicenseState,
|
LicenseState,
|
||||||
LicenseStatus,
|
LicenseStatus,
|
||||||
} from 'types/api/licensesV3/getActive';
|
} from 'types/api/licensesV3/getActive';
|
||||||
@ -115,6 +116,7 @@ export function getAppContextMock(
|
|||||||
key: 'does-not-matter',
|
key: 'does-not-matter',
|
||||||
state: LicenseState.ACTIVE,
|
state: LicenseState.ACTIVE,
|
||||||
status: LicenseStatus.VALID,
|
status: LicenseStatus.VALID,
|
||||||
|
platform: LicensePlatform.CLOUD,
|
||||||
},
|
},
|
||||||
isFetchingActiveLicenseV3: false,
|
isFetchingActiveLicenseV3: false,
|
||||||
activeLicenseV3FetchError: null,
|
activeLicenseV3FetchError: null,
|
||||||
|
@ -13,6 +13,11 @@ export enum LicenseState {
|
|||||||
ACTIVE = 'ACTIVE',
|
ACTIVE = 'ACTIVE',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum LicensePlatform {
|
||||||
|
SELF_HOSTED = 'SELF_HOSTED',
|
||||||
|
CLOUD = 'CLOUD',
|
||||||
|
}
|
||||||
|
|
||||||
export type LicenseV3EventQueueResModel = {
|
export type LicenseV3EventQueueResModel = {
|
||||||
event: LicenseEvent;
|
event: LicenseEvent;
|
||||||
status: string;
|
status: string;
|
||||||
@ -26,4 +31,5 @@ export type LicenseV3ResModel = {
|
|||||||
status: LicenseStatus;
|
status: LicenseStatus;
|
||||||
state: LicenseState;
|
state: LicenseState;
|
||||||
event_queue: LicenseV3EventQueueResModel;
|
event_queue: LicenseV3EventQueueResModel;
|
||||||
|
platform: LicensePlatform;
|
||||||
};
|
};
|
||||||
|
@ -13,18 +13,6 @@ export function extractDomain(email: string): string {
|
|||||||
return emailParts[1];
|
return emailParts[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isCloudUser = (): boolean => {
|
|
||||||
const { hostname } = window.location;
|
|
||||||
|
|
||||||
return hostname?.endsWith('signoz.cloud');
|
|
||||||
};
|
|
||||||
|
|
||||||
export const isEECloudUser = (): boolean => {
|
|
||||||
const { hostname } = window.location;
|
|
||||||
|
|
||||||
return hostname?.endsWith('signoz.io');
|
|
||||||
};
|
|
||||||
|
|
||||||
export const checkVersionState = (
|
export const checkVersionState = (
|
||||||
currentVersion: string,
|
currentVersion: string,
|
||||||
latestVersion: string,
|
latestVersion: string,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user