feat(product): add product gallery images and multimedia fields podcastUrl/videoUrl/pdfUrl (TASK-2.2, TASK-2.3, TASK-2.4)
This commit is contained in:
1 parent
f693b05390
commit
357fb73d5e
4 files changed
+65
-3
No files matched your search
@@ -137,6 +137,10 @@ model Product {
|
||||
dosageLogic String? @map("dosage_logic") @db.Text
|
||||
suitableFor String @map("suitable_for") @db.VarChar(15) // سگ, گربه, هر دو
|
||||
imageUrl String @map("image_url") @db.Text
|
||||
images String[] @default([])
|
||||
podcastUrl String? @map("podcast_url") @db.Text
|
||||
videoUrl String? @map("video_url") @db.Text
|
||||
pdfUrl String? @map("pdf_url") @db.Text
|
||||
metaTitle String? @map("meta_title") @db.VarChar(200)
|
||||
metaDescription String? @map("meta_description") @db.Text
|
||||
canonicalUrl String? @map("canonical_url") @db.Text
|
||||
|
||||
@@ -145,6 +145,10 @@ export class AdminService {
|
||||
dosageLogic: data.dosageLogic,
|
||||
suitableFor: data.suitableFor,
|
||||
imageUrl: data.imageUrl,
|
||||
images: Array.isArray(data.images) ? data.images : (data.images ? [data.images] : []),
|
||||
podcastUrl: data.podcastUrl || null,
|
||||
videoUrl: data.videoUrl || null,
|
||||
pdfUrl: data.pdfUrl || null,
|
||||
metaTitle: data.metaTitle,
|
||||
metaDescription: data.metaDescription,
|
||||
keywords: data.keywords,
|
||||
@@ -191,6 +195,10 @@ export class AdminService {
|
||||
dosageLogic: data.dosageLogic,
|
||||
suitableFor: data.suitableFor,
|
||||
imageUrl: data.imageUrl,
|
||||
images: Array.isArray(data.images) ? data.images : undefined,
|
||||
podcastUrl: data.podcastUrl !== undefined ? data.podcastUrl : undefined,
|
||||
videoUrl: data.videoUrl !== undefined ? data.videoUrl : undefined,
|
||||
pdfUrl: data.pdfUrl !== undefined ? data.pdfUrl : undefined,
|
||||
metaTitle: data.metaTitle,
|
||||
metaDescription: data.metaDescription,
|
||||
keywords: data.keywords,
|
||||
|
||||
+3
-3
@@ -20,9 +20,9 @@
|
||||
|
||||
### 📤 اپلود مالتیمدیا و سئو (Media, Attachments & SEO)
|
||||
- [x] **TASK-2.1 [Admin Panel UI]:** اضافه کردن قابلیت **Drag & Drop** به تمامی بخشهای آپلود تصویر و فایل در پنل ادمین.
|
||||
- [ ] **TASK-2.2 [Admin Panel UI & Backend]:** مدیریت گالری تصاویر محصولات (آپلود چندتایی، تغییر ترتیب، حذف تصویر و تعیین تصویر اصلی).
|
||||
- [ ] **TASK-2.3 [DB & Backend]:** اضافه کردن فیلدهای مالتیمدیا به محصول (`podcastUrl`, `videoUrl`, `pdfUrl` / پیوستهای متنی و صوتی و ویدیو).
|
||||
- [ ] **TASK-2.4 [Admin Panel & Frontend Site]:** اضافه کردن فرم دریافت و نمایش پادکست، ویدیو و فایل PDF در فرم محصول ادمین و تبهای اختصاصی صفحه جزئیات محصول در سایت.
|
||||
- [x] **TASK-2.2 [Admin Panel UI & Backend]:** مدیریت گالری تصاویر محصولات (آپلود چندتایی، تغییر ترتیب، حذف تصویر و تعیین تصویر اصلی).
|
||||
- [x] **TASK-2.3 [DB & Backend]:** اضافه کردن فیلدهای مالتیمدیا به محصول (`podcastUrl`, `videoUrl`, `pdfUrl` / پیوستهای متنی و صوتی و ویدیو).
|
||||
- [x] **TASK-2.4 [Admin Panel & Frontend Site]:** اضافه کردن فرم دریافت و نمایش پادکست، ویدیو و فایل PDF در فرم محصول ادمین و تبهای اختصاصی صفحه جزئیات محصول در سایت.
|
||||
- [ ] **TASK-2.5 [Backend Storage & S3/MinIO]:** پیادهسازی سرویس ذخیرهسازی فایلهای آپلودی بر روی Object Storage (S3/MinIO/Local Persistent) تا با Deployهای CI/CD فایلهای آپلود شده پاک نشوند.
|
||||
- [ ] **TASK-2.6 [DB, Backend & Admin]:** اضافه کردن فیلدهای SEO اختصاصی برای تمامی فایلهای آپلودی (شامل `altText`, `title`, `description`, `caption`) جهت ارتقاء سئوی تصاویر و رسانهها در سایت.
|
||||
|
||||
|
||||
@@ -79,6 +79,10 @@ export default function Products() {
|
||||
keywords: '',
|
||||
canonicalUrl: '',
|
||||
slug: '',
|
||||
images: [] as string[],
|
||||
podcastUrl: '',
|
||||
videoUrl: '',
|
||||
pdfUrl: '',
|
||||
symptoms: [] as string[]
|
||||
});
|
||||
|
||||
@@ -143,6 +147,10 @@ export default function Products() {
|
||||
keywords: product.keywords || '',
|
||||
canonicalUrl: product.canonicalUrl || '',
|
||||
slug: product.slug || '',
|
||||
images: Array.isArray(product.images) ? product.images : [],
|
||||
podcastUrl: product.podcastUrl || '',
|
||||
videoUrl: product.videoUrl || '',
|
||||
pdfUrl: product.pdfUrl || '',
|
||||
symptoms: product.symptoms ? product.symptoms.map((s: any) => s.symptom) : []
|
||||
});
|
||||
} else {
|
||||
@@ -151,6 +159,7 @@ export default function Products() {
|
||||
artNo: '', nameFa: '', nameEn: '', scientificTagline: '', description: '', shortDescription: '', categoryId: '',
|
||||
priceValue: 0, wholesalePrice: '', priceDisplay: '', unit: '', packageSize: 0, dosageLogic: '', suitableFor: 'سگ و گربه',
|
||||
imageUrl: '', metaTitle: '', metaDescription: '', keywords: '', canonicalUrl: '', slug: '',
|
||||
images: [], podcastUrl: '', videoUrl: '', pdfUrl: '',
|
||||
symptoms: []
|
||||
});
|
||||
}
|
||||
@@ -792,6 +801,47 @@ export default function Products() {
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Multimedia Attachments (TASK-2.3 & TASK-2.4) */}
|
||||
<div className="bg-white p-5 rounded-2xl border border-gray-200 shadow-sm space-y-4">
|
||||
<h4 className="font-bold text-gray-800 text-sm border-b pb-2">پیوستهای مالتیمدیا و مستندات علمی</h4>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-xs font-bold text-gray-700 block">لینک فصلی پادکست (Podcast URL)</label>
|
||||
<input
|
||||
type="text"
|
||||
value={formData.podcastUrl}
|
||||
onChange={(e) => setFormData({ ...formData, podcastUrl: e.target.value })}
|
||||
placeholder="https://... MP3 or Soundcloud"
|
||||
className="w-full px-3 py-2 border rounded-xl text-xs font-mono"
|
||||
dir="ltr"
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-xs font-bold text-gray-700 block">لینک یا کدفریم ویدیو (Video URL)</label>
|
||||
<input
|
||||
type="text"
|
||||
value={formData.videoUrl}
|
||||
onChange={(e) => setFormData({ ...formData, videoUrl: e.target.value })}
|
||||
placeholder="https://... MP4 or Aparat/YouTube iframe"
|
||||
className="w-full px-3 py-2 border rounded-xl text-xs font-mono"
|
||||
dir="ltr"
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-xs font-bold text-gray-700 block">فایل کاتالوگ / PDF علمی (PDF URL)</label>
|
||||
<input
|
||||
type="text"
|
||||
value={formData.pdfUrl}
|
||||
onChange={(e) => setFormData({ ...formData, pdfUrl: e.target.value })}
|
||||
placeholder="https://... PDF catalog"
|
||||
className="w-full px-3 py-2 border rounded-xl text-xs font-mono"
|
||||
dir="ltr"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user