From 2e752ce186fc34f5530841bdac7537ee775ed3f6 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 5 May 2024 17:24:14 +0300 Subject: Job uploader from FSE/RSM. User password reset from FSE. Connectivity check method set to Windows by default. --- .../ViewModels/UserDetailsViewVM.cs | 35 +++++++- .../Views/UserDetailsView.xaml | 10 +++ .../Tango.FSE.BL/Services/OrganizationsService.cs | 8 +- .../FSE/Tango.FSE.Common/FSESettings.cs | 7 +- .../RemoteJobUpload/IRemoteJobUploadProvider.cs | 3 +- .../FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml | 63 ++++++++++++++ .../FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml.cs | 74 +++++++++++++++++ .../FSE/Tango.FSE.UI/Dialogs/JobUploadViewVM.cs | 52 ++++++++++++ .../FSE/Tango.FSE.UI/Images/job_upload.png | Bin 0 -> 2401 bytes .../Tango.FSE.UI/Images/job_upload_disabled.png | Bin 0 -> 2251 bytes .../DefaultRemoteJobUploadProvider.cs | 5 +- .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 14 ++++ .../FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs | 92 +++++++++++++++++++++ .../FSE/Tango.FSE.UI/Views/LayoutView.xaml | 16 ++++ .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../Tango.BL/Helpers/SegmentsCsvHelper.cs | 2 +- 16 files changed, 374 insertions(+), 9 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadViewVM.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/job_upload.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/job_upload_disabled.png (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/UserDetailsViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/UserDetailsViewVM.cs index 9f021ddb1..701e67aa8 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/UserDetailsViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/UserDetailsViewVM.cs @@ -36,6 +36,20 @@ namespace Tango.FSE.UsersAndRoles.ViewModels set { _organization = value; RaisePropertyChangedAuto(); } } + private bool _isResetUserPassword; + public bool IsResetUserPassword + { + get { return _isResetUserPassword; } + set { _isResetUserPassword = value; RaisePropertyChangedAuto(); } + } + + private String _resetPassword; + public String ResetPassword + { + get { return _resetPassword; } + set { _resetPassword = value; RaisePropertyChangedAuto(); } + } + private bool _isNewUser; public bool IsNewUser { @@ -121,11 +135,26 @@ namespace Tango.FSE.UsersAndRoles.ViewModels public RelayCommand GeneratePasswordCommand { get; set; } + public RelayCommand ResetPasswordCommand { get; set; } + + public RelayCommand GenerateResetPasswordCommand { get; set; } + public UserDetailsViewVM() { SaveCommand = new RelayCommand(Save, () => IsFree); GeneratePasswordCommand = new RelayCommand(GeneratePassword); SendInvitation = true; + + ResetPasswordCommand = new RelayCommand(() => { IsResetUserPassword = true; GenerateResetPassword(); }); + GenerateResetPasswordCommand = new RelayCommand(GenerateResetPassword); + } + + private void GenerateResetPassword() + { + if (IsResetUserPassword) + { + ResetPassword = Services.OrganizationsService.GenerateRandomPassword(); + } } private void GeneratePassword() @@ -190,7 +219,7 @@ namespace Tango.FSE.UsersAndRoles.ViewModels bool user_is_current_user_and_fse_admin_and_not_twine_admin = user.Guid == CurrentUser.Guid && user.HasRole(Roles.FSEAdministrator) && !user.HasRole(Roles.FSETwineAdministrator); var collection = new RolesCollection(); - collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETechnician)) { IsSelected = isNew}); + collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSETechnician)) { IsSelected = isNew }); collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSEAdvancedTechnician), Roles.FSETechnician)); collection.Add(new RoleModel(roles.SingleOrDefault(x => x.RoleEnum == Roles.FSEAdministrator), Roles.FSETechnician, Roles.FSEAdvancedTechnician) { IsEnabled = !user_is_current_user_and_fse_admin_and_not_twine_admin }); @@ -273,7 +302,7 @@ namespace Tango.FSE.UsersAndRoles.ViewModels if (!IsNewUser) { - await Services.OrganizationsService.UpdateUser(User); + await Services.OrganizationsService.UpdateUser(User, IsResetUserPassword, ResetPassword); } else { @@ -386,6 +415,8 @@ namespace Tango.FSE.UsersAndRoles.ViewModels public void OnNavigatedToWithObject(NavigationObject obj) { + IsResetUserPassword = false; + ResetPassword = null; User = null; IsNewUser = obj.IsNewUser; Organization = obj.Organization; diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/Views/UserDetailsView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/Views/UserDetailsView.xaml index fe6ba4ea3..0df85dea8 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/Views/UserDetailsView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/Views/UserDetailsView.xaml @@ -71,6 +71,12 @@ + + + + + + @@ -155,6 +161,10 @@ Send invitation via email + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + diff --git a/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs b/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs index 18dde341b..28c227a8d 100644 --- a/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs +++ b/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs @@ -476,7 +476,7 @@ namespace Tango.BL.Helpers }); } - static async void ToFile(String filePath, List segments) + public static async void ToFile(String filePath, List segments) { await Task.Factory.StartNew(() => { -- cgit v1.3.1