Skip to content

BadgeRegistryService

service

Returns all registered badges across the global scope and every bucket.Bucket entries override globals with the same id; remaining duplicates between buckets keep the first occurrence. Useful for tests and debug inspection.

all(): Badge[]

Returns a registered badge by id.Looks first in the given bucket (if any), then in the global scope.

get(id: string, bucket?: string): Badge | undefined
NameTypeDescription
idstring
bucketstring

Resolves all active badges for a given object in the given scope.The visible scope is main ∪ bucket. Variants only resolve when their parent id is present in the visible scope. If idFilter is provided, only badges whose id (or whose variant’s parent id) is in the filter are considered. The resulting list is sorted by ascending priority.

getActiveBadges(dmsObject: DmsObject, options?: literal type): Badge[]
NameTypeDescription
dmsObjectDmsObject
optionsliteral type

Returns a reactive list of badges visible in the given scope.The returned signal recomputes whenever the registry changes. The list contains the global badges merged with the named bucket’s badges (bucket entries override globals with the same id), sorted by ascending priority. At equal priority, globals come first, then bucket-local badges.

getBadgesForBucket(bucket?: string): Signal<Badge[]>
NameTypeDescription
bucketstring

Registers one or multiple badges in the registry.If a badge with the same id already exists in the same scope, it is replaced. Otherwise, the badge is added to the scope.Example :

registered globally and visible to every consumer. If provided, badges are scoped to that bucket and only visible when consumers query with the matching bucket.
See Badge

registerBadges(badges: Badge[], bucket?: string): void
NameTypeDescription
badgesBadge[]
bucketstring

Registers the default badges into the registry.Initializes three built-in badge types:* LOCK_BADGE: Indicates objects locked by other users* LOCK_SELF_BADGE: Indicates objects locked by the current user* RETENTION_BADGE: Indicates objects under retention holdSee Badge

registerDefaultBadges(bucket?: string): void
NameTypeDescription
bucketstring

Unregisters one or multiple badges from the registry by id.Operates only on the specified scope: omitting bucket removes from the global scope only, providing bucket removes from that bucket only.

unregister(id: string | string[], bucket?: string): void
NameTypeDescription
idstring | string[]
bucketstring