From 4b77ced4adaab5c496355e68fc670697a0032639 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 26 Nov 2024 14:07:45 +0800 Subject: [PATCH] fix: not show from market bundle package icon --- .../install-plugin/install-bundle/item/package-item.tsx | 3 +++ .../install-plugin/install-bundle/ready-to-install.tsx | 3 +++ .../install-plugin/install-bundle/steps/install-multi.tsx | 4 ++++ .../plugins/install-plugin/install-bundle/steps/install.tsx | 3 +++ .../plugins/install-plugin/install-from-marketplace/index.tsx | 1 + 5 files changed, 14 insertions(+) diff --git a/web/app/components/plugins/install-plugin/install-bundle/item/package-item.tsx b/web/app/components/plugins/install-plugin/install-bundle/item/package-item.tsx index b649aada8f..97ee6b0de6 100644 --- a/web/app/components/plugins/install-plugin/install-bundle/item/package-item.tsx +++ b/web/app/components/plugins/install-plugin/install-bundle/item/package-item.tsx @@ -11,12 +11,14 @@ type Props = { checked: boolean onCheckedChange: (plugin: Plugin) => void payload: PackageDependency + isFromMarketPlace?: boolean } const PackageItem: FC = ({ payload, checked, onCheckedChange, + isFromMarketPlace, }) => { if (!payload.value?.manifest) return @@ -27,6 +29,7 @@ const PackageItem: FC = ({ payload={plugin} checked={checked} onCheckedChange={onCheckedChange} + isFromMarketPlace={isFromMarketPlace} /> ) } diff --git a/web/app/components/plugins/install-plugin/install-bundle/ready-to-install.tsx b/web/app/components/plugins/install-plugin/install-bundle/ready-to-install.tsx index 0f5dda2395..b534f0c6b9 100644 --- a/web/app/components/plugins/install-plugin/install-bundle/ready-to-install.tsx +++ b/web/app/components/plugins/install-plugin/install-bundle/ready-to-install.tsx @@ -11,6 +11,7 @@ type Props = { onStepChange: (step: InstallStep) => void, allPlugins: Dependency[] onClose: () => void + isFromMarketPlace?: boolean } const ReadyToInstall: FC = ({ @@ -18,6 +19,7 @@ const ReadyToInstall: FC = ({ onStepChange, allPlugins, onClose, + isFromMarketPlace, }) => { const [installedPlugins, setInstalledPlugins] = useState([]) const [installStatus, setInstallStatus] = useState([]) @@ -33,6 +35,7 @@ const ReadyToInstall: FC = ({ allPlugins={allPlugins} onCancel={onClose} onInstalled={handleInstalled} + isFromMarketPlace={isFromMarketPlace} /> )} {step === InstallStep.installed && ( diff --git a/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx b/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx index 445c8be9d9..e8bf71297d 100644 --- a/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx +++ b/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx @@ -14,6 +14,7 @@ type Props = { selectedPlugins: Plugin[] onSelect: (plugin: Plugin, selectedIndex: number) => void onLoadedAllPlugin: () => void + isFromMarketPlace?: boolean } const InstallByDSLList: FC = ({ @@ -21,6 +22,7 @@ const InstallByDSLList: FC = ({ selectedPlugins, onSelect, onLoadedAllPlugin, + isFromMarketPlace, }) => { // DSL has id, to get plugin info to show more info const { isLoading: isFetchingMarketplaceDataById, data: infoGetById, error: infoByIdError } = useFetchPluginsInMarketPlaceByIds(allPlugins.filter(d => d.type === 'marketplace').map(d => (d as GitHubItemAndMarketPlaceDependency).value.plugin_unique_identifier!)) @@ -171,12 +173,14 @@ const InstallByDSLList: FC = ({ ) } + // Local package return ( p.plugin_id === plugins[index]?.plugin_id)} onCheckedChange={handleSelect(index)} payload={d as PackageDependency} + isFromMarketPlace={isFromMarketPlace} /> ) }) diff --git a/web/app/components/plugins/install-plugin/install-bundle/steps/install.tsx b/web/app/components/plugins/install-plugin/install-bundle/steps/install.tsx index 389cb3d9ca..223c561d84 100644 --- a/web/app/components/plugins/install-plugin/install-bundle/steps/install.tsx +++ b/web/app/components/plugins/install-plugin/install-bundle/steps/install.tsx @@ -14,12 +14,14 @@ type Props = { allPlugins: Dependency[] onInstalled: (plugins: Plugin[], installStatus: InstallStatusResponse[]) => void onCancel: () => void + isFromMarketPlace?: boolean } const Install: FC = ({ allPlugins, onInstalled, onCancel, + isFromMarketPlace, }) => { const { t } = useTranslation() const [selectedPlugins, setSelectedPlugins] = React.useState([]) @@ -75,6 +77,7 @@ const Install: FC = ({ selectedPlugins={selectedPlugins} onSelect={handleSelect} onLoadedAllPlugin={handleLoadedAllPlugin} + isFromMarketPlace={isFromMarketPlace} /> diff --git a/web/app/components/plugins/install-plugin/install-from-marketplace/index.tsx b/web/app/components/plugins/install-plugin/install-from-marketplace/index.tsx index 5a3621995a..84668e0898 100644 --- a/web/app/components/plugins/install-plugin/install-from-marketplace/index.tsx +++ b/web/app/components/plugins/install-plugin/install-from-marketplace/index.tsx @@ -83,6 +83,7 @@ const InstallFromMarketplace: React.FC = ({ onStepChange={setStep} onClose={onClose} allPlugins={dependencies!} + isFromMarketPlace /> ) : (<> {