Repository navigation
Expand file tree
/
Copy pathPlan.java
More file actions
55 lines (53 loc) · 2.9 KB
/
Copy pathPlan.java
File metadata and controls
55 lines (53 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package blocks;
import com.slack.api.model.block.Blocks;
import com.slack.api.model.block.PlanBlock;
import com.slack.api.model.block.RichTextBlock;
import com.slack.api.model.block.element.RichTextSectionElement;
import java.util.List;
/**
* Displays a collection of related tasks.
* {@link https://docs.slack.dev/reference/block-kit/blocks/plan-block/}
*/
public class Plan {
/**
* A plan block with multiple task cards in various states.
*/
public static PlanBlock example01() {
PlanBlock block = Blocks.plan(p -> p.title("Thinking completed")
.tasks(List.of(
Blocks.taskCard(t -> t.taskId("call_001")
.title("Fetched user profile information")
.status("in_progress")
.details(RichTextBlock.builder()
.blockId("viMWO")
.elements(List.of(RichTextSectionElement.builder()
.elements(List.of(RichTextSectionElement.Text.builder()
.text("Searched database...")
.build()))
.build()))
.build())
.output(RichTextBlock.builder()
.blockId("viMWO")
.elements(List.of(RichTextSectionElement.builder()
.elements(List.of(RichTextSectionElement.Text.builder()
.text("Profile data loaded")
.build()))
.build()))
.build())),
Blocks.taskCard(t -> t.taskId("call_002")
.title("Checked user permissions")
.status("in_progress")),
Blocks.taskCard(t -> t.taskId("call_003")
.title("Generated comprehensive user report")
.status("complete")
.output(RichTextBlock.builder()
.blockId("crsk")
.elements(List.of(RichTextSectionElement.builder()
.elements(List.of(RichTextSectionElement.Text.builder()
.text("15 data points compiled")
.build()))
.build()))
.build())))));
return block;
}
}