mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 16:45:56 +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 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 listAllDomain from 'api/SAML/listAllDomain';
|
||||
import updateDomain from 'api/SAML/updateDomain';
|
||||
import { SIGNOZ_UPGRADE_PLAN_URL } from 'constants/app';
|
||||
import { FeatureKeys } from 'constants/featureKeys';
|
||||
import useFeatureFlag from 'hooks/useFeatureFlag';
|
||||
import React, { useCallback, useState } from 'react';
|
||||
@ -30,6 +31,21 @@ function AuthDomains(): JSX.Element {
|
||||
|
||||
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'], {
|
||||
queryFn: () =>
|
||||
listAllDomain({
|
||||
@ -90,10 +106,10 @@ function AuthDomains(): JSX.Element {
|
||||
|
||||
const onEditHandler = useCallback(
|
||||
(record: SAMLDomain) => (): void => {
|
||||
setIsEditModalOpen(true);
|
||||
onOpenHandler(setIsEditModalOpen)();
|
||||
setCurrentDomain(record);
|
||||
},
|
||||
[],
|
||||
[onOpenHandler],
|
||||
);
|
||||
|
||||
const onDeleteHandler = useCallback(
|
||||
@ -128,7 +144,7 @@ function AuthDomains(): JSX.Element {
|
||||
);
|
||||
|
||||
const onClickLicenseHandler = useCallback(() => {
|
||||
window.open('http://signoz.io/pricing');
|
||||
window.open(SIGNOZ_UPGRADE_PLAN_URL);
|
||||
}, []);
|
||||
|
||||
const columns: ColumnsType<SAMLDomain> = [
|
||||
@ -171,10 +187,7 @@ function AuthDomains(): JSX.Element {
|
||||
if (!SSOFlag) {
|
||||
return (
|
||||
<Button
|
||||
onClick={(): void => {
|
||||
setCurrentDomain(record);
|
||||
onOpenHandler(setIsSettingsOpen)();
|
||||
}}
|
||||
onClick={onClickLicenseHandler}
|
||||
type="link"
|
||||
icon={<LockTwoTone />}
|
||||
>
|
||||
@ -235,7 +248,7 @@ function AuthDomains(): JSX.Element {
|
||||
</Modal>
|
||||
<Table
|
||||
rowKey={(record: SAMLDomain): string => record.name + v4()}
|
||||
dataSource={[]}
|
||||
dataSource={!SSOFlag ? notEntripriseData : []}
|
||||
columns={columns}
|
||||
tableLayout="fixed"
|
||||
/>
|
||||
@ -243,6 +256,8 @@ function AuthDomains(): JSX.Element {
|
||||
);
|
||||
}
|
||||
|
||||
const tableData = SSOFlag ? data?.payload || [] : notEntripriseData;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
@ -282,7 +297,7 @@ function AuthDomains(): JSX.Element {
|
||||
<AddDomain refetch={refetch} />
|
||||
|
||||
<Table
|
||||
dataSource={data?.payload || []}
|
||||
dataSource={tableData}
|
||||
loading={isLoading}
|
||||
columns={columns}
|
||||
tableLayout="fixed"
|
||||
|
Loading…
x
Reference in New Issue
Block a user