Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DynamoDS/Dynamo into dyn-5993_2
Browse files Browse the repository at this point in the history
  • Loading branch information
aparajit-pratap committed Jul 11, 2023
2 parents d2d1a3e + c91c6f8 commit 623fcb8
Show file tree
Hide file tree
Showing 67 changed files with 508 additions and 965 deletions.
10 changes: 10 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,16 @@ https://github.com/JoshClose/CsvHelper/blob/master/LICENSE.txt

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Prism.Core v8.1.97
The MIT License (MIT)
https://github.com/PrismLibrary/Prism/blob/master/LICENSE.txt

Copyright (c) Prism Library

All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

MimeMapping v2.0.0
MIT License
https://licenses.nuget.org/MIT
Expand Down
Empty file.
Binary file removed extern/prism/Microsoft.Practices.Prism.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<NoWarn>MSB3539;CS1591;NUnit2005;NUnit2007;CS0618;CS0612;CS0672</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Practices.Prism">
<HintPath>..\..\extern\prism\Microsoft.Practices.Prism.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System.Design" />
Expand Down
11 changes: 0 additions & 11 deletions src/Dynamo.All.sln
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoCoreWpf", "DynamoCore
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoServicesTests", "..\test\Libraries\NodeServicesTest\DynamoServicesTests.csproj", "{3E4278F7-60EC-491C-8094-B525C36A51A7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XmlDocumentationsUtility", "Tools\XmlDocumentationsUtility\XmlDocumentationsUtility.csproj", "{4CAB9005-0001-4B03-BBA0-57070ED105F1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoConversions", "Libraries\DynamoConversions\DynamoConversions.csproj", "{C5ADC05B-34E8-47BF-8E78-9C7BF96418C2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoShapeManager", "Tools\DynamoShapeManager\DynamoShapeManager.csproj", "{263FA9C1-F81E-4A8E-95E0-8CDAE20F177B}"
Expand Down Expand Up @@ -592,14 +590,6 @@ Global
{3E4278F7-60EC-491C-8094-B525C36A51A7}.Release|Any CPU.Build.0 = Release|Any CPU
{3E4278F7-60EC-491C-8094-B525C36A51A7}.Release|x64.ActiveCfg = Release|x64
{3E4278F7-60EC-491C-8094-B525C36A51A7}.Release|x64.Build.0 = Release|x64
{4CAB9005-0001-4B03-BBA0-57070ED105F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CAB9005-0001-4B03-BBA0-57070ED105F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CAB9005-0001-4B03-BBA0-57070ED105F1}.Debug|x64.ActiveCfg = Debug|Any CPU
{4CAB9005-0001-4B03-BBA0-57070ED105F1}.Debug|x64.Build.0 = Debug|Any CPU
{4CAB9005-0001-4B03-BBA0-57070ED105F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CAB9005-0001-4B03-BBA0-57070ED105F1}.Release|Any CPU.Build.0 = Release|Any CPU
{4CAB9005-0001-4B03-BBA0-57070ED105F1}.Release|x64.ActiveCfg = Release|Any CPU
{4CAB9005-0001-4B03-BBA0-57070ED105F1}.Release|x64.Build.0 = Release|Any CPU
{C5ADC05B-34E8-47BF-8E78-9C7BF96418C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5ADC05B-34E8-47BF-8E78-9C7BF96418C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5ADC05B-34E8-47BF-8E78-9C7BF96418C2}.Debug|x64.ActiveCfg = Debug|x64
Expand Down Expand Up @@ -947,7 +937,6 @@ Global
{ED1EA294-1BA1-45D6-A669-ECD2E24E21A9} = {24A1EF6B-5A24-4536-B8BD-C879ABA26389}
{89563CD0-509B-40A5-8728-9D3EC6FE8410} = {0E492D35-2310-4849-9694-A2A53C09F21B}
{3E4278F7-60EC-491C-8094-B525C36A51A7} = {0E492D35-2310-4849-9694-A2A53C09F21B}
{4CAB9005-0001-4B03-BBA0-57070ED105F1} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1}
{C5ADC05B-34E8-47BF-8E78-9C7BF96418C2} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
{263FA9C1-F81E-4A8E-95E0-8CDAE20F177B} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1}
{98692887-B389-4F73-A71A-9FC516738DAB} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1}
Expand Down
30 changes: 18 additions & 12 deletions src/DynamoCore/Configuration/LuceneConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ internal class LuceneConfig
/// <summary>
/// This represent the fields that will be indexed when initializing Lucene Search
/// </summary>
public enum IndexFieldsEnum
public enum NodeFieldsEnum
{
/// <summary>
/// Name - The name of the node
Expand Down Expand Up @@ -127,26 +127,32 @@ public enum IndexFieldsEnum
/// <summary>
/// Hosts - Package hosts
/// </summary>
Hosts
Hosts,

/// <summary>
/// Node Input Parameters as string (there are nodes with same name and category but different parameters)
/// </summary>
Parameters
}

/// <summary>
/// Nodes Fields to be indexed by Lucene Search
/// </summary>
public static string[] NodeIndexFields = { nameof(IndexFieldsEnum.Name),
nameof(IndexFieldsEnum.FullCategoryName),
nameof(IndexFieldsEnum.Description),
nameof(IndexFieldsEnum.SearchKeywords),
nameof(IndexFieldsEnum.DocName),
nameof(IndexFieldsEnum.Documentation)};
public static string[] NodeIndexFields = { nameof(NodeFieldsEnum.Name),
nameof(NodeFieldsEnum.FullCategoryName),
nameof(NodeFieldsEnum.Description),
nameof(NodeFieldsEnum.SearchKeywords),
nameof(NodeFieldsEnum.DocName),
nameof(NodeFieldsEnum.Documentation),
nameof(NodeFieldsEnum.Parameters)};


/// <summary>
/// Package Fields to be indexed by Lucene Search
/// </summary>
public static string[] PackageIndexFields = { nameof(IndexFieldsEnum.Name),
nameof(IndexFieldsEnum.Description),
nameof(IndexFieldsEnum.SearchKeywords),
nameof(IndexFieldsEnum.Hosts)};
public static string[] PackageIndexFields = { nameof(NodeFieldsEnum.Name),
nameof(NodeFieldsEnum.Description),
nameof(NodeFieldsEnum.SearchKeywords),
nameof(NodeFieldsEnum.Hosts)};
}
}
1 change: 0 additions & 1 deletion src/DynamoCore/Graph/Workspaces/NodesToCodeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Dynamo.Core;
using Dynamo.Engine;
using Dynamo.Engine.NodeToCode;
using Dynamo.Graph.Connectors;
Expand Down
9 changes: 5 additions & 4 deletions src/DynamoCore/Models/DynamoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3253,10 +3253,11 @@ private void AddNodeTypeToSearchIndex(NodeSearchElement node, Document doc)
if (IsTestMode) return;
if (LuceneSearchUtility.addedFields == null) return;

LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.FullCategoryName), node.FullCategoryName);
LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.Name), node.Name);
LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.Description), node.Description);
if (node.SearchKeywords.Count > 0) LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.SearchKeywords), node.SearchKeywords.Aggregate((x, y) => x + " " + y), true, true);
LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.FullCategoryName), node.FullCategoryName);
LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.Name), node.Name);
LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.Description), node.Description);
if (node.SearchKeywords.Count > 0) LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.SearchKeywords), node.SearchKeywords.Aggregate((x, y) => x + " " + y), true, true);
LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.Parameters), node.Parameters?? string.Empty);

LuceneSearchUtility.writer?.AddDocument(doc);
}
Expand Down
30 changes: 16 additions & 14 deletions src/DynamoCore/Utilities/LuceneSearchUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ internal Document InitializeIndexDocumentForNodes()
{
if (DynamoModel.IsTestMode) return null;

var name = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Name), string.Empty, Field.Store.YES);
var fullCategory = new TextField(nameof(LuceneConfig.IndexFieldsEnum.FullCategoryName), string.Empty, Field.Store.YES);
var description = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Description), string.Empty, Field.Store.YES);
var keywords = new TextField(nameof(LuceneConfig.IndexFieldsEnum.SearchKeywords), string.Empty, Field.Store.YES);
var docName = new StringField(nameof(LuceneConfig.IndexFieldsEnum.DocName), string.Empty, Field.Store.YES);
var fullDoc = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Documentation), string.Empty, Field.Store.YES);
var name = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Name), string.Empty, Field.Store.YES);
var fullCategory = new TextField(nameof(LuceneConfig.NodeFieldsEnum.FullCategoryName), string.Empty, Field.Store.YES);
var description = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Description), string.Empty, Field.Store.YES);
var keywords = new TextField(nameof(LuceneConfig.NodeFieldsEnum.SearchKeywords), string.Empty, Field.Store.YES);
var docName = new StringField(nameof(LuceneConfig.NodeFieldsEnum.DocName), string.Empty, Field.Store.YES);
var fullDoc = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Documentation), string.Empty, Field.Store.YES);
var parameters = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Parameters), string.Empty, Field.Store.YES);

var d = new Document()
{
Expand All @@ -93,7 +94,8 @@ internal Document InitializeIndexDocumentForNodes()
description,
keywords,
fullDoc,
docName
docName,
parameters
};
return d;
}
Expand All @@ -106,10 +108,10 @@ internal Document InitializeIndexDocumentForPackages()
{
if (DynamoModel.IsTestMode) return null;

var name = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Name), string.Empty, Field.Store.YES);
var description = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Description), string.Empty, Field.Store.YES);
var keywords = new TextField(nameof(LuceneConfig.IndexFieldsEnum.SearchKeywords), string.Empty, Field.Store.YES);
var hosts = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Hosts), string.Empty, Field.Store.YES);
var name = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Name), string.Empty, Field.Store.YES);
var description = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Description), string.Empty, Field.Store.YES);
var keywords = new TextField(nameof(LuceneConfig.NodeFieldsEnum.SearchKeywords), string.Empty, Field.Store.YES);
var hosts = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Hosts), string.Empty, Field.Store.YES);

var d = new Document()
{
Expand Down Expand Up @@ -196,7 +198,7 @@ internal string CreateSearchQuery(string[] fields, string SearchTerm)
}

var wildcardQuery = new WildcardQuery(new Term(f, searchTerm));
if (f.Equals(nameof(LuceneConfig.IndexFieldsEnum.Name)))
if (f.Equals(nameof(LuceneConfig.NodeFieldsEnum.Name)))
{
wildcardQuery.Boost = LuceneConfig.SearchNameWeight;
}
Expand All @@ -207,7 +209,7 @@ internal string CreateSearchQuery(string[] fields, string SearchTerm)
booleanQuery.Add(wildcardQuery, Occur.SHOULD);

wildcardQuery = new WildcardQuery(new Term(f, "*" + searchTerm + "*"));
if (f.Equals(nameof(LuceneConfig.IndexFieldsEnum.Name)))
if (f.Equals(nameof(LuceneConfig.NodeFieldsEnum.Name)))
{
wildcardQuery.Boost = LuceneConfig.WildcardsSearchNameWeight;
}
Expand All @@ -228,7 +230,7 @@ internal string CreateSearchQuery(string[] fields, string SearchTerm)
}
wildcardQuery = new WildcardQuery(new Term(f, "*" + s + "*"));

if (f.Equals(nameof(LuceneConfig.IndexFieldsEnum.Name)))
if (f.Equals(nameof(LuceneConfig.NodeFieldsEnum.Name)))
{
wildcardQuery.Boost = 5;
}
Expand Down
62 changes: 0 additions & 62 deletions src/DynamoCoreWpf/Controls/RunSettingsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,68 +33,6 @@
</ObjectDataProvider>

<viewModels:RunPeriodConverter x:Key="RunPeriodConverter" />
<Style x:Key="RunButtonStyle"
TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border x:Name="container"
Background="Transparent"
BorderBrush="#FF23A597"
CornerRadius="2"
BorderThickness="1">
<Grid x:Name="inner"
Background="#FF23A597">
<TextBlock x:Name="text"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="14px"
Foreground="#FFFFFF"
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" />
</Grid>
</Border>

<ControlTemplate.Triggers>

<Trigger Property="Button.IsMouseOver"
Value="true">
<Setter TargetName="container"
Property="BorderBrush"
Value="#26808080" />
<Setter TargetName="container"
Property="BorderThickness"
Value="2" />
</Trigger>

<Trigger Property="Button.IsPressed"
Value="true">
<Setter TargetName="container"
Property="BorderBrush"
Value="#40808080" />
<Setter TargetName="container"
Property="BorderThickness"
Value="4" />
</Trigger>

<Trigger Property="Button.IsEnabled"
Value="false">
<Setter TargetName="inner"
Property="Background"
Value="#218d81" />
<Setter TargetName="text"
Property="Foreground"
Value="#bebebe" />
<Setter TargetName="container"
Property="BorderBrush"
Value="#218d81" />
</Trigger>
</ControlTemplate.Triggers>

</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
</UserControl.Resources>

Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Dynamo.UI.Commands;
using Dynamo.ViewModels;
using Dynamo.Wpf.ViewModels.Core;
using Microsoft.Practices.Prism.ViewModel;
using Dynamo.Core;
using Greg.AuthProviders;
using System.Linq;
using System.Windows;
Expand Down
33 changes: 20 additions & 13 deletions src/DynamoCoreWpf/Controls/StartPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Dynamo.Utilities;
using Dynamo.ViewModels;
using Dynamo.Wpf.Properties;
using Microsoft.Practices.Prism.ViewModel;
using Dynamo.Core;

namespace Dynamo.UI.Controls
{
Expand Down Expand Up @@ -368,25 +368,32 @@ private void RefreshFileList(ObservableCollection<StartPageListItem> files,
files.Clear();
foreach (var filePath in filePaths)
{
var extension = Path.GetExtension(filePath).ToUpper();
// If not extension specified and code reach here, this means this is still a valid file
// only without file type. Otherwise, simply take extension substring skipping the 'dot'.
var subScript = extension.IndexOf(".") == 0 ? extension.Substring(1) : "";
var caption = Path.GetFileNameWithoutExtension(filePath);
try
{
var extension = Path.GetExtension(filePath).ToUpper();
// If not extension specified and code reach here, this means this is still a valid file
// only without file type. Otherwise, simply take extension substring skipping the 'dot'.
var subScript = extension.IndexOf(".") == 0 ? extension.Substring(1) : "";
var caption = Path.GetFileNameWithoutExtension(filePath);

files.Add(new StartPageListItem(caption)
files.Add(new StartPageListItem(caption)
{
ContextData = filePath,
ToolTip = filePath,
SubScript = subScript,
ClickAction = StartPageListItem.Action.FilePath
});
}
catch (ArgumentException ex)
{
ContextData = filePath,
ToolTip = filePath,
SubScript = subScript,
ClickAction = StartPageListItem.Action.FilePath
});
DynamoViewModel.Model.Logger.Log("File path is not valid: " + ex.StackTrace);
}
}
}

private void HandleRegularCommand(StartPageListItem item)
{
var dvm = this.DynamoViewModel;
var dvm = this.DynamoViewModel;

switch (item.ContextData)
{
Expand Down
Loading

0 comments on commit 623fcb8

Please sign in to comment.