Skip to main content

Downtime Reason Tree

Overview

The Downtime Reason Tree component is a custom Perspective component that provides a hierarchical tree view of downtime reasons. It allows users to easily navigate and select downtime reasons from a structured list, making it possible to categorize and analyze downtime events. Unlike the other trees, this component can be passed a locationId to filter the reasons shown based on the location.

Props

The Downtime Reason Tree component has the following props:

Prop NameTypeDescriptionInput/Output
showSearchbooleanIf true, shows a search box at the top of the tree to filter reasons.Input
selectedItemobjectThe currently selected item in the tree. Contains the properties code (number), notes (string), description (string), parentId (string), enabled (boolean), path (string), locationId (string), name (string), id (string), locationPath (string)Output
currentItemIdstringThe ID of the item most recently clicked on. This is useful for tracking user interaction with the tree.Output
forceRefreshbooleanIf true, forces the tree to refresh its data from the server. Automatically resets to false after 500ms.Input
allowEditbooleanIf true, allows the user to edit the tree (add, edit, delete, cut, paste, etc.).Input
locationIdstringIf set, filters the reasons shown in the tree to only those associated with the specified location.Input
rootPathstringIf set, only shows reasons that are descendants of the specified reason path.Input
hideItemsarray[string]An array of reason IDs to hide from the tree. Also hides their children.Input
showImportbooleanIf true, shows an "Import" button to allow importing reasons from a CSV or JSON file.Input
showExportbooleanIf true, shows an "Export" button in the context menu to allow exporting reasons to a CSV or JSON file.Input
importTooltipstringThe tooltip text to show when hovering over the "Import" button.Input

Events

The Downtime Reason Tree component emits the following events:

Event NameDescriptionPayload
onAddEmitted when the user adds a new reason.{ currentItemId: string, locationId: string }
onDeleteEmitted when the user deletes a reason.{ currentItemId: string }
onImportEmitted when the user imports downtime reasons.None
onExportEmitted when the user exports downtime reasons.{ currentItemId: string}