improvement: billing and report tabs turned invisible. removed from permissions dialog too. this is temporary.
This commit is contained in:
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user