Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions block-kit/src/main/java/blocks/Carousel.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,44 @@ public static CarouselBlock example01() {
Blocks.card(card -> card.blockId("carousel-card-1")
.icon(BlockElements.imageElement(
i -> i.imageUrl("https://picsum.photos/36/36").altText("Icon")))
.title(BlockCompositions.markdownText("MDR"))
.subtitle(BlockCompositions.markdownText("Refining data files"))
.title(BlockCompositions.markdownText(
mt -> mt.text("MDR").verbatim(false)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Same pattern as the card example across all three cards, and CarouselTest now matches the carousel docs JSON field for field.

.subtitle(BlockCompositions.markdownText(
mt -> mt.text("Refining data files").verbatim(false)))
.heroImage(BlockElements.imageElement(
i -> i.imageUrl("https://picsum.photos/400/300").altText("Sample hero image")))
.body(BlockCompositions.markdownText("Blue badge required to gain access."))
.body(BlockCompositions.markdownText(mt ->
mt.text("Blue badge required to gain access.").verbatim(false)))
.actions(List.of(BlockElements.button(b -> b.text(BlockCompositions.plainText(
pt -> pt.text("Action Button").emoji(false)))
.actionId("button_action_1"))))),
Blocks.card(card -> card.blockId("carousel-card-2")
.icon(BlockElements.imageElement(
i -> i.imageUrl("https://picsum.photos/36/36").altText("Icon")))
.title(BlockCompositions.markdownText("O&D"))
.subtitle(BlockCompositions.markdownText("Storage, maintenance, and rotation of art pieces"))
.title(BlockCompositions.markdownText(
mt -> mt.text("O&D").verbatim(false)))
.subtitle(BlockCompositions.markdownText(
mt -> mt.text("Storage, maintenance, and rotation of art pieces")
.verbatim(false)))
.heroImage(BlockElements.imageElement(
i -> i.imageUrl("https://picsum.photos/400/300").altText("Sample hero image")))
.body(BlockCompositions.markdownText("Green badge required to gain access."))
.body(BlockCompositions.markdownText(mt ->
mt.text("Green badge required to gain access.").verbatim(false)))
.actions(List.of(BlockElements.button(b -> b.text(BlockCompositions.plainText(
pt -> pt.text("Action Button").emoji(false)))
.actionId("button_action_2"))))),
Blocks.card(card -> card.blockId("carousel-card-3")
.icon(BlockElements.imageElement(
i -> i.imageUrl("https://picsum.photos/36/36").altText("Icon")))
.title(BlockCompositions.markdownText("Wellness Center"))
.subtitle(BlockCompositions.markdownText("Wellness sessions"))
.title(BlockCompositions.markdownText(
mt -> mt.text("Wellness Center").verbatim(false)))
.subtitle(BlockCompositions.markdownText(
mt -> mt.text("Wellness sessions").verbatim(false)))
.heroImage(BlockElements.imageElement(
i -> i.imageUrl("https://picsum.photos/400/300").altText("Sample hero image")))
.body(BlockCompositions.markdownText("Please take a seat in the waiting room until called."))
.body(BlockCompositions.markdownText(
mt -> mt.text("Please take a seat in the waiting room until called.")
.verbatim(false)))
.actions(List.of(BlockElements.button(b -> b.text(BlockCompositions.plainText(
pt -> pt.text("Action Button").emoji(false)))
.actionId("button_action_3"))))))));
Expand Down
27 changes: 18 additions & 9 deletions block-kit/src/test/java/blocks/CarouselTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ public void testExample01() {
},
"title": {
"type": "mrkdwn",
"text": "MDR"
"text": "MDR",
"verbatim": false
},
"subtitle": {
"type": "mrkdwn",
"text": "Refining data files"
"text": "Refining data files",
"verbatim": false
},
"hero_image": {
"type": "image",
Expand All @@ -39,7 +41,8 @@ public void testExample01() {
},
"body": {
"type": "mrkdwn",
"text": "Blue badge required to gain access."
"text": "Blue badge required to gain access.",
"verbatim": false
},
"actions": [
{
Expand All @@ -63,11 +66,13 @@ public void testExample01() {
},
"title": {
"type": "mrkdwn",
"text": "O&D"
"text": "O&D",
"verbatim": false
},
"subtitle": {
"type": "mrkdwn",
"text": "Storage, maintenance, and rotation of art pieces"
"text": "Storage, maintenance, and rotation of art pieces",
"verbatim": false
},
"hero_image": {
"type": "image",
Expand All @@ -76,7 +81,8 @@ public void testExample01() {
},
"body": {
"type": "mrkdwn",
"text": "Green badge required to gain access."
"text": "Green badge required to gain access.",
"verbatim": false
},
"actions": [
{
Expand All @@ -100,11 +106,13 @@ public void testExample01() {
},
"title": {
"type": "mrkdwn",
"text": "Wellness Center"
"text": "Wellness Center",
"verbatim": false
},
"subtitle": {
"type": "mrkdwn",
"text": "Wellness sessions"
"text": "Wellness sessions",
"verbatim": false
},
"hero_image": {
"type": "image",
Expand All @@ -113,7 +121,8 @@ public void testExample01() {
},
"body": {
"type": "mrkdwn",
"text": "Please take a seat in the waiting room until called."
"text": "Please take a seat in the waiting room until called.",
"verbatim": false
},
"actions": [
{
Expand Down
Loading