- Added `useAssetPickerController` for managing asset selection logic. - Created `AssetSelectProps` type for defining asset selection properties. - Implemented `AssetPickerDialog` for displaying the asset selection interface. - Developed `AssetPickerList` for rendering the list of selectable assets. - Introduced `AssetSelect` component for integrating the asset picker into forms. - Created `AssetList` component for shared asset listing functionality. - Added tests for workstation creation logic to ensure proper validation. - Implemented workstation asset fields and association fields for managing workstation assets. - Developed workstation lifecycle dialog for managing work profile states. - Added form progress component for visualizing multi-step forms.
14 lines
575 B
TypeScript
14 lines
575 B
TypeScript
import type { AssetInput, AssetRecordedInput } from "./asset-values";
|
|
|
|
export function assetTechnicalStatus(status: AssetRecordedInput["status"]): AssetInput["status"] {
|
|
return status === "available" || status === "in_use" ? "operational" : status;
|
|
}
|
|
|
|
export function assetDisplayStatus(status: AssetInput["status"], assigned: boolean) {
|
|
return status === "operational" ? (assigned ? "in_use" : "available") : status;
|
|
}
|
|
|
|
export function canAssignAsset(status: AssetInput["status"], assignedElsewhere: boolean) {
|
|
return status === "operational" && !assignedElsewhere;
|
|
}
|