Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion web/app/components/app/overview/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions web/i18n/de-DE/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/en-US/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/es-ES/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/fa-IR/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'تم رنگی چت‌بات را تنظیم کنید',
chatColorThemeInverted: 'معکوس',
invalidHexMessage: 'مقدار هگز نامعتبر',
invalidPrivacyPolicy: 'لینک سیاست حفظ حریم خصوصی نامعتبر است. لطفاً از یک لینک معتبر که با http یا https شروع میشود استفاده کنید',
more: {
entry: 'نمایش تنظیمات بیشتر',
copyright: 'حق نسخه‌برداری',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/fr-FR/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/hi-IN/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const translation = {
chatColorThemeDesc: 'चैटबॉट का रंग थीम निर्धारित करें',
chatColorThemeInverted: 'उल्टा',
invalidHexMessage: 'अमान्य हेक्स मान',
invalidPrivacyPolicy: 'गोपनीयता नीति लिंक अमान्य है। कृपया http या https से शुरू होने वाला एक वैध लिंक उपयोग करें।',
more: {
entry: 'अधिक सेटिंग्स दिखाएं',
copyright: 'कॉपीराइट',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/it-IT/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/ja-JP/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'チャットボットのカラーテーマを設定します',
chatColorThemeInverted: '反転',
invalidHexMessage: '無効な16進数値',
invalidPrivacyPolicy: '無効なプライバシーポリシーのリンクです。http または https で始まる有効なリンクを使用してください',
more: {
entry: 'その他の設定を表示',
copyright: '著作権',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/ko-KR/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: '챗봇의 색상 테마를 설정하세요',
chatColorThemeInverted: '반전',
invalidHexMessage: '잘못된 16진수 값',
invalidPrivacyPolicy: '유효하지 않은 개인정보처리방침 링크입니다. http 또는 https로 시작하는 유효한 링크를 사용해 주세요',
more: {
entry: '추가 설정 보기',
copyright: '저작권',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/pl-PL/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/pt-BR/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/ro-RO/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/ru-RU/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Установите цветовую тему чат-бота',
chatColorThemeInverted: 'Инвертированные цвета',
invalidHexMessage: 'Неверное HEX-значение',
invalidPrivacyPolicy: 'Недопустимая ссылка на политику конфиденциальности. Пожалуйста, используйте действительную ссылку, начинающуюся с http или https',
sso: {
label: 'SSO аутентификация',
title: 'WebApp SSO',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/sl-SI/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/th-TH/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'กําหนดธีมสีของแชทบอท',
chatColorThemeInverted: 'คว่ำ',
invalidHexMessage: 'ค่าฐานสิบหกไม่ถูกต้อง',
invalidPrivacyPolicy: 'ลิงก์นโยบายความเป็นส่วนตัวไม่ถูกต้อง โปรดใช้ลิงก์ที่ถูกต้องขึ้นต้นด้วย http หรือ https',
sso: {
label: 'การรับรองความถูกต้องของ SSO',
title: 'เว็บแอป SSO',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/tr-TR/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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ı',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/uk-UA/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: 'Встановіть тему кольору чат-бота',
chatColorThemeInverted: 'Інвертовано',
invalidHexMessage: 'Недійсне шістнадцяткове значення',
invalidPrivacyPolicy: 'Недійсне посилання на політику конфіденційності. Будь ласка, використовуйте дійсне посилання, яке починається з http або https',
more: {
entry: 'Показати додаткові налаштування',
copyright: 'Авторське право',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/vi-VN/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/zh-Hans/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const translation = {
chatColorThemeDesc: '设置聊天机器人的颜色主题',
chatColorThemeInverted: '反转',
invalidHexMessage: '无效的十六进制值',
invalidPrivacyPolicy: '无效的隐私政策链接,请使用以 http 或 https 开头的有效链接',
sso: {
label: '单点登录认证',
title: 'WebApp SSO 认证',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/zh-Hant/app-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const translation = {
chatColorThemeDesc: '設定聊天機器人的顏色主題',
chatColorThemeInverted: '反轉',
invalidHexMessage: '無效的十六進制值',
invalidPrivacyPolicy: '無效的隱私政策連結,請使用以 http 或 https 開頭的有效連結',
more: {
entry: '展示更多設定',
copyright: '版權',
Expand Down
Loading