-
Notifications
You must be signed in to change notification settings - Fork 670
Revert "DYN-9702 templates to home screen (#16932)" #17013
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |
| using System.Runtime.InteropServices; | ||
| using System.Text.Json; | ||
| using System.Text.Json.Serialization; | ||
| using System.Threading.Tasks; | ||
| using System.Windows; | ||
| using System.Windows.Controls; | ||
| using Autodesk.DesignScript.Runtime; | ||
|
|
@@ -273,25 +272,24 @@ internal void LoadingDone() | |
| if (startPage == null) { return; } | ||
|
|
||
| SendGuidesData(); | ||
| _ = SendSamplesData(); | ||
| _ = SendTemplateData(); | ||
| _ = SendRecentGraphsData(); | ||
| SendSamplesData(); | ||
| SendRecentGraphsData(); | ||
| SendVideoData(); | ||
| SetLocale(); | ||
| } | ||
|
|
||
| private void RecentFiles_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) | ||
| { | ||
| var recentFiles = startPage.RecentFiles?.DistinctBy(x => x.ContextData).ToList(); | ||
| _ = LoadGraphs(recentFiles); | ||
| LoadGraphs(recentFiles); | ||
| } | ||
|
|
||
| #region FrontEnd Initialization Calls | ||
| /// <summary> | ||
| /// Sends graph data to react app | ||
| /// </summary> | ||
| /// <param name="data"></param> | ||
| private async Task LoadGraphs(List<StartPageListItem> data) | ||
| private async void LoadGraphs(List<StartPageListItem> data) | ||
| { | ||
| if (data == null) { return; } | ||
| string jsonData = JsonSerializer.Serialize(data); | ||
|
|
@@ -302,26 +300,10 @@ private async Task LoadGraphs(List<StartPageListItem> data) | |
| } | ||
|
Comment on lines
292
to
300
|
||
| } | ||
|
|
||
|
|
||
| /// <summary> | ||
| /// Sends graph data to react app | ||
| /// </summary> | ||
| /// <param name="data"></param> | ||
| private async Task LoadTemplates(List<StartPageListItem> data) | ||
| { | ||
| if (data == null) { return; } | ||
| string jsonData = JsonSerializer.Serialize(data); | ||
|
|
||
| if (dynWebView?.CoreWebView2 != null) | ||
| { | ||
| await dynWebView.CoreWebView2.ExecuteScriptAsync(@$"window.receiveTemplatesDataFromDotNet({jsonData})"); | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Sends samples data to react app | ||
| /// </summary> | ||
| private async Task SendSamplesData() | ||
| private async void SendSamplesData() | ||
| { | ||
| if (!this.startPage.SampleFiles.Any()) return; | ||
|
|
||
|
|
@@ -333,21 +315,9 @@ private async Task SendSamplesData() | |
| } | ||
|
Comment on lines
306
to
315
|
||
| } | ||
|
|
||
| /// <summary> | ||
| /// Sends samples data to react app | ||
| /// </summary> | ||
| private async Task SendTemplateData() | ||
| { | ||
| var items = startPage.TemplateFiles?.DistinctBy(x => x.ContextData).ToList(); | ||
| if (items != null && items.Any()) | ||
| { | ||
| await LoadTemplates(items); | ||
| } | ||
| } | ||
|
|
||
| private async Task SendRecentGraphsData() | ||
| private async void SendRecentGraphsData() | ||
| { | ||
| // Send user preferences (could be split to a separate call later instead of coupling with recent files). | ||
| // Send user preferences | ||
| if (dynWebView?.CoreWebView2 != null) | ||
| { | ||
| if (startPage.DynamoViewModel.PreferenceSettings.HomePageSettings != null) | ||
|
|
@@ -364,7 +334,7 @@ private async Task SendRecentGraphsData() | |
| var recentFiles = startPage.RecentFiles?.DistinctBy(x => x.ContextData).ToList(); | ||
| if (recentFiles != null && recentFiles.Any()) | ||
| { | ||
| await LoadGraphs(recentFiles); | ||
| LoadGraphs(recentFiles); | ||
| } | ||
|
|
||
| if (startPage.DynamoViewModel != null && startPage.DynamoViewModel.RecentFiles != null) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HomePage.xaml.csandPackageManagerWizard.xaml.csare now included twice in the project (also present later with<DependentUpon>). Duplicate<Compile Include=...>items typically cause MSBuild errors (duplicate items) and should be removed—keep only the existing entries that includeDependentUpon.