Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug where the caret / chevron was still displayed when a child page was deleted. #1066

Closed
wants to merge 3 commits into from
Closed
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 Oqtane.Client/Services/PageService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Oqtane.Models;
using Oqtane.Models;
using System.Threading.Tasks;
using System.Linq;
using System.Net.Http;
Expand Down Expand Up @@ -100,7 +100,8 @@ private static List<Page> GetPagesHierarchy(List<Page> pages)
foreach (Page child in children)
{
child.Level = level + 1;
child.HasChildren = pages.Any(item => item.ParentId == child.PageId);
child.HasChildren = pages.Any(item => item.ParentId == child.PageId && item.IsDeleted == false);
child.HasNavigationChildren = pages.Any(item => item.ParentId == child.PageId && item.IsDeleted == false && item.IsNavigation == true);
hierarchy.Add(child);
getPath(pageList, child);
}
Expand Down
2 changes: 1 addition & 1 deletion Oqtane.Client/Themes/Controls/MenuVertical.razor
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<li class="nav-item px-3">
<a href="@GetUrl(p)" class="nav-link" style="padding-left:@((p.Level + 1) * 15)px !important;" target="@GetTarget(p)">

@if (p.HasChildren)
@if (p.HasNavigationChildren)
{
<i class="oi oi-chevron-right"></i>
}
Expand Down
4 changes: 3 additions & 1 deletion Oqtane.Shared/Models/Page.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

Expand Down Expand Up @@ -40,6 +40,8 @@ public class Page : IAuditable, IDeletable
public int Level { get; set; }
[NotMapped]
public bool HasChildren { get; set; }
[NotMapped]
public bool HasNavigationChildren { get; set; }

[Obsolete("This property is obsolete", false)]
[NotMapped]
Expand Down