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:
parent
5b03030de2
commit
b3d94dd712
2 changed files with 25 additions and 6 deletions
|
@ -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 />} />
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue