Skip to content

Commit

Permalink
add some docs for info line component
Browse files Browse the repository at this point in the history
  • Loading branch information
bsatarnejad committed Nov 21, 2024
1 parent e6c91a2 commit c5affce
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lookbook/docs/patterns/26-work-package-info-line.md.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
The work package info line is a consistent way to display the most commonly-used set of basic work package attributes.

## Overview

<%= embed OpenProject::WorkPackages::InfoLineComponentPreview, :playground %>

## Anatomy

The info line consists of three attributes that are displayed together:
Expand All @@ -21,9 +25,10 @@ It's best to not separate these three elements in different lines. The element c
- Work package header
- ...

## Technical notes


### Code structure

[CODE EXAMPLE HERE]
You can typically call the InfoLineComponent in views where work package details (Type, ID, and Status) need to be displayed in one line. You must pass a work package object containing valid data to it.

```html
render(WorkPackages::InfoLineComponent.new(work_package: @work_package))
```

0 comments on commit c5affce

Please sign in to comment.