diff --git a/packages/console/src/consts/applications.ts b/packages/console/src/consts/applications.ts index bd913ad9a..dbf80ec03 100644 --- a/packages/console/src/consts/applications.ts +++ b/packages/console/src/consts/applications.ts @@ -7,12 +7,6 @@ import SinglePageApp from '@/assets/images/single-page-app.svg'; import TraditionalWebAppDark from '@/assets/images/traditional-web-app-dark.svg'; import TraditionalWebApp from '@/assets/images/traditional-web-app.svg'; -export const applicationTypeI18nKey = Object.freeze({ - [ApplicationType.Native]: 'applications.type.native', - [ApplicationType.SPA]: 'applications.type.spa', - [ApplicationType.Traditional]: 'applications.type.traditional', -} as const); - type ApplicationIconMap = { [key in ApplicationType]: SvgComponent; }; @@ -21,10 +15,12 @@ export const lightModeApplicationIconMap: ApplicationIconMap = Object.freeze({ [ApplicationType.Native]: NativeApp, [ApplicationType.SPA]: SinglePageApp, [ApplicationType.Traditional]: TraditionalWebApp, + [ApplicationType.MachineToMachine]: TraditionalWebApp, } as const); export const darkModeApplicationIconMap: ApplicationIconMap = Object.freeze({ [ApplicationType.Native]: NativeAppDark, [ApplicationType.SPA]: SinglePageAppDark, [ApplicationType.Traditional]: TraditionalWebAppDark, + [ApplicationType.MachineToMachine]: TraditionalWebAppDark, } as const); diff --git a/packages/console/src/pages/ApplicationDetails/components/AdvancedSettings.tsx b/packages/console/src/pages/ApplicationDetails/components/AdvancedSettings.tsx index 84d230465..e24ce1695 100644 --- a/packages/console/src/pages/ApplicationDetails/components/AdvancedSettings.tsx +++ b/packages/console/src/pages/ApplicationDetails/components/AdvancedSettings.tsx @@ -30,6 +30,17 @@ const AdvancedSettings = ({ oidcConfig, defaultData, isDeleted }: Props) => { return ( <> + + + - {applicationType === ApplicationType.Traditional && ( + + + + {[ApplicationType.Traditional, ApplicationType.MachineToMachine].includes( + applicationType + ) && ( )} - - - - - ( - - )} - /> - - - ( - - )} - /> - - - !value || uriOriginValidator(value), - message: t('errors.invalid_origin_format'), - }, - }), - }} - render={({ field: { onChange, value }, fieldState: { error } }) => ( - - )} - /> - + tooltip="application_details.redirect_uri_tip" + > + ( + + )} + /> + + )} + {applicationType !== ApplicationType.MachineToMachine && ( + + ( + + )} + /> + + )} + {applicationType !== ApplicationType.MachineToMachine && ( + + !value || uriOriginValidator(value), + message: t('errors.invalid_origin_format'), + }, + }), + }} + render={({ field: { onChange, value }, fieldState: { error } }) => ( + + )} + /> + + )} ); diff --git a/packages/console/src/pages/ApplicationDetails/index.tsx b/packages/console/src/pages/ApplicationDetails/index.tsx index 118962ed6..41eaa2593 100644 --- a/packages/console/src/pages/ApplicationDetails/index.tsx +++ b/packages/console/src/pages/ApplicationDetails/index.tsx @@ -1,4 +1,4 @@ -import { Application, SnakeCaseOidcConfig } from '@logto/schemas'; +import { Application, ApplicationType, SnakeCaseOidcConfig } from '@logto/schemas'; import classNames from 'classnames'; import { useEffect, useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; @@ -144,13 +144,16 @@ const ApplicationDetails = () => {
-