0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

fix(console): hide new protected app type in console guide (#5134)

This commit is contained in:
wangsijie 2023-12-21 11:39:48 +08:00 committed by GitHub
parent 6e82e99725
commit 8a457f3045
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 18 deletions

View file

@ -5,6 +5,7 @@ import { toast } from 'react-hot-toast';
import { useTranslation } from 'react-i18next';
import Modal from 'react-modal';
import { isDevFeaturesEnabled } from '@/consts/env';
import DynamicT from '@/ds-components/DynamicT';
import FormField from '@/ds-components/FormField';
import ModalLayout from '@/ds-components/ModalLayout';
@ -100,20 +101,22 @@ function CreateForm({ defaultCreateType, defaultCreateFrameworkName, onClose }:
type="card"
onChange={onChange}
>
{Object.values(ApplicationType).map((type) => (
<Radio
key={type}
value={type}
hasCheckIconForCard={type !== ApplicationType.MachineToMachine}
>
<TypeDescription
type={type}
title={t(`${applicationTypeI18nKey[type]}.title`)}
subtitle={t(`${applicationTypeI18nKey[type]}.subtitle`)}
description={t(`${applicationTypeI18nKey[type]}.description`)}
/>
</Radio>
))}
{Object.values(ApplicationType)
.filter((value) => isDevFeaturesEnabled || value !== ApplicationType.Protected)
.map((type) => (
<Radio
key={type}
value={type}
hasCheckIconForCard={type !== ApplicationType.MachineToMachine}
>
<TypeDescription
type={type}
title={t(`${applicationTypeI18nKey[type]}.title`)}
subtitle={t(`${applicationTypeI18nKey[type]}.subtitle`)}
description={t(`${applicationTypeI18nKey[type]}.description`)}
/>
</Radio>
))}
</RadioGroup>
{errors.type?.type === 'required' && (
<div className={styles.error}>{t('applications.no_application_type_selected')}</div>

View file

@ -89,10 +89,12 @@ function GuideLibrary({ className, hasCardBorder, hasCardButton, hasFilters }: P
<div className={styles.checkboxGroupContainer}>
<CheckboxGroup
className={styles.checkboxGroup}
options={allAppGuideCategories.map((category) => ({
title: `guide.categories.${category}`,
value: category,
}))}
options={allAppGuideCategories
.filter((category) => isDevFeaturesEnabled || category !== 'Protected')
.map((category) => ({
title: `guide.categories.${category}`,
value: category,
}))}
value={filterCategories}
onChange={(value) => {
const sortedValue = allAppGuideCategories.filter((category) =>