fix: require feedback on post rejection, post-specific review text, show superadmins in team list
All checks were successful
Deploy / deploy (push) Successful in 11s

- Reject requires feedback on both client and server (400 if empty)
- PublicPostReview uses post-specific i18n keys instead of artefact ones
- Team list always includes superadmins/managers for non-superadmin users

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
fahed
2026-03-05 15:24:48 +03:00
parent 0e948cbf37
commit 93956ff117
4 changed files with 27 additions and 6 deletions

View File

@@ -46,6 +46,10 @@ export default function PublicPostReview() {
toast.error(t('review.enterName'))
return
}
if (action === 'reject' && !feedback.trim()) {
toast.error(t('review.feedbackRequiredError'))
return
}
setPendingAction(action)
}
@@ -276,7 +280,7 @@ export default function PublicPostReview() {
</div>
<div>
<label className="block text-sm font-medium text-text-primary mb-1">{t('review.feedbackOptional')}</label>
<label className="block text-sm font-medium text-text-primary mb-1">{t('review.feedbackRequired')}</label>
<textarea value={feedback} onChange={e => setFeedback(e.target.value)} rows={4}
placeholder={t('review.feedbackPlaceholder')}
className="w-full px-4 py-2 text-sm border border-border rounded-lg bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-brand-primary/20 focus:border-brand-primary" />
@@ -328,13 +332,13 @@ export default function PublicPostReview() {
<Modal
isOpen={!!pendingAction}
onClose={() => setPendingAction(null)}
title={pendingAction === 'approve' ? t('review.confirmApprove') : t('review.confirmReject')}
title={pendingAction === 'approve' ? t('review.confirmApprovePost') : t('review.confirmRejectPost')}
isConfirm
danger={pendingAction === 'reject'}
onConfirm={() => { const a = pendingAction; setPendingAction(null); executeAction(a) }}
confirmText={pendingAction === 'approve' ? t('review.approve') : t('review.reject')}
>
{pendingAction === 'approve' ? t('review.confirmApproveDesc') : t('review.confirmRejectDesc')}
{pendingAction === 'approve' ? t('review.confirmApprovePostDesc') : t('review.confirmRejectPostDesc')}
</Modal>
</div>
)