Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-1874: I want to download missing graph package dependencies easily #9854

Merged
merged 26 commits into from
Aug 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
83a995c
Add IPackageInfo interface
scottmitchell Jul 19, 2019
8b244db
Add IPackageInfo interface
scottmitchell Jul 19, 2019
b03663e
Add PackageManagerClient API to intiate download and install of a pac…
scottmitchell Jul 23, 2019
d54d9a4
Add download button to test package download
scottmitchell Jul 23, 2019
9096e8a
Merge Master
scottmitchell Jul 23, 2019
32c867c
Add IPackageInfo interface
scottmitchell Jul 23, 2019
319f497
Use PD state
scottmitchell Jul 23, 2019
f5a4dca
Fix comment
scottmitchell Jul 23, 2019
968caa3
Refactor Dependency Viewer UI
scottmitchell Jul 26, 2019
5b36a36
Rename ExecutePackage -> ExecutePackageDownload
scottmitchell Jul 26, 2019
12e7fd1
Add PackageManagerClientViewModel to ViewLoadedParams
scottmitchell Jul 28, 2019
6ac49fb
Add IPackageDownloader to LoadedViewParams
scottmitchell Jul 29, 2019
7b48355
Move messages to resource file
scottmitchell Jul 29, 2019
0e2395b
Add state-based messages
scottmitchell Jul 29, 2019
5d2ffc3
Font size
scottmitchell Jul 29, 2019
48d8f2a
Keep ReferenceType and INodeLibraryDepInfo internal
scottmitchell Jul 30, 2019
a502ad0
IPackageDownloader.cs -> IPackageInstaller.cs
scottmitchell Jul 30, 2019
0ba290a
IPackageInstaller comments
scottmitchell Jul 30, 2019
50d28e6
Move details message to resx
scottmitchell Jul 30, 2019
5af95b6
Fix resource conflict
scottmitchell Jul 30, 2019
db28e0c
Fix resource conflict
scottmitchell Jul 30, 2019
f9ac4b2
Check terms of use acceptance before downloading package
scottmitchell Aug 3, 2019
8a19113
Embed icons in resources.resx
scottmitchell Aug 3, 2019
1bb8afa
Remove raw resources
scottmitchell Aug 3, 2019
ef2fec8
Add summary to public class
scottmitchell Aug 3, 2019
6ca7e5d
Add summaries for PackageDependencyRow members
scottmitchell Aug 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions src/DynamoCore/Graph/Workspaces/PackageDependencyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Dynamo.Graph.Workspaces
/// <summary>
/// Enum containing the different types of package dependency states.
/// </summary>
internal enum PackageDependencyState
public enum PackageDependencyState
{
Loaded, // Correct package and version loaded.
IncorrectVersion, // Correct package but incorrect version.
Expand All @@ -15,20 +15,36 @@ internal enum PackageDependencyState
RequiresRestart // Restart needed inorder to complete the uninstall of some package.
}

/// <summary>
/// Interface for types containing info about a package
/// </summary>
public interface IPackageInfo
{
/// <summary>
/// Name of the package
/// </summary>
string Name { get; }

/// <summary>
/// Version of the package
/// </summary>
Version Version { get; }
}

/// <summary>
/// Class containing info about a package
/// </summary>
public class PackageInfo
public class PackageInfo : IPackageInfo
{
/// <summary>
/// Name of the package
/// </summary>
internal string Name { get; set; }
public string Name { get; private set; }

/// <summary>
/// Version of the package
/// </summary>
internal Version Version { get; set; }
public Version Version { get; private set; }

/// <summary>
/// Create a package info object from the package name and version
Expand Down Expand Up @@ -133,12 +149,17 @@ interface INodeLibraryDependencyInfo
/// </summary>
[Obsolete("This property is obsolete", false)]
bool IsLoaded { get; set; }

/// <summary>
/// The state of this dependency
/// </summary>
PackageDependencyState State { get; }
}

/// <summary>
/// Class containing info about a workspace package dependency
/// </summary>
internal class PackageDependencyInfo : INodeLibraryDependencyInfo
internal class PackageDependencyInfo : INodeLibraryDependencyInfo, IPackageInfo
{
private PackageDependencyState _state;
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@
<Compile Include="ViewModels\Core\GalleryViewModel.cs" />
<Compile Include="ViewModels\Core\HomeWorkspaceViewModel.cs" />
<Compile Include="ViewModels\Core\SerializationExtensions.cs" />
<Compile Include="ViewModels\PackageManager\IPackageInstaller.cs" />
<Compile Include="ViewModels\PackageManager\PackagePathViewModel.cs" />
<Compile Include="ViewModels\Preview\CompactBubbleViewModel.cs" />
<Compile Include="ViewModels\RunSettingsViewModel.cs" />
Expand Down
8 changes: 8 additions & 0 deletions src/DynamoCoreWpf/Extensions/ViewLoadedParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ public IRenderPackageFactory RenderPackageFactory
get { return dynamoViewModel.RenderPackageFactoryViewModel.Factory; }
}

/// <summary>
/// A reference to package install operations on the package manager
/// </summary>
public IPackageInstaller PackageInstaller
{
get { return dynamoViewModel.PackageManagerClientViewModel; }
}

/// <summary>
/// A reference to the Dynamo Window object. Useful for correctly setting the parent of a
/// newly created window.
Expand Down
20 changes: 19 additions & 1 deletion src/DynamoCoreWpf/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,12 @@ Uninstall the following packages: {0}?</value>
<data name="MessageUninstallSamePackage" xml:space="preserve">
<value>"The package {0} is already installed. To reinstall it, you must first uninstall it and restart to complete the uninstall. Would you like to mark {0} for uninstall?"</value>
</data>
<data name="MessagePackageNotFound" xml:space="preserve">
<value>{0} was not found and could not be downloaded.</value>
</data>
<data name="MessagePackageVersionNotFound" xml:space="preserve">
<value>Version {0} of {1} could not be found.</value>
</data>
<data name="PublishPackageViewPackageHostDependency" xml:space="preserve">
<value>Host Dependency (optional)</value>
</data>
Expand Down
6 changes: 6 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,12 @@ Uninstall the following packages: {0}?</value>
<data name="MessageUninstallSamePackage" xml:space="preserve">
<value>"The package {0} is already installed. To reinstall it, you must first uninstall it and restart to complete the uninstall. Would you like to mark {0} for uninstall?"</value>
</data>
<data name="MessagePackageNotFound" xml:space="preserve">
<value>{0} was not found and could not be downloaded.</value>
</data>
<data name="MessagePackageVersionNotFound" xml:space="preserve">
<value>Version {0} of {1} could not be found.</value>
</data>
<data name="PublishPackageViewPackageHostDependency" xml:space="preserve">
<value>Host Dependency (optional)</value>
</data>
Expand Down
22 changes: 22 additions & 0 deletions src/DynamoCoreWpf/ViewModels/PackageManager/IPackageInstaller.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dynamo.Graph.Workspaces;

namespace Dynamo.ViewModels
{
/// <summary>
/// An interface containing operations for installing Dynamo packages
/// </summary>
public interface IPackageInstaller
{
/// <summary>
/// Initiates download and install of a package
/// </summary>
/// <param name="package">Package Info of the package to be downloaded--includes package name and version</param>
/// <param name="downloadPath">Path to download location of the package</param>
void DownloadAndInstallPackage(IPackageInfo package, string downloadPath = null);
}
}
Loading