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-6313 Add ML Node AutoComplete TOU #14625

Merged
merged 9 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
195 changes: 195 additions & 0 deletions doc/distrib/MLNodeAutocompleteConsent.rtf

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ internal readonly static Lazy<PreferenceSettings>
private bool isTimeStampIncludedInExportFilePath;
private bool isCreatedFromValidFile = true;
private string backupLocation;
private bool isMLAutocompleteTOUApproved;

#region Constants
/// <summary>
Expand Down Expand Up @@ -696,6 +697,21 @@ public bool EnableStaticSplashScreen
}
}

/// <summary>
/// This defines if the user is agree to the ML Automcomplete Terms of Use
/// </summary>
public bool IsMLAutocompleteTOUApproved
{
get
{
return isMLAutocompleteTOUApproved;
}
set
{
isMLAutocompleteTOUApproved = value;
}
}

/// <summary>
/// Engine used by default for new Python script and string nodes. If not empty, this takes precedence over any system settings.
/// </summary>
Expand Down Expand Up @@ -932,6 +948,7 @@ public PreferenceSettings()
DynamoPlayerFolderGroups = new List<DynamoPlayerFolderGroup>();
backupLocation = string.Empty;
GraphChecksumItemsList = new List<GraphChecksumItem>();
isMLAutocompleteTOUApproved = false;
}

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCore/DynamoCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
<Copy SourceFiles="$(SolutionDir)..\doc\distrib\TermsOfUse.rtf" DestinationFolder="$(OutputPath)" />
<Copy SourceFiles="$(SolutionDir)..\doc\distrib\InstrumentationConsent.rtf" DestinationFolder="$(OutputPath)" />
<Copy SourceFiles="$(SolutionDir)..\doc\distrib\ADPAnalyticsConsent.rtf" DestinationFolder="$(OutputPath)" />
<Copy SourceFiles="$(SolutionDir)..\doc\distrib\MLNodeAutocompleteConsent.rtf" DestinationFolder="$(OutputPath)" />
<Copy SourceFiles="@(NodeHelpMDFiles)" DestinationFolder="$(OutputPath)\en-US\fallback_docs\" />
<Copy SourceFiles="@(NodeHelpDYNFiles)" DestinationFolder="$(OutputPath)\NodeHelpSharedDocs\" />
<Copy SourceFiles="@(NodeHelpTXTFiles)" DestinationFolder="$(OutputPath)\en-US\fallback_docs\" />
Expand Down
15 changes: 12 additions & 3 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

11 changes: 7 additions & 4 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ Don't worry, you'll have the option to save your work.</value>
<comment>Setting menu | Decimal inch</comment>
</data>
<data name="DynamoViewSettingMenuShowDataReportingDialog" xml:space="preserve">
<value>Agreement to _Collect Usability Data</value>
<value>Agreement and _Terms of Use</value>
<comment>Dynamo menu | Show user agreement dialog about data collecting</comment>
</data>
<data name="DynamoViewSettingMenuFractionalFoot" xml:space="preserve">
Expand Down Expand Up @@ -2157,7 +2157,10 @@ Installing the latest update requires Dynamo and any host applications to close.
Do you want to install the latest Dynamo update?</value>
</data>
<data name="UsageReportPromptDialogTitle" xml:space="preserve">
<value>Agreement to Collect Usability Data</value>
<value>Agreement and Terms of Use</value>
</data>
<data name="AgreeToMLAutocompleteTOUText" xml:space="preserve">
<value>I agree to ML Node Autocomplete Terms of Use</value>
</data>
<data name="UseLevelKeepListStructureHint" xml:space="preserve">
<value>Keep 1 input list's nesting</value>
Expand Down Expand Up @@ -2250,7 +2253,7 @@ Uninstall the following packages: {0}?</value>
<value>Filter by</value>
</data>
<data name="DynamoViewSettingMenuShowDataReportingDialogTooltip" xml:space="preserve">
<value>Display the dialog for user to pick agreement on data collecting.</value>
<value>Display the dialog of agreement on data collecting and Machine Learning Node Autocomplete terms of use</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="psDynamoMesh" type="System.Resources.ResXFileRef, System.Windows.Forms">
Expand Down Expand Up @@ -3771,4 +3774,4 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="ElementBindingDesc" xml:space="preserve">
<value>Element Binding allows a two-way interaction between Dynamo and the host application like Revit or Civil3D where a user can select an element in the host document and have Dynamo "bind" that element to a node in the workspace.</value>
</data>
</root>
</root>
13 changes: 8 additions & 5 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
<comment>Setting menu | Decimal inch</comment>
</data>
<data name="DynamoViewSettingMenuShowDataReportingDialog" xml:space="preserve">
<value>Agreement to _Collect Usability Data</value>
<value>Agreement and _Terms of Use</value>
<comment>Dynamo menu | Show user agreement dialog about data collecting</comment>
</data>
<data name="DynamoViewSettingShowRunPreview" xml:space="preserve">
Expand Down Expand Up @@ -1151,7 +1151,10 @@ Don't worry, you'll have the option to save your work.</value>
<value>Cancel</value>
</data>
<data name="UsageReportPromptDialogTitle" xml:space="preserve">
<value>Agreement to Collect Usability Data</value>
<value>Agreement and Terms of Use</value>
</data>
<data name="AgreeToMLAutocompleteTOUText" xml:space="preserve">
<value>I agree to ML Node Autocomplete Terms of Use</value>
</data>
<data name="DynamoViewContextMenuClearLog" xml:space="preserve">
<value>Clear</value>
Expand Down Expand Up @@ -1303,7 +1306,7 @@ Don't worry, you'll have the option to save your work.</value>
</data>
<data name="PackageManagerNoInstalledPackagesSubMessage" xml:space="preserve">
<value>Once you install a package, you can find it here.</value>
</data>
</data>
<data name="PackagerManageUserNotSignedPackagesMessage" xml:space="preserve">
<value>Sign in to your Dynamo account to view your published packages.</value>
</data>
Expand Down Expand Up @@ -2528,7 +2531,7 @@ Uninstall the following packages: {0}?</value>
<value>Filter by</value>
</data>
<data name="DynamoViewSettingMenuShowDataReportingDialogTooltip" xml:space="preserve">
<value>Display the dialog for user to pick agreement on data collecting.</value>
<value>Display the dialog of agreement on data collecting and Machine Learning Node Autocomplete terms of use</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="psDynamoMesh" type="System.Resources.ResXFileRef, System.Windows.Forms">
Expand Down Expand Up @@ -3758,4 +3761,4 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="ElementBindingDesc" xml:space="preserve">
<value>Element Binding allows a two-way interaction between Dynamo and the host application like Revit or Civil3D where a user can select an element in the host document and have Dynamo "bind" that element to a node in the workspace.</value>
</data>
</root>
</root>
44 changes: 40 additions & 4 deletions src/DynamoCoreWpf/UI/Prompts/UsageReportingAgreementPrompt.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
WindowStyle="None"
MinWidth="530"
MaxWidth="650"
Height="310"
Height="485"
ResizeMode="NoResize"
ShowInTaskbar="False"
AllowsTransparency="True"
Expand Down Expand Up @@ -98,6 +98,8 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="145"></RowDefinition>
<RowDefinition Height="145"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
Expand Down Expand Up @@ -178,19 +180,53 @@
Background="Transparent"
OpenLinksInBrowser="True"
BorderThickness="0" />

</ScrollViewer>
</Border>
<Border Background="#E6E6E6"
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="0 15 3 0"
Padding="0">
<ScrollViewer
Padding="0"
HorizontalScrollBarVisibility="Disabled"
Margin="0 0 -18 0">

<views:RichTextFile x:Name="MLNodeAutocompleteConsent"
Padding="5 5 15 10"
IsReadOnly="True"
IsEnabled="True"
IsDocumentEnabled="True"
Margin="0 5"
Foreground="{StaticResource DarkThemeInputBoxBackgroundBrush}"
Background="Transparent"
OpenLinksInBrowser="True"
BorderThickness="0" />

</ScrollViewer>
</Border>

<StackPanel Orientation="Vertical"
Grid.Row="2"
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="2">

<Rectangle Style="{StaticResource DividerRectangleStyle}" Margin="-15 15 -15 0"/>

</StackPanel>

<StackPanel Orientation="Horizontal"
Margin="0,20,0,10"
Grid.Row="4">
<CheckBox x:Name="AgreeToMLAutocompleteTOUCheckbox"/>
<TextBlock x:Name="AgreeToMLAutocompleteTOUTextbox"
Margin="10,0,0,0"
Text="{x:Static p:Resources.AgreeToMLAutocompleteTOUText}"/>
</StackPanel>
<!--Configure ADP Consent-->
<Button Grid.Row="3"
<Button Grid.Row="5"
Grid.Column="0"
x:Name="configure_adp_button"
Background="White"
Expand All @@ -205,7 +241,7 @@
Click="configure_adp_button_Click" />

<!--Continue Button-->
<Button Grid.Row="3"
<Button Grid.Row="5"
Grid.Column="1"
x:Name="okButton"
BorderBrush="#0696D7"
Expand Down
22 changes: 11 additions & 11 deletions src/DynamoCoreWpf/UI/Prompts/UsageReportingAgreementPrompt.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using Dynamo.Logging;
using Dynamo.Services;
using Dynamo.ViewModels;
using Dynamo.Wpf.Interfaces;

Expand All @@ -28,28 +26,30 @@ public UsageReportingAgreementPrompt(IBrandingResourceProvider resourceProvider,
InitializeComponent();
if (resourceProvider != null)
{
TitleTextBlock.Text = resourceProvider.GetString(Wpf.Interfaces.ResourceNames.ConsentForm.Title);
TitleTextBlock.Text = resourceProvider.GetString(ResourceNames.ConsentForm.Title);
}

viewModel = dynamoViewModel;

// Resolve and load ADP Analytics Consent file
var adpAnalyticsFile = "ADPAnalyticsConsent.rtf";

if (viewModel.Model.PathManager.ResolveDocumentPath(ref adpAnalyticsFile))
ADPAnalyticsConsent.File = adpAnalyticsFile;

//disable adp configure dialog version check fails.
// disable adp configuration if version check fails.
//also disabled below id all analytics disabled.
configure_adp_button.IsEnabled = AnalyticsService.IsADPAvailable();

if (Analytics.DisableAnalytics)
{
configure_adp_button.IsEnabled = false;
}

// Resolve and load ML Node Autocomplete Consent file
var mlNodeAutocompleteFile = "MLNodeAutocompleteConsent.rtf";
if (viewModel.Model.PathManager.ResolveDocumentPath(ref adpAnalyticsFile))
MLNodeAutocompleteConsent.File = mlNodeAutocompleteFile;
// Initialize the checkbox to the current value
AgreeToMLAutocompleteTOUCheckbox.IsChecked = dynamoViewModel.PreferenceSettings.IsMLAutocompleteTOUApproved;
}

private void OnContinueClick(object sender, RoutedEventArgs e)
{
viewModel.PreferenceSettings.IsMLAutocompleteTOUApproved = AgreeToMLAutocompleteTOUCheckbox.IsChecked ?? false;
Close();
}

Expand Down
1 change: 1 addition & 0 deletions test/settings/DynamoSettings-NewSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<HideAutocompleteMethodOptions>true</HideAutocompleteMethodOptions>
<EnableNotificationCenter>false</EnableNotificationCenter>
<EnableStaticSplashScreen>false</EnableStaticSplashScreen>
<IsMLAutocompleteTOUApproved>true</IsMLAutocompleteTOUApproved>
<IsTimeStampIncludedInExportFilePath>false</IsTimeStampIncludedInExportFilePath>
<EnablePersistExtensions>true</EnablePersistExtensions>
<DefaultPythonEngine/>
Expand Down
Loading