mirror of
https://github.com/logto-io/logto.git
synced 2025-01-13 21:30:30 -05:00
refactor(console,phrases): show notification when modify origin url in protected app details (#5334)
This commit is contained in:
parent
29eb633c44
commit
7266aee445
16 changed files with 50 additions and 0 deletions
|
@ -3,6 +3,7 @@ import {
|
||||||
type Application,
|
type Application,
|
||||||
type CustomDomain as CustomDomainType,
|
type CustomDomain as CustomDomainType,
|
||||||
} from '@logto/schemas';
|
} from '@logto/schemas';
|
||||||
|
import { cond } from '@silverhand/essentials';
|
||||||
import { type ChangeEvent } from 'react';
|
import { type ChangeEvent } from 'react';
|
||||||
import { Controller, useFieldArray, useFormContext } from 'react-hook-form';
|
import { Controller, useFieldArray, useFormContext } from 'react-hook-form';
|
||||||
import { Trans, useTranslation } from 'react-i18next';
|
import { Trans, useTranslation } from 'react-i18next';
|
||||||
|
@ -45,6 +46,7 @@ function ProtectedAppSettings({ data }: Props) {
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
register,
|
register,
|
||||||
|
getFieldState,
|
||||||
formState: { errors },
|
formState: { errors },
|
||||||
} = useFormContext<ApplicationForm>();
|
} = useFormContext<ApplicationForm>();
|
||||||
|
|
||||||
|
@ -146,6 +148,10 @@ function ProtectedAppSettings({ data }: Props) {
|
||||||
<FormField
|
<FormField
|
||||||
isRequired
|
isRequired
|
||||||
title="protected_app.form.url_field_label"
|
title="protected_app.form.url_field_label"
|
||||||
|
description={cond(
|
||||||
|
getFieldState('protectedAppMetadata.origin').isDirty &&
|
||||||
|
'protected_app.form.url_field_modification_notice'
|
||||||
|
)}
|
||||||
tip={<span className={styles.tip}>{t('application_details.origin_url_tip')}</span>}
|
tip={<span className={styles.tip}>{t('application_details.origin_url_tip')}</span>}
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -18,6 +18,8 @@ const protected_app = {
|
||||||
url_field_label: 'Origin URL',
|
url_field_label: 'Origin URL',
|
||||||
url_field_placeholder: 'https://',
|
url_field_placeholder: 'https://',
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
create_application: 'Create application',
|
create_application: 'Create application',
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
|
@ -33,6 +33,9 @@ const protected_app = {
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
url_field_description: 'Enter the primary website address of your application.',
|
url_field_description: 'Enter the primary website address of your application.',
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
url_field_modification_notice:
|
||||||
|
'Modifications to the Origin URL may take up to 1-2 minutes to propagate and become effective across global network locations.',
|
||||||
|
/** UNTRANSLATED */
|
||||||
url_field_tooltip:
|
url_field_tooltip:
|
||||||
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
"Enter primary website address of your application, excluding any '/pathname'. After creation, you can customize route authentication rules.\n\nNote: The Origin URL itself won't require authentication; only accesses via the added app domain will be protected.",
|
||||||
/** UNTRANSLATED */
|
/** UNTRANSLATED */
|
||||||
|
|
Loading…
Add table
Reference in a new issue