0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-17 22:31:28 -05:00

chore(console, core): remove dev features guard for bring your ui feature (#6465)

This commit is contained in:
Charles Zhao 2024-08-19 15:56:16 +08:00 committed by GitHub
parent 2362791edc
commit 13bfa0641b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 18 deletions

View file

@ -4,7 +4,7 @@ import { Controller, useFormContext } from 'react-hook-form';
import { Trans, useTranslation } from 'react-i18next';
import InlineUpsell from '@/components/InlineUpsell';
import { isDevFeaturesEnabled, isCloud } from '@/consts/env';
import { isCloud } from '@/consts/env';
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
import Card from '@/ds-components/Card';
import CodeEditor from '@/ds-components/CodeEditor';
@ -67,7 +67,7 @@ function CustomUiForm() {
)}
/>
</FormField>
{isDevFeaturesEnabled && isCloud && (
{isCloud && (
<FormField
title="sign_in_exp.custom_ui.bring_your_ui_title"
description={

View file

@ -4,8 +4,7 @@
"name": "Custom UI assets",
"description": "Endpoints for uploading custom UI assets for the sign-in experience. Users can upload a zip file containing custom HTML, CSS, and JavaScript files to replace and fully customize the sign-in experience."
},
{ "name": "Cloud only" },
{ "name": "Dev feature" }
{ "name": "Cloud only" }
],
"paths": {
"/api/sign-in-exp/default/custom-ui-assets": {

View file

@ -28,15 +28,8 @@ export default function customUiAssetsRoutes<T extends ManagementApiRouter>(
},
]: RouterInitArgs<T>
) {
// TODO: Remove
if (!EnvSet.values.isDevFeaturesEnabled) {
return;
}
router.post(
'/sign-in-exp/default/custom-ui-assets',
// Manually add this to avoid the case that the dev feature guard is removed but the quota guard is not being updated accordingly.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
EnvSet.values.isDevFeaturesEnabled
? newKoaQuotaGuard({ key: 'bringYourUiEnabled', quota })
: koaQuotaGuard({ key: 'bringYourUiEnabled', quota }),

View file

@ -51,11 +51,7 @@ const managementApiIdentifiableEntityNames = Object.freeze([
/** Additional tags that cannot be inferred from the path. */
const additionalTags = Object.freeze(
condArray<string>(
'Organization applications',
EnvSet.values.isDevFeaturesEnabled && 'Custom UI assets',
'Organization users'
)
condArray<string>('Organization applications', 'Custom UI assets', 'Organization users')
);
export const buildManagementApiBaseDocument = (

View file

@ -27,8 +27,6 @@ type RouteDictionary = Record<`${OpenAPIV3.HttpMethods} ${string}`, string>;
const devFeatureCustomRoutes: RouteDictionary = Object.freeze({
// Subject tokens
'post /subject-tokens': 'CreateSubjectToken',
// Custom UI assets
'post /sign-in-exp/default/custom-ui-assets': 'UploadCustomUiAssets',
});
export const customRoutes: Readonly<RouteDictionary> = Object.freeze({
@ -83,6 +81,8 @@ export const customRoutes: Readonly<RouteDictionary> = Object.freeze({
// Well-known
'get /.well-known/phrases': 'GetSignInExperiencePhrases',
'get /.well-known/sign-in-exp': 'GetSignInExperienceConfig',
// Custom UI assets
'post /sign-in-exp/default/custom-ui-assets': 'UploadCustomUiAssets',
...(EnvSet.values.isDevFeaturesEnabled ? devFeatureCustomRoutes : {}),
} satisfies RouteDictionary); // Key assertion doesn't work without `satisfies`