chore: fix issue where child tags would get hidden in exclusive vault mode if parent tag is in different vault (#2502)

This commit is contained in:
Aman Harwara
2023-09-15 16:28:16 +05:30
committed by GitHub
parent 2ecd6cf5cd
commit 520bede842
3 changed files with 14 additions and 1 deletions

View File

@@ -117,6 +117,7 @@ export interface ItemManagerInterface extends AbstractService {
getDisplayableTags(): SNTag[]
getTagChildren(itemToLookupUuidFor: SNTag): SNTag[]
getTagParent(itemToLookupUuidFor: SNTag): SNTag | undefined
getDisplayableTagParent(itemToLookupUuidFor: SNTag): SNTag | undefined
isValidTagParent(parentTagToLookUpUuidFor: SNTag, childToLookUpUuidFor: SNTag): boolean
isSmartViewTitle(title: string): boolean
getDisplayableComponents(): ComponentInterface[]

View File

@@ -640,6 +640,18 @@ export class ItemManager extends Services.AbstractService implements Services.It
return undefined
}
getDisplayableTagParent(itemToLookupUuidFor: Models.SNTag): Models.SNTag | undefined {
const tag = this.findItem<Models.SNTag>(itemToLookupUuidFor.uuid)
if (!tag) {
return undefined
}
const parentId = tag.parentId
if (parentId) {
return this.tagDisplayController.items().find((displayableTag) => displayableTag.uuid === parentId)
}
return undefined
}
public getTagPrefixTitle(tag: Models.SNTag): string | undefined {
const hierarchy = this.getTagParentChain(tag)

View File

@@ -472,7 +472,7 @@ export class NavigationController
}
get rootTags(): SNTag[] {
return this.tags.filter((tag) => !this.items.getTagParent(tag))
return this.tags.filter((tag) => !this.items.getDisplayableTagParent(tag))
}
get tagsCount(): number {