mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
chore(console): remove dev features flag from console client (#5368)
This commit is contained in:
parent
cf049b26f9
commit
d2fc3fd916
5 changed files with 27 additions and 29 deletions
|
@ -4,5 +4,6 @@ import { yes } from '@silverhand/essentials';
|
||||||
export const isProduction = process.env.NODE_ENV === 'production';
|
export const isProduction = process.env.NODE_ENV === 'production';
|
||||||
export const isCloud = yes(process.env.IS_CLOUD);
|
export const isCloud = yes(process.env.IS_CLOUD);
|
||||||
export const adminEndpoint = process.env.ADMIN_ENDPOINT;
|
export const adminEndpoint = process.env.ADMIN_ENDPOINT;
|
||||||
|
// eslint-disable-next-line import/no-unused-modules
|
||||||
export const isDevFeaturesEnabled =
|
export const isDevFeaturesEnabled =
|
||||||
!isProduction || yes(process.env.DEV_FEATURES_ENABLED) || yes(process.env.INTEGRATION_TEST);
|
!isProduction || yes(process.env.DEV_FEATURES_ENABLED) || yes(process.env.INTEGRATION_TEST);
|
||||||
|
|
|
@ -17,7 +17,7 @@ import ExternalLinkIcon from '@/assets/icons/external-link.svg';
|
||||||
import DomainStatusTag from '@/components/DomainStatusTag';
|
import DomainStatusTag from '@/components/DomainStatusTag';
|
||||||
import FormCard from '@/components/FormCard';
|
import FormCard from '@/components/FormCard';
|
||||||
import OpenExternalLink from '@/components/OpenExternalLink';
|
import OpenExternalLink from '@/components/OpenExternalLink';
|
||||||
import { isCloud, isDevFeaturesEnabled } from '@/consts/env';
|
import { isCloud } from '@/consts/env';
|
||||||
import { openIdProviderConfigPath } from '@/consts/oidc';
|
import { openIdProviderConfigPath } from '@/consts/oidc';
|
||||||
import Button from '@/ds-components/Button';
|
import Button from '@/ds-components/Button';
|
||||||
import CopyToClipboard from '@/ds-components/CopyToClipboard';
|
import CopyToClipboard from '@/ds-components/CopyToClipboard';
|
||||||
|
@ -58,7 +58,7 @@ function ProtectedAppSettings({ data }: Props) {
|
||||||
`api/applications/${data.id}/protected-app-metadata/custom-domains`
|
`api/applications/${data.id}/protected-app-metadata/custom-domains`
|
||||||
);
|
);
|
||||||
const { data: systemDomainData } = useSWRImmutable<ProtectedAppsDomainConfig>(
|
const { data: systemDomainData } = useSWRImmutable<ProtectedAppsDomainConfig>(
|
||||||
isDevFeaturesEnabled && isCloud && 'api/systems/application'
|
isCloud && 'api/systems/application'
|
||||||
);
|
);
|
||||||
const api = useApi();
|
const api = useApi();
|
||||||
const [isDeletingCustomDomain, setIsDeletingCustomDomain] = useState(false);
|
const [isDeletingCustomDomain, setIsDeletingCustomDomain] = useState(false);
|
||||||
|
|
|
@ -11,7 +11,7 @@ import FeatureTag from '@/components/FeatureTag';
|
||||||
import { type SelectedGuide } from '@/components/Guide/GuideCard';
|
import { type SelectedGuide } from '@/components/Guide/GuideCard';
|
||||||
import GuideCardGroup from '@/components/Guide/GuideCardGroup';
|
import GuideCardGroup from '@/components/Guide/GuideCardGroup';
|
||||||
import { useAppGuideMetadata } from '@/components/Guide/hooks';
|
import { useAppGuideMetadata } from '@/components/Guide/hooks';
|
||||||
import { isCloud, isDevFeaturesEnabled } from '@/consts/env';
|
import { isCloud } from '@/consts/env';
|
||||||
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
|
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
|
||||||
import { CheckboxGroup } from '@/ds-components/Checkbox';
|
import { CheckboxGroup } from '@/ds-components/Checkbox';
|
||||||
import OverlayScrollbar from '@/ds-components/OverlayScrollbar';
|
import OverlayScrollbar from '@/ds-components/OverlayScrollbar';
|
||||||
|
@ -108,21 +108,23 @@ function GuideLibrary({ className, hasCardBorder, hasCardButton }: Props) {
|
||||||
<div className={styles.checkboxGroupContainer}>
|
<div className={styles.checkboxGroupContainer}>
|
||||||
<CheckboxGroup
|
<CheckboxGroup
|
||||||
className={styles.checkboxGroup}
|
className={styles.checkboxGroup}
|
||||||
options={allAppGuideCategories.map((category) => ({
|
options={allAppGuideCategories
|
||||||
title: `guide.categories.${category}`,
|
.filter((category) => isCloud || category !== 'Protected')
|
||||||
value: category,
|
.map((category) => ({
|
||||||
...cond(
|
title: `guide.categories.${category}`,
|
||||||
isCloud &&
|
value: category,
|
||||||
category === 'ThirdParty' && {
|
...cond(
|
||||||
tag: (
|
isCloud &&
|
||||||
<FeatureTag
|
category === 'ThirdParty' && {
|
||||||
isVisible={currentPlan.quota.thirdPartyApplicationsLimit === 0}
|
tag: (
|
||||||
plan={ReservedPlanId.Pro}
|
<FeatureTag
|
||||||
/>
|
isVisible={currentPlan.quota.thirdPartyApplicationsLimit === 0}
|
||||||
),
|
plan={ReservedPlanId.Pro}
|
||||||
}
|
/>
|
||||||
),
|
),
|
||||||
}))}
|
}
|
||||||
|
),
|
||||||
|
}))}
|
||||||
value={filterCategories}
|
value={filterCategories}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
const sortedValue = allAppGuideCategories.filter((category) =>
|
const sortedValue = allAppGuideCategories.filter((category) =>
|
||||||
|
@ -149,8 +151,7 @@ function GuideLibrary({ className, hasCardBorder, hasCardButton }: Props) {
|
||||||
))}
|
))}
|
||||||
{!keyword && (
|
{!keyword && (
|
||||||
<>
|
<>
|
||||||
{isDevFeaturesEnabled &&
|
{isCloud &&
|
||||||
isCloud &&
|
|
||||||
(filterCategories.length === 0 ||
|
(filterCategories.length === 0 ||
|
||||||
filterCategories.includes(ApplicationType.Protected)) && (
|
filterCategories.includes(ApplicationType.Protected)) && (
|
||||||
<ProtectedAppCard
|
<ProtectedAppCard
|
||||||
|
|
|
@ -13,7 +13,7 @@ import useSWRImmutable from 'swr/immutable';
|
||||||
import ContactUsPhraseLink from '@/components/ContactUsPhraseLink';
|
import ContactUsPhraseLink from '@/components/ContactUsPhraseLink';
|
||||||
import PlanName from '@/components/PlanName';
|
import PlanName from '@/components/PlanName';
|
||||||
import QuotaGuardFooter from '@/components/QuotaGuardFooter';
|
import QuotaGuardFooter from '@/components/QuotaGuardFooter';
|
||||||
import { isCloud, isDevFeaturesEnabled } from '@/consts/env';
|
import { isCloud } from '@/consts/env';
|
||||||
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
|
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
|
||||||
import Button, { type Props as ButtonProps } from '@/ds-components/Button';
|
import Button, { type Props as ButtonProps } from '@/ds-components/Button';
|
||||||
import FormField from '@/ds-components/FormField';
|
import FormField from '@/ds-components/FormField';
|
||||||
|
@ -44,9 +44,7 @@ function ProtectedAppForm({
|
||||||
hasRequiredLabel,
|
hasRequiredLabel,
|
||||||
onCreateSuccess,
|
onCreateSuccess,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const { data } = useSWRImmutable<ProtectedAppsDomainConfig>(
|
const { data } = useSWRImmutable<ProtectedAppsDomainConfig>(isCloud && 'api/systems/application');
|
||||||
isDevFeaturesEnabled && isCloud && 'api/systems/application'
|
|
||||||
);
|
|
||||||
const { currentPlan } = useContext(SubscriptionDataContext);
|
const { currentPlan } = useContext(SubscriptionDataContext);
|
||||||
const { hasAppsReachedLimit } = useApplicationsUsage();
|
const { hasAppsReachedLimit } = useApplicationsUsage();
|
||||||
const { name: planName, quota } = currentPlan;
|
const { name: planName, quota } = currentPlan;
|
||||||
|
|
|
@ -15,7 +15,7 @@ import GuideCardGroup from '@/components/Guide/GuideCardGroup';
|
||||||
import { useApiGuideMetadata, useAppGuideMetadata } from '@/components/Guide/hooks';
|
import { useApiGuideMetadata, useAppGuideMetadata } from '@/components/Guide/hooks';
|
||||||
import PageMeta from '@/components/PageMeta';
|
import PageMeta from '@/components/PageMeta';
|
||||||
import { ConnectorsTabs } from '@/consts';
|
import { ConnectorsTabs } from '@/consts';
|
||||||
import { isCloud, isDevFeaturesEnabled } from '@/consts/env';
|
import { isCloud } from '@/consts/env';
|
||||||
import { AppDataContext } from '@/contexts/AppDataProvider';
|
import { AppDataContext } from '@/contexts/AppDataProvider';
|
||||||
import { LinkButton } from '@/ds-components/Button';
|
import { LinkButton } from '@/ds-components/Button';
|
||||||
import Card from '@/ds-components/Card';
|
import Card from '@/ds-components/Card';
|
||||||
|
@ -110,11 +110,9 @@ function GetStarted() {
|
||||||
</div>
|
</div>
|
||||||
<Card className={styles.card}>
|
<Card className={styles.card}>
|
||||||
<div className={styles.title}>
|
<div className={styles.title}>
|
||||||
{isCloud && isDevFeaturesEnabled
|
{t(`get_started.develop.title${isCloud ? '_cloud' : ''}`)}
|
||||||
? t('get_started.develop.title_cloud')
|
|
||||||
: t('get_started.develop.title')}
|
|
||||||
</div>
|
</div>
|
||||||
{isCloud && isDevFeaturesEnabled && (
|
{isCloud && (
|
||||||
<>
|
<>
|
||||||
<ProtectedAppCreationForm />
|
<ProtectedAppCreationForm />
|
||||||
<div className={styles.subtitle}>{t('get_started.develop.subtitle_cloud')}</div>
|
<div className={styles.subtitle}>{t('get_started.develop.subtitle_cloud')}</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue