Question: Is it possible to add ViewState to blockSuggestion events?
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi việc xử lý blockSuggestion và hành vi của ViewState trong BlockSuggestionPayload, sau đó so sánh chúng với các payload của blockAction và viewSubmission. Xác định liệu các giá trị đã chọn có thể được cung cấp cho các gợi ý hay không; được xem là hoàn tất khi hành vi được hỗ trợ hoặc giới hạn đã được xác lập bằng các bài kiểm thử hoặc tài liệu tương ứng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In a modal view we have two ExternalSelectElements that provide suggestion support for user entering customer and project values. We would love to use the input of the first select element, if a selection was performed, as filter for the second one without having to store the entered value in a short-living cache or backing datastore. The API could simply return the value of the selected elements within the ViewState object similar to how blockAcktion(...) or viewSubmission(...) receive it.
The modal basically looks like this:
View view = View.builder()
.type("modal")
.callbackId("some_callback_id")
.title(ViewTitle.builder()
.type("plain_text")
.text("Some title")
.build())
.submit(ViewSubmit.builder()
.type("plain_text")
.text("Submit")
.build())
.close(ViewClose.builder()
.type("plain_text")
.text("Cancel")
.build())
.blocks(List.of(
SectionBlock.builder()
.blockId("customerFilterBlock")
.text(MarkdownTextObject.builder()
.text("Customer")
.build())
.accessory(customerFilter())
.build(),
SectionBlock.builder()
.blockId("projectFilterBlock")
.text(MarkdownTextObject.builder()
.text("Project")
.build())
.accessory(projectFilter())
.build()
))
.privateMetadata(metadata)
.build();
private ExternalSelectElement customerFilter() {
final ExternalSelectElement.ExternalSelectElementBuilder builder =
ExternalSelectElement.builder()
.actionId("customerFilter")
.placeholder(PlainTextObject.builder()
.text("Customer")
.build());
return builder.build();
}
private ExternalSelectElement projectFilter() {
final ExternalSelectElement.ExternalSelectElementBuilder builder =
ExternalSelectElement.builder()
.actionId("projectFilter")
.placeholder(PlainTextObject.builder()
.text("Project")
.build());
return builder.build();
}
Suggestions are provided via
app.blockSuggestion("customerFilter", (req, ctx) -> {
...
return ctx.ack(r -> r.options(suggestions.stream()
.map(Option.builder()
.text(...)
.value(...)
.build()
)
.toList());
});
while
app.blockAction("customerFilter", (req, ctx) -> {
final BlockSuggestionPayload payload = req.getPayload();
final View view = payload.getView();
final Map<String, Map<String, ViewState.Value>> values = view.getState().getValues();
final ViewState.Value customerOption = values.get("customerFilterBlock").get("customerFilter");
final String customerUuid = customerOption.getSelectedOption().getValue();
...
return ctx.ack();
});
can be used to learn the actual selected value (before the modal is submitted). Trying that within a blockSuggestion(...) fails as here the ViewState is basically empty (ViewState(values={})).
While we could push that value to some backing cache or datastore, i.e. Redis, so we can access it while making a suggestion for the second one by including the selection of the first input field as filter, I wonder if there are ways to actually get the ViewState also within blockSuggestion(...) and not only blockAction(...) and viewSubmission(...) somehow so we could use the value entered/selected in the first input as filter for the second suggestion? This would avoid having to push those values to a short-living cache or backing datastore.
- Ngôn ngữ chính
- Java
- Star
- 602
- Fork
- 235
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của slackapi/java-slack-sdk
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
slackapi/java-slack-sdk#1653 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Upgrade JettyCó thể đã có người làm @skrcode đã nhận 40 ngày trước. Đang mởauto-triage-skip dependencies good first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
slackapi/java-slack-sdk#1567 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
auto-triage-skip discussion enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
slackapi/java-slack-sdk#1535 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Workflows, Slack Apps and formsĐang mởauto-triage-skip question untriaged
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
slackapi/java-slack-sdk#1528 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update okhttp to 5.xĐang mởauto-triage-skip dependencies project:slack-api-client project:slack-app-backend
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
slackapi/java-slack-sdk#1500 · 11 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của slackapi/java-slack-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
utopia-rise/godot-jvm#1004 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
spring-projects/spring-grpc#442 ·
-
Expose numberOfPermits in RateLimiterEvent.toString() and the ratelimiterevents actuator DTOCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
resilience4j/resilience4j#2547 ·
Maintainer thường phản hồi trong vòng 9 ngày
-
Clock.MakeDate continues execution and returns a rolled-over instant after dispatching error on invalid dateCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
mit-cml/appinventor-sources#4155 ·
Maintainer thường phản hồi trong vòng 1 ngày