mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
feat(console): change free tenant number limit to 10 (#4130)
This commit is contained in:
parent
a030b0817f
commit
c5b0f9bdc5
4 changed files with 4 additions and 5 deletions
|
@ -42,5 +42,3 @@ export const getCallbackUrl = (tenantId?: string) =>
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getSignOutRedirectPathname = () => (isCloud ? '/' : ossConsolePath);
|
export const getSignOutRedirectPathname = () => (isCloud ? '/' : ossConsolePath);
|
||||||
|
|
||||||
export const maxFreeTenantNumbers = 3;
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { adminTenantId } from '@logto/schemas';
|
import { adminTenantId, maxFreeTenantLimit } from '@logto/schemas';
|
||||||
import { type TenantInfo } from '@logto/schemas/models';
|
import { type TenantInfo } from '@logto/schemas/models';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useContext, useMemo, useRef, useState } from 'react';
|
import { useContext, useMemo, useRef, useState } from 'react';
|
||||||
|
@ -8,7 +8,6 @@ import KeyboardArrowDown from '@/assets/icons/keyboard-arrow-down.svg';
|
||||||
import PlusSign from '@/assets/icons/plus.svg';
|
import PlusSign from '@/assets/icons/plus.svg';
|
||||||
import Tick from '@/assets/icons/tick.svg';
|
import Tick from '@/assets/icons/tick.svg';
|
||||||
import CreateTenantModal from '@/cloud/pages/Main/TenantLandingPage/TenantLandingPageContent/CreateTenantModal';
|
import CreateTenantModal from '@/cloud/pages/Main/TenantLandingPage/TenantLandingPageContent/CreateTenantModal';
|
||||||
import { maxFreeTenantNumbers } from '@/consts';
|
|
||||||
import { TenantsContext } from '@/contexts/TenantsProvider';
|
import { TenantsContext } from '@/contexts/TenantsProvider';
|
||||||
import Divider from '@/ds-components/Divider';
|
import Divider from '@/ds-components/Divider';
|
||||||
import Dropdown, { DropdownItem } from '@/ds-components/Dropdown';
|
import Dropdown, { DropdownItem } from '@/ds-components/Dropdown';
|
||||||
|
@ -31,7 +30,7 @@ export default function TenantSelector() {
|
||||||
const isCreateButtonDisabled = useMemo(
|
const isCreateButtonDisabled = useMemo(
|
||||||
() =>
|
() =>
|
||||||
/** Should not block admin tenant owners from creating more than three tenants */
|
/** Should not block admin tenant owners from creating more than three tenants */
|
||||||
!tenants.some(({ id }) => id === adminTenantId) && tenants.length >= maxFreeTenantNumbers,
|
!tenants.some(({ id }) => id === adminTenantId) && tenants.length >= maxFreeTenantLimit,
|
||||||
[tenants]
|
[tenants]
|
||||||
);
|
);
|
||||||
const anchorRef = useRef<HTMLDivElement>(null);
|
const anchorRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
|
@ -2,3 +2,4 @@ export * from './cookie.js';
|
||||||
export * from './system.js';
|
export * from './system.js';
|
||||||
export * from './oidc.js';
|
export * from './oidc.js';
|
||||||
export * from './date.js';
|
export * from './date.js';
|
||||||
|
export * from './tenant.js';
|
||||||
|
|
1
packages/schemas/src/consts/tenant.ts
Normal file
1
packages/schemas/src/consts/tenant.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export const maxFreeTenantLimit = 10;
|
Loading…
Reference in a new issue