improvement: billing and report tabs turned invisible. removed from permissions dialog too. this is temporary.

This commit is contained in:
2026-07-14 03:17:57 +03:30
parent d383a4abc3
commit 8de15ecdb5
5 changed files with 63 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
*/
import type { OrgTypeName } from '@/components/shared/permissions';
import { isHiddenTabPermission } from '@/components/shared/hidden-tabs';
export const STAFF_FEATURE_GROUPS = [
{ labelKey: 'featureToday', read: 'TAB_TODAY_READ', edit: 'TAB_TODAY_EDIT', orgTypes: ['CLINIC', 'LAB'] as const },
@@ -24,8 +25,9 @@ export type OrgType = OrgTypeName | null | undefined;
type StaffFeaturesTranslate = (key: string) => string;
export function staffFeatureGroupsForOrgType(organizationType: OrgType) {
if (!organizationType) return [...STAFF_FEATURE_GROUPS];
return STAFF_FEATURE_GROUPS.filter((g) =>
const visible = STAFF_FEATURE_GROUPS.filter((g) => !isHiddenTabPermission(g.read));
if (!organizationType) return [...visible];
return visible.filter((g) =>
(g.orgTypes as readonly OrgTypeName[]).includes(organizationType),
);
}