From cb8d22ee5bc00510a8cf91e4b5a5c499f6ae4190 Mon Sep 17 00:00:00 2001 From: PramodKumarHK89 Date: Fri, 26 Aug 2022 22:42:21 +0530 Subject: [PATCH] UI updates + guideme feature UI updates + guideme feature --- IdAceCodeEditor/Models/DataSource.cs | 36 +++++- IdAceCodeEditor/Models/Framework.cs | 7 +- IdAceCodeEditor/Models/Sample.cs | 2 + .../Services/ConfigureAzureAdApp.cs | 2 +- .../ViewModels/AppListViewModel.cs | 1 + IdAceCodeEditor/Views/AppList.xaml | 69 ++++++------ IdAceCodeEditor/Views/AppList.xaml.cs | 3 + .../Views/AutomaticAppCreationWindow.xaml | 22 ++-- IdAceCodeEditor/Views/CertificateWindow.xaml | 68 ++++------- .../Views/CertificateWindow.xaml.cs | 1 + IdAceCodeEditor/Views/ExistingCertWindow.xaml | 92 ++++++--------- IdAceCodeEditor/Views/GuideMeWindow.xaml | 50 +++++++++ IdAceCodeEditor/Views/GuideMeWindow.xaml.cs | 25 +++++ IdAceCodeEditor/Views/IdAceCodeEditor.xaml | 47 +++++--- IdAceCodeEditor/Views/ListCerts.xaml | 51 +++++---- .../Views/ManualAppdetailsCollection.xaml | 24 ++-- IdAceCodeEditor/Views/Prerequisites.xaml | 106 ++++++++++-------- IdAceCodeEditor/Views/SecretManagement.xaml | 46 ++++---- 18 files changed, 379 insertions(+), 273 deletions(-) create mode 100644 IdAceCodeEditor/Views/GuideMeWindow.xaml create mode 100644 IdAceCodeEditor/Views/GuideMeWindow.xaml.cs diff --git a/IdAceCodeEditor/Models/DataSource.cs b/IdAceCodeEditor/Models/DataSource.cs index 60aa10a..89c715a 100644 --- a/IdAceCodeEditor/Models/DataSource.cs +++ b/IdAceCodeEditor/Models/DataSource.cs @@ -1,12 +1,46 @@ -using System; +using IdAceCodeEditor.Views; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text; +using System.Windows; +using System.Windows.Input; namespace IdAceCodeEditor { public class DataSource { public ObservableCollection Frameworks{ get; set; } + + private ICommand _guideMeCommand; + + public ICommand GuideMeCommand + { + get + { + if (_guideMeCommand == null) + { + _guideMeCommand = new RelayCommand( + param => this.GuideMe(param), + param => this.CanGuideMe() + ); + } + return _guideMeCommand; + } + } + + private bool CanGuideMe() + { + return true; + // Verify command can be executed here + } + + private void GuideMe(object o) + { + GuideMeWindow guideMe = new GuideMeWindow(this); + guideMe.Owner = (Window)o; + guideMe.ShowDialog(); + + } } } diff --git a/IdAceCodeEditor/Models/Framework.cs b/IdAceCodeEditor/Models/Framework.cs index 431bf4c..ee95e17 100644 --- a/IdAceCodeEditor/Models/Framework.cs +++ b/IdAceCodeEditor/Models/Framework.cs @@ -1,7 +1,9 @@ -using System; +using IdAceCodeEditor.Views; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text; +using System.Windows.Input; namespace IdAceCodeEditor { @@ -9,6 +11,7 @@ public class Framework { public string Name { get; set; } public string DisplayName { get; set; } - public ObservableCollection Samples{ get; set; } + public ObservableCollection Samples { get; set; } + } } diff --git a/IdAceCodeEditor/Models/Sample.cs b/IdAceCodeEditor/Models/Sample.cs index 14018e3..911c586 100644 --- a/IdAceCodeEditor/Models/Sample.cs +++ b/IdAceCodeEditor/Models/Sample.cs @@ -60,6 +60,7 @@ private void ConfigureWithAzureAd(object o) foreach (var item in Projects) { AppList objWindow = new AppList(persistData, clonnedPath, item); + objWindow.Owner = (Window)o; if (objWindow.ShowDialog() == false) { isCorrect = false; @@ -119,6 +120,7 @@ private void ConfigureManually(object o) foreach (var item in Projects) { ManualAppdetailsCollection objWindow = new ManualAppdetailsCollection(clonnedPath, item); + objWindow.Owner = (Window)o; if (objWindow.ShowDialog() == false) { isCorrect = false; diff --git a/IdAceCodeEditor/Services/ConfigureAzureAdApp.cs b/IdAceCodeEditor/Services/ConfigureAzureAdApp.cs index 2ef3679..b8c2527 100644 --- a/IdAceCodeEditor/Services/ConfigureAzureAdApp.cs +++ b/IdAceCodeEditor/Services/ConfigureAzureAdApp.cs @@ -295,7 +295,7 @@ await graphClient. { _project.PortalSettings.Certificate.WorkingFolder = _project.AbsoluteProjectPath; - CertificateWindow certificateWindow = new CertificateWindow(_project.PortalSettings.Certificate); + CertificateWindow certificateWindow = new CertificateWindow(_project.PortalSettings.Certificate); if (certificateWindow.ShowDialog() == true) { var keyCredential = new KeyCredential diff --git a/IdAceCodeEditor/ViewModels/AppListViewModel.cs b/IdAceCodeEditor/ViewModels/AppListViewModel.cs index b07c5a7..b679a1f 100644 --- a/IdAceCodeEditor/ViewModels/AppListViewModel.cs +++ b/IdAceCodeEditor/ViewModels/AppListViewModel.cs @@ -68,6 +68,7 @@ private async void CreateApp(object o) { var window = (AppList)o; AutomaticAppCreationWindow objWindow = new AutomaticAppCreationWindow(_project); + objWindow.Owner = window; if (objWindow.ShowDialog() == true) { var authResult = await _ConfigureAzureAdApp.AuthenticateWithAzureAd(CREATESCOPES, window); diff --git a/IdAceCodeEditor/Views/AppList.xaml b/IdAceCodeEditor/Views/AppList.xaml index 8ee3fdc..bafbb50 100644 --- a/IdAceCodeEditor/Views/AppList.xaml +++ b/IdAceCodeEditor/Views/AppList.xaml @@ -5,51 +5,56 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:IdAceCodeEditor" mc:Ignorable="d" - Title="AppList" Height="450" Width="800" Loaded="Window_Loaded"> + Title="Configure Azure App regsitration" WindowStartupLocation="CenterOwner" Height="650" Width="800" Loaded="Window_Loaded"> - + - + - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + diff --git a/IdAceCodeEditor/Views/CertificateWindow.xaml.cs b/IdAceCodeEditor/Views/CertificateWindow.xaml.cs index c0a7a54..57ec96d 100644 --- a/IdAceCodeEditor/Views/CertificateWindow.xaml.cs +++ b/IdAceCodeEditor/Views/CertificateWindow.xaml.cs @@ -39,6 +39,7 @@ private void Button_Click(object sender, RoutedEventArgs e) ExistingCertWindow obExsiting = new ExistingCertWindow(false, !cert.Type.Equals("PemFile"), !cert.Type.Equals("PfxFile")); + obExsiting.Owner = this; if (obExsiting.ShowDialog() == true) { cert.CertName = obExsiting.CertFileName; diff --git a/IdAceCodeEditor/Views/ExistingCertWindow.xaml b/IdAceCodeEditor/Views/ExistingCertWindow.xaml index 7ab9423..298a197 100644 --- a/IdAceCodeEditor/Views/ExistingCertWindow.xaml +++ b/IdAceCodeEditor/Views/ExistingCertWindow.xaml @@ -5,71 +5,51 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:IdAceCodeEditor.Views" mc:Ignorable="d" - Title="ExistingCertWindow" Height="450" Width="800"> - - - - - - - - - - - - - - + Title="ExistingCertWindow" Height="250" Width="500" WindowStartupLocation="CenterOwner"> - - + - + + - - - - - - - - - - - - - + + + + + - - - + + + + + - - - + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/IdAceCodeEditor/Views/GuideMeWindow.xaml b/IdAceCodeEditor/Views/GuideMeWindow.xaml new file mode 100644 index 0000000..a5f5b07 --- /dev/null +++ b/IdAceCodeEditor/Views/GuideMeWindow.xaml @@ -0,0 +1,50 @@ + + + + + + + + + + + + Select the aplication platform + + + + + + If the application interactive and user is involved, then please select this option + If the application daemon and operates without UI, then please select this option + + + + + Application implements sign-in feature to the users + Application implements sign-in feature to the users and then calls graph resources + Application implements sign-in feature to the users and then calls custom API + + + + + Usage of certificate + Store Certificate in Azure KeyVault + CAE + + + + + + + + + + diff --git a/IdAceCodeEditor/Views/GuideMeWindow.xaml.cs b/IdAceCodeEditor/Views/GuideMeWindow.xaml.cs new file mode 100644 index 0000000..ba8a55c --- /dev/null +++ b/IdAceCodeEditor/Views/GuideMeWindow.xaml.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace IdAceCodeEditor.Views +{ + /// + /// Interaction logic for GuideMeWindow.xaml + /// + public partial class GuideMeWindow : Window + { + public GuideMeWindow(DataSource framework) + { + InitializeComponent(); + } + } +} diff --git a/IdAceCodeEditor/Views/IdAceCodeEditor.xaml b/IdAceCodeEditor/Views/IdAceCodeEditor.xaml index c232044..100fc73 100644 --- a/IdAceCodeEditor/Views/IdAceCodeEditor.xaml +++ b/IdAceCodeEditor/Views/IdAceCodeEditor.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:IdAceCodeEditor" mc:Ignorable="d" Loaded="Window_Loaded" - Title="IdAceCodeEditor" Height="450" Width="800"> + Title="IdAceCodeEditor" Height="500" Width="800"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + Enter the existing secret + + + + + + + + + + \ No newline at end of file