From c1397b30c8f5654f6dca6799633a1ff29efd65c2 Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Sat, 21 Dec 2024 09:26:35 +0200 Subject: [PATCH 01/51] ExpandUntillPostsynapticExteralReferences_Master --- .../UI/Views/Blazor.Common/TreeView.razor | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor index 94275d6..2ada852 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor +++ b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor @@ -155,7 +155,7 @@ @if (child.ExpansionState == ExpansionState.Expanded) {
-
} @@ -188,6 +188,8 @@ [Parameter] public EventCallback OnMenuRequested { get; set; } + [Parameter] + public bool ExpandUntillPostsynapticExteralReferences { get; set; } [Parameter] public EventCallback OnInfoRequested { get; set; } @@ -228,6 +230,9 @@ } } + [Parameter] + public IList ExpandUntillPostsynapticExteralReferencesNeurons { get; set; } = new List(); + [Parameter] public EventCallback ControlsEnabledChanged { get; set; } @@ -246,6 +251,70 @@ } } + private CancellationTokenSource _expansionCancellationTokenSource; + + + protected override async Task OnParametersSetAsync() + { + // Only handle cancellation if we previously had an expansion operation + if (_expansionCancellationTokenSource != null) + { + _expansionCancellationTokenSource.Cancel(); + _expansionCancellationTokenSource.Dispose(); + _expansionCancellationTokenSource = null; + } + + // Only create new cancellation token and start expansion if flag is true + if (this.ExpandUntillPostsynapticExteralReferences) + { + //this.NextExpandUntillPostsynapticExteralReferencesNeurons.Clear(); + _expansionCancellationTokenSource = new CancellationTokenSource(); + + try + { + await Task.Run(async () => + { + if (this.Children.Any(x => x.Neuron.Id == this.SelectedNeuron.Neuron.Id && x.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(SelectedNeuron.Neuron.ExternalReferenceUrl))) + { + // Check for cancellation + _expansionCancellationTokenSource?.Token.ThrowIfCancellationRequested(); + + if (SelectedNeuron.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(SelectedNeuron.Neuron.ExternalReferenceUrl)) + { + await InvokeAsync(() => SelectedNeuron.Toggle()); + } + } + else + { + foreach (var child in this.Children) + { + // Check for cancellation + _expansionCancellationTokenSource?.Token.ThrowIfCancellationRequested(); + + if (child.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(child.Neuron.ExternalReferenceUrl)) + { + await InvokeAsync(() => child.Toggle()); + + } + } + this.ExpandUntillPostsynapticExteralReferencesNeurons = this.ExpandUntillPostsynapticExteralReferencesNeurons.Concat(this.Children).ToList(); //this.expandUntillPostsynapticExteralReferencesNeurons.Concat(child.Children).ToList(); + + } + }, _expansionCancellationTokenSource.Token); + } + catch (OperationCanceledException) + { + // Expansion was cancelled, do nothing + } + catch (Exception e) + { + // Handle other exceptions if needed + + } + } + await base.OnParametersSetAsync(); + } + private bool ShouldRightJustify(TreeNeuronViewModel child) { return child.Neuron.Validation.IsCurrentUserCreationAuthor && child.Neuron.Type == Library.Common.RelativeType.NotSet; @@ -334,4 +403,14 @@ return dict; } + + public void Dispose() + { + if (_expansionCancellationTokenSource != null) + { + _expansionCancellationTokenSource.Cancel(); + _expansionCancellationTokenSource.Dispose(); + _expansionCancellationTokenSource = null; + } + } } From 13bcbd016279fc54aa32526cb036b8a0775ef91f Mon Sep 17 00:00:00 2001 From: elmerbool <35117496+elmerbool@users.noreply.github.com> Date: Fri, 27 Dec 2024 08:26:12 +1100 Subject: [PATCH 02/51] Review changes. --- .../UI/ViewModels/TreeNeuronViewModel.cs | 5 + .../UI/Views/Blazor.Common/TreeView.razor | 113 +++++++----------- 2 files changed, 50 insertions(+), 68 deletions(-) diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index 4e00f5c..bdc8a45 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -1,9 +1,11 @@ using ei8.Cortex.Diary.Application.Neurons; using ei8.Cortex.Library.Client; using ei8.Cortex.Library.Common; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using System.Timers; namespace ei8.Cortex.Diary.Port.Adapter.UI.ViewModels { @@ -18,6 +20,7 @@ public TreeNeuronViewModel(Neuron neuron, string avatarUrl, INeuronQueryService this.avatarUrl = avatarUrl; this.neuronQueryService = neuronQueryService; this.Children = new List(); + this.ExpandPostsynapticsUntilExternalReferencesTimer = new Timer(); } public IList Children { get; set; } @@ -26,6 +29,8 @@ public TreeNeuronViewModel(Neuron neuron, string avatarUrl, INeuronQueryService public ExpansionState ExpansionState { get; private set; } + public Timer ExpandPostsynapticsUntilExternalReferencesTimer { get; } + public async Task Toggle() { this.ExpansionState = this.ExpansionState == ExpansionState.Collapsed ? ExpansionState.Expanding : ExpansionState.Collapsed; diff --git a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor index 2ada852..540bf95 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor +++ b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor @@ -7,7 +7,7 @@ @if (this.Children != null) { string lastAuthor = string.Empty; - @foreach (var child in Children) + @foreach (var child in this.Children) { string currentAuthor = (child.Neuron.Creation?.Author?.Tag + ((child.Neuron.Creation?.Author?.Id != child.Neuron.UnifiedLastModification?.Author?.Id) ? ", " + child.Neuron.UnifiedLastModification.Author.Tag : string.Empty));
  • @@ -155,8 +155,15 @@ @if (child.ExpansionState == ExpansionState.Expanded) {
    - +
    } @if (this.renderDirection == RenderDirectionValue.BottomToTop && this.Children.LastOrDefault() == child) @@ -188,8 +195,6 @@ [Parameter] public EventCallback OnMenuRequested { get; set; } - [Parameter] - public bool ExpandUntillPostsynapticExteralReferences { get; set; } [Parameter] public EventCallback OnInfoRequested { get; set; } @@ -230,9 +235,6 @@ } } - [Parameter] - public IList ExpandUntillPostsynapticExteralReferencesNeurons { get; set; } = new List(); - [Parameter] public EventCallback ControlsEnabledChanged { get; set; } @@ -251,67 +253,52 @@ } } - private CancellationTokenSource _expansionCancellationTokenSource; - - protected override async Task OnParametersSetAsync() { - // Only handle cancellation if we previously had an expansion operation - if (_expansionCancellationTokenSource != null) - { - _expansionCancellationTokenSource.Cancel(); - _expansionCancellationTokenSource.Dispose(); - _expansionCancellationTokenSource = null; - } - // Only create new cancellation token and start expansion if flag is true - if (this.ExpandUntillPostsynapticExteralReferences) + if ( + this.selectedNeuron != null && + this.selectedNeuron.ExpandPostsynapticsUntilExternalReferencesTimer.Enabled && + ( + this.selectedNeuron.ExpansionState == ExpansionState.Collapsed || + !this.Children.Any(c => c.ExpansionState == ExpansionState.Expanded) + ) + ) { - //this.NextExpandUntillPostsynapticExteralReferencesNeurons.Clear(); - _expansionCancellationTokenSource = new CancellationTokenSource(); - - try + this.selectedNeuron.ExpandPostsynapticsUntilExternalReferencesTimer.Enabled = false; + this.selectedNeuron.ExpandPostsynapticsUntilExternalReferencesTimer.Start(); + + // if children contains selected neuron + if ( + this.Children.Any( + x => x.Neuron.Id == this.SelectedNeuron.Neuron.Id && + x.Neuron.Type != Library.Common.RelativeType.Presynaptic && + string.IsNullOrEmpty(SelectedNeuron.Neuron.ExternalReferenceUrl) + ) + ) + { + if ( + this.SelectedNeuron.Neuron.Type != Library.Common.RelativeType.Presynaptic && + string.IsNullOrEmpty(this.SelectedNeuron.Neuron.ExternalReferenceUrl) + ) + { + await InvokeAsync(() => this.SelectedNeuron.Toggle()); + } + } + else { - await Task.Run(async () => + foreach (var child in this.Children) { - if (this.Children.Any(x => x.Neuron.Id == this.SelectedNeuron.Neuron.Id && x.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(SelectedNeuron.Neuron.ExternalReferenceUrl))) + if (child.Neuron.Type != Library.Common.RelativeType.Presynaptic && + string.IsNullOrEmpty(child.Neuron.ExternalReferenceUrl)) { - // Check for cancellation - _expansionCancellationTokenSource?.Token.ThrowIfCancellationRequested(); + await InvokeAsync(() => child.Toggle()); - if (SelectedNeuron.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(SelectedNeuron.Neuron.ExternalReferenceUrl)) - { - await InvokeAsync(() => SelectedNeuron.Toggle()); - } } - else - { - foreach (var child in this.Children) - { - // Check for cancellation - _expansionCancellationTokenSource?.Token.ThrowIfCancellationRequested(); - - if (child.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(child.Neuron.ExternalReferenceUrl)) - { - await InvokeAsync(() => child.Toggle()); - - } - } - this.ExpandUntillPostsynapticExteralReferencesNeurons = this.ExpandUntillPostsynapticExteralReferencesNeurons.Concat(this.Children).ToList(); //this.expandUntillPostsynapticExteralReferencesNeurons.Concat(child.Children).ToList(); - - } - }, _expansionCancellationTokenSource.Token); - } - catch (OperationCanceledException) - { - // Expansion was cancelled, do nothing - } - catch (Exception e) - { - // Handle other exceptions if needed - + } } } + await base.OnParametersSetAsync(); } @@ -403,14 +390,4 @@ return dict; } - - public void Dispose() - { - if (_expansionCancellationTokenSource != null) - { - _expansionCancellationTokenSource.Cancel(); - _expansionCancellationTokenSource.Dispose(); - _expansionCancellationTokenSource = null; - } - } } From 55756483a297be708fa5d2ce918ef75dbcf86d78 Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:13:21 +0200 Subject: [PATCH 03/51] Implement_StartExpandPostsynapticsUntilExternalReferences_Method --- .../UI/ViewModels/TreeNeuronViewModel.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index 4e00f5c..985bec6 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -4,6 +4,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using System.Threading; +using System; namespace ei8.Cortex.Diary.Port.Adapter.UI.ViewModels { @@ -11,6 +13,7 @@ public class TreeNeuronViewModel { private string avatarUrl; private INeuronQueryService neuronQueryService; + private CancellationTokenSource _cancellationTokenSource; public TreeNeuronViewModel(Neuron neuron, string avatarUrl, INeuronQueryService neuronQueryService) { @@ -45,5 +48,38 @@ public async Task Toggle() this.ExpansionState = ExpansionState.Expanded; } } + public async Task StartExpandPostsynapticsUntilExternalReferences(int expandTimeLimit) + { + _cancellationTokenSource = new CancellationTokenSource(expandTimeLimit); + + try + { + await StartExpandPostsynapticsUntilExternalReferences(_cancellationTokenSource.Token); + } + catch (OperationCanceledException) + { + // Handle the cancellation if needed + } + } + + private async Task StartExpandPostsynapticsUntilExternalReferences(CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + + if (this.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(this.Neuron.ExternalReferenceUrl)) + { + await Toggle(); + foreach (var item in this.Children) + { + cancellationToken.ThrowIfCancellationRequested(); + await item.StartExpandPostsynapticsUntilExternalReferences(cancellationToken); + } + } + } + + public void CancelExpansion() + { + _cancellationTokenSource?.Cancel(); + } } } From 8808fcf903b014a109bcceccb3350a23655e85e4 Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:45:03 +0200 Subject: [PATCH 04/51] Fix TreeNeuronViewModel issues --- .../UI/ViewModels/TreeNeuronViewModel.cs | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index 6f546b6..a1d5548 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -13,7 +13,6 @@ public class TreeNeuronViewModel { private string avatarUrl; private INeuronQueryService neuronQueryService; - private CancellationTokenSource _cancellationTokenSource; public TreeNeuronViewModel(Neuron neuron, string avatarUrl, INeuronQueryService neuronQueryService) { @@ -51,38 +50,38 @@ public async Task Toggle() this.ExpansionState = ExpansionState.Expanded; } } - public async Task StartExpandPostsynapticsUntilExternalReferences(int expandTimeLimit) - { - _cancellationTokenSource = new CancellationTokenSource(expandTimeLimit); + //public async Task StartExpandPostsynapticsUntilExternalReferences(int expandTimeLimit) + //{ + // _cancellationTokenSource = new CancellationTokenSource(expandTimeLimit); - try - { - await StartExpandPostsynapticsUntilExternalReferences(_cancellationTokenSource.Token); - } - catch (OperationCanceledException) - { - // Handle the cancellation if needed - } - } + // try + // { + // await StartExpandPostsynapticsUntilExternalReferences(_cancellationTokenSource.Token); + // } + // catch (OperationCanceledException) + // { + // // Handle the cancellation if needed + // } + //} - private async Task StartExpandPostsynapticsUntilExternalReferences(CancellationToken cancellationToken) - { - cancellationToken.ThrowIfCancellationRequested(); + //private async Task StartExpandPostsynapticsUntilExternalReferences(CancellationToken cancellationToken) + //{ + // cancellationToken.ThrowIfCancellationRequested(); - if (this.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(this.Neuron.ExternalReferenceUrl)) - { - await Toggle(); - foreach (var item in this.Children) - { - cancellationToken.ThrowIfCancellationRequested(); - await item.StartExpandPostsynapticsUntilExternalReferences(cancellationToken); - } - } - } + // if (this.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(this.Neuron.ExternalReferenceUrl)) + // { + // await Toggle(); + // foreach (var item in this.Children) + // { + // cancellationToken.ThrowIfCancellationRequested(); + // await item.StartExpandPostsynapticsUntilExternalReferences(cancellationToken); + // } + // } + //} - public void CancelExpansion() - { - _cancellationTokenSource?.Cancel(); - } + //public void CancelExpansion() + //{ + // _cancellationTokenSource?.Cancel(); + //} } } From 9443b8864f3f6eda1e8daf109ebaf476eef7e981 Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:27:55 +0200 Subject: [PATCH 05/51] Implement Process Box --- .../UI/Views/Blazor.Common/ProcessBox.razor | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/main/Port.Adapter/UI/Views/Blazor.Common/ProcessBox.razor diff --git a/src/main/Port.Adapter/UI/Views/Blazor.Common/ProcessBox.razor b/src/main/Port.Adapter/UI/Views/Blazor.Common/ProcessBox.razor new file mode 100644 index 0000000..b510a73 --- /dev/null +++ b/src/main/Port.Adapter/UI/Views/Blazor.Common/ProcessBox.razor @@ -0,0 +1,35 @@ +@if (this.IsExpandModalVisible) +{ + +} + +@code { + [Parameter] + public bool IsExpandModalVisible { get; set; } + + [Parameter] + public EventCallback OnCancelExpand { get; set; } + + private void CancelExpand() + { + this.OnCancelExpand.InvokeAsync(); + } + +} From 93d3ad5b932f3fd7e03d3251e7dc173fc3f459af Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:11:17 +0200 Subject: [PATCH 06/51] Encapsulate TreeNeuronViewModel Timer --- src/docker-compose.override.yml | 2 +- src/ei8-Cortex-Diary-Master.sln | 51 +++++++++++++++++++ .../UI/ViewModels/TreeNeuronViewModel.cs | 22 +++++++- .../UI/Views/Blazor.Common/TreeView.razor | 6 +-- .../UI/Views/Blazor/Blazor.csproj | 1 + .../UI/Views/Blazor/Blazor.csproj.user | 3 ++ .../Port.Adapter/UI/Views/Blazor/Program.cs | 2 +- .../Blazor/Properties/launchSettings.json | 6 +-- 8 files changed, 82 insertions(+), 11 deletions(-) diff --git a/src/docker-compose.override.yml b/src/docker-compose.override.yml index 13042f2..5323614 100644 --- a/src/docker-compose.override.yml +++ b/src/docker-compose.override.yml @@ -11,7 +11,7 @@ services: - ~/.aspnet/https:/https:ro - /C/ei8/avatars/prod/sample:/C/db ports: - - 192.168.1.110:65103:65103 + - 172.20.10.3:65103:65103 networks: default: external: diff --git a/src/ei8-Cortex-Diary-Master.sln b/src/ei8-Cortex-Diary-Master.sln index 9ed8d85..1a554ba 100644 --- a/src/ei8-Cortex-Diary-Master.sln +++ b/src/ei8-Cortex-Diary-Master.sln @@ -35,6 +35,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ViewModels", "main\Port.Ada EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.Common", "main\Port.Adapter\UI\Views\Blazor.Common\Blazor.Common.csproj", "{F88D3FD9-979D-4D85-9E32-FC2099BB71A5}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tree", "E:\.net\cdp-tree\src\main\Tree.csproj", "{23598F00-663B-4F48-B467-9CDA0956784F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU @@ -543,6 +545,54 @@ Global {F88D3FD9-979D-4D85-9E32-FC2099BB71A5}.Release|x64.Build.0 = Release|Any CPU {F88D3FD9-979D-4D85-9E32-FC2099BB71A5}.Release|x86.ActiveCfg = Release|Any CPU {F88D3FD9-979D-4D85-9E32-FC2099BB71A5}.Release|x86.Build.0 = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|ARM.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|iPhone.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|x64.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|x64.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|x86.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.AppStore|x86.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|ARM.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|ARM.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|iPhone.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|x64.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|x64.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|x86.ActiveCfg = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Debug|x86.Build.0 = Debug|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|Any CPU.Build.0 = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|ARM.ActiveCfg = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|ARM.Build.0 = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|iPhone.ActiveCfg = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|iPhone.Build.0 = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|x64.ActiveCfg = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|x64.Build.0 = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|x86.ActiveCfg = Release|Any CPU + {23598F00-663B-4F48-B467-9CDA0956784F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -560,6 +610,7 @@ Global {F0C34D6B-8B22-44D6-937F-0C5AE3AD60F4} = {38132213-F062-41E8-850D-6219AA841AEA} {AD384E19-7EC3-45A0-BF26-4270884CD3CF} = {3AF13D7E-92D5-4B2A-AB24-3A4330D2D06C} {F88D3FD9-979D-4D85-9E32-FC2099BB71A5} = {38132213-F062-41E8-850D-6219AA841AEA} + {23598F00-663B-4F48-B467-9CDA0956784F} = {38132213-F062-41E8-850D-6219AA841AEA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {13B02A2C-697B-411E-883A-07C0B820CFE1} diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index a1d5548..24945de 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -13,6 +13,7 @@ public class TreeNeuronViewModel { private string avatarUrl; private INeuronQueryService neuronQueryService; + private Timer expandPostsynapticsUntilExternalReferencesTimer { get; } public TreeNeuronViewModel(Neuron neuron, string avatarUrl, INeuronQueryService neuronQueryService) { @@ -20,7 +21,7 @@ public TreeNeuronViewModel(Neuron neuron, string avatarUrl, INeuronQueryService this.avatarUrl = avatarUrl; this.neuronQueryService = neuronQueryService; this.Children = new List(); - this.ExpandPostsynapticsUntilExternalReferencesTimer = new Timer(); + this.expandPostsynapticsUntilExternalReferencesTimer = new Timer(); } public IList Children { get; set; } @@ -29,7 +30,7 @@ public TreeNeuronViewModel(Neuron neuron, string avatarUrl, INeuronQueryService public ExpansionState ExpansionState { get; private set; } - public Timer ExpandPostsynapticsUntilExternalReferencesTimer { get; } + public Timer ExpandPostsynapticsUntilExternalReferencesTimer { get => this.expandPostsynapticsUntilExternalReferencesTimer; } public async Task Toggle() { @@ -83,5 +84,22 @@ public async Task Toggle() //{ // _cancellationTokenSource?.Cancel(); //} + + public void ConfigureExpandTimer(double interval, ElapsedEventHandler handler) + { + this.expandPostsynapticsUntilExternalReferencesTimer.Interval = interval; + this.expandPostsynapticsUntilExternalReferencesTimer.Elapsed -= handler; + this.expandPostsynapticsUntilExternalReferencesTimer.Elapsed += handler; + } + + public void StartExpandTimer() + { + this.expandPostsynapticsUntilExternalReferencesTimer.Start(); + } + + public void StopExpandTimer() + { + this.expandPostsynapticsUntilExternalReferencesTimer.Stop(); + } } } diff --git a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor index 540bf95..3cf01f2 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor +++ b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor @@ -255,7 +255,6 @@ protected override async Task OnParametersSetAsync() { - // Only create new cancellation token and start expansion if flag is true if ( this.selectedNeuron != null && this.selectedNeuron.ExpandPostsynapticsUntilExternalReferencesTimer.Enabled && @@ -265,8 +264,8 @@ ) ) { - this.selectedNeuron.ExpandPostsynapticsUntilExternalReferencesTimer.Enabled = false; - this.selectedNeuron.ExpandPostsynapticsUntilExternalReferencesTimer.Start(); + this.selectedNeuron.StopExpandTimer(); + this.selectedNeuron.StartExpandTimer(); // if children contains selected neuron if ( @@ -293,7 +292,6 @@ string.IsNullOrEmpty(child.Neuron.ExternalReferenceUrl)) { await InvokeAsync(() => child.Toggle()); - } } } diff --git a/src/main/Port.Adapter/UI/Views/Blazor/Blazor.csproj b/src/main/Port.Adapter/UI/Views/Blazor/Blazor.csproj index bc3df72..cd56530 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor/Blazor.csproj +++ b/src/main/Port.Adapter/UI/Views/Blazor/Blazor.csproj @@ -42,6 +42,7 @@ + diff --git a/src/main/Port.Adapter/UI/Views/Blazor/Blazor.csproj.user b/src/main/Port.Adapter/UI/Views/Blazor/Blazor.csproj.user index 46b3953..8b531a2 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor/Blazor.csproj.user +++ b/src/main/Port.Adapter/UI/Views/Blazor/Blazor.csproj.user @@ -14,4 +14,7 @@ ProjectDebugger + + ProjectDebugger + \ No newline at end of file diff --git a/src/main/Port.Adapter/UI/Views/Blazor/Program.cs b/src/main/Port.Adapter/UI/Views/Blazor/Program.cs index b54a97a..a977c69 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor/Program.cs +++ b/src/main/Port.Adapter/UI/Views/Blazor/Program.cs @@ -1,4 +1,4 @@ -// #define staticLinkAssembly +#define staticLinkAssembly using Blazored.Toast; using Blazorise; using Blazorise.Bootstrap; diff --git a/src/main/Port.Adapter/UI/Views/Blazor/Properties/launchSettings.json b/src/main/Port.Adapter/UI/Views/Blazor/Properties/launchSettings.json index 9d0ff85..84122cf 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor/Properties/launchSettings.json +++ b/src/main/Port.Adapter/UI/Views/Blazor/Properties/launchSettings.json @@ -20,9 +20,9 @@ "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", - "OIDC_AUTHORITY": "https://dev.example.com:65102", + "OIDC_AUTHORITY": "https://login.neurul.net", "CLIENT_ID": "d23-sample", - "CLIENT_SECRET": "", + "CLIENT_SECRET": "978c1052-1184-48f7-89f4-4fd034847a06", "REQUESTED_SCOPES": "openid,profile,email,avatarapi-sample,offline_access", "UPDATE_CHECK_INTERVAL": "1000000", "DATABASE_PATH": "C:\\ei8\\avatars\\prod\\sample\\d23.db", @@ -32,7 +32,7 @@ "APP_TITLE": "", "APP_ICON": "" }, - "applicationUrl": "https://192.168.1.110:65103/" + "applicationUrl": "https://192.168.1.2:65103" }, "Docker": { "commandName": "Docker", From c4fd237939026c796aaeee49a270dcfa380f24ea Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Sat, 25 Jan 2025 12:06:57 +0200 Subject: [PATCH 07/51] Implement elmer's final comments --- .../UI/ViewModels/TreeNeuronViewModel.cs | 48 +++++-------------- .../UI/Views/Blazor.Common/TreeView.razor | 5 +- 2 files changed, 14 insertions(+), 39 deletions(-) diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index 24945de..b895d3a 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -13,7 +13,7 @@ public class TreeNeuronViewModel { private string avatarUrl; private INeuronQueryService neuronQueryService; - private Timer expandPostsynapticsUntilExternalReferencesTimer { get; } + private Timer expandPostsynapticsUntilExternalReferencesTimer; public TreeNeuronViewModel(Neuron neuron, string avatarUrl, INeuronQueryService neuronQueryService) { @@ -30,8 +30,6 @@ public TreeNeuronViewModel(Neuron neuron, string avatarUrl, INeuronQueryService public ExpansionState ExpansionState { get; private set; } - public Timer ExpandPostsynapticsUntilExternalReferencesTimer { get => this.expandPostsynapticsUntilExternalReferencesTimer; } - public async Task Toggle() { this.ExpansionState = this.ExpansionState == ExpansionState.Collapsed ? ExpansionState.Expanding : ExpansionState.Collapsed; @@ -51,39 +49,6 @@ public async Task Toggle() this.ExpansionState = ExpansionState.Expanded; } } - //public async Task StartExpandPostsynapticsUntilExternalReferences(int expandTimeLimit) - //{ - // _cancellationTokenSource = new CancellationTokenSource(expandTimeLimit); - - // try - // { - // await StartExpandPostsynapticsUntilExternalReferences(_cancellationTokenSource.Token); - // } - // catch (OperationCanceledException) - // { - // // Handle the cancellation if needed - // } - //} - - //private async Task StartExpandPostsynapticsUntilExternalReferences(CancellationToken cancellationToken) - //{ - // cancellationToken.ThrowIfCancellationRequested(); - - // if (this.Neuron.Type != Library.Common.RelativeType.Presynaptic && string.IsNullOrEmpty(this.Neuron.ExternalReferenceUrl)) - // { - // await Toggle(); - // foreach (var item in this.Children) - // { - // cancellationToken.ThrowIfCancellationRequested(); - // await item.StartExpandPostsynapticsUntilExternalReferences(cancellationToken); - // } - // } - //} - - //public void CancelExpansion() - //{ - // _cancellationTokenSource?.Cancel(); - //} public void ConfigureExpandTimer(double interval, ElapsedEventHandler handler) { @@ -101,5 +66,16 @@ public void StopExpandTimer() { this.expandPostsynapticsUntilExternalReferencesTimer.Stop(); } + + public void RestartExpandTimer() + { + this.expandPostsynapticsUntilExternalReferencesTimer.Enabled = false; + this.StartExpandTimer(); + } + + public bool IsExpandTimerEnabled() + { + return this.expandPostsynapticsUntilExternalReferencesTimer.Enabled; + } } } diff --git a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor index 3cf01f2..4598b7d 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor +++ b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor @@ -257,15 +257,14 @@ { if ( this.selectedNeuron != null && - this.selectedNeuron.ExpandPostsynapticsUntilExternalReferencesTimer.Enabled && + this.selectedNeuron.IsExpandTimerEnabled() && ( this.selectedNeuron.ExpansionState == ExpansionState.Collapsed || !this.Children.Any(c => c.ExpansionState == ExpansionState.Expanded) ) ) { - this.selectedNeuron.StopExpandTimer(); - this.selectedNeuron.StartExpandTimer(); + this.selectedNeuron.RestartExpandTimer(); // if children contains selected neuron if ( From a94785c4f64508946fc5253b9b8088d9bdcc1126 Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Mon, 27 Jan 2025 23:49:13 +0200 Subject: [PATCH 08/51] Rename IsExpandModalVisible to IsVisible and OnCancelExpand to OnCancelProcess --- .../Port.Adapter/UI/Views/Blazor.Common/ProcessBox.razor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/Port.Adapter/UI/Views/Blazor.Common/ProcessBox.razor b/src/main/Port.Adapter/UI/Views/Blazor.Common/ProcessBox.razor index b510a73..edf53d7 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor.Common/ProcessBox.razor +++ b/src/main/Port.Adapter/UI/Views/Blazor.Common/ProcessBox.razor @@ -1,4 +1,4 @@ -@if (this.IsExpandModalVisible) +@if (this.IsVisible) {
  • +
  • @{var tagUrlType = this.GetUrlType(child.Neuron.Tag);}
    @@ -44,13 +45,13 @@ } @if (@child.ExpansionState == ExpansionState.Collapsed) { - } else if (@child.ExpansionState == ExpansionState.Expanded) { - } @@ -479,4 +480,16 @@ return dict; } + + private string GetBackgroundColorStyle(TreeNeuronViewModel neuron) + { + var baseStyle = "list-style-type: none;"; + var colorStyle = neuron.Color switch + { + ViewModels.Color.White => "background-color: #ffffff;", + ViewModels.Color.Blue => "background-color: #f0f8ff;", + _ => string.Empty + }; + return $"{baseStyle} {colorStyle}"; + } } From 17134a308951a0862c829a8657f742fa12ef77dd Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:51:38 +0300 Subject: [PATCH 45/51] Remove un needed spaces --- src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index 86332c4..f262fc8 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -92,9 +92,7 @@ public void ConfigureExpansionTimer(Timer timer, ExpansionType type, double inte { if (timer == null) throw new ArgumentNullException(nameof(timer)); - this.expansionTimer = timer; - this.currentExpansionType = type; this.expansionTimer.Interval = interval; this.expansionTimer.Elapsed -= handler; From f442610ce68f4db8e9b2284b72b238673cac5fdf Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Fri, 13 Jun 2025 14:55:29 +0300 Subject: [PATCH 46/51] Use neuron index instead of enum and implement set index method --- .../UI/ViewModels/TreeNeuronViewModel.cs | 13 ++++--------- .../UI/Views/Blazor.Common/TreeView.razor | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index f262fc8..68cee60 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -16,11 +16,6 @@ public enum ExpansionType PostsynapticUntilExternalReferences, FarthestPresynaptic } - public enum Color - { - White, - Blue - } public class TreeNeuronViewModel { @@ -35,7 +30,7 @@ public TreeNeuronViewModel( string avatarUrl, INeuronQueryService neuronQueryService, IEnumerable mirrorConfigFiles, - Color color = Color.White + int index = 0 ) { this.Neuron = neuron; @@ -43,7 +38,7 @@ public TreeNeuronViewModel( this.neuronQueryService = neuronQueryService; this.mirrorConfigFiles = mirrorConfigFiles; this.Children = new List(); - this.Color = color; + this.Index = index; } public IList Children { get; set; } @@ -53,7 +48,7 @@ public TreeNeuronViewModel( public ExpansionState ExpansionState { get; private set; } public ExpansionType CurrentExpansionType => this.currentExpansionType; - public Color Color; + public int Index; public async Task Toggle() { @@ -78,7 +73,7 @@ public async Task Toggle() this.avatarUrl, this.neuronQueryService, this.mirrorConfigFiles, - this.Color + this.Index )) ); diff --git a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor index 501c156..ae03584 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor +++ b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor @@ -273,6 +273,8 @@ protected override async Task OnParametersSetAsync() { + if (IsRoot) + SetIndex(); if ( this.selectedNeuron != null && string.IsNullOrEmpty(this.selectedNeuron.Neuron.ExternalReferenceUrl) && this.selectedNeuron.IsExpansionTimerEnabled() && @@ -481,13 +483,24 @@ } + private void SetIndex() + { + for (int i = 0; i < this.Children.Count; i++) + { + if (i % 2 == 0) + this.Children[i].Index = 0; + else + this.Children[i].Index = 1; + } + } + private string GetBackgroundColorStyle(TreeNeuronViewModel neuron) { var baseStyle = "list-style-type: none;"; - var colorStyle = neuron.Color switch + var colorStyle = neuron.Index switch { - ViewModels.Color.White => "background-color: #ffffff;", - ViewModels.Color.Blue => "background-color: #f0f8ff;", + 0 => "background-color: #ffffff;", + 1 => "background-color: #f0f8ff;", _ => string.Empty }; return $"{baseStyle} {colorStyle}"; From 299e26ba2614e437ce27f8e3e5420170982de96f Mon Sep 17 00:00:00 2001 From: Abdulrahman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Mon, 16 Jun 2025 01:36:29 +0300 Subject: [PATCH 47/51] Implement modular --- .../UI/ViewModels/TreeNeuronViewModel.cs | 6 ++-- .../UI/Views/Blazor.Common/TreeView.razor | 31 +++++++++---------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index 68cee60..41ccfb0 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -30,7 +30,7 @@ public TreeNeuronViewModel( string avatarUrl, INeuronQueryService neuronQueryService, IEnumerable mirrorConfigFiles, - int index = 0 + int rootIndex = 0 ) { this.Neuron = neuron; @@ -38,7 +38,7 @@ public TreeNeuronViewModel( this.neuronQueryService = neuronQueryService; this.mirrorConfigFiles = mirrorConfigFiles; this.Children = new List(); - this.Index = index; + this.RootIndex = rootIndex; } public IList Children { get; set; } @@ -48,7 +48,7 @@ public TreeNeuronViewModel( public ExpansionState ExpansionState { get; private set; } public ExpansionType CurrentExpansionType => this.currentExpansionType; - public int Index; + public int RootIndex; public async Task Toggle() { diff --git a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor index ae03584..c8689ea 100644 --- a/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor +++ b/src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor @@ -166,15 +166,15 @@ {
    } @@ -273,8 +273,8 @@ protected override async Task OnParametersSetAsync() { - if (IsRoot) - SetIndex(); + if (this.IsRoot) + this.UpdateChildrenRootIndex(); if ( this.selectedNeuron != null && string.IsNullOrEmpty(this.selectedNeuron.Neuron.ExternalReferenceUrl) && this.selectedNeuron.IsExpansionTimerEnabled() && @@ -483,21 +483,18 @@ } - private void SetIndex() + private void UpdateChildrenRootIndex() { for (int i = 0; i < this.Children.Count; i++) { - if (i % 2 == 0) - this.Children[i].Index = 0; - else - this.Children[i].Index = 1; + this.Children[i].RootIndex = i; } } private string GetBackgroundColorStyle(TreeNeuronViewModel neuron) { var baseStyle = "list-style-type: none;"; - var colorStyle = neuron.Index switch + var colorStyle = (neuron.RootIndex % 2) switch { 0 => "background-color: #ffffff;", 1 => "background-color: #f0f8ff;", From 33ebf93c1d80105b3f5a655cc57e9f8b11cd94a9 Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Tue, 17 Jun 2025 01:27:38 +0300 Subject: [PATCH 48/51] Implement a camel case for root index field --- src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index 41ccfb0..a6ae3e8 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -24,6 +24,7 @@ public class TreeNeuronViewModel private Timer expansionTimer; private ExpansionType currentExpansionType = ExpansionType.None; private readonly IEnumerable mirrorConfigFiles; + private int rootIndex; public TreeNeuronViewModel( Neuron neuron, @@ -38,7 +39,7 @@ public TreeNeuronViewModel( this.neuronQueryService = neuronQueryService; this.mirrorConfigFiles = mirrorConfigFiles; this.Children = new List(); - this.RootIndex = rootIndex; + this.rootIndex = rootIndex; } public IList Children { get; set; } @@ -48,7 +49,7 @@ public TreeNeuronViewModel( public ExpansionState ExpansionState { get; private set; } public ExpansionType CurrentExpansionType => this.currentExpansionType; - public int RootIndex; + public int RootIndex => this.rootIndex; public async Task Toggle() { @@ -73,7 +74,7 @@ public async Task Toggle() this.avatarUrl, this.neuronQueryService, this.mirrorConfigFiles, - this.Index + this.RootIndex )) ); From 591076a74936714e9f76e1461cef712f12d45634 Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Tue, 17 Jun 2025 01:38:05 +0300 Subject: [PATCH 49/51] Make Root Index as property with set get methods --- src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs index a6ae3e8..31d1a53 100644 --- a/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs +++ b/src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs @@ -24,7 +24,6 @@ public class TreeNeuronViewModel private Timer expansionTimer; private ExpansionType currentExpansionType = ExpansionType.None; private readonly IEnumerable mirrorConfigFiles; - private int rootIndex; public TreeNeuronViewModel( Neuron neuron, @@ -39,7 +38,7 @@ public TreeNeuronViewModel( this.neuronQueryService = neuronQueryService; this.mirrorConfigFiles = mirrorConfigFiles; this.Children = new List(); - this.rootIndex = rootIndex; + this.RootIndex = rootIndex; } public IList Children { get; set; } @@ -48,8 +47,9 @@ public TreeNeuronViewModel( public ExpansionState ExpansionState { get; private set; } + public int RootIndex { get; set; } + public ExpansionType CurrentExpansionType => this.currentExpansionType; - public int RootIndex => this.rootIndex; public async Task Toggle() { From 96f58ae96db1fb6ccba5198ed713d91e04a4c846 Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Fri, 20 Jun 2025 09:48:16 +0300 Subject: [PATCH 50/51] Add Eupm Constant --- src/main/Port.Adapter/UI/ViewModels/Types.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/Port.Adapter/UI/ViewModels/Types.cs b/src/main/Port.Adapter/UI/ViewModels/Types.cs index 9766e53..c56e2b2 100644 --- a/src/main/Port.Adapter/UI/ViewModels/Types.cs +++ b/src/main/Port.Adapter/UI/ViewModels/Types.cs @@ -14,5 +14,6 @@ public enum ExpansionState public class Constants { public const int TreeNodeChildrenQueryPageSize = 200; + public const string Eupm = "eupm"; } } From ead9fd6ce51867da22156118fafa7d32b406248e Mon Sep 17 00:00:00 2001 From: Abdelrhman Ahmed <64210458+AbdulrahmanAhmeed@users.noreply.github.com> Date: Sat, 21 Jun 2025 04:48:12 +0300 Subject: [PATCH 51/51] Remove Eupm varieble from constants class --- src/main/Port.Adapter/UI/ViewModels/Types.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/Port.Adapter/UI/ViewModels/Types.cs b/src/main/Port.Adapter/UI/ViewModels/Types.cs index c56e2b2..9766e53 100644 --- a/src/main/Port.Adapter/UI/ViewModels/Types.cs +++ b/src/main/Port.Adapter/UI/ViewModels/Types.cs @@ -14,6 +14,5 @@ public enum ExpansionState public class Constants { public const int TreeNodeChildrenQueryPageSize = 200; - public const string Eupm = "eupm"; } }