Skip to content

Commit

Permalink
feat: Warning on invite modal when mail setup is incomplete (#11809)
Browse files Browse the repository at this point in the history
  • Loading branch information
miya authored Dec 23, 2024
1 parent 03548cd commit 4e3d732
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const MembersPage = () => {
}
const { locale } = useContext(I18n)

const { userProfile, currentWorkspace, isCurrentWorkspaceOwner, isCurrentWorkspaceManager } = useAppContext()
const { userProfile, currentWorkspace, isCurrentWorkspaceOwner, isCurrentWorkspaceManager, systemFeatures } = useAppContext()
const { data, mutate } = useSWR({ url: '/workspaces/current/members' }, fetchMembers)
const [inviteModalVisible, setInviteModalVisible] = useState(false)
const [invitationResults, setInvitationResults] = useState<InvitationResult[]>([])
Expand Down Expand Up @@ -122,6 +122,7 @@ const MembersPage = () => {
{
inviteModalVisible && (
<InviteModal
isEmailSetup={systemFeatures.is_email_setup}
onCancel={() => setInviteModalVisible(false)}
onSend={(invitationResults) => {
setInvitedModalVisible(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useContext } from 'use-context-selector'
import { XMarkIcon } from '@heroicons/react/24/outline'
import { useTranslation } from 'react-i18next'
import { ReactMultiEmail } from 'react-multi-email'
import { RiErrorWarningFill } from '@remixicon/react'
import RoleSelector from './role-selector'
import s from './index.module.css'
import cn from '@/utils/classnames'
Expand All @@ -17,11 +18,13 @@ import I18n from '@/context/i18n'

import 'react-multi-email/dist/style.css'
type IInviteModalProps = {
isEmailSetup: boolean
onCancel: () => void
onSend: (invitationResults: InvitationResult[]) => void
}

const InviteModal = ({
isEmailSetup,
onCancel,
onSend,
}: IInviteModalProps) => {
Expand Down Expand Up @@ -59,7 +62,23 @@ const InviteModal = ({
<div className='text-xl font-semibold text-gray-900'>{t('common.members.inviteTeamMember')}</div>
<XMarkIcon className='w-4 h-4 cursor-pointer' onClick={onCancel} />
</div>
<div className='mb-7 text-[13px] text-gray-500'>{t('common.members.inviteTeamMemberTip')}</div>
<div className='mb-3 text-[13px] text-gray-500'>{t('common.members.inviteTeamMemberTip')}</div>
{!isEmailSetup && (
<div className='grow basis-0 overflow-y-auto pb-4'>
<div className='relative mb-1 p-2 rounded-xl border border-components-panel-border shadow-xs'>
<div className='absolute top-0 left-0 w-full h-full rounded-xl opacity-40' style={{ background: 'linear-gradient(92deg, rgba(255, 171, 0, 0.25) 18.12%, rgba(255, 255, 255, 0.00) 167.31%)' }}></div>
<div className='relative flex items-start w-full h-full'>
<div className='shrink-0 mr-0.5 p-0.5'>
<RiErrorWarningFill className='w-5 h-5 text-text-warning' />
</div>
<div className='text-text-primary system-xs-medium'>
<span>{t('common.members.emailNotSetup')}</span>
</div>
</div>
</div>
</div>
)}

<div>
<div className='mb-2 text-sm font-medium text-gray-900'>{t('common.members.email')}</div>
<div className='mb-8 h-36 flex items-stretch'>
Expand Down
1 change: 1 addition & 0 deletions web/i18n/de-DE/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const translation = {
editorTip: 'Kann Apps erstellen & bearbeiten',
inviteTeamMember: 'Teammitglied hinzufügen',
inviteTeamMemberTip: 'Sie können direkt nach der Anmeldung auf Ihre Teamdaten zugreifen.',
emailNotSetup: 'E-Mail-Server ist nicht eingerichtet, daher können keine Einladungs-E-Mails versendet werden. Bitte informieren Sie die Benutzer über den Einladungslink, der nach der Einladung ausgestellt wird.',
email: 'E-Mail',
emailInvalid: 'Ungültiges E-Mail-Format',
emailPlaceholder: 'Bitte E-Mails eingeben',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/en-US/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const translation = {
datasetOperatorTip: 'Only can manage the knowledge base',
inviteTeamMember: 'Add team member',
inviteTeamMemberTip: 'They can access your team data directly after signing in.',
emailNotSetup: 'Email server is not set up, so invitation emails cannot be sent. Please notify users of the invitation link that will be issued after invitation instead.',
email: 'Email',
emailInvalid: 'Invalid Email Format',
emailPlaceholder: 'Please input emails',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/es-ES/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const translation = {
datasetOperatorTip: 'Solo puede administrar la base de conocimiento',
inviteTeamMember: 'Agregar miembro del equipo',
inviteTeamMemberTip: 'Pueden acceder a tus datos del equipo directamente después de iniciar sesión.',
emailNotSetup: 'El servidor de correo no está configurado, por lo que no se pueden enviar correos de invitación. En su lugar, notifique a los usuarios el enlace de invitación que se emitirá después de la invitación.',
email: 'Correo electrónico',
emailInvalid: 'Formato de correo electrónico inválido',
emailPlaceholder: 'Por favor ingresa correos electrónicos',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/fa-IR/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const translation = {
datasetOperatorTip: 'فقط می‌تواند پایگاه دانش را مدیریت کند',
inviteTeamMember: 'افزودن عضو تیم',
inviteTeamMemberTip: 'آنها می‌توانند پس از ورود به سیستم، مستقیماً به داده‌های تیم شما دسترسی پیدا کنند.',
emailNotSetup: 'سرور ایمیل راه‌اندازی نشده است، بنابراین ایمیل‌های دعوت نمی‌توانند ارسال شوند. لطفاً کاربران را از لینک دعوت که پس از دعوت صادر خواهد شد مطلع کنید。',
email: 'ایمیل',
emailInvalid: 'فرمت ایمیل نامعتبر است',
emailPlaceholder: 'لطفاً ایمیل‌ها را وارد کنید',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/fr-FR/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const translation = {
editorTip: 'Peut construire des applications, mais ne peut pas gérer les paramètres de l\'équipe',
inviteTeamMember: 'Ajouter un membre de l\'équipe',
inviteTeamMemberTip: 'Ils peuvent accéder directement à vos données d\'équipe après s\'être connectés.',
emailNotSetup: 'Le serveur de messagerie n\'est pas configuré, les e-mails d\'invitation ne peuvent donc pas être envoyés. Veuillez informer les utilisateurs du lien d\'invitation qui sera émis après l\'invitation.',
email: 'Courrier électronique',
emailInvalid: 'Format de courriel invalide',
emailPlaceholder: 'Veuillez entrer des emails',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/hi-IN/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ const translation = {
inviteTeamMember: 'टीम सदस्य जोड़ें',
inviteTeamMemberTip:
'वे साइन इन करने के बाद सीधे आपकी टीम डेटा तक पहुंच सकते हैं।',
emailNotSetup: 'ईमेल सर्वर सेट नहीं है, इसलिए आमंत्रण ईमेल नहीं भेजे जा सकते। कृपया उपयोगकर्ताओं को आमंत्रण के बाद जारी किए जाने वाले आमंत्रण लिंक के बारे में सूचित करें。',
email: 'ईमेल',
emailInvalid: 'अवैध ईमेल प्रारूप',
emailPlaceholder: 'कृपया ईमेल दर्ज करें',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/it-IT/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ const translation = {
inviteTeamMember: 'Aggiungi membro del team',
inviteTeamMemberTip:
'Potranno accedere ai dati del tuo team direttamente dopo aver effettuato l\'accesso.',
emailNotSetup: 'Il server email non è configurato, quindi non è possibile inviare email di invito. Si prega di notificare agli utenti il link di invito che verrà emesso dopo l\'invito.',
email: 'Email',
emailInvalid: 'Formato Email non valido',
emailPlaceholder: 'Per favore inserisci le email',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/ja-JP/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const translation = {
datasetOperatorTip: 'ナレッジベースのみを管理できる',
inviteTeamMember: 'チームメンバーを招待する',
inviteTeamMemberTip: '彼らはサインイン後、直接あなた様のチームデータにアクセスできます。',
emailNotSetup: 'メールサーバーがセットアップされていないので、招待メールを送信することはできません。代わりに招待後に発行される招待リンクをユーザーに通知してください。',
email: 'メール',
emailInvalid: '無効なメール形式',
emailPlaceholder: 'メールを入力してください',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/ko-KR/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ const translation = {
editorTip: '앱 빌드만 가능하고 팀 설정 관리 불가능',
inviteTeamMember: '팀 멤버 초대',
inviteTeamMemberTip: '로그인 후에 바로 팀 데이터에 액세스할 수 있습니다.',
emailNotSetup: '이메일 서버가 설정되지 않아 초대 이메일을 보낼 수 없습니다. 대신 초대 후 발급되는 초대 링크를 사용자에게 알려주세요.',
email: '이메일',
emailInvalid: '유효하지 않은 이메일 형식',
emailPlaceholder: '이메일 입력',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/pl-PL/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ const translation = {
inviteTeamMember: 'Dodaj członka zespołu',
inviteTeamMemberTip:
'Mogą uzyskać bezpośredni dostęp do danych Twojego zespołu po zalogowaniu.',
emailNotSetup: 'Serwer poczty nie jest skonfigurowany, więc nie można wysyłać zaproszeń e-mail. Proszę powiadomić użytkowników o linku do zaproszenia, który zostanie wydany po zaproszeniu.',
email: 'Email',
emailInvalid: 'Nieprawidłowy format e-maila',
emailPlaceholder: 'Proszę podać adresy e-mail',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/pt-BR/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const translation = {
editorTip: 'Pode editar aplicativos, mas não pode gerenciar configurações da equipe',
inviteTeamMember: 'Adicionar membro da equipe',
inviteTeamMemberTip: 'Eles podem acessar os dados da sua equipe diretamente após fazer login.',
emailNotSetup: 'O servidor de e-mail não está configurado, então os e-mails de convite não podem ser enviados. Por favor, notifique os usuários sobre o link de convite que será emitido após o convite.',
email: 'E-mail',
emailInvalid: 'Formato de e-mail inválido',
emailPlaceholder: 'Por favor, insira e-mails',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/ro-RO/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const translation = {
editorTip: 'Poate construi aplicații, dar nu poate gestiona setările echipei',
inviteTeamMember: 'Adaugă membru în echipă',
inviteTeamMemberTip: 'Pot accesa direct datele echipei dvs. după autentificare.',
emailNotSetup: 'Serverul de e-mail nu este configurat, astfel încât e-mailurile de invitație nu pot fi trimise. Vă rugăm să notificați utilizatorii despre linkul de invitație care va fi emis după invitație.',
email: 'Email',
emailInvalid: 'Format de email invalid',
emailPlaceholder: 'Vă rugăm să introduceți emailuri',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/ru-RU/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const translation = {
datasetOperatorTip: 'Может управлять только базой знаний',
inviteTeamMember: 'Добавить участника команды',
inviteTeamMemberTip: 'Они могут получить доступ к данным вашей команды сразу после входа в систему.',
emailNotSetup: 'Почтовый сервер не настроен, поэтому приглашения по электронной почте не могут быть отправлены. Пожалуйста, уведомите пользователей о ссылке для приглашения, которая будет выдана после приглашения.',
email: 'Электронная почта',
emailInvalid: 'Неверный формат электронной почты',
emailPlaceholder: 'Пожалуйста, введите адреса электронной почты',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/sl-SI/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const translation = {
datasetOperatorTip: 'Lahko upravlja samo bazo znanja',
inviteTeamMember: 'Dodaj člana ekipe',
inviteTeamMemberTip: 'Do vaših podatkov bo lahko dostopal takoj po prijavi.',
emailNotSetup: 'E-poštni strežnik ni nastavljen, zato vabil po e-pošti ni mogoče poslati. Prosimo, obvestite uporabnike o povezavi za povabilo, ki bo izdana po povabilu.',
email: 'E-pošta',
emailInvalid: 'Neveljaven format e-pošte',
emailPlaceholder: 'Vnesite e-poštne naslove',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/th-TH/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const translation = {
datasetOperatorTip: 'สามารถจัดการฐานความรู้ได้เท่านั้น',
inviteTeamMember: 'เพิ่มสมาชิกในทีม',
inviteTeamMemberTip: 'พวกเขาสามารถเข้าถึงข้อมูลทีมของคุณได้โดยตรงหลังจากลงชื่อเข้าใช้',
emailNotSetup: 'เซิร์ฟเวอร์อีเมลไม่ได้ตั้งค่าไว้ จึงไม่สามารถส่งอีเมลเชิญได้ กรุณาแจ้งผู้ใช้เกี่ยวกับลิงก์เชิญที่จะออกหลังจากการเชิญแทน',
email: 'อีเมล',
emailInvalid: 'รูปแบบอีเมลไม่ถูกต้อง',
emailPlaceholder: 'กรุณากรอกอีเมล',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/tr-TR/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const translation = {
datasetOperatorTip: 'Sadece bilgi tabanını yönetebilir',
inviteTeamMember: 'Takım Üyesi Ekle',
inviteTeamMemberTip: 'Giriş yaptıktan sonra takım verilerinize doğrudan erişebilirler.',
emailNotSetup: 'E-posta sunucusu kurulu değil, bu nedenle davet e-postaları gönderilemiyor. Lütfen kullanıcıları davetten sonra verilecek davet bağlantısı hakkında bilgilendirin.',
email: 'E-posta',
emailInvalid: 'Geçersiz E-posta Formatı',
emailPlaceholder: 'Lütfen e-postaları girin',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/uk-UA/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const translation = {
editorTip: 'Може створювати програми, але не може керувати налаштуваннями команди',
inviteTeamMember: 'Додати учасника команди',
inviteTeamMemberTip: 'Вони зможуть отримати доступ до даних вашої команди безпосередньо після входу.',
emailNotSetup: 'Поштовий сервер не налаштований, тому запрошення електронною поштою не можуть бути надіслані. Будь ласка, повідомте користувачів про посилання для запрошення, яке буде видано після запрошення.',
email: 'Електронна пошта',
emailInvalid: 'Недійсний формат електронної пошти',
emailPlaceholder: 'Будь ласка, введіть адресу електронної пошти',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/vi-VN/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const translation = {
editorTip: 'Có thể xây dựng ứng dụng, không thể quản lý cài đặt nhóm',
inviteTeamMember: 'Mời thành viên nhóm',
inviteTeamMemberTip: 'Sau khi đăng nhập, họ có thể truy cập trực tiếp vào dữ liệu nhóm của bạn.',
emailNotSetup: 'Máy chủ email chưa được thiết lập, vì vậy không thể gửi email mời. Vui lòng thông báo cho người dùng về liên kết mời sẽ được phát hành sau khi mời.',
email: 'Email',
emailInvalid: 'Định dạng Email không hợp lệ',
emailPlaceholder: 'Vui lòng nhập email',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/zh-Hans/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const translation = {
datasetOperatorTip: '只能管理知识库',
inviteTeamMember: '添加团队成员',
inviteTeamMemberTip: '对方在登录后可以访问你的团队数据。',
emailNotSetup: '由于邮件服务器未设置,无法发送邀请邮件。请将邀请后生成的邀请链接通知用户。',
email: '邮箱',
emailInvalid: '邮箱格式无效',
emailPlaceholder: '输入邮箱',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/zh-Hant/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const translation = {
editorTip: '能夠建立並編輯應用程式,不能管理團隊設定',
inviteTeamMember: '新增團隊成員',
inviteTeamMemberTip: '對方在登入後可以訪問你的團隊資料。',
emailNotSetup: '由於郵件伺服器未設置,無法發送邀請郵件。請將邀請後生成的邀請連結通知用戶。',
email: '郵箱',
emailInvalid: '郵箱格式無效',
emailPlaceholder: '輸入郵箱',
Expand Down

0 comments on commit 4e3d732

Please sign in to comment.