Skip to content

Commit 6ff387a

Browse files
author
Paul van Brenk
committed
Fixes an issue where the NPM UI would not update on Install
1 parent 35f872e commit 6ff387a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Nodejs/Product/Nodejs/NpmUI/PackageCatalogEntryViewModel.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Collections.Generic;
55
using System.Linq;
6+
using System.Windows;
67
using Microsoft.NodejsTools.Npm;
78

89
namespace Microsoft.NodejsTools.NpmUI
@@ -34,12 +35,26 @@ protected PackageCatalogEntryViewModel(
3435
}
3536

3637
public virtual string Name { get; }
38+
39+
public string Version => this.version?.ToString() ?? string.Empty;
40+
3741
public IEnumerable<SemverVersion> AvailableVersions { get; }
42+
3843
public string Author { get; }
44+
public Visibility AuthorVisibility => string.IsNullOrEmpty(this.Author) ? Visibility.Collapsed : Visibility.Visible;
45+
3946
public string Description { get; }
47+
public Visibility DescriptionVisibility => string.IsNullOrEmpty(this.Description) ? Visibility.Collapsed : Visibility.Visible;
48+
4049
public IEnumerable<string> Homepages { get; }
50+
public Visibility HomepagesVisibility => this.Homepages.Any() ? Visibility.Visible : Visibility.Collapsed;
51+
4152
public string Keywords { get; }
4253

54+
public bool IsInstalledLocally => this.localVersion.HasValue;
55+
public bool IsLocalInstallOutOfDate => this.localVersion.HasValue && this.localVersion < this.version;
56+
public string LocalVersion => this.localVersion?.ToString() ?? string.Empty;
57+
4358
public override string ToString()
4459
{
4560
return this.Name;

0 commit comments

Comments
 (0)