feat: add showOnlyOnCloud flag

This commit is contained in:
Shivam Mishra
2025-01-23 18:08:41 +05:30
parent 2f4bf9d009
commit eff39fbbf5
5 changed files with 23 additions and 3 deletions
@@ -23,6 +23,7 @@ const {
resolvePath,
resolvePermissions,
resolveFeatureFlag,
isOnChatwootCloud,
isAllowed,
} = useSidebarContext();
@@ -41,6 +42,7 @@ const hasChildren = computed(
const accessibleItems = computed(() => {
if (!hasChildren.value) return [];
return props.children.filter(child => {
if (child.showOnlyOnCloud && isOnChatwootCloud.value) return false;
// If a item has no link, it means it's just a subgroup header
// So we don't need to check for permissions here, because there's nothing to
// access here anyway