Question: Is it possible to add ViewState to blockSuggestion events?
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
Línea de trabajo
Empieza rastreando el manejo de blockSuggestion y el comportamiento de ViewState en BlockSuggestionPayload, y compáralos después con los payloads de blockAction y viewSubmission. Determina si los valores seleccionados pueden exponerse para las sugerencias; se considera terminado cuando el comportamiento compatible o la limitación quedan establecidos con las pruebas o la documentación correspondientes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 602
- Forks
- 235
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de slackapi/java-slack-sdk
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
slackapi/java-slack-sdk#1653 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Upgrade JettyPosiblemente ocupada @skrcode la tomó hace 42 días. Abiertoauto-triage-skip dependencies good first issue
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
slackapi/java-slack-sdk#1567 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
auto-triage-skip discussion enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
slackapi/java-slack-sdk#1535 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Workflows, Slack Apps and formsAbiertoauto-triage-skip question untriaged
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
slackapi/java-slack-sdk#1528 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
Update okhttp to 5.xAbiertoauto-triage-skip dependencies project:slack-api-client project:slack-app-backend
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
slackapi/java-slack-sdk#1500 · 11 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de slackapi/java-slack-sdk
Issues similares
-
Flight SQL JDBC parses boolean properties case-sensitively, silently disabling TLS for useEncryption=TRUEPosiblemente ocupada @Arawoof06 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
apache/arrow-java#1357 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
apache/rocketmq-dashboard#6610 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MetricsHub/metricshub-community#1396 ·
Los mantenedores suelen responder en 1 día
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
dependabot/dependabot-core#16547 ·
Los mantenedores suelen responder en 1 día
-
Citationcount column sorts alphabetically instead of numericallyPosiblemente ocupada @kpunia306 la tomó hoy. Abiertostatus: needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
JabRef/jabref#17459 · 4 comentarios ·
Los mantenedores suelen responder en 1 día