Skip to content

Commit

Permalink
resources
Browse files Browse the repository at this point in the history
  • Loading branch information
dnenov committed Oct 31, 2023
1 parent f993ed8 commit 04b8ff4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
9 changes: 9 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2958,6 +2958,9 @@ This package will be unloaded after the next Dynamo restart.</value>
<data name="PackageManagerPublishTab" xml:space="preserve">
<value>Publish a Package</value>
</data>
<data name="PackageManagerPublishOnlineFinishedMessage" xml:space="preserve">
<value>Virus scan in progress. Your package will be searchable in approximately 15 minutes.</value>
</data>
<data name="PackageManagerInstalledPackagesTab" xml:space="preserve">
<value>Installed Packages</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,9 @@ Don't worry, you'll have the option to save your work.</value>
<data name="PackageManagerPublishTab" xml:space="preserve">
<value>Publish a Package</value>
</data>
<data name="PackageManagerPublishOnlineFinishedMessage" xml:space="preserve">
<value>Virus scan in progress. Your package will be searchable in approximately 15 minutes.</value>
</data>
<data name="PackageManagerInstalledPackagesTab" xml:space="preserve">
<value>Installed Packages</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1877,9 +1877,9 @@ private void PublishLocally()
UploadState = PackageUploadHandle.State.Copying;
Uploading = true;

if(RetainFolderStructureOverride)
if (RetainFolderStructureOverride)
{
var updatedFiles = UpdateFilesForRetainFolderStructre(files);
var updatedFiles = UpdateFilesForRetainFolderStructure(files);

// begin publishing to local directory retaining the folder structure
var remapper = new CustomNodePathRemapper(DynamoViewModel.Model.CustomNodeManager,
Expand Down Expand Up @@ -1918,9 +1918,12 @@ private void PublishLocally()
/// </summary>
/// <param name="files"></param>
/// <returns></returns>
private List<List<String>> UpdateFilesForRetainFolderStructre(IEnumerable<string> files)
private IEnumerable<IEnumerable<string>> UpdateFilesForRetainFolderStructure(IEnumerable<string> files)
{
if(!files.Any() || !PreviewPackageContents.Any()) { return null; }
if (!files.Any() || !PreviewPackageContents.Any())
{
return Enumerable.Empty<IEnumerable<string>>();
}

var updatedFiles = files.Select(file =>
{
Expand All @@ -1931,23 +1934,22 @@ private List<List<String>> UpdateFilesForRetainFolderStructre(IEnumerable<string
return file;
}).ToList();

if(PreviewPackageContents.Count() > 1 )
if (PreviewPackageContents.Count() > 1)
{
// we cannot have more than 1 root folder at this stage
return null;
return Enumerable.Empty<IEnumerable<string>>();
}

var updatedFileStructure = new List<List<String>>();
var updatedFileStructure = new List<IEnumerable<string>>();
var packageFolderItem = PreviewPackageContents.First();

// For each
foreach(var root in packageFolderItem.ChildItems)
foreach (var root in packageFolderItem.ChildItems)
{
var updatedFolder = new List<String>();
var updatedFolder = new List<string>();
if (root.DependencyType.Equals(DependencyType.Folder))
{
var folderContents = PackageItemRootViewModel.GetFiles(root);
foreach(var item in folderContents)
foreach (var item in folderContents)
{
if (item.DependencyType.Equals(DependencyType.Folder) || item.DependencyType.Equals(DependencyType.CustomNode)) continue;
if (updatedFiles.Contains(item.FilePath))
Expand All @@ -1956,7 +1958,10 @@ private List<List<String>> UpdateFilesForRetainFolderStructre(IEnumerable<string
}
}
}
else if (root.DependencyType.Equals(DependencyType.CustomNode)) { continue; }
else if (root.DependencyType.Equals(DependencyType.CustomNode))
{
continue;
}
else
{
updatedFolder.Add(root.FilePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
Style="{StaticResource FinishedPageTextStyle}"/>


<TextBlock Text="Virus scan in progress. Your package will be searchable in approximately # minutes."
<TextBlock Text="{x:Static p:Resources.PackageManagerPublishOnlineFinishedMessage}"
Margin="0 3"
FontSize="12"
Style="{StaticResource FinishedPageTextStyle}"/>
Expand Down

0 comments on commit 04b8ff4

Please sign in to comment.