mirror of
https://github.com/langgenius/dify.git
synced 2026-01-08 07:14:14 +00:00
fix: correct trigger events limit modal wording (#28463)
Some checks are pending
autofix.ci / autofix (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions
Main CI Pipeline / Check Changed Files (push) Waiting to run
Main CI Pipeline / API Tests (push) Blocked by required conditions
Main CI Pipeline / Web Tests (push) Blocked by required conditions
Main CI Pipeline / Style Check (push) Waiting to run
Main CI Pipeline / VDB Tests (push) Blocked by required conditions
Main CI Pipeline / DB Migration Test (push) Blocked by required conditions
Check i18n Files and Create PR / check-and-update (push) Waiting to run
Some checks are pending
autofix.ci / autofix (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions
Main CI Pipeline / Check Changed Files (push) Waiting to run
Main CI Pipeline / API Tests (push) Blocked by required conditions
Main CI Pipeline / Web Tests (push) Blocked by required conditions
Main CI Pipeline / Style Check (push) Waiting to run
Main CI Pipeline / VDB Tests (push) Blocked by required conditions
Main CI Pipeline / DB Migration Test (push) Blocked by required conditions
Check i18n Files and Create PR / check-and-update (push) Waiting to run
This commit is contained in:
@@ -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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user