Added logout functionality. IO-403
This commit is contained in:
@@ -60,6 +60,15 @@ namespace BodyshopPartner.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Log out.
|
||||
/// </summary>
|
||||
public static string Actions_Logout {
|
||||
get {
|
||||
return ResourceManager.GetString("Actions_Logout", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to An issue has occured. Please check the log files..
|
||||
/// </summary>
|
||||
|
||||
@@ -117,6 +117,9 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Actions_Logout" xml:space="preserve">
|
||||
<value>Log out</value>
|
||||
</data>
|
||||
<data name="Error_Generic" xml:space="preserve">
|
||||
<value>An issue has occured. Please check the log files.</value>
|
||||
</data>
|
||||
|
||||
@@ -174,5 +174,25 @@ namespace BodyshopPartner.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _logoutCommand;
|
||||
public ICommand LogoutCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_logoutCommand == null)
|
||||
{
|
||||
_logoutCommand = new RelayCommand(
|
||||
p => true,
|
||||
p =>
|
||||
{
|
||||
Logout();
|
||||
});
|
||||
}
|
||||
return _logoutCommand;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +189,15 @@ namespace BodyshopPartner.ViewModels
|
||||
IndeterminateLoading = false;
|
||||
}
|
||||
|
||||
|
||||
public void Logout()
|
||||
{
|
||||
Properties.Settings.Default.AuthToken = "";
|
||||
Properties.Settings.Default.RefreshToken = "";
|
||||
Properties.Settings.Default.Save();
|
||||
App.Current.Shutdown();
|
||||
}
|
||||
|
||||
public async Task LoadBodyshopData()
|
||||
{
|
||||
var r = new GraphQLRequest
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<StackPanel DockPanel.Dock="Right">
|
||||
|
||||
<ComboBox ItemsSource="{Binding ShopData}"
|
||||
Margin="8"
|
||||
Margin="4"
|
||||
SelectedItem="{Binding ActiveShop}"
|
||||
Style="{StaticResource MaterialDesignFloatingHintComboBox}"
|
||||
materialDesign:HintAssist.Hint="{x:Static p:Resources.Label_ActiveShop}"
|
||||
@@ -121,6 +121,9 @@
|
||||
</ItemsPanelTemplate>
|
||||
</ComboBox.ItemsPanel>
|
||||
</ComboBox>
|
||||
<Button Command="{Binding LogoutCommand, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="8"
|
||||
Content="{x:Static p:Resources.Actions_Logout}" />
|
||||
<Separator />
|
||||
<CheckBox IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=AutoStartMonitor}"
|
||||
Margin="8"
|
||||
|
||||
Reference in New Issue
Block a user