feat: update privacy policy URL and add validation for privacy policy link (#18422)

This commit is contained in:
Ethan 2025-04-21 10:04:33 +08:00 committed by GitHub
parent 9bd8e62702
commit c768d97637
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 32 additions and 1 deletions

View File

@ -162,11 +162,22 @@ const SettingsModal: FC<ISettingsModalProps> = ({
return check
}
const validatePrivacyPolicy = (privacyPolicy: string | null) => {
if (privacyPolicy === null || privacyPolicy?.length === 0)
return true
return privacyPolicy.startsWith('http://') || privacyPolicy.startsWith('https://')
}
if (inputInfo !== null) {
if (!validateColorHex(inputInfo.chatColorTheme)) {
notify({ type: 'error', message: t(`${prefixSettings}.invalidHexMessage`) })
return
}
if (!validatePrivacyPolicy(inputInfo.privacyPolicy)) {
notify({ type: 'error', message: t(`${prefixSettings}.invalidPrivacyPolicy`) })
return
}
}
setSaveLoading(true)
@ -410,7 +421,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({
<p className={cn('body-xs-regular pb-0.5 text-text-tertiary')}>
<Trans
i18nKey={`${prefixSettings}.more.privacyPolicyTip`}
components={{ privacyPolicyLink: <Link href={'https://docs.dify.ai/user-agreement/privacy-policy'} target='_blank' rel='noopener noreferrer' className='text-text-accent' /> }}
components={{ privacyPolicyLink: <Link href={'https://dify.ai/privacy'} target='_blank' rel='noopener noreferrer' className='text-text-accent' /> }}
/>
</p>
<Input

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Legen Sie das Farbschema des Chatbots fest',
chatColorThemeInverted: 'Invertiert',
invalidHexMessage: 'Ungültiger Hex-Wert',
invalidPrivacyPolicy: 'Ungültiger Link zur Datenschutzrichtlinie. Bitte verwenden Sie einen gültigen Link, der mit http oder https beginnt',
more: {
entry: 'Mehr Einstellungen anzeigen',
copyright: 'Urheberrecht',

View File

@ -57,6 +57,7 @@ const translation = {
chatColorThemeDesc: 'Set the color theme of the chatbot',
chatColorThemeInverted: 'Inverted',
invalidHexMessage: 'Invalid hex value',
invalidPrivacyPolicy: 'Invalid privacy policy link. Please use a valid link that starts with http or https',
sso: {
label: 'SSO Enforcement',
title: 'WebApp SSO',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Establece el tema de color del chatbot',
chatColorThemeInverted: 'Invertido',
invalidHexMessage: 'Valor hexadecimal no válido',
invalidPrivacyPolicy: 'Enlace de política de privacidad no válido. Por favor, utiliza un enlace válido que comience con http o https',
more: {
entry: 'Mostrar más configuraciones',
copyright: 'Derechos de autor',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'تم رنگی چت‌بات را تنظیم کنید',
chatColorThemeInverted: 'معکوس',
invalidHexMessage: 'مقدار هگز نامعتبر',
invalidPrivacyPolicy: 'لینک سیاست حفظ حریم خصوصی نامعتبر است. لطفاً از یک لینک معتبر که با http یا https شروع میشود استفاده کنید',
more: {
entry: 'نمایش تنظیمات بیشتر',
copyright: 'حق نسخه‌برداری',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Définir le thème de couleur du chatbot',
chatColorThemeInverted: 'Inversé',
invalidHexMessage: 'Valeur hexadécimale invalide',
invalidPrivacyPolicy: 'Lien de politique de confidentialité invalide. Veuillez utiliser un lien valide commençant par http ou https',
more: {
entry: 'Afficher plus de paramètres',
copyright: 'Droits d\'auteur',

View File

@ -59,6 +59,7 @@ const translation = {
chatColorThemeDesc: 'चैटबॉट का रंग थीम निर्धारित करें',
chatColorThemeInverted: 'उल्टा',
invalidHexMessage: 'अमान्य हेक्स मान',
invalidPrivacyPolicy: 'गोपनीयता नीति लिंक अमान्य है। कृपया http या https से शुरू होने वाला एक वैध लिंक उपयोग करें।',
more: {
entry: 'अधिक सेटिंग्स दिखाएं',
copyright: 'कॉपीराइट',

View File

@ -59,6 +59,7 @@ const translation = {
chatColorThemeDesc: 'Imposta il tema colore del chatbot',
chatColorThemeInverted: 'Inverso',
invalidHexMessage: 'Valore esadecimale non valido',
invalidPrivacyPolicy: 'Link alla privacy policy non valido. Si prega di utilizzare un link valido che inizi con http o https',
more: {
entry: 'Mostra più impostazioni',
copyright: 'Copyright',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'チャットボットのカラーテーマを設定します',
chatColorThemeInverted: '反転',
invalidHexMessage: '無効な16進数値',
invalidPrivacyPolicy: '無効なプライバシーポリシーのリンクです。http または https で始まる有効なリンクを使用してください',
more: {
entry: 'その他の設定を表示',
copyright: '著作権',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: '챗봇의 색상 테마를 설정하세요',
chatColorThemeInverted: '반전',
invalidHexMessage: '잘못된 16진수 값',
invalidPrivacyPolicy: '유효하지 않은 개인정보처리방침 링크입니다. http 또는 https로 시작하는 유효한 링크를 사용해 주세요',
more: {
entry: '추가 설정 보기',
copyright: '저작권',

View File

@ -59,6 +59,7 @@ const translation = {
chatColorThemeDesc: 'Ustaw motyw kolorystyczny czatu',
chatColorThemeInverted: 'Odwrócony',
invalidHexMessage: 'Nieprawidłowa wartość heksadecymalna',
invalidPrivacyPolicy: 'Nieprawidłowy link do polityki prywatności. Proszę użyć prawidłowego linku zaczynającego się od http lub https',
more: {
entry: 'Pokaż więcej ustawień',
copyright: 'Prawa autorskie',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Defina o tema de cor do chatbot',
chatColorThemeInverted: 'Inve',
invalidHexMessage: 'Valor hex inválido',
invalidPrivacyPolicy: 'Link de política de privacidade inválido. Por favor, use um link válido que comece com http ou https',
more: {
entry: 'Mostrar mais configurações',
copyright: 'Direitos autorais',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Setați tema de culoare a chatbotului',
chatColorThemeInverted: 'Inversat',
invalidHexMessage: 'Valoare hex nevalidă',
invalidPrivacyPolicy: 'Link politică de confidențialitate invalid. Vă rugăm să folosiți un link valid care începe cu http sau https',
more: {
entry: 'Afișați mai multe setări',
copyright: 'Drepturi de autor',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Установите цветовую тему чат-бота',
chatColorThemeInverted: 'Инвертированные цвета',
invalidHexMessage: 'Неверное HEX-значение',
invalidPrivacyPolicy: 'Недопустимая ссылка на политику конфиденциальности. Пожалуйста, используйте действительную ссылку, начинающуюся с http или https',
sso: {
label: 'SSO аутентификация',
title: 'WebApp SSO',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Nastavite barvno temo klepetalnega bota',
chatColorThemeInverted: 'Inverzna',
invalidHexMessage: 'Neveljavna vrednost heksa',
invalidPrivacyPolicy: 'Neveljavna povezava do pravilnika o zasebnosti. Uporabite veljavno povezavo, ki se začne z http ali https',
sso: {
label: 'SSO avtentikacija',
title: 'SSO spletne aplikacije',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'กําหนดธีมสีของแชทบอท',
chatColorThemeInverted: 'คว่ำ',
invalidHexMessage: 'ค่าฐานสิบหกไม่ถูกต้อง',
invalidPrivacyPolicy: 'ลิงก์นโยบายความเป็นส่วนตัวไม่ถูกต้อง โปรดใช้ลิงก์ที่ถูกต้องขึ้นต้นด้วย http หรือ https',
sso: {
label: 'การรับรองความถูกต้องของ SSO',
title: 'เว็บแอป SSO',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Sohbet botunun renk temasını ayarlayın',
chatColorThemeInverted: 'Tersine çevrilmiş',
invalidHexMessage: 'Geçersiz hex değeri',
invalidPrivacyPolicy: 'Geçersiz gizlilik politikası bağlantısı. Lütfen http veya https ile başlayan geçerli bir bağlantı kullanın',
more: {
entry: 'Daha fazla ayarı göster',
copyright: 'Telif Hakkı',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Встановіть тему кольору чат-бота',
chatColorThemeInverted: 'Інвертовано',
invalidHexMessage: 'Недійсне шістнадцяткове значення',
invalidPrivacyPolicy: 'Недійсне посилання на політику конфіденційності. Будь ласка, використовуйте дійсне посилання, яке починається з http або https',
more: {
entry: 'Показати додаткові налаштування',
copyright: 'Авторське право',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Thiết lập giao diện màu của chatbot',
chatColorThemeInverted: 'Đảo ngược',
invalidHexMessage: 'Giá trị mã màu không hợp lệ',
invalidPrivacyPolicy: 'Liên kết chính sách bảo mật không hợp lệ. Vui lòng sử dụng liên kết hợp lệ bắt đầu bằng http hoặc https',
more: {
entry: 'Hiển thị thêm cài đặt',
copyright: 'Bản quyền',

View File

@ -57,6 +57,7 @@ const translation = {
chatColorThemeDesc: '设置聊天机器人的颜色主题',
chatColorThemeInverted: '反转',
invalidHexMessage: '无效的十六进制值',
invalidPrivacyPolicy: '无效的隐私政策链接,请使用以 http 或 https 开头的有效链接',
sso: {
label: '单点登录认证',
title: 'WebApp SSO 认证',

View File

@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: '設定聊天機器人的顏色主題',
chatColorThemeInverted: '反轉',
invalidHexMessage: '無效的十六進制值',
invalidPrivacyPolicy: '無效的隱私政策連結,請使用以 http 或 https 開頭的有效連結',
more: {
entry: '展示更多設定',
copyright: '版權',