[feat] Show conflicting status for installed packages with compatibility issues (#4579)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jin Yi
2025-07-29 17:31:57 +09:00
committed by GitHub
parent b7c43707d3
commit d3f0ae33be
3 changed files with 16 additions and 9 deletions

View File

@@ -32,8 +32,9 @@ type StatusProps = {
severity: MessageSeverity severity: MessageSeverity
} }
const { statusType } = defineProps<{ const { statusType, hasCompatibilityIssues } = defineProps<{
statusType: Status statusType: Status
hasCompatibilityIssues?: boolean
}>() }>()
const statusPropsMap: Record<Status, StatusProps> = { const statusPropsMap: Record<Status, StatusProps> = {
@@ -71,10 +72,14 @@ const statusPropsMap: Record<Status, StatusProps> = {
} }
} }
const statusLabel = computed( const statusLabel = computed(() =>
() => statusPropsMap[statusType]?.label || 'unknown' hasCompatibilityIssues
? 'conflicting'
: statusPropsMap[statusType]?.label || 'unknown'
) )
const statusSeverity = computed( const statusSeverity = computed(() =>
() => statusPropsMap[statusType]?.severity || 'secondary' hasCompatibilityIssues
? 'error'
: statusPropsMap[statusType]?.severity || 'secondary'
) )
</script> </script>

View File

@@ -32,6 +32,7 @@
:status-type=" :status-type="
nodePack.status as components['schemas']['NodeVersionStatus'] nodePack.status as components['schemas']['NodeVersionStatus']
" "
:has-compatibility-issues="hasCompatibilityIssues"
/> />
</MetadataRow> </MetadataRow>
<MetadataRow :label="t('manager.version')"> <MetadataRow :label="t('manager.version')">
@@ -131,9 +132,9 @@ const conflictResult = computed((): ConflictDetectionResult | null => {
return null return null
}) })
const hasCompatibilityIssues = computed( const hasCompatibilityIssues = computed(() => {
() => conflictResult.value?.has_conflict ?? false return isInstalled.value && conflictResult.value?.has_conflict ? true : false
) })
const infoItems = computed<InfoItem[]>(() => [ const infoItems = computed<InfoItem[]>(() => [
{ {

View File

@@ -190,7 +190,8 @@
"flagged": "Flagged", "flagged": "Flagged",
"deleted": "Deleted", "deleted": "Deleted",
"banned": "Banned", "banned": "Banned",
"unknown": "Unknown" "unknown": "Unknown",
"conflicting": "Conflicting"
}, },
"sort": { "sort": {
"downloads": "Most Popular", "downloads": "Most Popular",