mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 04:26:30 +08:00
refactor: remove version prop from plugin item components and update version comparison logic
This commit is contained in:
parent
61eb655823
commit
fa6858090b
@ -23,7 +23,6 @@ type Props = {
|
|||||||
installationId: string
|
installationId: string
|
||||||
pluginUniqueIdentifier: string
|
pluginUniqueIdentifier: string
|
||||||
pluginName: string
|
pluginName: string
|
||||||
version: string
|
|
||||||
usedInApps: number
|
usedInApps: number
|
||||||
isShowFetchNewVersion: boolean
|
isShowFetchNewVersion: boolean
|
||||||
isShowInfo: boolean
|
isShowInfo: boolean
|
||||||
@ -36,7 +35,6 @@ const Action: FC<Props> = ({
|
|||||||
installationId,
|
installationId,
|
||||||
pluginUniqueIdentifier,
|
pluginUniqueIdentifier,
|
||||||
pluginName,
|
pluginName,
|
||||||
version,
|
|
||||||
isShowFetchNewVersion,
|
isShowFetchNewVersion,
|
||||||
isShowInfo,
|
isShowInfo,
|
||||||
isShowDelete,
|
isShowDelete,
|
||||||
@ -63,7 +61,7 @@ const Action: FC<Props> = ({
|
|||||||
return
|
return
|
||||||
const versions = fetchedReleases.map(release => release.tag_name)
|
const versions = fetchedReleases.map(release => release.tag_name)
|
||||||
const latestVersion = getLatestVersion(versions)
|
const latestVersion = getLatestVersion(versions)
|
||||||
if (compareVersion(latestVersion, version) === 1) {
|
if (compareVersion(latestVersion, meta!.version) === 1) {
|
||||||
setShowUpdatePluginModal({
|
setShowUpdatePluginModal({
|
||||||
onSaveCallback: () => {
|
onSaveCallback: () => {
|
||||||
invalidateInstalledPluginList()
|
invalidateInstalledPluginList()
|
||||||
|
|||||||
@ -48,7 +48,6 @@ const PluginItem: FC<Props> = ({
|
|||||||
endpoints_active,
|
endpoints_active,
|
||||||
meta,
|
meta,
|
||||||
plugin_id,
|
plugin_id,
|
||||||
version,
|
|
||||||
} = plugin
|
} = plugin
|
||||||
const { category, author, name, label, description, icon, verified } = plugin.declaration
|
const { category, author, name, label, description, icon, verified } = plugin.declaration
|
||||||
|
|
||||||
@ -93,7 +92,6 @@ const PluginItem: FC<Props> = ({
|
|||||||
installationId={installation_id}
|
installationId={installation_id}
|
||||||
author={author}
|
author={author}
|
||||||
pluginName={name}
|
pluginName={name}
|
||||||
version={version}
|
|
||||||
usedInApps={5}
|
usedInApps={5}
|
||||||
isShowFetchNewVersion={source === PluginSource.github}
|
isShowFetchNewVersion={source === PluginSource.github}
|
||||||
isShowInfo={source === PluginSource.github}
|
isShowInfo={source === PluginSource.github}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user