Skip to content

Commit

Permalink
remove closeModal
Browse files Browse the repository at this point in the history
  • Loading branch information
adhityamamallan committed Jan 15, 2025
1 parent d15f684 commit 7474cda
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const mockWorkflowActionsConfig = [
getIsEnabled: () => true,
apiRoute: 'cancel',
onSuccess: (params) => {
params.onCloseModal();
params.sendNotification('Mock notification');
},
},
Expand All @@ -23,7 +22,6 @@ export const mockWorkflowActionsConfig = [
getIsEnabled: () => false,
apiRoute: 'terminate',
onSuccess: (params) => {
params.onCloseModal();
params.sendNotification('Mock notification');
},
},
Expand Down
6 changes: 2 additions & 4 deletions src/views/workflow-actions/config/workflow-actions.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ const workflowPageActionsConfig: [
workflow.workflowExecutionInfo?.closeEvent?.attributes ?? ''
),
apiRoute: 'cancel',
onSuccess: ({ onCloseModal, sendNotification }) => {
onCloseModal();
onSuccess: ({ sendNotification }) => {
sendNotification('Workflow cancellation has been requested.');
},
},
Expand All @@ -35,8 +34,7 @@ const workflowPageActionsConfig: [
workflow.workflowExecutionInfo?.closeEvent?.attributes ?? ''
),
apiRoute: 'terminate',
onSuccess: ({ onCloseModal, sendNotification }) => {
onCloseModal();
onSuccess: ({ sendNotification }) => {
sendNotification('Workflow has been terminated.');
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ export default function WorkflowActionsModalContent<R>({
queryKey: ['describe_workflow', workflowDetailsParams],
});

onCloseModal();

action.onSuccess({
result,
inputParams: params,
onCloseModal,
sendNotification: (message, duration) =>
enqueue(
{
Expand Down
1 change: 0 additions & 1 deletion src/views/workflow-actions/workflow-actions.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export type WorkflowActionOnSuccessParams<R> = {
result: R;
inputParams: WorkflowActionInputParams;
sendNotification: (message: React.ReactNode, duration?: Duration) => void;
onCloseModal: () => void;
};

export type WorkflowAction<R> = {
Expand Down

0 comments on commit 7474cda

Please sign in to comment.