Skip to content

Commit

Permalink
feat: enhance note sharing functionality and update translations #368 #…
Browse files Browse the repository at this point in the history
…356 #362

- Added new fields to the notes model for sharing: shareEncryptedUrl, shareExpiryDate, shareMaxView, and shareViewCount.
- Implemented share note feature in the backend, allowing notes to be shared with optional password protection and expiration.
- Updated frontend components to support sharing functionality, including a share dialog and password verification.
- Enhanced user experience with new translations for sharing-related messages across multiple languages.
- Removed fallback-development.js as it is no longer needed.
  • Loading branch information
blinko-space committed Dec 27, 2024
1 parent e208124 commit 9795776
Show file tree
Hide file tree
Showing 23 changed files with 745 additions and 68 deletions.
5 changes: 5 additions & 0 deletions prisma/migrations/20241226141834_0_30_7/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "notes" ADD COLUMN "shareEncryptedUrl" VARCHAR,
ADD COLUMN "shareExpiryDate" TIMESTAMPTZ(6),
ADD COLUMN "shareMaxView" INTEGER DEFAULT 0,
ADD COLUMN "shareViewCount" INTEGER DEFAULT 0;
4 changes: 4 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ model notes {
isTop Boolean @default(false)
isReviewed Boolean @default(false)
sharePassword String @default("") @db.VarChar
shareEncryptedUrl String? @db.VarChar
shareExpiryDate DateTime? @db.Timestamptz(6)
shareMaxView Int? @default(0)
shareViewCount Int? @default(0)
metadata Json? @db.Json
accountId Int?
createdAt DateTime @default(now()) @db.Timestamptz(6)
Expand Down
1 change: 1 addition & 0 deletions public/fallback-7ih1VBpDWHKhJ-2-n8ZvF.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 0 additions & 28 deletions public/fallback-development.js

This file was deleted.

20 changes: 19 additions & 1 deletion public/locales/ar/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,5 +398,23 @@
"offline": "غير متصل",
"close-background-animation": "إغلاق الخلفية المتحركة",
"custom-bg-tip": "انتقل إلى https://www.shadergradient.co/ لإنشاء خلفية التدرج الخاصة بك",
"custom-background-url": "الخلفية المخصصة"
"custom-background-url": "الخلفية المخصصة",
"share": "مشاركة",
"need-password-to-access": "مطلوب كلمة مرور للوصول",
"password-error": "خطأ في كلمة المرور",
"cancel-share": "إلغاء المشاركة",
"create-share": "إنشاء مشاركة",
"share-link": "حصة الرابط",
"set-access-password": "قم بتعيين كلمة مرور الوصول",
"protect-your-shared-content": "حافظ على محتواك المشترك",
"access-password": "كلمة مرور الوصول",
"select-date": "حدد التاريخ",
"expiry-time": "وقت انتهاء الصلاحية",
"select-expiry-time": "اختر وقت انتهاء الصلاحية",
"permanent-valid": "صالح دائما",
"7days-expiry": "انتهاء صلاحية بعد 7 أيام",
"custom-expiry": "انتهاء مخصص",
"30days-expiry": "انتهاء صلاحية خلال 30 يومًا",
"share-link-expired": "انتهت صلاحية الرابط المشاركة",
"share-link-expired-desc": "لقد انتهت صلاحية هذا المشاركة، يرجى الاتصال بالمسؤول لإعادة مشاركتها!"
}
20 changes: 19 additions & 1 deletion public/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,23 @@
"offline": "Offline",
"close-background-animation": "Schließen der Hintergrundanimation",
"custom-bg-tip": "Gehe zu https://www.shadergradient.co/, um deinen eigenen Verlaufshintergrund zu erstellen.",
"custom-background-url": "Benutzerdefinierten Hintergrund"
"custom-background-url": "Benutzerdefinierten Hintergrund",
"share": "Teilen",
"need-password-to-access": "Passwortzugriff erforderlich",
"password-error": "Passwortfehler",
"cancel-share": "Stornieren Freigeben",
"create-share": "Erstellen Teilen",
"share-link": "Freigabelink",
"set-access-password": "Legen Sie das Zugriffspasswort fest",
"protect-your-shared-content": "Schütze deine gemeinsamen Inhalte.",
"access-password": "Zugriffspasswort",
"select-date": "Wählen Sie ein Datum aus",
"expiry-time": "Verfallszeit",
"select-expiry-time": "Wählen Sie das Ablaufdatum aus.",
"permanent-valid": "Dauerhaft gültig",
"7days-expiry": "7 Tage Ablauf",
"custom-expiry": "Benutzerdefiniertes Ablaufdatum",
"30days-expiry": "30 Tage Ablauf",
"share-link-expired": "Freigabelink abgelaufen",
"share-link-expired-desc": "Dieser Link ist abgelaufen. Bitte wenden Sie sich an den Administrator, um ihn erneut freizugeben!"
}
20 changes: 19 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,23 @@
"offline": "Offline",
"close-background-animation": "Close Background Animation",
"custom-background-url": "Custom Background",
"custom-bg-tip": "Go to https://www.shadergradient.co/ to create your own gradient background"
"custom-bg-tip": "Go to https://www.shadergradient.co/ to create your own gradient background",
"share": "Share",
"need-password-to-access": "Password access required",
"password-error": "Password error",
"create-share": "Create Share",
"cancel-share": "Cancel Share",
"share-link": "Share Link",
"set-access-password": "Set access password",
"protect-your-shared-content": "Protect your shared content",
"access-password": "Access password",
"select-date": "Select date",
"expiry-time": "Expiry Time",
"select-expiry-time": "Select Expiry Time",
"permanent-valid": "Permanent Valid",
"7days-expiry": "7 Days Expiry",
"30days-expiry": "30 Days Expiry",
"custom-expiry": "Custom Expiry",
"share-link-expired": "Share Link Expired",
"share-link-expired-desc": "This share has expired please contact the administrator to re-share!"
}
20 changes: 19 additions & 1 deletion public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,5 +376,23 @@
"offline": "Sin conexión",
"close-background-animation": "Cerrar Animación de Fondo",
"custom-bg-tip": "Ve a https://www.shadergradient.co/ para crear tu propio fondo degradado.",
"custom-background-url": "Fondo personalizado"
"custom-background-url": "Fondo personalizado",
"share": "Compartir",
"need-password-to-access": "Se requiere contraseña para acceder.",
"password-error": "Error de contraseña",
"cancel-share": "Cancelar Compartir",
"create-share": "Crear Compartir",
"share-link": "Compartir enlace",
"set-access-password": "Establecer contraseña de acceso",
"protect-your-shared-content": "Proteja su contenido compartido",
"access-password": "Contraseña de acceso",
"select-date": "Seleccionar fecha",
"expiry-time": "Tiempo de expiración",
"select-expiry-time": "Seleccionar tiempo de vencimiento",
"permanent-valid": "Válido permanente",
"7days-expiry": "Caducidad de 7 días",
"custom-expiry": "Caducidad personalizada",
"30days-expiry": "Caducidad de 30 días.",
"share-link-expired": "Enlace compartido caducado",
"share-link-expired-desc": "¡Esta compartición ha caducado, por favor contacta al administrador para volver a compartir!"
}
20 changes: 19 additions & 1 deletion public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,5 +373,23 @@
"offline": "Hors ligne",
"close-background-animation": "Animation d'arrière-plan proche",
"custom-bg-tip": "Allez sur https://www.shadergradient.co/ pour créer votre propre arrière-plan dégradé.",
"custom-background-url": "Arrière-plan personnalisé"
"custom-background-url": "Arrière-plan personnalisé",
"share": "Partager",
"need-password-to-access": "Accès par mot de passe requis",
"password-error": "Erreur de mot de passe",
"cancel-share": "Annuler le partage",
"create-share": "Créer Partager",
"share-link": "Partager le lien",
"set-access-password": "Définir le mot de passe d'accès",
"protect-your-shared-content": "Protégez votre contenu partagé.",
"access-password": "Mot de passe d'accès",
"select-date": "Sélectionner la date",
"expiry-time": "Heure d'expiration",
"select-expiry-time": "Sélectionnez l'heure d'expiration",
"permanent-valid": "Valide en permanence",
"7days-expiry": "Expiration de 7 jours",
"custom-expiry": "Expiration personnalisée",
"30days-expiry": "30 jours d'expiration",
"share-link-expired": "Lien partagé expiré",
"share-link-expired-desc": "Cette part a expiré, veuillez contacter l'administrateur pour la re-partager !"
}
20 changes: 19 additions & 1 deletion public/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,5 +358,23 @@
"offline": "オフライン",
"close-background-animation": "背景アニメーションを閉じる",
"custom-bg-tip": "https://www.shadergradient.co/ にアクセスして、独自のグラデーション背景を作成してください。",
"custom-background-url": "カスタム背景"
"custom-background-url": "カスタム背景",
"share": "共有",
"need-password-to-access": "パスワードアクセスが必要です",
"password-error": "パスワードエラー",
"cancel-share": "共有をキャンセル",
"create-share": "共有を作成する",
"share-link": "共有リンク",
"set-access-password": "アクセスパスワードを設定します",
"protect-your-shared-content": "共有コンテンツを保護します。",
"access-password": "アクセスパスワード",
"select-date": "日付を選択してください。",
"expiry-time": "有効期限",
"select-expiry-time": "有効期限を選択します",
"permanent-valid": "永久有効",
"7days-expiry": "有効期限7日間",
"custom-expiry": "カスタム有効期限",
"30days-expiry": "30日有効期限",
"share-link-expired": "共有リンクの期限切れ",
"share-link-expired-desc": "この共有は期限切れです。再共有するには管理者に連絡してください!"
}
20 changes: 19 additions & 1 deletion public/locales/ko/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,5 +381,23 @@
"offline": "오프라인.",
"close-background-animation": "배경 애니메이션 닫기",
"custom-bg-tip": "https://www.shadergradient.co/ 에 방문하여 자체 그라데이션 배경을 만드세요.",
"custom-background-url": "사용자 정의 배경"
"custom-background-url": "사용자 정의 배경",
"share": "공유하기",
"need-password-to-access": "비밀번호로 접근이 필요합니다.",
"password-error": "비밀번호 오류",
"cancel-share": "공유 취소",
"create-share": "공유 만들기",
"share-link": "공유 링크",
"set-access-password": "액세스 암호 설정",
"protect-your-shared-content": "공유된 콘텐츠를 보호하세요.",
"access-password": "액세스 비밀번호",
"select-date": "날짜 선택",
"expiry-time": "만료 시간",
"select-expiry-time": "만료 시간 선택",
"permanent-valid": "영구적 유효",
"7days-expiry": "7일 만료",
"custom-expiry": "사용자 정의 만료",
"30days-expiry": "30일 만료",
"share-link-expired": "공유 링크가 만료되었습니다.",
"share-link-expired-desc": "이 공유가 만료되었습니다. 다시 공유하려면 관리자에게 문의하세요!"
}
20 changes: 19 additions & 1 deletion public/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,23 @@
"offline": "Offline",
"close-background-animation": "Fechar Animação de Fundo",
"custom-bg-tip": "Acesse https://www.shadergradient.co/ para criar seu próprio fundo de gradiente.",
"custom-background-url": "Fundo Personalizado"
"custom-background-url": "Fundo Personalizado",
"share": "Compartilhar",
"need-password-to-access": "Acesso com senha é necessário",
"password-error": "Erro de senha",
"cancel-share": "Cancelar Compartilhar",
"create-share": "Criar Compartilhar",
"share-link": "Compartilhar Link",
"set-access-password": "Definir senha de acesso",
"protect-your-shared-content": "Proteja seu conteúdo compartilhado",
"access-password": "Senha de acesso",
"select-date": "Selecionar data",
"expiry-time": "Tempo de validade",
"select-expiry-time": "Selecionar Tempo de Expiração",
"permanent-valid": "Válido permanentemente.",
"7days-expiry": "Validade de 7 dias",
"custom-expiry": "Validade personalizada",
"30days-expiry": "30 Dias de Validade",
"share-link-expired": "O link compartilhado expirou",
"share-link-expired-desc": "Esta partilha expirou, por favor entre em contato com o administrador para recriar a partilha!"
}
20 changes: 19 additions & 1 deletion public/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,5 +317,23 @@
"offline": "Офлайн",
"close-background-animation": "Закрыть фоновую анимацию",
"custom-bg-tip": "Перейдите на https://www.shadergradient.co/, чтобы создать свой собственный градиентный фон.",
"custom-background-url": "Пользовательский фон"
"custom-background-url": "Пользовательский фон",
"share": "Поделиться",
"need-password-to-access": "Требуется пароль для доступа",
"password-error": "Ошибка пароля",
"cancel-share": "Отменить публикацию",
"create-share": "Создать Совместно",
"share-link": "Поделиться ссылкой",
"set-access-password": "Установите пароль доступа",
"protect-your-shared-content": "Защищайте ваш общий контент",
"access-password": "Пароль доступа",
"select-date": "Выберите дату",
"expiry-time": "Время окончания",
"select-expiry-time": "Выберите время истечения.",
"permanent-valid": "Постоянно действительный",
"7days-expiry": "Истекает через 7 дней",
"custom-expiry": "Пользовательский срок действия",
"30days-expiry": "Срок действия 30 дней",
"share-link-expired": "Ссылка для обмена устарела",
"share-link-expired-desc": "Эта доля истекла, пожалуйста, свяжитесь с администратором для повторного обмена."
}
20 changes: 19 additions & 1 deletion public/locales/tr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,5 +327,23 @@
"offline": "Çevrimdışı",
"close-background-animation": "Arka Plan Animasyonunu Kapat",
"custom-bg-tip": "Kendi gradyan arka planınızı oluşturmak için https://www.shadergradient.co/ adresine gidin.",
"custom-background-url": "Özel Arka Plan"
"custom-background-url": "Özel Arka Plan",
"share": "Paylaşmak",
"need-password-to-access": "Şifre erişimi gereklidir",
"password-error": "Şifre hatası",
"cancel-share": "Paylaşımı İptal Et",
"create-share": "Paylaşım Oluştur",
"share-link": "Paylaşma Bağlantısı",
"set-access-password": "Erişim şifresi ayarla",
"protect-your-shared-content": "Paylaşılan içeriğinizi koruyun",
"access-password": "Şifreye erişim",
"select-date": "Tarih seçiniz",
"expiry-time": "Son Kullanma Tarihi",
"select-expiry-time": "Son Kullanma Tarihini Seç",
"permanent-valid": "Sürekli Geçerli",
"7days-expiry": "7 Gün Son Kullanım Tarihi",
"custom-expiry": "Özel Son Kullanma Tarihi",
"30days-expiry": "30 Gün Son Kullanma Tarihi",
"share-link-expired": "Paylaşım Bağlantısı Süresi Doldu",
"share-link-expired-desc": "Bu paylaşımın süresi doldu, lütfen tekrar paylaşım yapabilmek için yöneticiyle iletişime geçin!"
}
20 changes: 19 additions & 1 deletion public/locales/zh-TW/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -414,5 +414,23 @@
"offline": "離線",
"close-background-animation": "關閉背景動畫",
"custom-bg-tip": "前往https://www.shadergradient.co/ 創建您自己的漸層背景。",
"custom-background-url": "自訂背景"
"custom-background-url": "自訂背景",
"share": "分享",
"need-password-to-access": "需要密碼訪問",
"password-error": "密碼錯誤",
"cancel-share": "取消分享",
"create-share": "創建分享",
"share-link": "分享連結",
"set-access-password": "設置存取密碼",
"protect-your-shared-content": "保護您的共享內容",
"access-password": "存取密碼",
"select-date": "選擇日期",
"expiry-time": "到期時間",
"select-expiry-time": "選擇到期時間",
"permanent-valid": "永久有效",
"7days-expiry": "7天到期",
"custom-expiry": "自訂到期",
"30days-expiry": "30天到期",
"share-link-expired": "分享連結已過期",
"share-link-expired-desc": "此分享已過期,請聯繫管理員重新分享!"
}
20 changes: 19 additions & 1 deletion public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,5 +404,23 @@
"offline": "离线",
"close-background-animation": "关闭背景动画",
"custom-bg-tip": "访问 https://www.shadergradient.co/ 创建您自己的渐变背景",
"custom-background-url": "自定义背景"
"custom-background-url": "自定义背景",
"share": "分享",
"need-password-to-access": "密码访问已被要求",
"password-error": "密码错误",
"create-share": "创建分享",
"cancel-share": "取消分享",
"share-link": "分享链接",
"set-access-password": "设置访问密码",
"access-password": "访问密码",
"protect-your-shared-content": "保护您分享的内容",
"select-date": "选择日期",
"expiry-time": "过期时间",
"select-expiry-time": "选择到期时间",
"permanent-valid": "永久有效",
"7days-expiry": "7天到期",
"custom-expiry": "自定义到期",
"30days-expiry": "30天有效期",
"share-link-expired": "分享链接已过期",
"share-link-expired-desc": "这份共享已过期,请联系管理员重新共享!"
}
Loading

0 comments on commit 9795776

Please sign in to comment.