From 3ca5c342c38e22cc760742d310f9c686c276970d Mon Sep 17 00:00:00 2001 From: mihretue Date: Tue, 18 Aug 2026 11:32:42 +0000 Subject: [PATCH] fix(question): collapse row actions into a dropdown menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Matches the exams table's action pattern — a single Actions button opening a menu, instead of a row of inline buttons/icons that got crowded once a question had submit/approve/reject/retire/edit/delete all applicable at once. Co-Authored-By: Claude Sonnet 5 --- .../question/pages/QuestionPage/actions.tsx | 108 ++++++++++-------- 1 file changed, 63 insertions(+), 45 deletions(-) diff --git a/apps/backoffice/src/app/features/question/pages/QuestionPage/actions.tsx b/apps/backoffice/src/app/features/question/pages/QuestionPage/actions.tsx index 05f1b02fb..fcea510ff 100644 --- a/apps/backoffice/src/app/features/question/pages/QuestionPage/actions.tsx +++ b/apps/backoffice/src/app/features/question/pages/QuestionPage/actions.tsx @@ -1,5 +1,11 @@ -import { ActionIcon, Button, Group } from '@mantine/core'; -import { IconEdit, IconGavel, IconSend, IconTrash } from '@tabler/icons-react'; +import { Button, Menu } from '@mantine/core'; +import { + IconChevronDown, + IconEdit, + IconGavel, + IconSend, + IconTrash, +} from '@tabler/icons-react'; import type { TFunction } from 'i18next'; import type { AdvancedColumn } from '@ema-platform/ui'; import { LICENSE_PERMISSIONS, RequirePermission } from '@ema-platform/auth'; @@ -21,52 +27,64 @@ export function questionActionsColumn( cell: ({ row }) => { const q = row.original; return ( - - {(q.status === 'DRAFT' || q.status === 'REJECTED') && ( + + + + + + {(q.status === 'DRAFT' || q.status === 'REJECTED') && ( + + } + onClick={() => handlers.onSubmitForApproval(q)} + > + {t('question.qc.submit')} + + + )} + {q.status === 'PENDING_APPROVAL' && ( + + handlers.onReview(q, 'APPROVED')}> + {t('question.qc.approve')} + + handlers.onReview(q, 'REJECTED')}> + {t('question.qc.reject')} + + + )} + {q.status === 'APPROVED' && ( + + } + onClick={() => handlers.onReview(q, 'RETIRED')} + > + {t('question.qc.retire')} + + + )} - + {t('question.action.delete', 'Delete')} + - )} - {q.status === 'PENDING_APPROVAL' && ( - - - - - )} - {q.status === 'APPROVED' && ( - - - - )} - - handlers.onEdit(q)}> - - - handlers.onDelete(q)}> - - - - + + ); }, };