Skip to content

Commit

Permalink
feat(backoffice-v2): assign dropdown is now disabled once the workflo…
Browse files Browse the repository at this point in the history
…w is completed (#2327)
  • Loading branch information
Omri-Levy committed Apr 28, 2024
1 parent c30aa8d commit 3997fb7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Expand Up @@ -35,6 +35,7 @@ export const Actions: FunctionComponent<IActionsProps> = ({
assignees,
onMutateAssignWorkflow,
workflowDefinition,
isWorkflowCompleted,
} = useCaseActionsLogic({ workflowId: id, fullName });

return (
Expand All @@ -47,6 +48,7 @@ export const Actions: FunctionComponent<IActionsProps> = ({
onMutateAssignWorkflow(id, id === authenticatedUser?.id);
}}
authenticatedUserId={authenticatedUser?.id}
isDisabled={isWorkflowCompleted}
/>
</div>
<div className={`flex h-20 justify-between`}>
Expand Down
Expand Up @@ -57,6 +57,8 @@ export const useCaseActionsLogic = ({ workflowId, fullName }: IUseActions) => {
}
: undefined;

const isWorkflowCompleted = workflow?.status === 'completed';

return {
isActionButtonDisabled,
onMutateAssignWorkflow,
Expand All @@ -74,5 +76,6 @@ export const useCaseActionsLogic = ({ workflowId, fullName }: IUseActions) => {
tag,
workflow,
workflowDefinition: workflow?.workflowDefinition,
isWorkflowCompleted,
};
};
2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations
@@ -1,9 +1,6 @@
import {
Business,
EndUser,
PaymentAcquirer,
PaymentBrandName,
PaymentChannel,
PaymentGateway,
PaymentIssuer,
PaymentMethod,
Expand All @@ -18,6 +15,14 @@ import {
import { faker } from '@faker-js/faker';
import { generateBusiness, generateEndUser } from '../generate-end-user';

const PaymentChannel = {
online: 'online',
mobile_app: 'mobile_app',
in_store: 'in_store',
telephone: 'telephone',
mail_order: 'mail_order',
};

export const generateTransactions = async (
prismaClient: PrismaClient,
{
Expand Down

0 comments on commit 3997fb7

Please sign in to comment.