- Implement folder account options helper for filtering access items based on person ID and date. - Create FolderAccessAccountField component for selecting accounts with profile integration. - Develop AssetLocalIdentities component for managing local identities associated with assets. - Introduce LocalIdentityOwner component to display and manage local identity ownership. - Add LocalIdentityEditor for creating, associating, and retiring local identities. - Implement local identity API for fetching and executing local identity commands. - Create tests for local identity UI components to ensure functionality and correctness. - Add NetworkShareOptions class for structured and paginated SMB selection. - Introduce NetworkShareAddress component for displaying and copying network share addresses. - Create RemoteOptionList and RemoteOptionPicker components for remote option selection with pagination and search. - Add tests for RemoteOptionList to validate rendering and behavior under various states.
27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
import type { AccessResponseDTO } from "../../common/dto/shared/access.dto";
|
|
import { projectAccess } from "../domain/access/access-projection";
|
|
|
|
import type { AccessSnapshot } from "./access.repository";
|
|
|
|
export function buildAccessResponse(snapshot: AccessSnapshot): AccessResponseDTO {
|
|
const items = [...snapshot.context.catalog, ...snapshot.workspace.items];
|
|
|
|
return {
|
|
localEnvironments: snapshot.localEnvironments ?? [],
|
|
directoryEnvironmentIds: [...(snapshot.directoryEnvironmentIds ?? [])],
|
|
items: items.map((item) => ({
|
|
id: item.id.toPrimitive(),
|
|
companyId: item.companyId.getOrUndefined()?.toPrimitive() ?? null,
|
|
values: item.values.data,
|
|
history: item.history.map((revision) => ({
|
|
id: revision.id.toPrimitive(),
|
|
actorId: revision.actorId.toPrimitive(),
|
|
actorName: snapshot.actors.get(revision.actorId.toPrimitive()) ?? "—",
|
|
recordedAt: revision.recordedAt,
|
|
values: revision.values.data,
|
|
})),
|
|
})),
|
|
...projectAccess(items, snapshot.context.people, snapshot.context.today),
|
|
};
|
|
}
|