fix: from marketplace install and update bundle

pull/12372/head
Joel 1 year ago
parent 32619bd05e
commit 47579c86e6

@ -136,9 +136,9 @@ const InstallByDSLList: FC<Props> = ({
const isLoadedAllData = (plugins.filter(p => !!p).length + errorIndexes.length) === allPlugins.length const isLoadedAllData = (plugins.filter(p => !!p).length + errorIndexes.length) === allPlugins.length
const { installedInfo, isLoading: isLoadingCheckInstalled } = useCheckInstalled({ const { installedInfo } = useCheckInstalled({
pluginIds: plugins?.filter(p => !!p).map((d) => { pluginIds: plugins?.filter(p => !!p).map((d) => {
return `${d?.org}/${d?.name}` return `${d?.org || d?.author}/${d?.name}`
}) || [], }) || [],
enabled: isLoadedAllData, enabled: isLoadedAllData,
}) })
@ -182,7 +182,7 @@ const InstallByDSLList: FC<Props> = ({
dependency={d as GitHubItemAndMarketPlaceDependency} dependency={d as GitHubItemAndMarketPlaceDependency}
onFetchedPayload={handleGitHubPluginFetched(index)} onFetchedPayload={handleGitHubPluginFetched(index)}
onFetchError={handleGitHubPluginFetchError(index)} onFetchError={handleGitHubPluginFetchError(index)}
versionInfo={getVersionInfo(`${plugin?.org}/${plugin?.name}`)} versionInfo={getVersionInfo(`${plugin?.org || plugin?.author}/${plugin?.name}`)}
/>) />)
} }
@ -194,7 +194,7 @@ const InstallByDSLList: FC<Props> = ({
onCheckedChange={handleSelect(index)} onCheckedChange={handleSelect(index)}
payload={plugins[index] as Plugin} payload={plugins[index] as Plugin}
version={(d as GitHubItemAndMarketPlaceDependency).value.version!} version={(d as GitHubItemAndMarketPlaceDependency).value.version!}
versionInfo={getVersionInfo(`${plugin?.org}/${plugin?.name}`)} versionInfo={getVersionInfo(`${plugin?.org || plugin?.author}/${plugin?.name}`)}
/> />
) )
} }
@ -207,7 +207,7 @@ const InstallByDSLList: FC<Props> = ({
onCheckedChange={handleSelect(index)} onCheckedChange={handleSelect(index)}
payload={d as PackageDependency} payload={d as PackageDependency}
isFromMarketPlace={isFromMarketPlace} isFromMarketPlace={isFromMarketPlace}
versionInfo={getVersionInfo(`${plugin?.org}/${plugin?.name}`)} versionInfo={getVersionInfo(`${plugin?.org || plugin?.author}/${plugin?.name}`)}
/> />
) )
}) })

@ -109,6 +109,7 @@ export type PluginDetail = {
export type Plugin = { export type Plugin = {
type: 'plugin' | 'bundle' type: 'plugin' | 'bundle'
org: string org: string
author?: string
name: string name: string
plugin_id: string plugin_id: string
version: string version: string

@ -163,7 +163,7 @@ export const useInstallOrUpdate = ({
return Promise.all(payload.map(async (item, i) => { return Promise.all(payload.map(async (item, i) => {
try { try {
const orgAndName = `${plugin[i]?.org}/${plugin[i]?.name}` const orgAndName = `${plugin[i]?.org || plugin[i]?.author}/${plugin[i]?.name}`
const installedPayload = installedInfo[orgAndName] const installedPayload = installedInfo[orgAndName]
const isInstalled = !!installedPayload const isInstalled = !!installedPayload
let uniqueIdentifier = '' let uniqueIdentifier = ''

Loading…
Cancel
Save