Skip to content

Commit a2756ac

Browse files
committed
Show custom params in backfill configuration
1 parent 4a07a4a commit a2756ac

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

service/src/main/kotlin/app/cash/backfila/ui/actions/BackfillCreateHandlerAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class BackfillCreateHandlerAction @Inject constructor(
4949
formFields[BackfillCreateField.EXTRA_SLEEP_MS.fieldId]?.ifNotBlank { createRequestBuilder.extra_sleep_ms(it.toLongOrNull()) }
5050
formFields[BackfillCreateField.BACKOFF_SCHEDULE.fieldId]?.ifNotBlank { createRequestBuilder.backoff_schedule(it) }
5151
val customParameters = formFields.filter { it.key.startsWith(BackfillCreateField.CUSTOM_PARAMETER_PREFIX.fieldId) }
52-
.mapValues { it.value?.encodeUtf8() }
52+
.map { it.key.removePrefix(BackfillCreateField.CUSTOM_PARAMETER_PREFIX.fieldId) to it.value?.encodeUtf8() }.toMap()
5353
if (customParameters.isNotEmpty()) {
5454
createRequestBuilder.parameter_map(customParameters)
5555
}

service/src/main/kotlin/app/cash/backfila/ui/pages/BackfillShowAction.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import app.cash.backfila.ui.components.AutoReload
88
import app.cash.backfila.ui.components.DashboardPageLayout
99
import app.cash.backfila.ui.components.PageTitle
1010
import app.cash.backfila.ui.components.ProgressBar
11+
import app.cash.backfila.ui.pages.BackfillCreateAction.BackfillCreateField.CUSTOM_PARAMETER_PREFIX
1112
import javax.inject.Inject
1213
import javax.inject.Singleton
1314
import kotlinx.html.ButtonType
@@ -319,8 +320,13 @@ class BackfillShowAction @Inject constructor(
319320
label = "View",
320321
href = "#",
321322
),
323+
),
324+
) + (parameters ?: mapOf()).map { (key, value) ->
325+
DescriptionListRow(
326+
label = key.removePrefix(CUSTOM_PARAMETER_PREFIX.fieldId),
327+
description = value,
322328
)
323-
)
329+
}
324330

325331
private fun TagConsumer<*>.Card(block: TagConsumer<*>.() -> Unit) {
326332
div("-mx-4 mb-8 px-4 py-8 overflow-x-auto shadow-sm ring-1 ring-gray-900/5 sm:mx-0 sm:rounded-lg sm:px-8 lg:col-span-2 lg:row-span-2 lg:row-end-2") {

0 commit comments

Comments
 (0)