File

apps/recallassess/recallassess-api/src/api/client/common/dto/client-navigation.dto.ts

Description

Client-safe navigation item. Internal fields (allowedRoles, featureFlags, permissions) are not exposed and are stripped by plainToInstance with excludeExtraneousValues: true.

Index

Properties

Properties

Optional children
Type : ClientNavigationItemDto[]
Decorators :
@Expose()
@Type(undefined)
Optional disabled
Type : boolean
Decorators :
@Expose()
Optional hidden
Type : boolean
Decorators :
@Expose()
Optional icon
Type : string
Decorators :
@Expose()
id
Type : string
Decorators :
@Expose()
Optional metadata
Type : ClientNavigationMetadataDto
Decorators :
@Expose()
@Type(undefined)
Optional routerLink
Type : string
Decorators :
@Expose()
Optional subtitle
Type : string
Decorators :
@Expose()
title
Type : string
Decorators :
@Expose()
type
Type : "basic" | "collapsable" | "group"
Decorators :
@Expose()
import { Exclude, Expose, Type } from "class-transformer";

/**
 * Public navigation metadata (only keys we expose to the client).
 * Server-side-only fields on the config `metadata` bag are dropped.
 */
@Exclude()
export class ClientNavigationBadgeDto {
  @Expose()
  title!: string;

  @Expose()
  classes!: string;
}

@Exclude()
export class ClientNavigationMetadataDto {
  @Expose()
  trackingId?: string;

  @Expose()
  helpText?: string;

  @Expose()
  @Type(() => ClientNavigationBadgeDto)
  badge?: ClientNavigationBadgeDto;

  @Expose()
  isBeta?: boolean;
}

/**
 * Client-safe navigation item. Internal fields (`allowedRoles`, `featureFlags`, `permissions`) are not
 * exposed and are stripped by `plainToInstance` with `excludeExtraneousValues: true`.
 */
@Exclude()
export class ClientNavigationItemDto {
  @Expose()
  id!: string;

  @Expose()
  title!: string;

  @Expose()
  type!: "basic" | "collapsable" | "group";

  @Expose()
  subtitle?: string;

  @Expose()
  icon?: string;

  @Expose()
  routerLink?: string;

  @Expose()
  disabled?: boolean;

  @Expose()
  hidden?: boolean;

  @Expose()
  @Type(() => ClientNavigationMetadataDto)
  metadata?: ClientNavigationMetadataDto;

  @Expose()
  @Type(() => ClientNavigationItemDto)
  children?: ClientNavigationItemDto[];
}

results matching ""

    No results matching ""