Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c1397b3
ExpandUntillPostsynapticExteralReferences_Master
AbdulrahmanAhmeed Dec 21, 2024
13bcbd0
Review changes.
elmerbool Dec 26, 2024
5575648
Implement_StartExpandPostsynapticsUntilExternalReferences_Method
AbdulrahmanAhmeed Jan 3, 2025
31e1e62
Merge branch 'pr/85-review' into master2
AbdulrahmanAhmeed Jan 7, 2025
8808fcf
Fix TreeNeuronViewModel issues
AbdulrahmanAhmeed Jan 8, 2025
9443b88
Implement Process Box
AbdulrahmanAhmeed Jan 16, 2025
93d3ad5
Encapsulate TreeNeuronViewModel Timer
AbdulrahmanAhmeed Jan 24, 2025
c4fd237
Implement elmer's final comments
AbdulrahmanAhmeed Jan 25, 2025
a94785c
Rename IsExpandModalVisible to IsVisible and OnCancelExpand to OnCanc…
AbdulrahmanAhmeed Jan 27, 2025
82025e5
Remove_Add_Button
AbdulrahmanAhmeed Feb 21, 2025
faf3952
Merge remote-tracking branch 'upstream/master' into master2
AbdulrahmanAhmeed Feb 22, 2025
44291d7
Fix relative values issue
AbdulrahmanAhmeed Feb 22, 2025
cf1a142
Revert Elmer requested changes
AbdulrahmanAhmeed Feb 26, 2025
aa86592
Init
AbdulrahmanAhmeed Mar 4, 2025
ce67926
Revert "Init"
AbdulrahmanAhmeed Mar 4, 2025
97a09bb
Remove cdp-tree reffrence
AbdulrahmanAhmeed Mar 4, 2025
ab1350e
Setting NeuronQuery to an initial value.
elmerbool Mar 6, 2025
c9900af
Update launchSettings.json
elmerbool Mar 6, 2025
a0e3931
Fix_TreeNeuronViewModel_bug
AbdulrahmanAhmeed Mar 7, 2025
638fb3f
Merge branch 'master2' of https://github.com/AbdulrahmanAhmeed/cortex…
AbdulrahmanAhmeed Mar 7, 2025
4f5e951
Fix Expanding ExternalReferenceUrl Neuron Issue
AbdulrahmanAhmeed Mar 19, 2025
0ee8fb7
Revert settings changes
AbdulrahmanAhmeed Mar 23, 2025
1e05874
Merge branch 'master' into master2
elmerbool Mar 24, 2025
f47eb28
Update TreeNeuronViewModel.cs
elmerbool Mar 24, 2025
d2720ef
Implement #6 ticket
AbdulrahmanAhmeed Apr 9, 2025
df10162
Add_Light_Blue_Color
AbdulrahmanAhmeed Apr 10, 2025
76828ea
Fix hover issue
AbdulrahmanAhmeed Apr 11, 2025
6fae269
Finish #6 ticket
AbdulrahmanAhmeed Apr 11, 2025
712f9cd
Fix Post issue
AbdulrahmanAhmeed Apr 12, 2025
733706f
Implement Elmer's comments
AbdulrahmanAhmeed Apr 14, 2025
fe8fa97
Append Clean Code for hover and unhover feature
AbdulrahmanAhmeed Apr 16, 2025
2e4b39a
Implement Elmer's new comments
AbdulrahmanAhmeed Apr 16, 2025
3f97726
Implement Elmer's notes
AbdulrahmanAhmeed Apr 25, 2025
fa8e171
Remove unused try catch
AbdulrahmanAhmeed Apr 27, 2025
f1e2f27
Fix expand issue
AbdulrahmanAhmeed May 9, 2025
2856b18
Merge remote-tracking branch 'upstream/master' into master2
AbdulrahmanAhmeed May 10, 2025
ee57fe9
Revert "Fix expand issue"
AbdulrahmanAhmeed May 10, 2025
fbc6e98
Fix expand issue
AbdulrahmanAhmeed May 10, 2025
21397fa
implement Expand Until Farthest Presynaptic
AbdulrahmanAhmeed May 26, 2025
e3b2fb4
Merge branch 'master2' of https://github.com/AbdulrahmanAhmeed/cortex…
AbdulrahmanAhmeed May 26, 2025
184dc82
Update TreeNeuronViewModel
AbdulrahmanAhmeed May 27, 2025
ff3dccf
Inhance Code Reusabilty
AbdulrahmanAhmeed May 28, 2025
82333e2
Implement Elmer's comments
AbdulrahmanAhmeed May 28, 2025
13cc9ee
Implement Other Condition Expression
AbdulrahmanAhmeed May 28, 2025
21868fe
Make Other Condition optional parameter
AbdulrahmanAhmeed May 29, 2025
e81f44a
Remove unnecessary parameters
AbdulrahmanAhmeed May 29, 2025
01df8ed
Merge branch 'master' into master2
elmerbool May 29, 2025
a13b147
Merge remote-tracking branch 'upstream/master' into master2
AbdulrahmanAhmeed Jun 1, 2025
5ebeecb
Implement Just one timer instead one implement timer for each neuron
AbdulrahmanAhmeed Jun 5, 2025
604544c
Remove SetExpansionTimer
AbdulrahmanAhmeed Jun 10, 2025
906c64f
Update TreeNeuronViewModel.cs
elmerbool Jun 10, 2025
1753f7a
Implement ticket 19
AbdulrahmanAhmeed Jun 11, 2025
d89e68b
Merge branch 'master2' of https://github.com/AbdulrahmanAhmeed/cortex…
AbdulrahmanAhmeed Jun 11, 2025
61a6d0f
Merge remote-tracking branch 'upstream/master' into master2
AbdulrahmanAhmeed Jun 12, 2025
17134a3
Remove un needed spaces
AbdulrahmanAhmeed Jun 12, 2025
f442610
Use neuron index instead of enum and implement set index method
AbdulrahmanAhmeed Jun 13, 2025
299e26b
Implement modular
AbdulrahmanAhmeed Jun 15, 2025
33ebf93
Implement a camel case for root index field
AbdulrahmanAhmeed Jun 16, 2025
591076a
Make Root Index as property with set get methods
AbdulrahmanAhmeed Jun 16, 2025
96f58ae
Add Eupm Constant
AbdulrahmanAhmeed Jun 20, 2025
ead9fd6
Remove Eupm varieble from constants class
AbdulrahmanAhmeed Jun 21, 2025
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
13 changes: 8 additions & 5 deletions src/main/Port.Adapter/UI/ViewModels/TreeNeuronViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ public TreeNeuronViewModel(
Neuron neuron,
string avatarUrl,
INeuronQueryService neuronQueryService,
IEnumerable<MirrorConfigFile> mirrorConfigFiles
IEnumerable<MirrorConfigFile> mirrorConfigFiles,
int rootIndex = 0
)
{
this.Neuron = neuron;
this.avatarUrl = avatarUrl;
this.neuronQueryService = neuronQueryService;
this.mirrorConfigFiles = mirrorConfigFiles;
this.Children = new List<TreeNeuronViewModel>();
this.RootIndex = rootIndex;
}

public IList<TreeNeuronViewModel> Children { get; set; }
Expand All @@ -45,6 +47,8 @@ IEnumerable<MirrorConfigFile> mirrorConfigFiles

public ExpansionState ExpansionState { get; private set; }

public int RootIndex { get; set; }

public ExpansionType CurrentExpansionType => this.currentExpansionType;

public async Task Toggle()
Expand All @@ -69,7 +73,8 @@ public async Task Toggle()
new Neuron(n),
this.avatarUrl,
this.neuronQueryService,
this.mirrorConfigFiles
this.mirrorConfigFiles,
this.RootIndex
))
);

Expand All @@ -83,9 +88,7 @@ public void ConfigureExpansionTimer(Timer timer, ExpansionType type, double inte
{
if (timer == null)
throw new ArgumentNullException(nameof(timer));

this.expansionTimer = timer;

this.expansionTimer = timer;
this.currentExpansionType = type;
this.expansionTimer.Interval = interval;
this.expansionTimer.Elapsed -= handler;
Expand Down
47 changes: 35 additions & 12 deletions src/main/Port.Adapter/UI/Views/Blazor.Common/TreeView.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@using Blazorise
@using Blazorise.Icons.FontAwesome
@using Microsoft.JSInterop
@using Microsoft.AspNetCore.Components.Web
@using ei8.Cortex.Diary.Application.Neurons
@using ei8.Cortex.Diary.Port.Adapter.UI.ViewModels

Expand All @@ -11,7 +12,7 @@
@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));
<li class="p-0 my-1" style="list-style-type: none;">
<li class="p-0 my-1" style="@GetBackgroundColorStyle(child)">
<div class="container-fluid m-0" style="@this.GetJustifyStyle(child)">
@{var tagUrlType = this.GetUrlType(child.Neuron.Tag);}
<div class="row" style=@(tagUrlType == UrlType.GoogleDriveImage ? "max-width: 70%" : string.Empty)>
Expand Down Expand Up @@ -44,13 +45,13 @@
}
@if (@child.ExpansionState == ExpansionState.Collapsed)
{
<button class="btn btn-light btn-xs rounded-circle" style="height: 25px; background-color: white; border-color: white" @onclick="child.Toggle">
<button class="btn btn-xs rounded-circle" style="height: 25px;" @onclick="child.Toggle">
<span class="small text-secondary">&#x25B7;</span>
</button>
}
else if (@child.ExpansionState == ExpansionState.Expanded)
{
<button class="btn btn-light btn-xs rounded-circle" style="height: 25px; background-color: white; border-color: white" @onclick="child.Toggle">
<button class="btn btn-xs rounded-circle" style="height: 25px;" @onclick="child.Toggle">
<span class="small text-secondary">&#x25E2;</span>
</button>
}
Expand Down Expand Up @@ -165,15 +166,15 @@
{
<div class="row">
<TreeView Children="@child.Children"
AvatarUrl="@this.AvatarUrl"
OnHover="@(async (childNode) => await Hover(childNode))"
OnUnhover="@(async (childNode) => await Unhover(childNode))"
@bind-SelectedNeuron="@this.SelectedNeuron"
OnMenuRequested="@this.MenuRequested"
OnInfoRequested="@this.InfoRequested"
@bind-ControlsEnabled="@this.ControlsEnabled"
IsRoot="false"
IsRootRightJustified="@(this.ShouldRightJustifyBasedOnRoot(child))"
AvatarUrl="@this.AvatarUrl"
OnHover="@(async (childNode) => await Hover(childNode))"
OnUnhover="@(async (childNode) => await Unhover(childNode))"
@bind-SelectedNeuron="@this.SelectedNeuron"
OnMenuRequested="@this.MenuRequested"
OnInfoRequested="@this.InfoRequested"
@bind-ControlsEnabled="@this.ControlsEnabled"
IsRoot="false"
IsRootRightJustified="@(this.ShouldRightJustifyBasedOnRoot(child))"
/>
</div>
}
Expand Down Expand Up @@ -272,6 +273,8 @@

protected override async Task OnParametersSetAsync()
{
if (this.IsRoot)
this.UpdateChildrenRootIndex();
if (
this.selectedNeuron != null && string.IsNullOrEmpty(this.selectedNeuron.Neuron.ExternalReferenceUrl) &&
this.selectedNeuron.IsExpansionTimerEnabled() &&
Expand Down Expand Up @@ -479,4 +482,24 @@
return dict;

}

private void UpdateChildrenRootIndex()
{
for (int i = 0; i < this.Children.Count; i++)
{
this.Children[i].RootIndex = i;
}
}

private string GetBackgroundColorStyle(TreeNeuronViewModel neuron)
{
var baseStyle = "list-style-type: none;";
var colorStyle = (neuron.RootIndex % 2) switch
{
0 => "background-color: #ffffff;",
1 => "background-color: #f0f8ff;",
_ => string.Empty
};
return $"{baseStyle} {colorStyle}";
}
}