Skip to content

Commit 5fceb79

Browse files
authored
Merge pull request #3767 from illacloud/Release/4.7.0
Release/4.7.0
2 parents 4fc04f7 + 9f19e35 commit 5fceb79

File tree

19 files changed

+224
-31
lines changed

19 files changed

+224
-31
lines changed

README-CN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ ILLA CLI 使您能够以超乎想象的速度部署 ILLA Builder。 [单击此
9494
加入 ILLA 社区,分享您的想法、建议或问题,并与其他用户和贡献者交流。
9595

9696
加入微信群:
97+
![IMG_6451](https://github.com/illacloud/illa-builder/assets/112603073/06b024f1-5aad-428a-9342-ee4396d20e92)
98+
9799

98-
![IMG_6103](https://github.com/illacloud/illa-builder/assets/112603073/a4eb22b9-f826-49df-b538-75599292370f)
99100

100101

101102
Discord与Github社区入口

apps/builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"author": "ILLA Cloud <[email protected]>",
77
"license": "Apache-2.0",
8-
"version": "4.5.18",
8+
"version": "4.7.0",
99
"scripts": {
1010
"dev": "vite --strictPort --force",
1111
"build-cloud": "NODE_OPTIONS=--max-old-space-size=12288 vite build --mode cloud",

apps/builder/src/page/App/components/Actions/ActionList/listWithNewButton.tsx

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getIconFromResourceType } from "@illa-public/icon"
1+
import { UpgradeIcon, getIconFromResourceType } from "@illa-public/icon"
22
import {
33
ILLA_MIXPANEL_BUILDER_PAGE_NAME,
44
ILLA_MIXPANEL_EVENT_TYPE,
@@ -22,6 +22,9 @@ import {
2222
ActionGenerator,
2323
ResourceGeneratorProvider,
2424
} from "@illa-public/resource-generator"
25+
import { useUpgradeModal } from "@illa-public/upgrade-modal"
26+
import { isSubscribeForUseDrive } from "@illa-public/upgrade-modal/utils"
27+
import { getCurrentTeamInfo } from "@illa-public/user-data"
2528
import { isCloudVersion } from "@illa-public/utils"
2629
import { isEqual } from "lodash-es"
2730
import { FC, useCallback, useContext, useState } from "react"
@@ -65,9 +68,11 @@ import {
6568
actionListEmptyStyle,
6669
addNewActionButtonStyle,
6770
createDropListItemContainerStyle,
71+
dropListWithUpgradeIconStyle,
6872
listContainerStyle,
6973
listStyle,
7074
prefixIconContainerStyle,
75+
upgradeContainerStyle,
7176
} from "./style"
7277

7378
export const ActionListWithNewButton: FC<ListWithNewButtonProps> = (props) => {
@@ -81,6 +86,8 @@ export const ActionListWithNewButton: FC<ListWithNewButtonProps> = (props) => {
8186
const [currentActionType, setCurrentActionType] =
8287
useState<ActionType | null>()
8388
const actionList = useSelector(getActionMixedList)
89+
const teamInfo = useSelector(getCurrentTeamInfo)!
90+
const upgradeModal = useUpgradeModal()
8491

8592
const searchList = actionList.filter((value) => {
8693
return value.displayName
@@ -167,6 +174,13 @@ export const ActionListWithNewButton: FC<ListWithNewButtonProps> = (props) => {
167174
break
168175
}
169176
case "illadrive": {
177+
if (!isSubscribeForUseDrive(teamInfo)) {
178+
upgradeModal({
179+
modalType: "upgrade",
180+
from: "drive_action",
181+
})
182+
return
183+
}
170184
const displayName = DisplayNameGenerator.generateDisplayName(type)
171185
const initialContent = getInitialContent(type)
172186
const baseData = generateBaseActionItem(displayName, "")
@@ -302,11 +316,19 @@ export const ActionListWithNewButton: FC<ListWithNewButtonProps> = (props) => {
302316
key="illaDrive"
303317
value="illaDrive"
304318
title={
305-
<div css={createDropListItemContainerStyle}>
306-
<span css={prefixIconContainerStyle}>
307-
{getIconFromResourceType("illadrive", "16px")}
308-
</span>
309-
ILLA Drive
319+
<div css={dropListWithUpgradeIconStyle}>
320+
<div css={createDropListItemContainerStyle}>
321+
<span css={prefixIconContainerStyle}>
322+
{getIconFromResourceType("illadrive", "16px")}
323+
</span>
324+
ILLA Drive
325+
</div>
326+
{!isSubscribeForUseDrive(teamInfo) && (
327+
<div css={upgradeContainerStyle}>
328+
<UpgradeIcon />
329+
<span>{t("Upgrade")}</span>
330+
</div>
331+
)}
310332
</div>
311333
}
312334
onClick={handleClickActionType("illadrive")}

apps/builder/src/page/App/components/Actions/ActionList/style.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,19 @@ export const prefixIconContainerStyle = css`
4848
align-items: center;
4949
justify-content: center;
5050
`
51+
52+
export const dropListWithUpgradeIconStyle = css`
53+
display: flex;
54+
align-items: center;
55+
justify-content: space-between;
56+
`
57+
58+
export const upgradeContainerStyle = css`
59+
display: flex;
60+
align-items: center;
61+
gap: 4px;
62+
color: ${getColor("techPurple", "03")};
63+
font-size: 12px;
64+
font-style: normal;
65+
line-height: 20px;
66+
`

apps/builder/src/page/App/components/ComponentPanel/ComponentItem.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import { UpgradeIcon } from "@illa-public/icon"
2+
import { isSubscribeForUseDrive } from "@illa-public/upgrade-modal/utils"
3+
import { getCurrentTeamInfo } from "@illa-public/user-data"
4+
import { isCloudVersion } from "@illa-public/utils"
15
import { FC, memo } from "react"
26
import { useDrag } from "react-dnd"
37
import { useSelector } from "react-redux"
@@ -16,14 +20,20 @@ import {
1620
DRAG_EFFECT,
1721
DragInfo,
1822
} from "../ScaleSquare/components/DragContainer/interface"
19-
import { iconStyle, itemContainerStyle, nameStyle } from "./style"
23+
import {
24+
iconStyle,
25+
itemContainerStyle,
26+
nameStyle,
27+
upgradeIconStyle,
28+
} from "./style"
2029

2130
export const ComponentItem: FC<ComponentItemProps> = memo(
2231
(props: ComponentItemProps) => {
23-
const { widgetName, widgetType, icon, displayName } = props
32+
const { widgetName, widgetType, icon, displayName, isPremiumWidget } = props
2433

2534
const isEditMode = useSelector(getIsILLAEditMode)
2635
const isGuideOpen = useSelector(getGuideStatus)
36+
const teamInfo = useSelector(getCurrentTeamInfo)!
2737

2838
const [, dragRef] = useDrag<DragInfo, DropResultInfo>(
2939
() => ({
@@ -81,6 +91,13 @@ export const ComponentItem: FC<ComponentItemProps> = memo(
8191
css={iconStyle}
8292
{...(isGuideOpen ? { "data-onboarding-icon": widgetType } : {})}
8393
>
94+
{isPremiumWidget &&
95+
isCloudVersion &&
96+
!isSubscribeForUseDrive(teamInfo) && (
97+
<span css={upgradeIconStyle}>
98+
<UpgradeIcon />
99+
</span>
100+
)}
84101
{icon}
85102
</span>
86103
<span css={nameStyle}>{widgetName}</span>

apps/builder/src/page/App/components/ComponentPanel/ComponentSession.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const ComponentSession = memo((props: ComponentSessionProps) => {
2727
widgetType={item.widgetType}
2828
widgetName={item.widgetName}
2929
displayName={item.displayName}
30+
isPremiumWidget={item.isPremiumWidget}
3031
/>
3132
))}
3233
</div>

apps/builder/src/page/App/components/ComponentPanel/componentListBuilder.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from "@/widgetLibrary/widgetBuilder"
1313

1414
export const DEPRECATED_WIDGETS = ["CHART", "TABLE_WIDGET"]
15+
export const PREMIUM_WIDGETS = ["DRIVE_PICKER_WIDGET"]
1516

1617
export type SessionType = keyof typeof sessionTypeMapSessionNameKey
1718

@@ -70,6 +71,7 @@ const translateChildren = (componentConfigs: WidgetConfig[]) => {
7071
widgetName,
7172
icon: item.icon,
7273
displayName,
74+
isPremiumWidget: PREMIUM_WIDGETS.includes(type),
7375
}
7476
if (COMMONLY_WIDGET.has(type as string)) {
7577
sessionConfigs.COMMON.push(childrenConfig)

apps/builder/src/page/App/components/ComponentPanel/interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface WidgetCardInfo {
1212
widgetName: string
1313
widgetType: string
1414
icon: ReactNode
15+
isPremiumWidget: boolean
1516
}
1617

1718
export type ComponentSessionProps = {
@@ -29,4 +30,5 @@ export interface ComponentItemProps {
2930
displayName: string
3031
widgetType: string
3132
icon: ReactNode
33+
isPremiumWidget: boolean
3234
}

apps/builder/src/page/App/components/ComponentPanel/style.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { css } from "@emotion/react"
2-
import { globalColor, illaPrefix } from "@illa-design/react"
2+
import { getColor, globalColor, illaPrefix } from "@illa-design/react"
33

44
export const componentContainerStyle = css`
55
border-top: 1px solid ${globalColor(`--${illaPrefix}-grayBlue-08`)};
@@ -70,7 +70,8 @@ export const iconStyle = css`
7070
color: ${globalColor(`--${illaPrefix}-grayBlue-04`)};
7171
transition: background-color 200ms ease-in-out;
7272
padding: 8px;
73-
73+
position: relative;
74+
overflow: hidden;
7475
&:hover {
7576
background-color: ${globalColor(`--${illaPrefix}-grayBlue-08`)};
7677
}
@@ -95,3 +96,15 @@ export const emptyContainerStyle = css`
9596
align-items: center;
9697
justify-content: center;
9798
`
99+
100+
export const upgradeIconStyle = css`
101+
position: absolute;
102+
padding: 2px 8px;
103+
top: 0;
104+
left: 0;
105+
color: ${getColor("techPurple", "03")};
106+
background-color: ${getColor("techPurple", "08")};
107+
display: flex;
108+
align-items: center;
109+
justify-content: center;
110+
`

apps/builder/src/page/App/components/InspectPanel/PanelSetters/DriveSourceGroupSetter/components/SourceHeader/index.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useUpgradeModal } from "@illa-public/upgrade-modal"
12
import { FC, useContext } from "react"
23
import Folder from "@/assets/drive/panelFolder.svg?react"
34
import { DriveFileSelectContext } from "@/components/DriveFileSelect"
@@ -12,13 +13,26 @@ interface SourceHeaderProps {
1213
labelName?: string
1314
labelDesc?: string
1415
showSelect: boolean
16+
canUseDrive: boolean
1517
}
1618
const SourceHeader: FC<SourceHeaderProps> = ({
1719
labelName,
1820
labelDesc,
1921
showSelect,
22+
canUseDrive,
2023
}) => {
24+
const upgradeModal = useUpgradeModal()
2125
const { setModalVisible } = useContext(DriveFileSelectContext)
26+
const handleClickSelect = () => {
27+
if (canUseDrive) {
28+
setModalVisible(true)
29+
} else {
30+
upgradeModal({
31+
modalType: "upgrade",
32+
from: "panel_setter_select",
33+
})
34+
}
35+
}
2236
return (
2337
<div css={sourceHeaderContainerStyle}>
2438
<PanelLabel
@@ -27,12 +41,7 @@ const SourceHeader: FC<SourceHeaderProps> = ({
2741
labelSize="medium"
2842
/>
2943
{showSelect && (
30-
<div
31-
css={fileSelectContainerStyle}
32-
onClick={() => {
33-
setModalVisible(true)
34-
}}
35-
>
44+
<div css={fileSelectContainerStyle} onClick={handleClickSelect}>
3645
<span css={folderIconStyle}>
3746
<Folder />
3847
</span>

apps/builder/src/page/App/components/InspectPanel/PanelSetters/DriveSourceGroupSetter/components/UploadInput/index.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useUpgradeModal } from "@illa-public/upgrade-modal"
12
import { FC, useContext } from "react"
23
import { FolderOperateModalContext } from "@/components/FolderOperateModal/context"
34
import { FileUploadContext } from "@/page/App/components/InspectPanel/PanelSetters/DriveSourceGroupSetter/provider/FileUploadProvider"
@@ -6,18 +7,26 @@ import { uploadContainerStyle, uploadIconStyle, uploadNameStyle } from "./style"
67

78
interface UploadModeProps {
89
widgetType: string
10+
canUseDrive: boolean
911
}
10-
const UploadMode: FC<UploadModeProps> = ({ widgetType }) => {
12+
const UploadMode: FC<UploadModeProps> = ({ widgetType, canUseDrive }) => {
1113
const placeholderInfo = getUploadModeInfo(widgetType)
12-
14+
const upgradeModal = useUpgradeModal()
1315
const { uploadName, isUpLoading } = useContext(FileUploadContext)
1416
const { setFolderOperateVisible } = useContext(FolderOperateModalContext)
17+
const handleClickUpload = () => {
18+
if (canUseDrive) {
19+
setFolderOperateVisible(true)
20+
} else {
21+
upgradeModal({
22+
modalType: "upgrade",
23+
from: "panel_setter_upload",
24+
})
25+
}
26+
}
1527

1628
return (
17-
<div
18-
css={uploadContainerStyle(isUpLoading)}
19-
onClick={() => setFolderOperateVisible(true)}
20-
>
29+
<div css={uploadContainerStyle(isUpLoading)} onClick={handleClickUpload}>
2130
<span css={uploadIconStyle}>{placeholderInfo?.icon}</span>
2231
<span css={uploadNameStyle}>{uploadName || placeholderInfo?.name}</span>
2332
</div>

apps/builder/src/page/App/components/InspectPanel/PanelSetters/DriveSourceGroupSetter/index.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1+
import { UpgradeIcon } from "@illa-public/icon"
2+
import { isSubscribeForUseDrive } from "@illa-public/upgrade-modal/utils"
3+
import { getCurrentTeamInfo } from "@illa-public/user-data"
14
import { get } from "lodash-es"
25
import { FC, useMemo, useState } from "react"
36
import { useTranslation } from "react-i18next"
4-
import { RadioGroup } from "@illa-design/react"
7+
import { useSelector } from "react-redux"
8+
import { RadioGroup, getColor } from "@illa-design/react"
59
import FilesModal, { ROOT_PATH } from "@/components/DriveFileSelect"
610
import FolderOperateModal from "@/components/FolderOperateModal"
711
import {
812
applyRadioGroupWrapperStyle,
913
baseRadioGroupContainerStyle,
1014
radioGroupStyle,
15+
uploadButtonStyle,
1116
} from "@/page/App/components/InspectPanel/PanelSetters/DriveSourceGroupSetter/style"
1217
import SourceHeader from "./components/SourceHeader"
1318
import URLModeInput from "./components/URLModeInput"
@@ -31,14 +36,21 @@ const DriveSourceGroupSetter: FC<DriveSourceGroupSetterProps> = (props) => {
3136
} = props
3237

3338
const { t } = useTranslation()
39+
const teamInfo = useSelector(getCurrentTeamInfo)!
40+
const canUseDrive = isSubscribeForUseDrive(teamInfo)
3441

3542
const options = [
3643
{
3744
label: t("widget.public.select_options.url"),
3845
value: DRIVE_SOURCE_MODE.URL,
3946
},
4047
{
41-
label: t("widget.public.select_options.upload"),
48+
label: (
49+
<span css={uploadButtonStyle}>
50+
{!canUseDrive && <UpgradeIcon color={getColor("techPurple", "03")} />}
51+
<span>{t("widget.public.select_options.upload")}</span>
52+
</span>
53+
),
4254
value: DRIVE_SOURCE_MODE.UPLOAD,
4355
},
4456
]
@@ -93,6 +105,7 @@ const DriveSourceGroupSetter: FC<DriveSourceGroupSetterProps> = (props) => {
93105
labelDesc={labelDesc}
94106
labelName={labelName}
95107
showSelect={selectMode === DRIVE_SOURCE_MODE.URL}
108+
canUseDrive={canUseDrive}
96109
/>
97110
<div css={applyRadioGroupWrapperStyle(isSetterSingleRow)}>
98111
<RadioGroup
@@ -115,7 +128,7 @@ const DriveSourceGroupSetter: FC<DriveSourceGroupSetterProps> = (props) => {
115128
/>
116129
)}
117130
{selectMode === DRIVE_SOURCE_MODE.UPLOAD && (
118-
<UploadMode widgetType={widgetType} />
131+
<UploadMode widgetType={widgetType} canUseDrive={canUseDrive} />
119132
)}
120133
</div>
121134
</div>

apps/builder/src/page/App/components/InspectPanel/PanelSetters/DriveSourceGroupSetter/style.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,11 @@ export const baseRadioGroupContainerStyle = (
4141
width: 100%;
4242
`
4343
}
44+
45+
export const uploadButtonStyle = css`
46+
display: flex;
47+
align-items: center;
48+
justify-content: center;
49+
width: 100%;
50+
gap: 4px;
51+
`

0 commit comments

Comments
 (0)