refactor: simplify assignment logic and remove bulk claim functionality from license queue page

This commit is contained in:
estifanos
2026-09-07 09:16:26 +00:00
parent 9962e2b9e7
commit 5a6a3579d1

View File

@@ -55,7 +55,6 @@ import {
AmharicDatePicker,
type AdvancedColumn,
} from "@ema-platform/ui";
import { LICENSE_PERMISSIONS, RequirePermission } from "@ema-platform/auth";
import {
DEFAULT_VIEW,
SAVED_VIEWS,
@@ -404,13 +403,11 @@ export function LicenseQueuePage() {
// "c" now opens the assign dialog on an undispatched row. Kept on the
// same key: it is still "do the queue's primary action to this row",
// and rebinding a shortcut officers have in their fingers costs more
// than the name mismatch.
if (isLogistics !== false && cursorRow && cursorRow.assignedOfficerId === null)
setAssignTarget(cursorRow);
// Only unclaimed rows on a claimable queue can be claimed; pressing c
// elsewhere is a no-op rather than an error the officer has to read.
// than the name mismatch. Only undispatched rows on a queue with an
// unclaimed pool qualify; pressing c elsewhere is a no-op rather than
// an error the officer has to read.
if (claimable && cursorRow && cursorRow.assignedOfficerId === null)
handleClaim(cursorRow.id);
setAssignTarget(cursorRow);
},
onEscape: () => setSelected([]),
onHelp: () => setHelpOpen(true),
@@ -475,12 +472,10 @@ export function LicenseQueuePage() {
assigning,
onAssign: setAssignTarget,
onOpen: (id) => navigate(`/licence-review/${id}`),
// Non-logistics applications aren't dispatched off a shared queue (see
// `savedViewsForFamily`) — every row opens straight to Review.
assignable: isLogistics !== false,
// Applications with no unclaimed pool (see `hasUnclaimedPool`) are
// never claimed — every row opens straight to Review.
claimable,
// never dispatched off a shared queue — every row opens straight to
// Review.
assignable: claimable,
}),
],
[
@@ -774,19 +769,6 @@ export function LicenseQueuePage() {
>
{t("queue.export", "Export CSV")}
</Button>
{claimable && (
<RequirePermission
anyOf={[LICENSE_PERMISSIONS.CLAIM_APPLICATION]}
hideOnly
>
<Button loading={claiming} onClick={handleBulkClaim}>
{t("queue.bulkClaim", {
count: selected.length,
defaultValue: "Claim {{count}}",
})}
</Button>
</RequirePermission>
)}
</Group>
</Group>
</Paper>