0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00

refactor(console): deprecate original organization template page (#5681)

This commit is contained in:
Xiao Yijun 2024-04-11 17:28:15 +08:00 committed by GitHub
parent 5b03030de2
commit b3d94dd712
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 6 deletions

View file

@ -202,10 +202,14 @@ function ConsoleContent() {
<Route path="organizations">
<Route index element={<Organizations />} />
<Route path="create" element={<Organizations />} />
<Route path="template" element={<Organizations tab="template" />} />
{!isDevFeaturesEnabled && (
<Route path="template" element={<Organizations tab="template" />} />
)}
<Route path=":id/*" element={<OrganizationDetails />} />
</Route>
<Route path="organization-guide/*" element={<OrganizationGuide />} />
{!isDevFeaturesEnabled && (
<Route path="organization-guide/*" element={<OrganizationGuide />} />
)}
<Route path="profile">
<Route index element={<Profile />} />
<Route path="verify-password" element={<VerifyPasswordModal />} />

View file

@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
import Plus from '@/assets/icons/plus.svg';
import PageMeta from '@/components/PageMeta';
import { organizationsFeatureLink } from '@/consts';
import { isCloud } from '@/consts/env';
import { isCloud, isDevFeaturesEnabled } from '@/consts/env';
import { subscriptionPage } from '@/consts/pages';
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
import { TenantsContext } from '@/contexts/TenantsProvider';
@ -51,7 +51,7 @@ function Organizations({ tab }: Props) {
}, [navigate]);
const handleCreate = useCallback(() => {
if (isInitialSetup) {
if (isInitialSetup && !isDevFeaturesEnabled) {
navigate(guidePathname);
return;
}
@ -91,7 +91,7 @@ function Organizations({ tab }: Props) {
/>
)}
</div>
{isInitialSetup && (
{isInitialSetup && !isDevFeaturesEnabled && (
<Card className={styles.emptyCardContainer}>
<EmptyDataPlaceholder
buttonProps={{
@ -104,7 +104,7 @@ function Organizations({ tab }: Props) {
/>
</Card>
)}
{!isInitialSetup && (
{!isInitialSetup && !isDevFeaturesEnabled && (
<>
<TabNav className={styles.tabs}>
<TabNavItem href="/organizations" isActive={!tab}>
@ -121,6 +121,21 @@ function Organizations({ tab }: Props) {
{tab === 'template' && <Settings />}
</>
)}
{isDevFeaturesEnabled && isOrganizationsDisabled && (
<Card className={styles.emptyCardContainer}>
<EmptyDataPlaceholder
buttonProps={{
title: 'upsell.upgrade_plan',
onClick: upgradePlan,
// Set to `undefined` to override the default icon
icon: undefined,
}}
/>
</Card>
)}
{isDevFeaturesEnabled && !isOrganizationsDisabled && (
<OrganizationsTable isLoading={isLoadingConfigs} onCreate={handleCreate} />
)}
</div>
);
}