mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 01:15:54 +08:00
chore: free plan config is updated (#1625)
* chore: free plan config is updated * fix: solved empty state issue with no auth domains Co-authored-by: Amol <amolumbarkar@gmail.com>
This commit is contained in:
parent
fe0f305ea7
commit
4e38f1dcc0
@ -8,3 +8,6 @@ export const DEFAULT_AUTH0_APP_REDIRECTION_PATH = ROUTES.APPLICATION;
|
|||||||
|
|
||||||
export const IS_SIDEBAR_COLLAPSED = 'isSideBarCollapsed';
|
export const IS_SIDEBAR_COLLAPSED = 'isSideBarCollapsed';
|
||||||
export const INVITE_MEMBERS_HASH = '#invite-team-members';
|
export const INVITE_MEMBERS_HASH = '#invite-team-members';
|
||||||
|
|
||||||
|
export const SIGNOZ_UPGRADE_PLAN_URL =
|
||||||
|
'https://upgrade.signoz.io/upgrade-from-app';
|
||||||
|
@ -4,6 +4,7 @@ import { ColumnsType } from 'antd/lib/table';
|
|||||||
import deleteDomain from 'api/SAML/deleteDomain';
|
import deleteDomain from 'api/SAML/deleteDomain';
|
||||||
import listAllDomain from 'api/SAML/listAllDomain';
|
import listAllDomain from 'api/SAML/listAllDomain';
|
||||||
import updateDomain from 'api/SAML/updateDomain';
|
import updateDomain from 'api/SAML/updateDomain';
|
||||||
|
import { SIGNOZ_UPGRADE_PLAN_URL } from 'constants/app';
|
||||||
import { FeatureKeys } from 'constants/featureKeys';
|
import { FeatureKeys } from 'constants/featureKeys';
|
||||||
import useFeatureFlag from 'hooks/useFeatureFlag';
|
import useFeatureFlag from 'hooks/useFeatureFlag';
|
||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
@ -30,6 +31,21 @@ function AuthDomains(): JSX.Element {
|
|||||||
|
|
||||||
const SSOFlag = useFeatureFlag(FeatureKeys.SSO);
|
const SSOFlag = useFeatureFlag(FeatureKeys.SSO);
|
||||||
|
|
||||||
|
const notEntripriseData: SAMLDomain[] = [
|
||||||
|
{
|
||||||
|
id: v4(),
|
||||||
|
name: '',
|
||||||
|
ssoEnabled: false,
|
||||||
|
orgId: (org || [])[0].id || '',
|
||||||
|
samlConfig: {
|
||||||
|
samlCert: '',
|
||||||
|
samlEntity: '',
|
||||||
|
samlIdp: '',
|
||||||
|
},
|
||||||
|
ssoType: 'SAML',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const { data, isLoading, refetch } = useQuery(['saml'], {
|
const { data, isLoading, refetch } = useQuery(['saml'], {
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
listAllDomain({
|
listAllDomain({
|
||||||
@ -90,10 +106,10 @@ function AuthDomains(): JSX.Element {
|
|||||||
|
|
||||||
const onEditHandler = useCallback(
|
const onEditHandler = useCallback(
|
||||||
(record: SAMLDomain) => (): void => {
|
(record: SAMLDomain) => (): void => {
|
||||||
setIsEditModalOpen(true);
|
onOpenHandler(setIsEditModalOpen)();
|
||||||
setCurrentDomain(record);
|
setCurrentDomain(record);
|
||||||
},
|
},
|
||||||
[],
|
[onOpenHandler],
|
||||||
);
|
);
|
||||||
|
|
||||||
const onDeleteHandler = useCallback(
|
const onDeleteHandler = useCallback(
|
||||||
@ -128,7 +144,7 @@ function AuthDomains(): JSX.Element {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const onClickLicenseHandler = useCallback(() => {
|
const onClickLicenseHandler = useCallback(() => {
|
||||||
window.open('http://signoz.io/pricing');
|
window.open(SIGNOZ_UPGRADE_PLAN_URL);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const columns: ColumnsType<SAMLDomain> = [
|
const columns: ColumnsType<SAMLDomain> = [
|
||||||
@ -171,10 +187,7 @@ function AuthDomains(): JSX.Element {
|
|||||||
if (!SSOFlag) {
|
if (!SSOFlag) {
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
onClick={(): void => {
|
onClick={onClickLicenseHandler}
|
||||||
setCurrentDomain(record);
|
|
||||||
onOpenHandler(setIsSettingsOpen)();
|
|
||||||
}}
|
|
||||||
type="link"
|
type="link"
|
||||||
icon={<LockTwoTone />}
|
icon={<LockTwoTone />}
|
||||||
>
|
>
|
||||||
@ -235,7 +248,7 @@ function AuthDomains(): JSX.Element {
|
|||||||
</Modal>
|
</Modal>
|
||||||
<Table
|
<Table
|
||||||
rowKey={(record: SAMLDomain): string => record.name + v4()}
|
rowKey={(record: SAMLDomain): string => record.name + v4()}
|
||||||
dataSource={[]}
|
dataSource={!SSOFlag ? notEntripriseData : []}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
tableLayout="fixed"
|
tableLayout="fixed"
|
||||||
/>
|
/>
|
||||||
@ -243,6 +256,8 @@ function AuthDomains(): JSX.Element {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tableData = SSOFlag ? data?.payload || [] : notEntripriseData;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal
|
<Modal
|
||||||
@ -282,7 +297,7 @@ function AuthDomains(): JSX.Element {
|
|||||||
<AddDomain refetch={refetch} />
|
<AddDomain refetch={refetch} />
|
||||||
|
|
||||||
<Table
|
<Table
|
||||||
dataSource={data?.payload || []}
|
dataSource={tableData}
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
tableLayout="fixed"
|
tableLayout="fixed"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user