From b5c5ed7a61c0eb530930a4b793a95462c375b353 Mon Sep 17 00:00:00 2001 From: Rohit Date: Tue, 29 Apr 2025 00:19:27 +0530 Subject: [PATCH] feat: check action exists in workflow --- .../action/ActionDescriptionBox.tsx | 103 +++++++++++++++++- 1 file changed, 99 insertions(+), 4 deletions(-) diff --git a/src/components/action/ActionDescriptionBox.tsx b/src/components/action/ActionDescriptionBox.tsx index d36db407..f3bfcd95 100644 --- a/src/components/action/ActionDescriptionBox.tsx +++ b/src/components/action/ActionDescriptionBox.tsx @@ -49,14 +49,24 @@ const Content = styled.div` text-align: left; `; - const ActionDescriptionBox = ({ isDarkMode }: { isDarkMode: boolean }) => { const { t } = useTranslation(); - const { getText, getScreenshot, getList, captureStage } = useActionContext() as { + const { + getText, + getScreenshot, + getList, + captureStage, + actionsInWorkflow + } = useActionContext() as { getText: boolean; getScreenshot: boolean; getList: boolean; captureStage: 'initial' | 'pagination' | 'limit' | 'complete'; + actionsInWorkflow: { + text: boolean; + list: boolean; + screenshot: boolean; + }; }; const messages = [ @@ -118,10 +128,95 @@ const ActionDescriptionBox = ({ isDarkMode }: { isDarkMode: boolean }) => { ); } else { + const actionsInWorkflowCount = Object.values(actionsInWorkflow).filter(Boolean).length; + return ( <> - {t('action_description.default.title')} - {t('action_description.default.description')} + + {actionsInWorkflowCount === 0 + ? t('action_description.default.title') + : t('action_description.workflow_progress.title')} + + + {actionsInWorkflowCount === 0 ? ( + + {t('action_description.default.description')} + + ) : ( + <> + + {t('action_description.workflow_actions.description')} + + + + {actionsInWorkflow.text && ( + + } + label={ + + {t('action_description.actions.text')} + + } + /> + )} + + {actionsInWorkflow.list && ( + + } + label={ + + {t('action_description.actions.list')} + + } + /> + )} + + {actionsInWorkflow.screenshot && ( + + } + label={ + + {t('action_description.actions.screenshot')} + + } + /> + )} + + + )} ); }