TF-1868 Fix a mailbox is visible then it's parents needs to be visible too
(cherry picked from commit 02a505fc6241ffb4df7559004e8dae718f13d39e)
This commit is contained in:
@@ -21,6 +21,8 @@ class MailboxNode with EquatableMixin{
|
||||
|
||||
bool hasChildren() => childrenItems?.isNotEmpty ?? false;
|
||||
|
||||
bool hasParents() => item.hasParentId();
|
||||
|
||||
bool get isActivated => nodeState == MailboxState.activated;
|
||||
|
||||
bool get isSelected => selectMode == SelectMode.ACTIVE;
|
||||
|
||||
@@ -111,6 +111,20 @@ class MailboxTree with EquatableMixin {
|
||||
return path;
|
||||
}
|
||||
|
||||
List<MailboxNode>? getAncestorList(MailboxNode mailboxNode) {
|
||||
var parentId = mailboxNode.item.parentId;
|
||||
List<MailboxNode> ancestor = <MailboxNode>[];
|
||||
while(parentId != null) {
|
||||
final parentNode = findNode((node) => node.item.id == parentId);
|
||||
if (parentNode == null) {
|
||||
break;
|
||||
}
|
||||
ancestor.add(parentNode);
|
||||
parentId = parentNode.item.parentId;
|
||||
}
|
||||
return ancestor.isNotEmpty ? ancestor : null;
|
||||
}
|
||||
|
||||
Map<Role, PresentationMailbox> get mapPresentationMailboxByRole {
|
||||
if (root.childrenItems?.isEmpty == true) {
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user