From 8f9ea2d4772222ae01413874bbea2df985689742 Mon Sep 17 00:00:00 2001 From: Claire Kuang Date: Wed, 28 Feb 2024 14:00:35 +0000 Subject: [PATCH] feat(DUI2): Cnx 9068 update dui2 to use new fe2 terminology (#3200) * updates all user-facing terminology to use FE2 conditionally on fe2 button or account * changes config fe2 default to true, and uses config first for activity and streams * sets useFE2 to true for stored configs * removes all terminology switching code * removes config fe2 setting and fe2 prop in some view models * removes unnecessary string interpolations --- DesktopUI2/DesktopUI2/Models/ConfigManager.cs | 11 ++-- DesktopUI2/DesktopUI2/Styles/Button.xaml | 11 ++-- DesktopUI2/DesktopUI2/Styles/Playground.xaml | 4 +- .../ViewModels/ActivityViewModel.cs | 2 +- .../DesktopUI2/ViewModels/DialogViewModel.cs | 13 +---- .../DesktopUI2/ViewModels/HomeViewModel.cs | 48 ++++------------ .../MappingTool/MappingsViewModel.cs | 10 ++-- .../ViewModels/OneClickViewModel.cs | 4 +- .../DesktopUI2/ViewModels/StreamViewModel.cs | 18 ++---- .../Views/Controls/SavedStreams.xaml | 13 ++--- .../Controls/StreamEditControls/Comments.xaml | 3 +- .../Controls/StreamEditControls/Receive.xaml | 14 ++--- .../Controls/StreamEditControls/Send.xaml | 8 +-- .../Views/Controls/StreamSelector.xaml | 8 +-- .../Views/Converters/Fe2TextValueConverter.cs | 30 ---------- .../DesktopUI2/Views/MappingsControl.xaml | 16 +++--- .../DesktopUI2/Views/Pages/HomeView.xaml | 57 +++---------------- DesktopUI2/DesktopUI2/Views/Scheduler.xaml | 12 ++-- .../Windows/Dialogs/AddFromUrlDialog.xaml | 10 +--- .../Windows/Dialogs/NewBranchDialog.xaml | 4 +- .../Windows/Dialogs/NewStreamDialog.xaml | 7 +-- 21 files changed, 83 insertions(+), 220 deletions(-) delete mode 100644 DesktopUI2/DesktopUI2/Views/Converters/Fe2TextValueConverter.cs diff --git a/DesktopUI2/DesktopUI2/Models/ConfigManager.cs b/DesktopUI2/DesktopUI2/Models/ConfigManager.cs index e606549027..115219640f 100644 --- a/DesktopUI2/DesktopUI2/Models/ConfigManager.cs +++ b/DesktopUI2/DesktopUI2/Models/ConfigManager.cs @@ -25,12 +25,11 @@ public static Config Load() var oldConfig = ConfigStorage.GetObject("config"); var newConfig = ConfigStorage.GetObject("configDUI"); - if (!string.IsNullOrEmpty(newConfig)) - { - return JsonConvert.DeserializeObject(newConfig); - } + Config deserializedConfig = !string.IsNullOrWhiteSpace(newConfig) + ? JsonConvert.DeserializeObject(newConfig) + : JsonConvert.DeserializeObject(oldConfig); - return JsonConvert.DeserializeObject(oldConfig); + return deserializedConfig; } catch (Exception e) { } return new Config(); @@ -45,5 +44,5 @@ public class Config public bool DarkTheme { set; get; } public bool OneClickMode { set; get; } = true; public bool ShowImportExportAlert { set; get; } = true; - public bool UseFe2 { set; get; } = false; + public bool UseFe2 { set; get; } } diff --git a/DesktopUI2/DesktopUI2/Styles/Button.xaml b/DesktopUI2/DesktopUI2/Styles/Button.xaml index 9a14d3b731..53e1b67a5d 100644 --- a/DesktopUI2/DesktopUI2/Styles/Button.xaml +++ b/DesktopUI2/DesktopUI2/Styles/Button.xaml @@ -65,9 +65,6 @@