0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-04-07 23:01:25 -05:00

feat(console,phrases): add inline notification if email domain not configured (#4986)

This commit is contained in:
Darcy Ye 2023-11-28 17:52:25 +08:00 committed by GitHub
parent fad8872b31
commit 15ce9643e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 98 additions and 1 deletions

View file

@ -71,3 +71,9 @@
outline-color: var(--color-focused-variant);
}
}
.error {
border-color: var(--color-error);
font: var(--font-body-2);
margin-top: _.unit(1);
}

View file

@ -11,3 +11,7 @@
color: var(--color-error);
margin-top: _.unit(1);
}
.inlineNotification {
margin-top: _.unit(6);
}

View file

@ -17,6 +17,7 @@ import DetailsForm from '@/components/DetailsForm';
import FormCard from '@/components/FormCard';
import UnsavedChangesAlertModal from '@/components/UnsavedChangesAlertModal';
import FormField from '@/ds-components/FormField';
import InlineNotification from '@/ds-components/InlineNotification';
import Select from '@/ds-components/Select';
import TextInput from '@/ds-components/TextInput';
import useApi from '@/hooks/use-api';
@ -98,7 +99,7 @@ function Experience({ data, isDeleted, onUpdated }: Props) {
clearErrors,
handleSubmit,
register,
formState: { isDirty, isSubmitting, errors },
formState: { defaultValues, isDirty, isSubmitting, errors },
reset,
} = formMethods;
@ -172,6 +173,11 @@ function Experience({ data, isDeleted, onUpdated }: Props) {
error={errors.connectorName?.message}
/>
</FormField>
{!defaultValues?.domains?.length && (
<InlineNotification className={styles.inlineNotification} severity="alert">
{t('enterprise_sso_details.configure_domain_field_info_text')}
</InlineNotification>
)}
<FormField title="enterprise_sso_details.email_domain_field_name">
<div className={styles.description}>
{t('enterprise_sso_details.email_domain_field_description')}
@ -179,6 +185,14 @@ function Experience({ data, isDeleted, onUpdated }: Props) {
<Controller
name="domains"
control={control}
rules={{
validate: (value) => {
if (value.length === 0) {
return t('enterprise_sso_details.email_domain_field_required');
}
return true;
},
}}
render={({ field: { onChange, value } }) => (
<MultiInput
values={value}

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -37,6 +37,9 @@ const enterprise_sso_details = {
upload_idp_metadata_title: 'Upload IdP metadata',
upload_idp_metadata_description: 'Configure the metadata copied from the identity provider.',
upload_idp_metadata_button_text: 'Upload metadata XML file',
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
upload_saml_idp_metadata_info_text_xml:

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */

View file

@ -71,6 +71,11 @@ const enterprise_sso_details = {
/** UNTRANSLATED */
upload_idp_metadata_button_text: 'Upload metadata XML file',
/** UNTRANSLATED */
configure_domain_field_info_text:
'Add email domain to guide enterprise users to their identity provider for Single Sign-on.',
/** UNTRANSLATED */
email_domain_field_required: 'Email domain is required to enable enterprise SSO.',
/** UNTRANSLATED */
upload_saml_idp_metadata_info_text_url:
'Paste the metadata URL from the identity provider to connect.',
/** UNTRANSLATED */