mirror of https://github.com/langgenius/dify.git
feat: add jumpToEmailConfigModal function to enhance email configuration navigation in delivery method component
This commit is contained in:
parent
a4b87be5f4
commit
9aa674a04f
|
|
@ -11,7 +11,7 @@ import {
|
|||
RiRobot2Fill,
|
||||
RiSendPlane2Line,
|
||||
} from '@remixicon/react'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { useCallback, useMemo, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import ActionButton, { ActionButtonState } from '@/app/components/base/action-button'
|
||||
import Badge from '@/app/components/base/badge/index'
|
||||
|
|
@ -80,6 +80,11 @@ const DeliveryMethodItem: FC<DeliveryMethodItemProps> = ({
|
|||
return t(`${i18nPrefix}.deliveryMethod.emailSender.testSendTip`, { ns: 'workflow' })
|
||||
}, [method.type, method.config?.debug_mode, t, email])
|
||||
|
||||
const jumpToEmailConfigModal = useCallback(() => {
|
||||
setShowTestEmailModal(false)
|
||||
setShowEmailModal(true)
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
|
|
@ -193,6 +198,7 @@ const DeliveryMethodItem: FC<DeliveryMethodItemProps> = ({
|
|||
nodesOutputVars={nodesOutputVars}
|
||||
availableNodes={availableNodes}
|
||||
onClose={() => setShowTestEmailModal(false)}
|
||||
jumpToEmailConfigModal={jumpToEmailConfigModal}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ type EmailConfigureModalProps = {
|
|||
deliveryId: string
|
||||
isShow: boolean
|
||||
onClose: () => void
|
||||
jumpToEmailConfigModal: () => void
|
||||
config?: EmailConfig
|
||||
formContent?: string
|
||||
formInputs?: FormInputItem[]
|
||||
|
|
@ -69,6 +70,7 @@ const EmailSenderModal = ({
|
|||
deliveryId,
|
||||
isShow,
|
||||
onClose,
|
||||
jumpToEmailConfigModal,
|
||||
config,
|
||||
formContent,
|
||||
formInputs,
|
||||
|
|
@ -293,7 +295,9 @@ const EmailSenderModal = ({
|
|||
<Trans
|
||||
i18nKey={`${i18nPrefix}.deliveryMethod.emailSender.tip`}
|
||||
ns="workflow"
|
||||
components={{ strong: <span className="system-xs-regular text-text-accent"></span> }}
|
||||
components={{
|
||||
strong: <span onClick={jumpToEmailConfigModal} className="system-xs-regular cursor-pointer text-text-accent"></span>,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
|||
Loading…
Reference in New Issue