Bladeren bron

Hide the copy button when there is no content to copy (#4546)

tags/0.6.9
非法操作 1 jaar geleden
bovenliggende
commit
ee53f98d8c
No account linked to committer's email address
1 gewijzigde bestanden met toevoegingen van 15 en 14 verwijderingen
  1. 15
    14
      web/app/components/workflow/panel/workflow-preview.tsx

+ 15
- 14
web/app/components/workflow/panel/workflow-preview.tsx Bestand weergeven

@@ -119,20 +119,21 @@ const WorkflowPreview = () => {
error={workflowRunningData?.result?.error}
onClick={() => switchTab('DETAIL')}
/>
<SimpleBtn
isDisabled={workflowRunningData?.result.status !== WorkflowRunningStatus.Succeeded}
className={cn('ml-4 mb-4 inline-flex space-x-1')}
onClick={() => {
const content = workflowRunningData?.resultText
if (typeof content === 'string')
copy(content)
else
copy(JSON.stringify(content))
Toast.notify({ type: 'success', message: t('common.actionMsg.copySuccessfully') })
}}>
<Clipboard className='w-3.5 h-3.5' />
<div>{t('common.operation.copy')}</div>
</SimpleBtn>
{(workflowRunningData?.result.status !== WorkflowRunningStatus.Succeeded || !workflowRunningData?.resultText) && (
<SimpleBtn
className={cn('ml-4 mb-4 inline-flex space-x-1')}
onClick={() => {
const content = workflowRunningData?.resultText
if (typeof content === 'string')
copy(content)
else
copy(JSON.stringify(content))
Toast.notify({ type: 'success', message: t('common.actionMsg.copySuccessfully') })
}}>
<Clipboard className='w-3.5 h-3.5' />
<div>{t('common.operation.copy')}</div>
</SimpleBtn>
)}
</>
)}
{currentTab === 'DETAIL' && (

Laden…
Annuleren
Opslaan