Added: Password change for User

This commit is contained in:
TheJoKlLa 2022-07-12 22:30:37 +02:00
parent 64f5fe0a07
commit f0a01175a8
9 changed files with 41 additions and 16 deletions

View File

@ -51,6 +51,7 @@ namespace Borepin
containerRegistry.RegisterForNavigation<UserListPage, UserListPageModel>(); containerRegistry.RegisterForNavigation<UserListPage, UserListPageModel>();
containerRegistry.RegisterForNavigation<UserPage, UserPageModel>(); containerRegistry.RegisterForNavigation<UserPage, UserPageModel>();
containerRegistry.RegisterForNavigation<AddUserPage, AddUserPageModel>(); containerRegistry.RegisterForNavigation<AddUserPage, AddUserPageModel>();
containerRegistry.RegisterForNavigation<ProfilePage, ProfilePageModel>();
#endregion #endregion
#region Register Sequence Navigation #region Register Sequence Navigation

View File

@ -12,7 +12,9 @@
</StackLayout> </StackLayout>
<StackLayout Margin="0,50,0,50"> <StackLayout Margin="0,50,0,50">
<Button Text="{x:Static resource_text:TextResource.MainPage_Servers}" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}" VerticalOptions="End"/> <Button Text="{x:Static resource_text:TextResource.MainPage_Servers}" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}" VerticalOptions="End"/>
<!--<Button Text="{x:Static resource_text:TextResource.MainPage_Profile}" Command="{Binding NavigateCommand}" CommandParameter="ProfilePage" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}" VerticalOptions="End"/>--> <StackLayout IsVisible="{Binding IsConnected}">
<Button Text="{x:Static resource_text:TextResource.MainPage_Profile}" Command="{Binding NavigateCommand}" CommandParameter="ProfilePage" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}" VerticalOptions="End"/>
</StackLayout>
</StackLayout> </StackLayout>
<StackLayout Margin="0,0,0,10"> <StackLayout Margin="0,0,0,10">
<Label Text="{Binding CurrentVersion, StringFormat='Version: {0}'}" VerticalOptions="End" Margin="10,0,0,0" TextColor="{StaticResource FirstColor}"/> <Label Text="{Binding CurrentVersion, StringFormat='Version: {0}'}" VerticalOptions="End" Margin="10,0,0,0" TextColor="{StaticResource FirstColor}"/>

View File

@ -5,6 +5,11 @@
xmlns:converters="clr-namespace:Borepin.Converter" xmlns:converters="clr-namespace:Borepin.Converter"
xmlns:resource_text="clr-namespace:Borepin.Resources.Text" xmlns:resource_text="clr-namespace:Borepin.Resources.Text"
Title="{x:Static resource_text:TextResource.TITLE_Profile}"> Title="{x:Static resource_text:TextResource.TITLE_Profile}">
<ContentPage.Resources>
<ResourceDictionary>
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content> <ContentPage.Content>
<StackLayout Padding="20"> <StackLayout Padding="20">
<StackLayout IsVisible="{Binding IsBusy}"> <StackLayout IsVisible="{Binding IsBusy}">
@ -12,7 +17,7 @@
</StackLayout> </StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}"> <StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<StackLayout IsVisible="{Binding IsConnected}"> <StackLayout IsVisible="{Binding IsConnected}">
<Label Text="{Binding UserItem.Name}" Style="{StaticResource LabelStyle_Title}"/> <Label Text="{Binding UserItem.Username}" Style="{StaticResource LabelStyle_Title}"/>
<Label Text="{x:Static resource_text:TextResource.ProfilePage_ChangePassword}" Style="{StaticResource Style_Label_Property_Title}"/> <Label Text="{x:Static resource_text:TextResource.ProfilePage_ChangePassword}" Style="{StaticResource Style_Label_Property_Title}"/>
<Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_OldPassword}" Text="{Binding OldPassword}"/> <Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_OldPassword}" Text="{Binding OldPassword}"/>
<Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_NewPassword}" Text="{Binding NewPassword}"/> <Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_NewPassword}" Text="{Binding NewPassword}"/>

View File

@ -6,6 +6,7 @@ using Borepin.Base;
using Borepin.Base.Exceptions; using Borepin.Base.Exceptions;
using Borepin.Service; using Borepin.Service;
using Borepin.Service.Storage; using Borepin.Service.Storage;
using Borepin.Service.Storage.Exceptions;
using FabAccessAPI; using FabAccessAPI;
using FabAccessAPI.Exceptions; using FabAccessAPI.Exceptions;
using Prism.Commands; using Prism.Commands;
@ -130,10 +131,9 @@ namespace Borepin.PageModel.AddServerProcess
}); });
return; return;
} }
await _LoginStorageService.Add(_ConnectionData).ConfigureAwait(false); await _LoginStorageService.Add(_ConnectionData).ConfigureAwait(false);
await _LoginStorageService.UpdateTimestamp(_ConnectionData).ConfigureAwait(false); await _LoginStorageService.UpdateTimestamp(_ConnectionData).ConfigureAwait(false);
Device.BeginInvokeOnMainThread(async () => Device.BeginInvokeOnMainThread(async () =>
{ {
INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage").ConfigureAwait(false); INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage").ConfigureAwait(false);

View File

@ -37,6 +37,7 @@ namespace Borepin.PageModel
public override async Task LoadAPIData() public override async Task LoadAPIData()
{ {
_UserItem = new UserVisualize(await _API.Session.UserSystem.Info.GetUserSelf().ConfigureAwait(false)); _UserItem = new UserVisualize(await _API.Session.UserSystem.Info.GetUserSelf().ConfigureAwait(false));
_UserItem.LoadData();
} }
#endregion #endregion

View File

@ -124,7 +124,9 @@ namespace Borepin.Resources.Text {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to PLACEHOLDER. /// Looks up a localized string similar to FabAccess is a decentralized machine management system. Each Space thus uses its own server.
///Ask your Space for the address of your server.
///You can also put down several servers and then connect to the desired server..
/// </summary> /// </summary>
internal static string AddServerProcess_SelectServerPage_Info { internal static string AddServerProcess_SelectServerPage_Info {
get { get {
@ -186,6 +188,15 @@ namespace Borepin.Resources.Text {
} }
} }
/// <summary>
/// Looks up a localized string similar to Connection already exist. Please delete old Connection before adding the new Connection..
/// </summary>
internal static string ALERT_DuplicateConnection {
get {
return ResourceManager.GetString("ALERT_DuplicateConnection", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Password is invalid.. /// Looks up a localized string similar to Password is invalid..
/// </summary> /// </summary>
@ -340,7 +351,8 @@ namespace Borepin.Resources.Text {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to PLACEHOLDER. /// Looks up a localized string similar to You do not have the authorization to use this machine.
///Ask in your Space if you can be trained on the machine to be unlocked for the machine..
/// </summary> /// </summary>
internal static string MachinePage_CanNotUseByPermission { internal static string MachinePage_CanNotUseByPermission {
get { get {
@ -502,7 +514,7 @@ namespace Borepin.Resources.Text {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to New Password:. /// Looks up a localized string similar to New Password.
/// </summary> /// </summary>
internal static string ProfilePage_NewPassword { internal static string ProfilePage_NewPassword {
get { get {
@ -511,7 +523,7 @@ namespace Borepin.Resources.Text {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Old Password:. /// Looks up a localized string similar to Old Password.
/// </summary> /// </summary>
internal static string ProfilePage_OldPassword { internal static string ProfilePage_OldPassword {
get { get {

View File

@ -139,8 +139,9 @@
<value>Connect to Server</value> <value>Connect to Server</value>
</data> </data>
<data name="AddServerProcess_SelectServerPage_Info" xml:space="preserve"> <data name="AddServerProcess_SelectServerPage_Info" xml:space="preserve">
<value>PLACEHOLDER</value> <value>FabAccess is a decentralized machine management system. Each Space thus uses its own server.
<comment>Server Struktur erklären, auf QR-Code hinweisen, ansonsten im Space fragen</comment> Ask your Space for the address of your server.
You can also put down several servers and then connect to the desired server.</value>
</data> </data>
<data name="AddUserPage_AddUser" xml:space="preserve"> <data name="AddUserPage_AddUser" xml:space="preserve">
<value>Add User</value> <value>Add User</value>
@ -160,6 +161,9 @@
<data name="ALERT_ConnectionFailed" xml:space="preserve"> <data name="ALERT_ConnectionFailed" xml:space="preserve">
<value>Connection failed</value> <value>Connection failed</value>
</data> </data>
<data name="ALERT_DuplicateConnection" xml:space="preserve">
<value>Connection already exist. Please delete old Connection before adding the new Connection.</value>
</data>
<data name="ALERT_PasswordInvalid" xml:space="preserve"> <data name="ALERT_PasswordInvalid" xml:space="preserve">
<value>Password is invalid.</value> <value>Password is invalid.</value>
</data> </data>
@ -212,8 +216,8 @@
<value>Host</value> <value>Host</value>
</data> </data>
<data name="MachinePage_CanNotUseByPermission" xml:space="preserve"> <data name="MachinePage_CanNotUseByPermission" xml:space="preserve">
<value>PLACEHOLDER</value> <value>You do not have the authorization to use this machine.
<comment>Nutzer darf die Maschine nicht nutzten, dass sollte erklärt werden, also beim Admin nachfragen</comment> Ask in your Space if you can be trained on the machine to be unlocked for the machine.</value>
</data> </data>
<data name="MachinePage_CurrentUser" xml:space="preserve"> <data name="MachinePage_CurrentUser" xml:space="preserve">
<value>Current User:</value> <value>Current User:</value>
@ -267,10 +271,10 @@
<value>Change Password</value> <value>Change Password</value>
</data> </data>
<data name="ProfilePage_NewPassword" xml:space="preserve"> <data name="ProfilePage_NewPassword" xml:space="preserve">
<value>New Password:</value> <value>New Password</value>
</data> </data>
<data name="ProfilePage_OldPassword" xml:space="preserve"> <data name="ProfilePage_OldPassword" xml:space="preserve">
<value>Old Password:</value> <value>Old Password</value>
</data> </data>
<data name="ProfilePage_UpdatePassword" xml:space="preserve"> <data name="ProfilePage_UpdatePassword" xml:space="preserve">
<value>Update Password</value> <value>Update Password</value>

View File

@ -41,7 +41,7 @@ namespace Borepin.Service.Storage
IList<ConnectionData> connectionData_List = await _LoadConnectionData().ConfigureAwait(false); IList<ConnectionData> connectionData_List = await _LoadConnectionData().ConfigureAwait(false);
if(connectionData_List.Contains(connectionData)) if(connectionData_List.Contains(connectionData))
{ {
throw new DuplicateConnectionException(connectionData); connectionData_List.Remove(connectionData);
} }
connectionData_List.Add(connectionData); connectionData_List.Add(connectionData);

@ -1 +1 @@
Subproject commit 086bbc2497785d2cc63e9252df6f6d3ee7599579 Subproject commit 63e63853c1d5ca9f223aa3627ad391ce434a0683