Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/OneWare.CloudIntegration/OneWareCloudIntegrationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void OnInitialized(IContainerProvider containerProvider)
containerProvider.Resolve<IWindowService>().RegisterMenuItem("MainWindow_MainMenu/Help", new MenuItemViewModel("Feedback")
{
Header = "Send Feedback",
IconObservable = Application.Current!.GetResourceObservable("VSImageLib.FeedbackBubble_16x"),
IconObservable = Application.Current!.GetResourceObservable("Unicons.CommentMessage"),
Command = new AsyncRelayCommand(async () => await OpenFeedbackDialogAsync())
});

Expand All @@ -61,8 +61,9 @@ public static async Task OpenFeedbackDialogAsync()
{
var windowService = ContainerLocator.Container.Resolve<IWindowService>();
var loginService = ContainerLocator.Container.Resolve<OneWareCloudLoginService>();
var accountSetting = ContainerLocator.Container.Resolve<OneWareCloudAccountSetting>();

var dataContext = new FeedbackViewModel(loginService);
var dataContext = new FeedbackViewModel(loginService, accountSetting);
await windowService.ShowDialogAsync(new SendFeedbackView()
{
DataContext = dataContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void Logout(string email)
}
}

public async Task<bool> SendFeedbackAsync(string category, string message)
public async Task<bool> SendFeedbackAsync(string category, string message, string? mail = null)
{
try
{
Expand All @@ -256,7 +256,8 @@ public async Task<bool> SendFeedbackAsync(string category, string message)
request.AddJsonBody(new
{
Category = category,
Message = message
Message = message,
Email = mail
});

var restClient =
Expand Down
45 changes: 26 additions & 19 deletions src/OneWare.CloudIntegration/ViewModels/FeedbackViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.ObjectModel;
using Avalonia.Controls;
using OneWare.CloudIntegration.Services;
using OneWare.CloudIntegration.Settings;
using OneWare.Essentials.ViewModels;

namespace OneWare.CloudIntegration.ViewModels;
Expand All @@ -10,20 +11,18 @@ public class FeedbackViewModel : FlexibleWindowViewModelBase
private readonly OneWareCloudLoginService _loginService;

private string _header = string.Empty;
private string _message = string.Empty;
private string _category = string.Empty;
private string _errorText = string.Empty;
private bool _isLoading = false;

public FeedbackViewModel(OneWareCloudLoginService loginService)

public FeedbackViewModel(OneWareCloudLoginService loginService, OneWareCloudAccountSetting setting)
{
_loginService = loginService;
UserIsAuthenticated = setting.IsLoggedIn;

Title = $"Send Feedback";
Category = "General Feedback";
}

public bool? Result { get; private set; }
public bool UserIsAuthenticated { get; private set; }
public ObservableCollection<string> Categories { get; } = [
"General Feedback",
"Bug Report",
Expand All @@ -33,28 +32,36 @@ public FeedbackViewModel(OneWareCloudLoginService loginService)
"Documentation",
"Other"
];

public bool IsLoading
{
get => _isLoading;
set => SetProperty(ref _isLoading, value);
}
get;
set => SetProperty(ref field, value);
} = false;

public string Message
{
get => _message;
set => SetProperty(ref _message, value);
}
get;
set => SetProperty(ref field, value);
} = string.Empty;

public string Mail
{
get;
set => SetProperty(ref field, value);
} = string.Empty;

public string Category
{
get => _category;
set => SetProperty(ref _category, value);
get;
set => SetProperty(ref field, value);
}

public string ErrorText
{
get => _errorText;
set => SetProperty(ref _errorText, value);
}
get;
set => SetProperty(ref field, value);
} = string.Empty;

public async Task SendFeedbackAsync(Window window)
{
Expand All @@ -66,7 +73,7 @@ public async Task SendFeedbackAsync(Window window)
}

IsLoading = true;
Result = await _loginService.SendFeedbackAsync(Category, Message);
Result = await _loginService.SendFeedbackAsync(Category, Message, Mail);
IsLoading = false;
window.Close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<Button Command="{Binding OpenFeedbackDialogAsync}"
CommandParameter="{Binding $self}" ToolTip.Tip="Feedback">
<Button.Content>
<Image Source="{DynamicResource VSImageLib.FeedbackBubble_16x}" />
<Image Source="{DynamicResource Unicons.CommentMessage}" />
</Button.Content>
</Button>

Expand Down
6 changes: 5 additions & 1 deletion src/OneWare.CloudIntegration/Views/SendFeedbackView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
mc:Ignorable="d" d:DesignWidth="300" SizeToContent="Height" PrefWidth="360" Padding="4"
x:Class="OneWare.CloudIntegration.Views.SendFeedbackView"
x:DataType="viewModels:FeedbackViewModel"
CustomIcon="{DynamicResource VSImageLib.FeedbackBubble_16x}"
CustomIcon="{DynamicResource Unicons.CommentMessage}"
WindowStartupLocation="CenterOwner" MinHeight="340"
Title="{Binding Title}">

Expand Down Expand Up @@ -55,6 +55,10 @@
SelectedItem="{Binding Category}" />
</StackPanel>

<StackPanel Spacing="3" Orientation="Vertical" IsVisible="{Binding !UserIsAuthenticated}">
<TextBlock Text="E-Mail:" />
<TextBox Text="{Binding Mail}" Watermark="optional" />
</StackPanel>
</StackPanel>

<DockPanel LastChildFill="True" Margin="0,3">
Expand Down
14 changes: 3 additions & 11 deletions src/OneWare.Core/Styles/Icons.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,9 @@
Geometry="M14,12 L14,11 L13.17,11 C13.14,10.89 13.1,10.79 13.05,10.7 L13.64,10.1 L12.93,9.395 L12.35,9.979 C12.24,9.917 12.12,9.869 12,9.832 L12,9 L11,9 L11,9.83 C10.89,9.866 10.78,9.91 10.68,9.966 L10.1,9.397 L9.397,10.1 L9.966,10.67 C9.91,10.78 9.866,10.88 9.83,11 L9,11 L9,12 L9.83,12 C9.867,12.12 9.917,12.24 9.979,12.35 L9.397,12.93 L10.1,13.64 L10.7,13.04 C10.79,13.1 10.89,13.14 11,13.17 L11,14 L12,14 L12,13.17 C12.12,13.13 12.22,13.09 12.32,13.03 L12.93,13.64 L13.64,12.93 L13.03,12.32 C13.09,12.22 13.13,12.11 13.17,12 L14,12 z M11.5,12.25 C11.08,12.25 10.75,11.91 10.75,11.5 C10.75,11.08 11.08,10.75 11.5,10.75 C11.91,10.75 12.25,11.08 12.25,11.5 C12.25,11.91 11.91,12.25 11.5,12.25 z M16,11.5 C16,9.182 14.25,7.278 12,7.029 L12,2.792 L9.206,0 L0,0 L0,16 L12,16 L12,15.97 C14.25,15.72 16,13.82 16,11.5 z M8.998,1.206 L10.79,3 L8.998,3 L8.998,1.206 z M1,15 L1,0.9984 L8,0.9984 L8,4 L11,4 L11,7.029 C8.749,7.278 7,9.184 7,11.5 C7,12.92 7.654,14.18 8.675,15 L1,15 z M11.5,14.94 C9.6,14.94 8.062,13.4 8.058,11.5 C8.062,9.6 9.6,8.062 11.5,8.058 C13.4,8.062 14.94,9.6 14.94,11.5 C14.94,13.4 13.4,14.94 11.5,14.94 z" />
</DrawingGroup>
</DrawingImage>

<DrawingImage x:Key="VSImageLib.FeedbackBubble_16x">
<DrawingGroup>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="{StaticResource ThemeControlVeryHighBrush}"
Geometry="F1M2.9997,1.0006L2.9997,6.0586 -0.000300000000000189,6.0586 -0.000300000000000189,14.0256 1.9947,14.0256 1.9947,15.9996 3.6637,15.9996 5.8637,13.9946 10.8697,13.9846 10.8697,12.5206 12.9967,14.0966 12.9967,9.9996 16.0007,9.9996 16.0007,1.0006z" />
<GeometryDrawing Brush="#FF424242"
Geometry="F1M11,7L6,7 6,6 11,6z M13,5L6,5 6,4 13,4z M4,2L4,9 8.404,9 12,11.972 12,9 15,9 15,2z M9,3L14,3 14,8 11.998,8 11,8 11,8.999 11,10.179 9.112,8.292 8.818,8 8.404,8 5,8 5,3 M10,11.877L10,13 5.915,13 3,14.931 3,13 1,13 1,7 3,7 3,8 2,8 2,12 4,12 4,13.085 5.501,12 9,12 9,11.137z" />
<GeometryDrawing Brush="{StaticResource ThemeControlVeryHighBrush}"
Geometry="F1M13,5L6,5 6,4 13,4z M11,7L6,7 6,6 11,6z M9,3L5,3 5,8 8.404,8 8.818,8 9.112,8.292 11,10.179 11,8.999 11,8 11.998,8 14,8 14,3z M9,11.137L9,12 5.501,12 4,13.085 4,12 2,12 2,8 3,8 3,9.999 7.464,9.999z" />
</DrawingGroup>

<DrawingImage x:Key="Unicons.CommentMessage">
<GeometryDrawing Brush="{StaticResource ThemeControlVeryHighBrush}" Geometry="M8.011,0 A7.989,7.989 0 0 0 0.02254,7.989 A7.901,7.901 0 0 0 1.828,13.05 L0.2302,14.64 A0.7989,0.7989 0 0 0 0.06248,15.51 A0.7989,0.7989 0 0 0 0.8214,15.98 L8.011,15.98 A7.989,7.989 0 0 0 8.011,0 z M8.011,14.38 L2.747,14.38 L3.49,13.64 A0.7989,0.7989 0 0 0 3.49,12.51 A6.391,6.391 0 1 1 8.011,14.38 z M12.01,7.19 L4.017,7.19 A0.7989,0.7989 0 0 0 4.017,8.788 L12.01,8.788 A0.7989,0.7989 0 0 0 12.01,7.19 z M10.41,10.39 L5.615,10.39 A0.7989,0.7989 0 0 0 5.615,11.98 L10.41,11.98 A0.7989,0.7989 0 0 0 10.41,10.39 z M5.615,5.592 L10.41,5.592 A0.7989,0.7989 0 0 0 10.41,3.994 L5.615,3.994 A0.7989,0.7989 0 0 0 5.615,5.592 z" />
</DrawingImage>

<DrawingImage x:Key="VSImageLib.BinaryManagement_16x">
Expand Down
Loading