mirror of https://github.com/langgenius/dify.git
fix: correct trigger events limit modal wording (#28463)
This commit is contained in:
parent
4b6f4081d6
commit
b4e7239ac7
|
|
@ -1,97 +0,0 @@
|
|||
import type { Meta, StoryObj } from '@storybook/nextjs'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import i18next from 'i18next'
|
||||
import { I18nextProvider } from 'react-i18next'
|
||||
import TriggerEventsLimitModal from '.'
|
||||
import { Plan } from '../type'
|
||||
|
||||
const i18n = i18next.createInstance()
|
||||
i18n.init({
|
||||
lng: 'en',
|
||||
resources: {
|
||||
en: {
|
||||
translation: {
|
||||
billing: {
|
||||
triggerLimitModal: {
|
||||
title: 'Upgrade to unlock unlimited triggers per workflow',
|
||||
description: 'You’ve reached the limit of 2 triggers per workflow for this plan. Upgrade to publish this workflow.',
|
||||
dismiss: 'Dismiss',
|
||||
upgrade: 'Upgrade',
|
||||
usageTitle: 'TRIGGER EVENTS',
|
||||
},
|
||||
usagePage: {
|
||||
triggerEvents: 'Trigger Events',
|
||||
resetsIn: 'Resets in {{count, number}} days',
|
||||
},
|
||||
upgradeBtn: {
|
||||
encourage: 'Upgrade Now',
|
||||
encourageShort: 'Upgrade',
|
||||
plain: 'View Plan',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
const Template = (args: React.ComponentProps<typeof TriggerEventsLimitModal>) => {
|
||||
const [visible, setVisible] = useState<boolean>(args.show ?? true)
|
||||
useEffect(() => {
|
||||
setVisible(args.show ?? true)
|
||||
}, [args.show])
|
||||
const handleHide = () => setVisible(false)
|
||||
return (
|
||||
<I18nextProvider i18n={i18n}>
|
||||
<div className="flex flex-col gap-4">
|
||||
<button
|
||||
className="rounded-lg border border-divider-subtle px-4 py-2 text-sm text-text-secondary hover:border-divider-deep hover:text-text-primary"
|
||||
onClick={() => setVisible(true)}
|
||||
>
|
||||
Open Modal
|
||||
</button>
|
||||
<TriggerEventsLimitModal
|
||||
{...args}
|
||||
show={visible}
|
||||
onDismiss={handleHide}
|
||||
onUpgrade={handleHide}
|
||||
/>
|
||||
</div>
|
||||
</I18nextProvider>
|
||||
)
|
||||
}
|
||||
|
||||
const meta = {
|
||||
title: 'Billing/TriggerEventsLimitModal',
|
||||
component: TriggerEventsLimitModal,
|
||||
parameters: {
|
||||
layout: 'centered',
|
||||
},
|
||||
args: {
|
||||
show: true,
|
||||
usage: 120,
|
||||
total: 120,
|
||||
resetInDays: 5,
|
||||
planType: Plan.professional,
|
||||
},
|
||||
} satisfies Meta<typeof TriggerEventsLimitModal>
|
||||
|
||||
export default meta
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
export const Professional: Story = {
|
||||
args: {
|
||||
onDismiss: () => { /* noop */ },
|
||||
onUpgrade: () => { /* noop */ },
|
||||
},
|
||||
render: args => <Template {...args} />,
|
||||
}
|
||||
|
||||
export const Sandbox: Story = {
|
||||
render: args => <Template {...args} />,
|
||||
args: {
|
||||
onDismiss: () => { /* noop */ },
|
||||
onUpgrade: () => { /* noop */ },
|
||||
resetInDays: undefined,
|
||||
planType: Plan.sandbox,
|
||||
},
|
||||
}
|
||||
|
|
@ -13,8 +13,8 @@ const translation = {
|
|||
},
|
||||
teamMembers: 'Team Members',
|
||||
triggerLimitModal: {
|
||||
title: 'Upgrade to unlock unlimited triggers per workflow',
|
||||
description: 'You’ve reached the limit of 2 triggers per workflow for this plan. Upgrade to publish this workflow.',
|
||||
title: 'Upgrade to unlock more trigger events',
|
||||
description: 'You\'ve reached the limit of workflow event triggers for this plan.',
|
||||
dismiss: 'Dismiss',
|
||||
upgrade: 'Upgrade',
|
||||
usageTitle: 'TRIGGER EVENTS',
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ const translation = {
|
|||
resetsIn: '{{count,number}}日後にリセット',
|
||||
},
|
||||
triggerLimitModal: {
|
||||
title: 'アップグレードして、各ワークフローのトリガーを制限なく使用',
|
||||
description: 'このプランでは、各ワークフローのトリガー数は最大2個までです。公開するにはアップグレードしてください。',
|
||||
title: 'アップグレードして、より多くのトリガーイベントを利用できるようになります',
|
||||
description: 'このプランでは、ワークフローのトリガーイベント数の上限に達しています。',
|
||||
dismiss: '閉じる',
|
||||
upgrade: 'アップグレード',
|
||||
usageTitle: 'TRIGGER EVENTS',
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ const translation = {
|
|||
resetsIn: '{{count,number}} 天后重置',
|
||||
},
|
||||
triggerLimitModal: {
|
||||
title: '升级以解锁每个工作流无限制的触发器',
|
||||
description: '您已达到此计划上每个工作流最多 2 个触发器的限制。请升级后再发布此工作流。',
|
||||
title: '升级以解锁更多触发器事件数',
|
||||
description: '您已达到此计划上工作流的触发器事件数限制。',
|
||||
dismiss: '知道了',
|
||||
upgrade: '升级',
|
||||
usageTitle: '触发事件额度',
|
||||
|
|
|
|||
Loading…
Reference in New Issue