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<UserPage, UserPageModel>();
containerRegistry.RegisterForNavigation<AddUserPage, AddUserPageModel>();
containerRegistry.RegisterForNavigation<ProfilePage, ProfilePageModel>();
#endregion
#region Register Sequence Navigation

View File

@ -12,7 +12,9 @@
</StackLayout>
<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_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 Margin="0,0,0,10">
<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:resource_text="clr-namespace:Borepin.Resources.Text"
Title="{x:Static resource_text:TextResource.TITLE_Profile}">
<ContentPage.Resources>
<ResourceDictionary>
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout Padding="20">
<StackLayout IsVisible="{Binding IsBusy}">
@ -12,7 +17,7 @@
</StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<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}"/>
<Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_OldPassword}" Text="{Binding OldPassword}"/>
<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.Service;
using Borepin.Service.Storage;
using Borepin.Service.Storage.Exceptions;
using FabAccessAPI;
using FabAccessAPI.Exceptions;
using Prism.Commands;
@ -130,7 +131,6 @@ namespace Borepin.PageModel.AddServerProcess
});
return;
}
await _LoginStorageService.Add(_ConnectionData).ConfigureAwait(false);
await _LoginStorageService.UpdateTimestamp(_ConnectionData).ConfigureAwait(false);

View File

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

View File

@ -124,7 +124,9 @@ namespace Borepin.Resources.Text {
}
/// <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>
internal static string AddServerProcess_SelectServerPage_Info {
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>
/// Looks up a localized string similar to Password is invalid..
/// </summary>
@ -340,7 +351,8 @@ namespace Borepin.Resources.Text {
}
/// <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>
internal static string MachinePage_CanNotUseByPermission {
get {
@ -502,7 +514,7 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Looks up a localized string similar to New Password:.
/// Looks up a localized string similar to New Password.
/// </summary>
internal static string ProfilePage_NewPassword {
get {
@ -511,7 +523,7 @@ namespace Borepin.Resources.Text {
}
/// <summary>
/// Looks up a localized string similar to Old Password:.
/// Looks up a localized string similar to Old Password.
/// </summary>
internal static string ProfilePage_OldPassword {
get {

View File

@ -139,8 +139,9 @@
<value>Connect to Server</value>
</data>
<data name="AddServerProcess_SelectServerPage_Info" xml:space="preserve">
<value>PLACEHOLDER</value>
<comment>Server Struktur erklären, auf QR-Code hinweisen, ansonsten im Space fragen</comment>
<value>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.</value>
</data>
<data name="AddUserPage_AddUser" xml:space="preserve">
<value>Add User</value>
@ -160,6 +161,9 @@
<data name="ALERT_ConnectionFailed" xml:space="preserve">
<value>Connection failed</value>
</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">
<value>Password is invalid.</value>
</data>
@ -212,8 +216,8 @@
<value>Host</value>
</data>
<data name="MachinePage_CanNotUseByPermission" xml:space="preserve">
<value>PLACEHOLDER</value>
<comment>Nutzer darf die Maschine nicht nutzten, dass sollte erklärt werden, also beim Admin nachfragen</comment>
<value>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.</value>
</data>
<data name="MachinePage_CurrentUser" xml:space="preserve">
<value>Current User:</value>
@ -267,10 +271,10 @@
<value>Change Password</value>
</data>
<data name="ProfilePage_NewPassword" xml:space="preserve">
<value>New Password:</value>
<value>New Password</value>
</data>
<data name="ProfilePage_OldPassword" xml:space="preserve">
<value>Old Password:</value>
<value>Old Password</value>
</data>
<data name="ProfilePage_UpdatePassword" xml:space="preserve">
<value>Update Password</value>

View File

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

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