Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
b5dd948e
Unverified
Commit
b5dd948e
authored
Dec 04, 2023
by
Joel
Committed by
GitHub
Dec 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add upgrade ga test (#1690)
parent
1263b7de
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
index.tsx
web/app/components/billing/plan/index.tsx
+2
-0
index.tsx
web/app/components/billing/upgrade-btn/index.tsx
+14
-4
billing.en.ts
web/i18n/lang/billing.en.ts
+1
-1
No files found.
web/app/components/billing/plan/index.tsx
View file @
b5dd948e
...
...
@@ -69,6 +69,7 @@ const PlanComp: FC<Props> = ({
<
UpgradeBtn
className=
'flex-shrink-0'
isPlain=
{
type
!==
Plan
.
sandbox
}
gaEventName=
'click_header_upgrade_btn'
/>
)
}
</
div
>
...
...
@@ -83,6 +84,7 @@ const PlanComp: FC<Props> = ({
isFull
size=
'lg'
isPlain=
{
type
!==
Plan
.
sandbox
}
gaEventName=
'click_header_upgrade_btn'
/>
)
}
</
div
>
...
...
web/app/components/billing/upgrade-btn/index.tsx
View file @
b5dd948e
...
...
@@ -15,9 +15,10 @@ type Props = {
isPlain
?:
boolean
isShort
?:
boolean
onClick
?:
()
=>
void
gaEventName
?:
string
}
const
PlainBtn
=
({
className
,
onClick
}:
{
className
?:
string
;
onClick
:
()
=>
{}
})
=>
{
const
PlainBtn
=
({
className
,
onClick
}:
{
className
?:
string
;
onClick
:
()
=>
void
})
=>
{
const
{
t
}
=
useTranslation
()
return
(
...
...
@@ -38,13 +39,22 @@ const UpgradeBtn: FC<Props> = ({
isFull
=
false
,
isShort
=
false
,
size
=
'md'
,
onClick
,
onClick
:
_onClick
,
gaEventName
,
})
=>
{
const
{
t
}
=
useTranslation
()
const
{
setShowPricingModal
}
=
useModalContext
()
const
onClick
=
()
=>
{
if
(
gaEventName
)
(
window
as
any
).
dataLayer
.
push
({
event
:
gaEventName
})
if
(
_onClick
)
_onClick
()
else
(
setShowPricingModal
as
any
)()
}
if
(
isPlain
)
return
<
PlainBtn
onClick=
{
onClick
||
setShowPricingModal
as
any
}
className=
{
className
}
/>
return
<
PlainBtn
onClick=
{
onClick
}
className=
{
className
}
/>
return
(
<
div
...
...
@@ -55,7 +65,7 @@ const UpgradeBtn: FC<Props> = ({
size
===
'lg'
?
'h-10'
:
'h-9'
,
'relative flex items-center cursor-pointer border rounded-[20px] border-[#0096EA] text-white'
,
)
}
onClick=
{
onClick
||
setShowPricingModal
}
onClick=
{
onClick
}
>
<
GoldCoin
className=
'mr-1 w-3.5 h-3.5'
/>
<
div
className=
'text-xs font-normal'
>
{
t
(
`billing.upgradeBtn.${isShort ? 'encourageShort' : 'encourage'}`
)
}
</
div
>
...
...
web/i18n/lang/billing.en.ts
View file @
b5dd948e
...
...
@@ -19,7 +19,7 @@ const translation = {
year
:
'year'
,
save
:
'Save '
,
free
:
'Free'
,
currentPlan
:
'
current p
lan'
,
currentPlan
:
'
Current P
lan'
,
startForFree
:
'Start for free'
,
getStartedWith
:
'Get started with '
,
contactSales
:
'Contact Sales'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment