From 49e1a796ed03f8f6e2b703559fa1c69596d4e942 Mon Sep 17 00:00:00 2001 From: fahed Date: Mon, 16 Mar 2026 14:17:08 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20code=20review=20=E2=80=94=20security,=20?= =?UTF-8?q?dead=20code,=20performance,=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Critical fixes: - XSS: escapeHtml() on all user-supplied text in email notifications - Budget PATCH: added mutex lock + availability validation (prevents corruption) - batchResolveNames: fixed wrong signature for budget request earmark names Dead code cleanup: - Deleted 8 unused PostComposition* files (replaced by PostDetail full page) Performance: - budget-helpers: single-fetch with computeFromEntries(), optional prefetch param - post-composition: parallelized text + thumbnail fetches with Promise.all Consistency: - PostDetail.jsx: native { - setEditProjectId(e.target.value) - handleUpdateField('project_id', e.target.value) - }} - className="w-full px-3 py-2 text-sm border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-brand-primary/20 bg-surface" - > - - {projects.map(p => )} - - -
-

{t('artefacts.campaign')}

- -
- - )} @@ -500,21 +469,16 @@ export default function ArtefactDetailPanel({ artefact, onClose, onUpdate, onDel {['draft', 'revision_requested', 'rejected'].includes(artefact.status) && (

{t('artefacts.reviewer')}

- + />
)} diff --git a/client/src/components/ArtefactDetailVersionsTab.jsx b/client/src/components/ArtefactDetailVersionsTab.jsx index 9c81ee0..301e1ce 100644 --- a/client/src/components/ArtefactDetailVersionsTab.jsx +++ b/client/src/components/ArtefactDetailVersionsTab.jsx @@ -1,5 +1,7 @@ import { useState } from 'react' -import { Plus, Upload, Trash2, Globe, Image as ImageIcon } from 'lucide-react' +import { Plus, Trash2, Globe, Image as ImageIcon } from 'lucide-react' +import PortalSelect from './PortalSelect' +import UploadZone from './UploadZone' import { useLanguage } from '../i18n/LanguageContext' import Modal from './Modal' import ArtefactVersionTimeline from './ArtefactVersionTimeline' @@ -172,29 +174,17 @@ export function ArtefactDetailVersionsTab({ {/* DESIGN TYPE: Image gallery */} {artefact.type === 'design' && (
-
-

{t('artefacts.imagesLabel')}

- -
+

{t('artefacts.imagesLabel')}

- {versionData.attachments && versionData.attachments.length > 0 ? ( -
+ {versionData.attachments && versionData.attachments.length > 0 && ( +
{versionData.attachments.map(att => (
{att.original_name}
- ) : ( -
- -

{t('artefacts.noImages')}

-
)} + 0} + />
)} @@ -256,30 +250,14 @@ export function ArtefactDetailVersionsTab({ )} {/* Drag-and-drop / click-to-upload zone */} -