mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-09-07 13:05:46 +00:00
Merge pull request #31 from Tria-plc/WorkflowChange
Remove 'assign-reviewer' action and related functionality from licens…
This commit is contained in:
@@ -134,10 +134,7 @@ export function DecisionConfirmModal({
|
|||||||
|
|
||||||
if (!action) return null;
|
if (!action) return null;
|
||||||
|
|
||||||
const needsOfficer =
|
const needsOfficer = action.id === 'assign' || action.id === 'escalate';
|
||||||
action.id === 'assign' ||
|
|
||||||
action.id === 'assign-reviewer' ||
|
|
||||||
action.id === 'escalate';
|
|
||||||
const reasonMissing = action.requiresReason && !reason.trim() && !reasonCode;
|
const reasonMissing = action.requiresReason && !reason.trim() && !reasonCode;
|
||||||
const blocked =
|
const blocked =
|
||||||
reasonMissing ||
|
reasonMissing ||
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export type ActionTier =
|
|||||||
export type ActionId =
|
export type ActionId =
|
||||||
| 'claim'
|
| 'claim'
|
||||||
| 'assign'
|
| 'assign'
|
||||||
| 'assign-reviewer'
|
|
||||||
| 'escalate'
|
| 'escalate'
|
||||||
| 'hold'
|
| 'hold'
|
||||||
| 'resume'
|
| 'resume'
|
||||||
@@ -69,18 +68,6 @@ export const ACTIONS: ActionDefinition[] = [
|
|||||||
// Claim is deliberately absent here: an officer claims from the queue
|
// Claim is deliberately absent here: an officer claims from the queue
|
||||||
// (LicenseQueuePage), not from this detail page. That implementation is
|
// (LicenseQueuePage), not from this detail page. That implementation is
|
||||||
// separate — see LicenseQueuePage/actions.tsx — and is unaffected by this.
|
// separate — see LicenseQueuePage/actions.tsx — and is unaffected by this.
|
||||||
{
|
|
||||||
// Starts the review under the push model: the team leader hands a freshly
|
|
||||||
// submitted (or eligibility-paid) file to an employee. Without it a CoC/CoP
|
|
||||||
// sitting in ELIGIBILITY_PAID had no action at all — the server offers only
|
|
||||||
// `claim` (a permission no seeded role holds) and this.
|
|
||||||
id: 'assign-reviewer',
|
|
||||||
tier: 'primary',
|
|
||||||
labelKey: 'review.actions.assignReviewer',
|
|
||||||
from: ['SUBMITTED', 'ELIGIBILITY_PAID'],
|
|
||||||
permissions: ['can:assign:license-application'],
|
|
||||||
emphasis: 'filled',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 'assign',
|
id: 'assign',
|
||||||
tier: 'workflow',
|
tier: 'workflow',
|
||||||
@@ -168,7 +155,9 @@ export const ACTIONS: ActionDefinition[] = [
|
|||||||
id: 'final-approve',
|
id: 'final-approve',
|
||||||
tier: 'primary',
|
tier: 'primary',
|
||||||
labelKey: 'review.actions.finalApprove',
|
labelKey: 'review.actions.finalApprove',
|
||||||
from: ['INSPECTION_COMPLETED', 'UNDER_EVALUATION'],
|
// ELIGIBILITY_PAID: an examined certificate (CoC/CoP) is decided straight
|
||||||
|
// off the eligibility queue — no assignment step.
|
||||||
|
from: ['INSPECTION_COMPLETED', 'UNDER_EVALUATION', 'ELIGIBILITY_PAID'],
|
||||||
permissions: ['can:approve:license-application'],
|
permissions: ['can:approve:license-application'],
|
||||||
emphasis: 'filled',
|
emphasis: 'filled',
|
||||||
color: 'teal',
|
color: 'teal',
|
||||||
@@ -178,7 +167,7 @@ export const ACTIONS: ActionDefinition[] = [
|
|||||||
id: 'request-adjustment',
|
id: 'request-adjustment',
|
||||||
tier: 'primary',
|
tier: 'primary',
|
||||||
labelKey: 'review.actions.requestAdjustment',
|
labelKey: 'review.actions.requestAdjustment',
|
||||||
from: ['UNDER_REVIEW', 'UNDER_EVALUATION', 'INSPECTION_COMPLETED'],
|
from: ['UNDER_REVIEW', 'UNDER_EVALUATION', 'INSPECTION_COMPLETED', 'ELIGIBILITY_PAID'],
|
||||||
permissions: ['can:request-adjustment:license-application'],
|
permissions: ['can:request-adjustment:license-application'],
|
||||||
emphasis: 'light',
|
emphasis: 'light',
|
||||||
color: 'orange',
|
color: 'orange',
|
||||||
@@ -193,6 +182,7 @@ export const ACTIONS: ActionDefinition[] = [
|
|||||||
'UNDER_EVALUATION',
|
'UNDER_EVALUATION',
|
||||||
'INSPECTION_PENDING',
|
'INSPECTION_PENDING',
|
||||||
'INSPECTION_COMPLETED',
|
'INSPECTION_COMPLETED',
|
||||||
|
'ELIGIBILITY_PAID',
|
||||||
],
|
],
|
||||||
permissions: ['can:reject:license-application'],
|
permissions: ['can:reject:license-application'],
|
||||||
emphasis: 'light',
|
emphasis: 'light',
|
||||||
@@ -315,7 +305,6 @@ export interface ResolveContext {
|
|||||||
const WORKFLOW_EVENT_IDS = new Set<ActionId>([
|
const WORKFLOW_EVENT_IDS = new Set<ActionId>([
|
||||||
'claim',
|
'claim',
|
||||||
'assign',
|
'assign',
|
||||||
'assign-reviewer',
|
|
||||||
'escalate',
|
'escalate',
|
||||||
'hold',
|
'hold',
|
||||||
'resume',
|
'resume',
|
||||||
@@ -390,13 +379,9 @@ export function resolveActions(ctx: ResolveContext): ResolvedAction[] {
|
|||||||
disabledReason: reason,
|
disabledReason: reason,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Decisions belong to whoever holds the application. Assigning a
|
// Decisions belong to whoever holds the application.
|
||||||
// reviewer is the team leader handing work out, so it is exempt — the
|
|
||||||
// leader is by definition not the officer who will hold it.
|
|
||||||
const needsOwnership =
|
const needsOwnership =
|
||||||
action.tier === 'primary' &&
|
action.tier === 'primary' && action.id !== 'confirm-payment';
|
||||||
action.id !== 'confirm-payment' &&
|
|
||||||
action.id !== 'assign-reviewer';
|
|
||||||
if (
|
if (
|
||||||
needsOwnership &&
|
needsOwnership &&
|
||||||
app.assignedOfficerId &&
|
app.assignedOfficerId &&
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import {
|
|||||||
useLocalized,
|
useLocalized,
|
||||||
useApproveDocumentsMutation,
|
useApproveDocumentsMutation,
|
||||||
useAssignApplicationMutation,
|
useAssignApplicationMutation,
|
||||||
useAssignReviewerMutation,
|
|
||||||
useClaimApplicationMutation,
|
useClaimApplicationMutation,
|
||||||
useCompleteReviewMutation,
|
useCompleteReviewMutation,
|
||||||
useConfirmPaymentMutation,
|
useConfirmPaymentMutation,
|
||||||
@@ -218,7 +217,6 @@ export function LicenseReviewPage() {
|
|||||||
const [resumeApplication] = useResumeApplicationMutation();
|
const [resumeApplication] = useResumeApplicationMutation();
|
||||||
const [escalateApplication] = useEscalateApplicationMutation();
|
const [escalateApplication] = useEscalateApplicationMutation();
|
||||||
const [assignApplication] = useAssignApplicationMutation();
|
const [assignApplication] = useAssignApplicationMutation();
|
||||||
const [assignReviewer] = useAssignReviewerMutation();
|
|
||||||
// Real officer list, so Assign and Escalate name a person instead of
|
// Real officer list, so Assign and Escalate name a person instead of
|
||||||
// silently reassigning to whoever already held the application.
|
// silently reassigning to whoever already held the application.
|
||||||
const { data: officers = [] } = useGetAssignableOfficersQuery();
|
const { data: officers = [] } = useGetAssignableOfficersQuery();
|
||||||
@@ -672,18 +670,6 @@ export function LicenseReviewPage() {
|
|||||||
t("review.done.escalate", "Escalated"),
|
t("review.done.escalate", "Escalated"),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case "assign-reviewer":
|
|
||||||
if (!submission.officerId) return;
|
|
||||||
await run(
|
|
||||||
() =>
|
|
||||||
assignReviewer({
|
|
||||||
id,
|
|
||||||
officerId: submission.officerId as string,
|
|
||||||
remark: submission.reason,
|
|
||||||
}).unwrap(),
|
|
||||||
t("review.done.assignReviewer", "Review assigned"),
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case "assign":
|
case "assign":
|
||||||
if (!submission.officerId) return;
|
if (!submission.officerId) return;
|
||||||
await run(
|
await run(
|
||||||
|
|||||||
Reference in New Issue
Block a user