From 2a339afee3171ff664993b8d6b6eafce4be5517d Mon Sep 17 00:00:00 2001 From: Samer Salameh Date: Wed, 18 Nov 2026 15:01:25 +0300 Subject: [PATCH] Permits list: shortcuts to the tender order permits and distribution summary reports Shown per report permission, same as the orders report shortcut. Co-Authored-By: Claude Sonnet 5.5 --- web/src/features/grains-permits/pages.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/web/src/features/grains-permits/pages.tsx b/web/src/features/grains-permits/pages.tsx index d936ed5..5e55e51 100644 --- a/web/src/features/grains-permits/pages.tsx +++ b/web/src/features/grains-permits/pages.tsx @@ -42,6 +42,8 @@ import { formatDate, formatNumber } from '@/components/meta/format'; import { elementToPdfUrl, type PdfOrientation } from '@/lib/pdf'; import { useFeatureUi } from '@/i18n/useUi'; import { useAuth } from '@/providers/AuthProvider'; +import AssessmentIcon from '@mui/icons-material/Assessment'; +import reportStrings from '../grains-reports/strings'; import { useConfirm } from '@/providers/ConfirmProvider'; import { useToast } from '@/providers/ToastProvider'; import { @@ -211,7 +213,10 @@ function usePermitActions() { // ================================================================= permit list (GNPermits.cfm) export function PermitsPage() { const { t, lang } = useFeatureUi(strings); - const { user } = useAuth(); + const { user, can } = useAuth(); + const navigate = useNavigate(); + // shortcuts to the reports of this screen, shown with the permission of each report menu entry + const reportLinks = (['tender-order', 'distribution-summary'] as const).filter((k) => can(`grains.reports.t.${k}`)); const { run, element } = usePermitActions(); const companyUser = Number(user?.stkId) === 62; // legacy session.stkid = 62 const showRevoked = String(user?.userId ?? '').toUpperCase() === 'GTOM1'; // legacy: only this login sees "ملغي" @@ -238,6 +243,11 @@ export function PermitsPage() { title={t('pm.list.title')} subtitle={t('pm.list.subtitle')} actions={( <> + {reportLinks.map((k) => ( + + ))} {canVoiceCall && (